gfortran.info 856 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704
  1. This is gfortran.info, produced by makeinfo version 5.2 from
  2. gfortran.texi.
  3. Copyright (C) 1999-2017 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-2017 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 2003 and 2008 status:: Fortran 2003 and 2008 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 and Fortran 2008 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 or
  91. Fortran 2008. 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. and '__GNUC__', '__GNUC_MINOR__' and '__GNUC_PATCHLEVEL__' can be used
  199. to determine the version of the compiler. See *note Overview: (cpp)Top.
  200. for details.
  201. While CPP is the de-facto standard for preprocessing Fortran code,
  202. Part 3 of the Fortran 95 standard (ISO/IEC 1539-3:1998) defines
  203. Conditional Compilation, which is not widely used and not directly
  204. supported by the GNU Fortran compiler. You can use the program coco to
  205. preprocess such files (<http://www.daniellnagle.com/coco.html>).
  206. 
  207. File: gfortran.info, Node: GNU Fortran and G77, Next: Project Status, Prev: Preprocessing and conditional compilation, Up: Introduction
  208. 1.4 GNU Fortran and G77
  209. =======================
  210. The GNU Fortran compiler is the successor to 'g77', the Fortran 77 front
  211. end included in GCC prior to version 4. It is an entirely new program
  212. that has been designed to provide Fortran 95 support and extensibility
  213. for future Fortran language standards, as well as providing backwards
  214. compatibility for Fortran 77 and nearly all of the GNU language
  215. extensions supported by 'g77'.
  216. 
  217. File: gfortran.info, Node: Project Status, Next: Standards, Prev: GNU Fortran and G77, Up: Introduction
  218. 1.5 Project Status
  219. ==================
  220. As soon as 'gfortran' can parse all of the statements correctly, it
  221. will be in the "larva" state. When we generate code, the "puppa"
  222. state. When 'gfortran' is done, we'll see if it will be a
  223. beautiful butterfly, or just a big bug....
  224. -Andy Vaught, April 2000
  225. The start of the GNU Fortran 95 project was announced on the GCC
  226. homepage in March 18, 2000 (even though Andy had already been working on
  227. it for a while, of course).
  228. The GNU Fortran compiler is able to compile nearly all
  229. standard-compliant Fortran 95, Fortran 90, and Fortran 77 programs,
  230. including a number of standard and non-standard extensions, and can be
  231. used on real-world programs. In particular, the supported extensions
  232. include OpenMP, Cray-style pointers, some old vendor extensions, and
  233. several Fortran 2003 and Fortran 2008 features, including TR 15581.
  234. However, it is still under development and has a few remaining rough
  235. edges. There also is initial support for OpenACC. Note that this is an
  236. experimental feature, incomplete, and subject to change in future
  237. versions of GCC. See <https://gcc.gnu.org/wiki/OpenACC> for more
  238. information.
  239. At present, the GNU Fortran compiler passes the NIST Fortran 77 Test
  240. Suite (http://www.fortran-2000.com/ArnaudRecipes/fcvs21_f95.html), and
  241. produces acceptable results on the LAPACK Test Suite
  242. (http://www.netlib.org/lapack/faq.html#1.21). It also provides
  243. respectable performance on the Polyhedron Fortran compiler benchmarks
  244. (http://www.polyhedron.com/fortran-compiler-comparisons/polyhedron-benchmark-suite)
  245. and the Livermore Fortran Kernels test
  246. (http://www.netlib.org/benchmark/livermore). It has been used to
  247. compile a number of large real-world programs, including the HARMONIE
  248. and HIRLAM weather forecasting code (http://hirlam.org/) and the Tonto
  249. quantum chemistry package
  250. (http://physical-chemistry.scb.uwa.edu.au/tonto/wiki/index.php/Main_Page);
  251. see <https://gcc.gnu.org/wiki/GfortranApps> for an extended list.
  252. Among other things, the GNU Fortran compiler is intended as a
  253. replacement for G77. At this point, nearly all programs that could be
  254. compiled with G77 can be compiled with GNU Fortran, although there are a
  255. few minor known regressions.
  256. The primary work remaining to be done on GNU Fortran falls into three
  257. categories: bug fixing (primarily regarding the treatment of invalid
  258. code and providing useful error messages), improving the compiler
  259. optimizations and the performance of compiled code, and extending the
  260. compiler to support future standards--in particular, Fortran 2003 and
  261. Fortran 2008.
  262. 
  263. File: gfortran.info, Node: Standards, Prev: Project Status, Up: Introduction
  264. 1.6 Standards
  265. =============
  266. * Menu:
  267. * Varying Length Character Strings::
  268. The GNU Fortran compiler implements ISO/IEC 1539:1997 (Fortran 95). As
  269. such, it can also compile essentially all standard-compliant Fortran 90
  270. and Fortran 77 programs. It also supports the ISO/IEC TR-15581
  271. enhancements to allocatable arrays.
  272. GNU Fortran also have a partial support for ISO/IEC 1539-1:2004
  273. (Fortran 2003), ISO/IEC 1539-1:2010 (Fortran 2008), the Technical
  274. Specification 'Further Interoperability of Fortran with C' (ISO/IEC TS
  275. 29113:2012). Full support of those standards and future Fortran
  276. standards is planned. The current status of the support is can be found
  277. in the *note Fortran 2003 status::, *note Fortran 2008 status::, *note
  278. TS 29113 status:: and *note TS 18508 status:: sections of the
  279. documentation.
  280. Additionally, the GNU Fortran compilers supports the OpenMP
  281. specification (version 4.0 and most of the features of the 4.5 version,
  282. <http://openmp.org/wp/openmp-specifications/>). There also is initial
  283. support for the OpenACC specification (targeting version 2.0,
  284. <http://www.openacc.org/>). Note that this is an experimental feature,
  285. incomplete, and subject to change in future versions of GCC. See
  286. <https://gcc.gnu.org/wiki/OpenACC> for more information.
  287. 
  288. File: gfortran.info, Node: Varying Length Character Strings, Up: Standards
  289. 1.6.1 Varying Length Character Strings
  290. --------------------------------------
  291. The Fortran 95 standard specifies in Part 2 (ISO/IEC 1539-2:2000)
  292. varying length character strings. While GNU Fortran currently does not
  293. support such strings directly, there exist two Fortran implementations
  294. for them, which work with GNU Fortran. They can be found at
  295. <http://www.fortran.com/iso_varying_string.f95> and at
  296. <ftp://ftp.nag.co.uk/sc22wg5/ISO_VARYING_STRING/>.
  297. Deferred-length character strings of Fortran 2003 supports part of
  298. the features of 'ISO_VARYING_STRING' and should be considered as
  299. replacement. (Namely, allocatable or pointers of the type
  300. 'character(len=:)'.)
  301. 
  302. File: gfortran.info, Node: Invoking GNU Fortran, Next: Runtime, Prev: Introduction, Up: Top
  303. 2 GNU Fortran Command Options
  304. *****************************
  305. The 'gfortran' command supports all the options supported by the 'gcc'
  306. command. Only options specific to GNU Fortran are documented here.
  307. *Note GCC Command Options: (gcc)Invoking GCC, for information on the
  308. non-Fortran-specific aspects of the 'gcc' command (and, therefore, the
  309. 'gfortran' command).
  310. All GCC and GNU Fortran options are accepted both by 'gfortran' and
  311. by 'gcc' (as well as any other drivers built at the same time, such as
  312. 'g++'), since adding GNU Fortran to the GCC distribution enables
  313. acceptance of GNU Fortran options by all of the relevant drivers.
  314. In some cases, options have positive and negative forms; the negative
  315. form of '-ffoo' would be '-fno-foo'. This manual documents only one of
  316. these two forms, whichever one is not the default.
  317. * Menu:
  318. * Option Summary:: Brief list of all 'gfortran' options,
  319. without explanations.
  320. * Fortran Dialect Options:: Controlling the variant of Fortran language
  321. compiled.
  322. * Preprocessing Options:: Enable and customize preprocessing.
  323. * Error and Warning Options:: How picky should the compiler be?
  324. * Debugging Options:: Symbol tables, measurements, and debugging dumps.
  325. * Directory Options:: Where to find module files
  326. * Link Options :: Influencing the linking step
  327. * Runtime Options:: Influencing runtime behavior
  328. * Code Gen Options:: Specifying conventions for function calls, data layout
  329. and register usage.
  330. * Environment Variables:: Environment variables that affect 'gfortran'.
  331. 
  332. File: gfortran.info, Node: Option Summary, Next: Fortran Dialect Options, Up: Invoking GNU Fortran
  333. 2.1 Option summary
  334. ==================
  335. Here is a summary of all the options specific to GNU Fortran, grouped by
  336. type. Explanations are in the following sections.
  337. _Fortran Language Options_
  338. *Note Options controlling Fortran dialect: Fortran Dialect Options.
  339. -fall-intrinsics -fbackslash -fcray-pointer -fd-lines-as-code
  340. -fd-lines-as-comments
  341. -fdec -fdec-structure -fdec-intrinsic-ints -fdec-static -fdec-math
  342. -fdefault-double-8 -fdefault-integer-8
  343. -fdefault-real-8 -fdollar-ok -ffixed-line-length-N
  344. -ffixed-line-length-none -ffree-form -ffree-line-length-N
  345. -ffree-line-length-none -fimplicit-none -finteger-4-integer-8
  346. -fmax-identifier-length -fmodule-private -ffixed-form -fno-range-check
  347. -fopenacc -fopenmp -freal-4-real-10 -freal-4-real-16 -freal-4-real-8
  348. -freal-8-real-10 -freal-8-real-16 -freal-8-real-4 -std=STD
  349. -ftest-forall-temp
  350. _Preprocessing Options_
  351. *Note Enable and customize preprocessing: Preprocessing Options.
  352. -A-QUESTION[=ANSWER]
  353. -AQUESTION=ANSWER -C -CC -DMACRO[=DEFN]
  354. -H -P
  355. -UMACRO -cpp -dD -dI -dM -dN -dU -fworking-directory
  356. -imultilib DIR
  357. -iprefix FILE -iquote -isysroot DIR -isystem DIR -nocpp
  358. -nostdinc
  359. -undef
  360. _Error and Warning Options_
  361. *Note Options to request or suppress errors and warnings: Error and
  362. Warning Options.
  363. -Waliasing -Wall -Wampersand -Wargument-mismatch -Warray-bounds
  364. -Wc-binding-type -Wcharacter-truncation
  365. -Wconversion -Wfunction-elimination -Wimplicit-interface
  366. -Wimplicit-procedure -Wintrinsic-shadow -Wuse-without-only -Wintrinsics-std
  367. -Wline-truncation -Wno-align-commons -Wno-tabs -Wreal-q-constant
  368. -Wsurprising -Wunderflow -Wunused-parameter -Wrealloc-lhs -Wrealloc-lhs-all
  369. -Wtarget-lifetime -fmax-errors=N -fsyntax-only -pedantic -pedantic-errors
  370. _Debugging Options_
  371. *Note Options for debugging your program or GNU Fortran: Debugging
  372. Options.
  373. -fbacktrace -fdump-fortran-optimized -fdump-fortran-original
  374. -fdump-parse-tree -ffpe-trap=LIST -ffpe-summary=LIST
  375. _Directory Options_
  376. *Note Options for directory search: Directory Options.
  377. -IDIR -JDIR -fintrinsic-modules-path DIR
  378. _Link Options_
  379. *Note Options for influencing the linking step: Link Options.
  380. -static-libgfortran
  381. _Runtime Options_
  382. *Note Options for influencing runtime behavior: Runtime Options.
  383. -fconvert=CONVERSION -fmax-subrecord-length=LENGTH
  384. -frecord-marker=LENGTH -fsign-zero
  385. _Code Generation Options_
  386. *Note Options for code generation conventions: Code Gen Options.
  387. -faggressive-function-elimination -fblas-matmul-limit=N
  388. -fbounds-check -ftail-call-workaround -ftail-call-workaround=N
  389. -fcheck-array-temporaries
  390. -fcheck=<ALL|ARRAY-TEMPS|BOUNDS|DO|MEM|POINTER|RECURSION>
  391. -fcoarray=<NONE|SINGLE|LIB> -fexternal-blas -ff2c
  392. -ffrontend-optimize
  393. -finit-character=N -finit-integer=N -finit-local-zero
  394. -finit-derived
  395. -finit-logical=<TRUE|FALSE>
  396. -finit-real=<ZERO|INF|-INF|NAN|SNAN>
  397. -finline-matmul-limit=N
  398. -fmax-array-constructor=N -fmax-stack-var-size=N
  399. -fno-align-commons
  400. -fno-automatic -fno-protect-parens -fno-underscoring
  401. -fsecond-underscore -fpack-derived -frealloc-lhs -frecursive
  402. -frepack-arrays -fshort-enums -fstack-arrays
  403. 
  404. File: gfortran.info, Node: Fortran Dialect Options, Next: Preprocessing Options, Prev: Option Summary, Up: Invoking GNU Fortran
  405. 2.2 Options controlling Fortran dialect
  406. =======================================
  407. The following options control the details of the Fortran dialect
  408. accepted by the compiler:
  409. '-ffree-form'
  410. '-ffixed-form'
  411. Specify the layout used by the source file. The free form layout
  412. was introduced in Fortran 90. Fixed form was traditionally used in
  413. older Fortran programs. When neither option is specified, the
  414. source form is determined by the file extension.
  415. '-fall-intrinsics'
  416. This option causes all intrinsic procedures (including the
  417. GNU-specific extensions) to be accepted. This can be useful with
  418. '-std=f95' to force standard-compliance but get access to the full
  419. range of intrinsics available with 'gfortran'. As a consequence,
  420. '-Wintrinsics-std' will be ignored and no user-defined procedure
  421. with the same name as any intrinsic will be called except when it
  422. is explicitly declared 'EXTERNAL'.
  423. '-fd-lines-as-code'
  424. '-fd-lines-as-comments'
  425. Enable special treatment for lines beginning with 'd' or 'D' in
  426. fixed form sources. If the '-fd-lines-as-code' option is given
  427. they are treated as if the first column contained a blank. If the
  428. '-fd-lines-as-comments' option is given, they are treated as
  429. comment lines.
  430. '-fdec'
  431. DEC compatibility mode. Enables extensions and other features that
  432. mimic the default behavior of older compilers (such as DEC). These
  433. features are non-standard and should be avoided at all costs. For
  434. details on GNU Fortran's implementation of these extensions see the
  435. full documentation.
  436. Other flags enabled by this switch are: '-fdollar-ok'
  437. '-fcray-pointer' '-fdec-structure' '-fdec-intrinsic-ints'
  438. '-fdec-static' '-fdec-math'
  439. If '-fd-lines-as-code'/'-fd-lines-as-comments' are unset, then
  440. '-fdec' also sets '-fd-lines-as-comments'.
  441. '-fdec-structure'
  442. Enable DEC 'STRUCTURE' and 'RECORD' as well as 'UNION', 'MAP', and
  443. dot ('.') as a member separator (in addition to '%'). This is
  444. provided for compatibility only; Fortran 90 derived types should be
  445. used instead where possible.
  446. '-fdec-intrinsic-ints'
  447. Enable B/I/J/K kind variants of existing integer functions (e.g.
  448. BIAND, IIAND, JIAND, etc...). For a complete list of intrinsics
  449. see the full documentation.
  450. '-fdec-math'
  451. Enable legacy math intrinsics such as COTAN and degree-valued
  452. trigonometric functions (e.g. TAND, ATAND, etc...) for
  453. compatability with older code.
  454. '-fdec-static'
  455. Enable DEC-style STATIC and AUTOMATIC attributes to explicitly
  456. specify the storage of variables and other objects.
  457. '-fdollar-ok'
  458. Allow '$' as a valid non-first character in a symbol name. Symbols
  459. that start with '$' are rejected since it is unclear which rules to
  460. apply to implicit typing as different vendors implement different
  461. rules. Using '$' in 'IMPLICIT' statements is also rejected.
  462. '-fbackslash'
  463. Change the interpretation of backslashes in string literals from a
  464. single backslash character to "C-style" escape characters. The
  465. following combinations are expanded '\a', '\b', '\f', '\n', '\r',
  466. '\t', '\v', '\\', and '\0' to the ASCII characters alert,
  467. backspace, form feed, newline, carriage return, horizontal tab,
  468. vertical tab, backslash, and NUL, respectively. Additionally,
  469. '\x'NN, '\u'NNNN and '\U'NNNNNNNN (where each N is a hexadecimal
  470. digit) are translated into the Unicode characters corresponding to
  471. the specified code points. All other combinations of a character
  472. preceded by \ are unexpanded.
  473. '-fmodule-private'
  474. Set the default accessibility of module entities to 'PRIVATE'.
  475. Use-associated entities will not be accessible unless they are
  476. explicitly declared as 'PUBLIC'.
  477. '-ffixed-line-length-N'
  478. Set column after which characters are ignored in typical fixed-form
  479. lines in the source file, and through which spaces are assumed (as
  480. if padded to that length) after the ends of short fixed-form lines.
  481. Popular values for N include 72 (the standard and the default), 80
  482. (card image), and 132 (corresponding to "extended-source" options
  483. in some popular compilers). N may also be 'none', meaning that the
  484. entire line is meaningful and that continued character constants
  485. never have implicit spaces appended to them to fill out the line.
  486. '-ffixed-line-length-0' means the same thing as
  487. '-ffixed-line-length-none'.
  488. '-ffree-line-length-N'
  489. Set column after which characters are ignored in typical free-form
  490. lines in the source file. The default value is 132. N may be
  491. 'none', meaning that the entire line is meaningful.
  492. '-ffree-line-length-0' means the same thing as
  493. '-ffree-line-length-none'.
  494. '-fmax-identifier-length=N'
  495. Specify the maximum allowed identifier length. Typical values are
  496. 31 (Fortran 95) and 63 (Fortran 2003 and Fortran 2008).
  497. '-fimplicit-none'
  498. Specify that no implicit typing is allowed, unless overridden by
  499. explicit 'IMPLICIT' statements. This is the equivalent of adding
  500. 'implicit none' to the start of every procedure.
  501. '-fcray-pointer'
  502. Enable the Cray pointer extension, which provides C-like pointer
  503. functionality.
  504. '-fopenacc'
  505. Enable the OpenACC extensions. This includes OpenACC '!$acc'
  506. directives in free form and 'c$acc', '*$acc' and '!$acc' directives
  507. in fixed form, '!$' conditional compilation sentinels in free form
  508. and 'c$', '*$' and '!$' sentinels in fixed form, and when linking
  509. arranges for the OpenACC runtime library to be linked in.
  510. Note that this is an experimental feature, incomplete, and subject
  511. to change in future versions of GCC. See <https://gcc.gnu.org/wiki/OpenACC>
  512. for more information.
  513. '-fopenmp'
  514. Enable the OpenMP extensions. This includes OpenMP '!$omp'
  515. directives in free form and 'c$omp', '*$omp' and '!$omp' directives
  516. in fixed form, '!$' conditional compilation sentinels in free form
  517. and 'c$', '*$' and '!$' sentinels in fixed form, and when linking
  518. arranges for the OpenMP runtime library to be linked in. The
  519. option '-fopenmp' implies '-frecursive'.
  520. '-fno-range-check'
  521. Disable range checking on results of simplification of constant
  522. expressions during compilation. For example, GNU Fortran will give
  523. an error at compile time when simplifying 'a = 1. / 0'. With this
  524. option, no error will be given and 'a' will be assigned the value
  525. '+Infinity'. If an expression evaluates to a value outside of the
  526. relevant range of ['-HUGE()':'HUGE()'], then the expression will be
  527. replaced by '-Inf' or '+Inf' as appropriate. Similarly, 'DATA
  528. i/Z'FFFFFFFF'/' will result in an integer overflow on most systems,
  529. but with '-fno-range-check' the value will "wrap around" and 'i'
  530. will be initialized to -1 instead.
  531. '-fdefault-integer-8'
  532. Set the default integer and logical types to an 8 byte wide type.
  533. This option also affects the kind of integer constants like '42'.
  534. Unlike '-finteger-4-integer-8', it does not promote variables with
  535. explicit kind declaration.
  536. '-fdefault-real-8'
  537. Set the default real type to an 8 byte wide type. This option also
  538. affects the kind of non-double real constants like '1.0', and does
  539. promote the default width of 'DOUBLE PRECISION' to 16 bytes if
  540. possible, unless '-fdefault-double-8' is given, too. Unlike
  541. '-freal-4-real-8', it does not promote variables with explicit kind
  542. declaration.
  543. '-fdefault-double-8'
  544. Set the 'DOUBLE PRECISION' type to an 8 byte wide type. Do nothing
  545. if this is already the default. If '-fdefault-real-8' is given,
  546. 'DOUBLE PRECISION' would instead be promoted to 16 bytes if
  547. possible, and '-fdefault-double-8' can be used to prevent this.
  548. The kind of real constants like '1.d0' will not be changed by
  549. '-fdefault-real-8' though, so also '-fdefault-double-8' does not
  550. affect it.
  551. '-finteger-4-integer-8'
  552. Promote all 'INTEGER(KIND=4)' entities to an 'INTEGER(KIND=8)'
  553. entities. If 'KIND=8' is unavailable, then an error will be
  554. issued. This option should be used with care and may not be
  555. suitable for your codes. Areas of possible concern include calls
  556. to external procedures, alignment in 'EQUIVALENCE' and/or 'COMMON',
  557. generic interfaces, BOZ literal constant conversion, and I/O.
  558. Inspection of the intermediate representation of the translated
  559. Fortran code, produced by '-fdump-tree-original', is suggested.
  560. '-freal-4-real-8'
  561. '-freal-4-real-10'
  562. '-freal-4-real-16'
  563. '-freal-8-real-4'
  564. '-freal-8-real-10'
  565. '-freal-8-real-16'
  566. Promote all 'REAL(KIND=M)' entities to 'REAL(KIND=N)' entities. If
  567. 'REAL(KIND=N)' is unavailable, then an error will be issued. All
  568. other real kind types are unaffected by this option. These options
  569. should be used with care and may not be suitable for your codes.
  570. Areas of possible concern include calls to external procedures,
  571. alignment in 'EQUIVALENCE' and/or 'COMMON', generic interfaces, BOZ
  572. literal constant conversion, and I/O. Inspection of the
  573. intermediate representation of the translated Fortran code,
  574. produced by '-fdump-tree-original', is suggested.
  575. '-std=STD'
  576. Specify the standard to which the program is expected to conform,
  577. which may be one of 'f95', 'f2003', 'f2008', 'gnu', or 'legacy'.
  578. The default value for STD is 'gnu', which specifies a superset of
  579. the Fortran 95 standard that includes all of the extensions
  580. supported by GNU Fortran, although warnings will be given for
  581. obsolete extensions not recommended for use in new code. The
  582. 'legacy' value is equivalent but without the warnings for obsolete
  583. extensions, and may be useful for old non-standard programs. The
  584. 'f95', 'f2003' and 'f2008' values specify strict conformance to the
  585. Fortran 95, Fortran 2003 and Fortran 2008 standards, respectively;
  586. errors are given for all extensions beyond the relevant language
  587. standard, and warnings are given for the Fortran 77 features that
  588. are permitted but obsolescent in later standards. '-std=f2008ts'
  589. allows the Fortran 2008 standard including the additions of the
  590. Technical Specification (TS) 29113 on Further Interoperability of
  591. Fortran with C and TS 18508 on Additional Parallel Features in
  592. Fortran.
  593. '-ftest-forall-temp'
  594. Enhance test coverage by forcing most forall assignments to use
  595. temporary.
  596. 
  597. File: gfortran.info, Node: Preprocessing Options, Next: Error and Warning Options, Prev: Fortran Dialect Options, Up: Invoking GNU Fortran
  598. 2.3 Enable and customize preprocessing
  599. ======================================
  600. Preprocessor related options. See section *note Preprocessing and
  601. conditional compilation:: for more detailed information on preprocessing
  602. in 'gfortran'.
  603. '-cpp'
  604. '-nocpp'
  605. Enable preprocessing. The preprocessor is automatically invoked if
  606. the file extension is '.fpp', '.FPP', '.F', '.FOR', '.FTN', '.F90',
  607. '.F95', '.F03' or '.F08'. Use this option to manually enable
  608. preprocessing of any kind of Fortran file.
  609. To disable preprocessing of files with any of the above listed
  610. extensions, use the negative form: '-nocpp'.
  611. The preprocessor is run in traditional mode. Any restrictions of
  612. the file-format, especially the limits on line length, apply for
  613. preprocessed output as well, so it might be advisable to use the
  614. '-ffree-line-length-none' or '-ffixed-line-length-none' options.
  615. '-dM'
  616. Instead of the normal output, generate a list of ''#define''
  617. directives for all the macros defined during the execution of the
  618. preprocessor, including predefined macros. This gives you a way of
  619. finding out what is predefined in your version of the preprocessor.
  620. Assuming you have no file 'foo.f90', the command
  621. touch foo.f90; gfortran -cpp -E -dM foo.f90
  622. will show all the predefined macros.
  623. '-dD'
  624. Like '-dM' except in two respects: it does not include the
  625. predefined macros, and it outputs both the '#define' directives and
  626. the result of preprocessing. Both kinds of output go to the
  627. standard output file.
  628. '-dN'
  629. Like '-dD', but emit only the macro names, not their expansions.
  630. '-dU'
  631. Like 'dD' except that only macros that are expanded, or whose
  632. definedness is tested in preprocessor directives, are output; the
  633. output is delayed until the use or test of the macro; and
  634. ''#undef'' directives are also output for macros tested but
  635. undefined at the time.
  636. '-dI'
  637. Output ''#include'' directives in addition to the result of
  638. preprocessing.
  639. '-fworking-directory'
  640. Enable generation of linemarkers in the preprocessor output that
  641. will let the compiler know the current working directory at the
  642. time of preprocessing. When this option is enabled, the
  643. preprocessor will emit, after the initial linemarker, a second
  644. linemarker with the current working directory followed by two
  645. slashes. GCC will use this directory, when it is present in the
  646. preprocessed input, as the directory emitted as the current working
  647. directory in some debugging information formats. This option is
  648. implicitly enabled if debugging information is enabled, but this
  649. can be inhibited with the negated form '-fno-working-directory'.
  650. If the '-P' flag is present in the command line, this option has no
  651. effect, since no '#line' directives are emitted whatsoever.
  652. '-idirafter DIR'
  653. Search DIR for include files, but do it after all directories
  654. specified with '-I' and the standard system directories have been
  655. exhausted. DIR is treated as a system include directory. If dir
  656. begins with '=', then the '=' will be replaced by the sysroot
  657. prefix; see '--sysroot' and '-isysroot'.
  658. '-imultilib DIR'
  659. Use DIR as a subdirectory of the directory containing
  660. target-specific C++ headers.
  661. '-iprefix PREFIX'
  662. Specify PREFIX as the prefix for subsequent '-iwithprefix' options.
  663. If the PREFIX represents a directory, you should include the final
  664. ''/''.
  665. '-isysroot DIR'
  666. This option is like the '--sysroot' option, but applies only to
  667. header files. See the '--sysroot' option for more information.
  668. '-iquote DIR'
  669. Search DIR only for header files requested with '#include "file"';
  670. they are not searched for '#include <file>', before all directories
  671. specified by '-I' and before the standard system directories. If
  672. DIR begins with '=', then the '=' will be replaced by the sysroot
  673. prefix; see '--sysroot' and '-isysroot'.
  674. '-isystem DIR'
  675. Search DIR for header files, after all directories specified by
  676. '-I' but before the standard system directories. Mark it as a
  677. system directory, so that it gets the same special treatment as is
  678. applied to the standard system directories. If DIR begins with
  679. '=', then the '=' will be replaced by the sysroot prefix; see
  680. '--sysroot' and '-isysroot'.
  681. '-nostdinc'
  682. Do not search the standard system directories for header files.
  683. Only the directories you have specified with '-I' options (and the
  684. directory of the current file, if appropriate) are searched.
  685. '-undef'
  686. Do not predefine any system-specific or GCC-specific macros. The
  687. standard predefined macros remain defined.
  688. '-APREDICATE=ANSWER'
  689. Make an assertion with the predicate PREDICATE and answer ANSWER.
  690. This form is preferred to the older form -A predicate(answer),
  691. which is still supported, because it does not use shell special
  692. characters.
  693. '-A-PREDICATE=ANSWER'
  694. Cancel an assertion with the predicate PREDICATE and answer ANSWER.
  695. '-C'
  696. Do not discard comments. All comments are passed through to the
  697. output file, except for comments in processed directives, which are
  698. deleted along with the directive.
  699. You should be prepared for side effects when using '-C'; it causes
  700. the preprocessor to treat comments as tokens in their own right.
  701. For example, comments appearing at the start of what would be a
  702. directive line have the effect of turning that line into an
  703. ordinary source line, since the first token on the line is no
  704. longer a ''#''.
  705. Warning: this currently handles C-Style comments only. The
  706. preprocessor does not yet recognize Fortran-style comments.
  707. '-CC'
  708. Do not discard comments, including during macro expansion. This is
  709. like '-C', except that comments contained within macros are also
  710. passed through to the output file where the macro is expanded.
  711. In addition to the side-effects of the '-C' option, the '-CC'
  712. option causes all C++-style comments inside a macro to be converted
  713. to C-style comments. This is to prevent later use of that macro
  714. from inadvertently commenting out the remainder of the source line.
  715. The '-CC' option is generally used to support lint comments.
  716. Warning: this currently handles C- and C++-Style comments only.
  717. The preprocessor does not yet recognize Fortran-style comments.
  718. '-DNAME'
  719. Predefine name as a macro, with definition '1'.
  720. '-DNAME=DEFINITION'
  721. The contents of DEFINITION are tokenized and processed as if they
  722. appeared during translation phase three in a ''#define'' directive.
  723. In particular, the definition will be truncated by embedded newline
  724. characters.
  725. If you are invoking the preprocessor from a shell or shell-like
  726. program you may need to use the shell's quoting syntax to protect
  727. characters such as spaces that have a meaning in the shell syntax.
  728. If you wish to define a function-like macro on the command line,
  729. write its argument list with surrounding parentheses before the
  730. equals sign (if any). Parentheses are meaningful to most shells,
  731. so you will need to quote the option. With sh and csh,
  732. '-D'name(args...)=definition'' works.
  733. '-D' and '-U' options are processed in the order they are given on
  734. the command line. All -imacros file and -include file options are
  735. processed after all -D and -U options.
  736. '-H'
  737. Print the name of each header file used, in addition to other
  738. normal activities. Each name is indented to show how deep in the
  739. ''#include'' stack it is.
  740. '-P'
  741. Inhibit generation of linemarkers in the output from the
  742. preprocessor. This might be useful when running the preprocessor
  743. on something that is not C code, and will be sent to a program
  744. which might be confused by the linemarkers.
  745. '-UNAME'
  746. Cancel any previous definition of NAME, either built in or provided
  747. with a '-D' option.
  748. 
  749. File: gfortran.info, Node: Error and Warning Options, Next: Debugging Options, Prev: Preprocessing Options, Up: Invoking GNU Fortran
  750. 2.4 Options to request or suppress errors and warnings
  751. ======================================================
  752. Errors are diagnostic messages that report that the GNU Fortran compiler
  753. cannot compile the relevant piece of source code. The compiler will
  754. continue to process the program in an attempt to report further errors
  755. to aid in debugging, but will not produce any compiled output.
  756. Warnings are diagnostic messages that report constructions which are
  757. not inherently erroneous but which are risky or suggest there is likely
  758. to be a bug in the program. Unless '-Werror' is specified, they do not
  759. prevent compilation of the program.
  760. You can request many specific warnings with options beginning '-W',
  761. for example '-Wimplicit' to request warnings on implicit declarations.
  762. Each of these specific warning options also has a negative form
  763. beginning '-Wno-' to turn off warnings; for example, '-Wno-implicit'.
  764. This manual lists only one of the two forms, whichever is not the
  765. default.
  766. These options control the amount and kinds of errors and warnings
  767. produced by GNU Fortran:
  768. '-fmax-errors=N'
  769. Limits the maximum number of error messages to N, at which point
  770. GNU Fortran bails out rather than attempting to continue processing
  771. the source code. If N is 0, there is no limit on the number of
  772. error messages produced.
  773. '-fsyntax-only'
  774. Check the code for syntax errors, but do not actually compile it.
  775. This will generate module files for each module present in the
  776. code, but no other output file.
  777. '-Wpedantic'
  778. '-pedantic'
  779. Issue warnings for uses of extensions to Fortran 95. '-pedantic'
  780. also applies to C-language constructs where they occur in GNU
  781. Fortran source files, such as use of '\e' in a character constant
  782. within a directive like '#include'.
  783. Valid Fortran 95 programs should compile properly with or without
  784. this option. However, without this option, certain GNU extensions
  785. and traditional Fortran features are supported as well. With this
  786. option, many of them are rejected.
  787. Some users try to use '-pedantic' to check programs for
  788. conformance. They soon find that it does not do quite what they
  789. want--it finds some nonstandard practices, but not all. However,
  790. improvements to GNU Fortran in this area are welcome.
  791. This should be used in conjunction with '-std=f95', '-std=f2003' or
  792. '-std=f2008'.
  793. '-pedantic-errors'
  794. Like '-pedantic', except that errors are produced rather than
  795. warnings.
  796. '-Wall'
  797. Enables commonly used warning options pertaining to usage that we
  798. recommend avoiding and that we believe are easy to avoid. This
  799. currently includes '-Waliasing', '-Wampersand', '-Wconversion',
  800. '-Wsurprising', '-Wc-binding-type', '-Wintrinsics-std', '-Wtabs',
  801. '-Wintrinsic-shadow', '-Wline-truncation', '-Wtarget-lifetime',
  802. '-Winteger-division', '-Wreal-q-constant', '-Wunused' and
  803. '-Wundefined-do-loop'.
  804. '-Waliasing'
  805. Warn about possible aliasing of dummy arguments. Specifically, it
  806. warns if the same actual argument is associated with a dummy
  807. argument with 'INTENT(IN)' and a dummy argument with 'INTENT(OUT)'
  808. in a call with an explicit interface.
  809. The following example will trigger the warning.
  810. interface
  811. subroutine bar(a,b)
  812. integer, intent(in) :: a
  813. integer, intent(out) :: b
  814. end subroutine
  815. end interface
  816. integer :: a
  817. call bar(a,a)
  818. '-Wampersand'
  819. Warn about missing ampersand in continued character constants. The
  820. warning is given with '-Wampersand', '-pedantic', '-std=f95',
  821. '-std=f2003' and '-std=f2008'. Note: With no ampersand given in a
  822. continued character constant, GNU Fortran assumes continuation at
  823. the first non-comment, non-whitespace character after the ampersand
  824. that initiated the continuation.
  825. '-Wargument-mismatch'
  826. Warn about type, rank, and other mismatches between formal
  827. parameters and actual arguments to functions and subroutines.
  828. These warnings are recommended and thus enabled by default.
  829. '-Warray-temporaries'
  830. Warn about array temporaries generated by the compiler. The
  831. information generated by this warning is sometimes useful in
  832. optimization, in order to avoid such temporaries.
  833. '-Wc-binding-type'
  834. Warn if the a variable might not be C interoperable. In
  835. particular, warn if the variable has been declared using an
  836. intrinsic type with default kind instead of using a kind parameter
  837. defined for C interoperability in the intrinsic 'ISO_C_Binding'
  838. module. This option is implied by '-Wall'.
  839. '-Wcharacter-truncation'
  840. Warn when a character assignment will truncate the assigned string.
  841. '-Wline-truncation'
  842. Warn when a source code line will be truncated. This option is
  843. implied by '-Wall'. For free-form source code, the default is
  844. '-Werror=line-truncation' such that truncations are reported as
  845. error.
  846. '-Wconversion'
  847. Warn about implicit conversions that are likely to change the value
  848. of the expression after conversion. Implied by '-Wall'.
  849. '-Wconversion-extra'
  850. Warn about implicit conversions between different types and kinds.
  851. This option does _not_ imply '-Wconversion'.
  852. '-Wextra'
  853. Enables some warning options for usages of language features which
  854. may be problematic. This currently includes '-Wcompare-reals' and
  855. '-Wunused-parameter'.
  856. '-Wimplicit-interface'
  857. Warn if a procedure is called without an explicit interface. Note
  858. this only checks that an explicit interface is present. It does
  859. not check that the declared interfaces are consistent across
  860. program units.
  861. '-Wimplicit-procedure'
  862. Warn if a procedure is called that has neither an explicit
  863. interface nor has been declared as 'EXTERNAL'.
  864. '-Winteger-division'
  865. Warn if a constant integer division truncates it result. As an
  866. example, 3/5 evaluates to 0.
  867. '-Wintrinsics-std'
  868. Warn if 'gfortran' finds a procedure named like an intrinsic not
  869. available in the currently selected standard (with '-std') and
  870. treats it as 'EXTERNAL' procedure because of this.
  871. '-fall-intrinsics' can be used to never trigger this behavior and
  872. always link to the intrinsic regardless of the selected standard.
  873. '-Wreal-q-constant'
  874. Produce a warning if a real-literal-constant contains a 'q'
  875. exponent-letter.
  876. '-Wsurprising'
  877. Produce a warning when "suspicious" code constructs are
  878. encountered. While technically legal these usually indicate that
  879. an error has been made.
  880. This currently produces a warning under the following
  881. circumstances:
  882. * An INTEGER SELECT construct has a CASE that can never be
  883. matched as its lower value is greater than its upper value.
  884. * A LOGICAL SELECT construct has three CASE statements.
  885. * A TRANSFER specifies a source that is shorter than the
  886. destination.
  887. * The type of a function result is declared more than once with
  888. the same type. If '-pedantic' or standard-conforming mode is
  889. enabled, this is an error.
  890. * A 'CHARACTER' variable is declared with negative length.
  891. '-Wtabs'
  892. By default, tabs are accepted as whitespace, but tabs are not
  893. members of the Fortran Character Set. For continuation lines, a
  894. tab followed by a digit between 1 and 9 is supported. '-Wtabs'
  895. will cause a warning to be issued if a tab is encountered. Note,
  896. '-Wtabs' is active for '-pedantic', '-std=f95', '-std=f2003',
  897. '-std=f2008', '-std=f2008ts' and '-Wall'.
  898. '-Wundefined-do-loop'
  899. Warn if a DO loop with step either 1 or -1 yields an underflow or
  900. an overflow during iteration of an induction variable of the loop.
  901. This option is implied by '-Wall'.
  902. '-Wunderflow'
  903. Produce a warning when numerical constant expressions are
  904. encountered, which yield an UNDERFLOW during compilation. Enabled
  905. by default.
  906. '-Wintrinsic-shadow'
  907. Warn if a user-defined procedure or module procedure has the same
  908. name as an intrinsic; in this case, an explicit interface or
  909. 'EXTERNAL' or 'INTRINSIC' declaration might be needed to get calls
  910. later resolved to the desired intrinsic/procedure. This option is
  911. implied by '-Wall'.
  912. '-Wuse-without-only'
  913. Warn if a 'USE' statement has no 'ONLY' qualifier and thus
  914. implicitly imports all public entities of the used module.
  915. '-Wunused-dummy-argument'
  916. Warn about unused dummy arguments. This option is implied by
  917. '-Wall'.
  918. '-Wunused-parameter'
  919. Contrary to 'gcc''s meaning of '-Wunused-parameter', 'gfortran''s
  920. implementation of this option does not warn about unused dummy
  921. arguments (see '-Wunused-dummy-argument'), but about unused
  922. 'PARAMETER' values. '-Wunused-parameter' is implied by '-Wextra'
  923. if also '-Wunused' or '-Wall' is used.
  924. '-Walign-commons'
  925. By default, 'gfortran' warns about any occasion of variables being
  926. padded for proper alignment inside a 'COMMON' block. This warning
  927. can be turned off via '-Wno-align-commons'. See also
  928. '-falign-commons'.
  929. '-Wfunction-elimination'
  930. Warn if any calls to functions are eliminated by the optimizations
  931. enabled by the '-ffrontend-optimize' option.
  932. '-Wrealloc-lhs'
  933. Warn when the compiler might insert code to for allocation or
  934. reallocation of an allocatable array variable of intrinsic type in
  935. intrinsic assignments. In hot loops, the Fortran 2003 reallocation
  936. feature may reduce the performance. If the array is already
  937. allocated with the correct shape, consider using a whole-array
  938. array-spec (e.g. '(:,:,:)') for the variable on the left-hand side
  939. to prevent the reallocation check. Note that in some cases the
  940. warning is shown, even if the compiler will optimize reallocation
  941. checks away. For instance, when the right-hand side contains the
  942. same variable multiplied by a scalar. See also '-frealloc-lhs'.
  943. '-Wrealloc-lhs-all'
  944. Warn when the compiler inserts code to for allocation or
  945. reallocation of an allocatable variable; this includes scalars and
  946. derived types.
  947. '-Wcompare-reals'
  948. Warn when comparing real or complex types for equality or
  949. inequality. This option is implied by '-Wextra'.
  950. '-Wtarget-lifetime'
  951. Warn if the pointer in a pointer assignment might be longer than
  952. the its target. This option is implied by '-Wall'.
  953. '-Wzerotrip'
  954. Warn if a 'DO' loop is known to execute zero times at compile time.
  955. This option is implied by '-Wall'.
  956. '-Werror'
  957. Turns all warnings into errors.
  958. *Note Options to Request or Suppress Errors and Warnings:
  959. (gcc)Warning Options, for information on more options offered by the GBE
  960. shared by 'gfortran', 'gcc' and other GNU compilers.
  961. Some of these have no effect when compiling programs written in
  962. Fortran.
  963. 
  964. File: gfortran.info, Node: Debugging Options, Next: Directory Options, Prev: Error and Warning Options, Up: Invoking GNU Fortran
  965. 2.5 Options for debugging your program or GNU Fortran
  966. =====================================================
  967. GNU Fortran has various special options that are used for debugging
  968. either your program or the GNU Fortran compiler.
  969. '-fdump-fortran-original'
  970. Output the internal parse tree after translating the source program
  971. into internal representation. Only really useful for debugging the
  972. GNU Fortran compiler itself.
  973. '-fdump-fortran-optimized'
  974. Output the parse tree after front-end optimization. Only really
  975. useful for debugging the GNU Fortran compiler itself.
  976. '-fdump-parse-tree'
  977. Output the internal parse tree after translating the source program
  978. into internal representation. Only really useful for debugging the
  979. GNU Fortran compiler itself. This option is deprecated; use
  980. '-fdump-fortran-original' instead.
  981. '-ffpe-trap=LIST'
  982. Specify a list of floating point exception traps to enable. On
  983. most systems, if a floating point exception occurs and the trap for
  984. that exception is enabled, a SIGFPE signal will be sent and the
  985. program being aborted, producing a core file useful for debugging.
  986. LIST is a (possibly empty) comma-separated list of the following
  987. exceptions: 'invalid' (invalid floating point operation, such as
  988. 'SQRT(-1.0)'), 'zero' (division by zero), 'overflow' (overflow in a
  989. floating point operation), 'underflow' (underflow in a floating
  990. point operation), 'inexact' (loss of precision during operation),
  991. and 'denormal' (operation performed on a denormal value). The
  992. first five exceptions correspond to the five IEEE 754 exceptions,
  993. whereas the last one ('denormal') is not part of the IEEE 754
  994. standard but is available on some common architectures such as x86.
  995. The first three exceptions ('invalid', 'zero', and 'overflow')
  996. often indicate serious errors, and unless the program has
  997. provisions for dealing with these exceptions, enabling traps for
  998. these three exceptions is probably a good idea.
  999. Many, if not most, floating point operations incur loss of
  1000. precision due to rounding, and hence the 'ffpe-trap=inexact' is
  1001. likely to be uninteresting in practice.
  1002. By default no exception traps are enabled.
  1003. '-ffpe-summary=LIST'
  1004. Specify a list of floating-point exceptions, whose flag status is
  1005. printed to 'ERROR_UNIT' when invoking 'STOP' and 'ERROR STOP'.
  1006. LIST can be either 'none', 'all' or a comma-separated list of the
  1007. following exceptions: 'invalid', 'zero', 'overflow', 'underflow',
  1008. 'inexact' and 'denormal'. (See '-ffpe-trap' for a description of
  1009. the exceptions.)
  1010. By default, a summary for all exceptions but 'inexact' is shown.
  1011. '-fno-backtrace'
  1012. When a serious runtime error is encountered or a deadly signal is
  1013. emitted (segmentation fault, illegal instruction, bus error,
  1014. floating-point exception, and the other POSIX signals that have the
  1015. action 'core'), the Fortran runtime library tries to output a
  1016. backtrace of the error. '-fno-backtrace' disables the backtrace
  1017. generation. This option only has influence for compilation of the
  1018. Fortran main program.
  1019. *Note Options for Debugging Your Program or GCC: (gcc)Debugging
  1020. Options, for more information on debugging options.
  1021. 
  1022. File: gfortran.info, Node: Directory Options, Next: Link Options, Prev: Debugging Options, Up: Invoking GNU Fortran
  1023. 2.6 Options for directory search
  1024. ================================
  1025. These options affect how GNU Fortran searches for files specified by the
  1026. 'INCLUDE' directive and where it searches for previously compiled
  1027. modules.
  1028. It also affects the search paths used by 'cpp' when used to
  1029. preprocess Fortran source.
  1030. '-IDIR'
  1031. These affect interpretation of the 'INCLUDE' directive (as well as
  1032. of the '#include' directive of the 'cpp' preprocessor).
  1033. Also note that the general behavior of '-I' and 'INCLUDE' is pretty
  1034. much the same as of '-I' with '#include' in the 'cpp' preprocessor,
  1035. with regard to looking for 'header.gcc' files and other such
  1036. things.
  1037. This path is also used to search for '.mod' files when previously
  1038. compiled modules are required by a 'USE' statement.
  1039. *Note Options for Directory Search: (gcc)Directory Options, for
  1040. information on the '-I' option.
  1041. '-JDIR'
  1042. This option specifies where to put '.mod' files for compiled
  1043. modules. It is also added to the list of directories to searched
  1044. by an 'USE' statement.
  1045. The default is the current directory.
  1046. '-fintrinsic-modules-path DIR'
  1047. This option specifies the location of pre-compiled intrinsic
  1048. modules, if they are not in the default location expected by the
  1049. compiler.
  1050. 
  1051. File: gfortran.info, Node: Link Options, Next: Runtime Options, Prev: Directory Options, Up: Invoking GNU Fortran
  1052. 2.7 Influencing the linking step
  1053. ================================
  1054. These options come into play when the compiler links object files into
  1055. an executable output file. They are meaningless if the compiler is not
  1056. doing a link step.
  1057. '-static-libgfortran'
  1058. On systems that provide 'libgfortran' as a shared and a static
  1059. library, this option forces the use of the static version. If no
  1060. shared version of 'libgfortran' was built when the compiler was
  1061. configured, this option has no effect.
  1062. 
  1063. File: gfortran.info, Node: Runtime Options, Next: Code Gen Options, Prev: Link Options, Up: Invoking GNU Fortran
  1064. 2.8 Influencing runtime behavior
  1065. ================================
  1066. These options affect the runtime behavior of programs compiled with GNU
  1067. Fortran.
  1068. '-fconvert=CONVERSION'
  1069. Specify the representation of data for unformatted files. Valid
  1070. values for conversion are: 'native', the default; 'swap', swap
  1071. between big- and little-endian; 'big-endian', use big-endian
  1072. representation for unformatted files; 'little-endian', use
  1073. little-endian representation for unformatted files.
  1074. _This option has an effect only when used in the main program. The
  1075. 'CONVERT' specifier and the GFORTRAN_CONVERT_UNIT environment
  1076. variable override the default specified by '-fconvert'._
  1077. '-frecord-marker=LENGTH'
  1078. Specify the length of record markers for unformatted files. Valid
  1079. values for LENGTH are 4 and 8. Default is 4. _This is different
  1080. from previous versions of 'gfortran'_, which specified a default
  1081. record marker length of 8 on most systems. If you want to read or
  1082. write files compatible with earlier versions of 'gfortran', use
  1083. '-frecord-marker=8'.
  1084. '-fmax-subrecord-length=LENGTH'
  1085. Specify the maximum length for a subrecord. The maximum permitted
  1086. value for length is 2147483639, which is also the default. Only
  1087. really useful for use by the gfortran testsuite.
  1088. '-fsign-zero'
  1089. When enabled, floating point numbers of value zero with the sign
  1090. bit set are written as negative number in formatted output and
  1091. treated as negative in the 'SIGN' intrinsic. '-fno-sign-zero' does
  1092. not print the negative sign of zero values (or values rounded to
  1093. zero for I/O) and regards zero as positive number in the 'SIGN'
  1094. intrinsic for compatibility with Fortran 77. The default is
  1095. '-fsign-zero'.
  1096. 
  1097. File: gfortran.info, Node: Code Gen Options, Next: Environment Variables, Prev: Runtime Options, Up: Invoking GNU Fortran
  1098. 2.9 Options for code generation conventions
  1099. ===========================================
  1100. These machine-independent options control the interface conventions used
  1101. in code generation.
  1102. Most of them have both positive and negative forms; the negative form
  1103. of '-ffoo' would be '-fno-foo'. In the table below, only one of the
  1104. forms is listed--the one which is not the default. You can figure out
  1105. the other form by either removing 'no-' or adding it.
  1106. '-fno-automatic'
  1107. Treat each program unit (except those marked as RECURSIVE) as if
  1108. the 'SAVE' statement were specified for every local variable and
  1109. array referenced in it. Does not affect common blocks. (Some
  1110. Fortran compilers provide this option under the name '-static' or
  1111. '-save'.) The default, which is '-fautomatic', uses the stack for
  1112. local variables smaller than the value given by
  1113. '-fmax-stack-var-size'. Use the option '-frecursive' to use no
  1114. static memory.
  1115. '-ff2c'
  1116. Generate code designed to be compatible with code generated by
  1117. 'g77' and 'f2c'.
  1118. The calling conventions used by 'g77' (originally implemented in
  1119. 'f2c') require functions that return type default 'REAL' to
  1120. actually return the C type 'double', and functions that return type
  1121. 'COMPLEX' to return the values via an extra argument in the calling
  1122. sequence that points to where to store the return value. Under the
  1123. default GNU calling conventions, such functions simply return their
  1124. results as they would in GNU C--default 'REAL' functions return the
  1125. C type 'float', and 'COMPLEX' functions return the GNU C type
  1126. 'complex'. Additionally, this option implies the
  1127. '-fsecond-underscore' option, unless '-fno-second-underscore' is
  1128. explicitly requested.
  1129. This does not affect the generation of code that interfaces with
  1130. the 'libgfortran' library.
  1131. _Caution:_ It is not a good idea to mix Fortran code compiled with
  1132. '-ff2c' with code compiled with the default '-fno-f2c' calling
  1133. conventions as, calling 'COMPLEX' or default 'REAL' functions
  1134. between program parts which were compiled with different calling
  1135. conventions will break at execution time.
  1136. _Caution:_ This will break code which passes intrinsic functions of
  1137. type default 'REAL' or 'COMPLEX' as actual arguments, as the
  1138. library implementations use the '-fno-f2c' calling conventions.
  1139. '-fno-underscoring'
  1140. Do not transform names of entities specified in the Fortran source
  1141. file by appending underscores to them.
  1142. With '-funderscoring' in effect, GNU Fortran appends one underscore
  1143. to external names with no underscores. This is done to ensure
  1144. compatibility with code produced by many UNIX Fortran compilers.
  1145. _Caution_: The default behavior of GNU Fortran is incompatible with
  1146. 'f2c' and 'g77', please use the '-ff2c' option if you want object
  1147. files compiled with GNU Fortran to be compatible with object code
  1148. created with these tools.
  1149. Use of '-fno-underscoring' is not recommended unless you are
  1150. experimenting with issues such as integration of GNU Fortran into
  1151. existing system environments (vis-a`-vis existing libraries, tools,
  1152. and so on).
  1153. For example, with '-funderscoring', and assuming that 'j()' and
  1154. 'max_count()' are external functions while 'my_var' and 'lvar' are
  1155. local variables, a statement like
  1156. I = J() + MAX_COUNT (MY_VAR, LVAR)
  1157. is implemented as something akin to:
  1158. i = j_() + max_count__(&my_var__, &lvar);
  1159. With '-fno-underscoring', the same statement is implemented as:
  1160. i = j() + max_count(&my_var, &lvar);
  1161. Use of '-fno-underscoring' allows direct specification of
  1162. user-defined names while debugging and when interfacing GNU Fortran
  1163. code with other languages.
  1164. Note that just because the names match does _not_ mean that the
  1165. interface implemented by GNU Fortran for an external name matches
  1166. the interface implemented by some other language for that same
  1167. name. That is, getting code produced by GNU Fortran to link to
  1168. code produced by some other compiler using this or any other method
  1169. can be only a small part of the overall solution--getting the code
  1170. generated by both compilers to agree on issues other than naming
  1171. can require significant effort, and, unlike naming disagreements,
  1172. linkers normally cannot detect disagreements in these other areas.
  1173. Also, note that with '-fno-underscoring', the lack of appended
  1174. underscores introduces the very real possibility that a
  1175. user-defined external name will conflict with a name in a system
  1176. library, which could make finding unresolved-reference bugs quite
  1177. difficult in some cases--they might occur at program run time, and
  1178. show up only as buggy behavior at run time.
  1179. In future versions of GNU Fortran we hope to improve naming and
  1180. linking issues so that debugging always involves using the names as
  1181. they appear in the source, even if the names as seen by the linker
  1182. are mangled to prevent accidental linking between procedures with
  1183. incompatible interfaces.
  1184. '-fsecond-underscore'
  1185. By default, GNU Fortran appends an underscore to external names.
  1186. If this option is used GNU Fortran appends two underscores to names
  1187. with underscores and one underscore to external names with no
  1188. underscores. GNU Fortran also appends two underscores to internal
  1189. names with underscores to avoid naming collisions with external
  1190. names.
  1191. This option has no effect if '-fno-underscoring' is in effect. It
  1192. is implied by the '-ff2c' option.
  1193. Otherwise, with this option, an external name such as 'MAX_COUNT'
  1194. is implemented as a reference to the link-time external symbol
  1195. 'max_count__', instead of 'max_count_'. This is required for
  1196. compatibility with 'g77' and 'f2c', and is implied by use of the
  1197. '-ff2c' option.
  1198. '-fcoarray=<KEYWORD>'
  1199. 'none'
  1200. Disable coarray support; using coarray declarations and
  1201. image-control statements will produce a compile-time error.
  1202. (Default)
  1203. 'single'
  1204. Single-image mode, i.e. 'num_images()' is always one.
  1205. 'lib'
  1206. Library-based coarray parallelization; a suitable GNU Fortran
  1207. coarray library needs to be linked.
  1208. '-fcheck=<KEYWORD>'
  1209. Enable the generation of run-time checks; the argument shall be a
  1210. comma-delimited list of the following keywords. Prefixing a check
  1211. with 'no-' disables it if it was activated by a previous
  1212. specification.
  1213. 'all'
  1214. Enable all run-time test of '-fcheck'.
  1215. 'array-temps'
  1216. Warns at run time when for passing an actual argument a
  1217. temporary array had to be generated. The information
  1218. generated by this warning is sometimes useful in optimization,
  1219. in order to avoid such temporaries.
  1220. Note: The warning is only printed once per location.
  1221. 'bounds'
  1222. Enable generation of run-time checks for array subscripts and
  1223. against the declared minimum and maximum values. It also
  1224. checks array indices for assumed and deferred shape arrays
  1225. against the actual allocated bounds and ensures that all
  1226. string lengths are equal for character array constructors
  1227. without an explicit typespec.
  1228. Some checks require that '-fcheck=bounds' is set for the
  1229. compilation of the main program.
  1230. Note: In the future this may also include other forms of
  1231. checking, e.g., checking substring references.
  1232. 'do'
  1233. Enable generation of run-time checks for invalid modification
  1234. of loop iteration variables.
  1235. 'mem'
  1236. Enable generation of run-time checks for memory allocation.
  1237. Note: This option does not affect explicit allocations using
  1238. the 'ALLOCATE' statement, which will be always checked.
  1239. 'pointer'
  1240. Enable generation of run-time checks for pointers and
  1241. allocatables.
  1242. 'recursion'
  1243. Enable generation of run-time checks for recursively called
  1244. subroutines and functions which are not marked as recursive.
  1245. See also '-frecursive'. Note: This check does not work for
  1246. OpenMP programs and is disabled if used together with
  1247. '-frecursive' and '-fopenmp'.
  1248. Example: Assuming you have a file 'foo.f90', the command
  1249. gfortran -fcheck=all,no-array-temps foo.f90
  1250. will compile the file with all checks enabled as specified above
  1251. except warnings for generated array temporaries.
  1252. '-fbounds-check'
  1253. Deprecated alias for '-fcheck=bounds'.
  1254. '-ftail-call-workaround'
  1255. '-ftail-call-workaround=N'
  1256. Some C interfaces to Fortran codes violate the gfortran ABI by
  1257. omitting the hidden character length arguments as described in
  1258. *Note Argument passing conventions::. This can lead to crashes
  1259. because pushing arguments for tail calls can overflow the stack.
  1260. To provide a workaround for existing binary packages, this option
  1261. disables tail call optimization for gfortran procedures with
  1262. character arguments. With '-ftail-call-workaround=2' tail call
  1263. optimization is disabled in all gfortran procedures with character
  1264. arguments, with '-ftail-call-workaround=1' or equivalent
  1265. '-ftail-call-workaround' only in gfortran procedures with character
  1266. arguments that call implicitly prototyped procedures.
  1267. Using this option can lead to problems including crashes due to
  1268. insufficient stack space.
  1269. It is _very strongly_ recommended to fix the code in question. The
  1270. '-fc-prototypes-external' option can be used to generate prototypes
  1271. which conform to gfortran's ABI, for inclusion in the source code.
  1272. Support for this option will likely be withdrawn in a future
  1273. release of gfortran.
  1274. The negative form, '-fno-tail-call-workaround' or equivalent
  1275. '-ftail-call-workaround=0', can be used to disable this option.
  1276. Default is currently '-ftail-call-workaround', this will change in
  1277. future releases.
  1278. '-fcheck-array-temporaries'
  1279. Deprecated alias for '-fcheck=array-temps'.
  1280. '-fmax-array-constructor=N'
  1281. This option can be used to increase the upper limit permitted in
  1282. array constructors. The code below requires this option to expand
  1283. the array at compile time.
  1284. program test
  1285. implicit none
  1286. integer j
  1287. integer, parameter :: n = 100000
  1288. integer, parameter :: i(n) = (/ (2*j, j = 1, n) /)
  1289. print '(10(I0,1X))', i
  1290. end program test
  1291. _Caution: This option can lead to long compile times and
  1292. excessively large object files._
  1293. The default value for N is 65535.
  1294. '-fmax-stack-var-size=N'
  1295. This option specifies the size in bytes of the largest array that
  1296. will be put on the stack; if the size is exceeded static memory is
  1297. used (except in procedures marked as RECURSIVE). Use the option
  1298. '-frecursive' to allow for recursive procedures which do not have a
  1299. RECURSIVE attribute or for parallel programs. Use '-fno-automatic'
  1300. to never use the stack.
  1301. This option currently only affects local arrays declared with
  1302. constant bounds, and may not apply to all character variables.
  1303. Future versions of GNU Fortran may improve this behavior.
  1304. The default value for N is 32768.
  1305. '-fstack-arrays'
  1306. Adding this option will make the Fortran compiler put all local
  1307. arrays, even those of unknown size onto stack memory. If your
  1308. program uses very large local arrays it is possible that you will
  1309. have to extend your runtime limits for stack memory on some
  1310. operating systems. This flag is enabled by default at optimization
  1311. level '-Ofast'.
  1312. '-fpack-derived'
  1313. This option tells GNU Fortran to pack derived type members as
  1314. closely as possible. Code compiled with this option is likely to
  1315. be incompatible with code compiled without this option, and may
  1316. execute slower.
  1317. '-frepack-arrays'
  1318. In some circumstances GNU Fortran may pass assumed shape array
  1319. sections via a descriptor describing a noncontiguous area of
  1320. memory. This option adds code to the function prologue to repack
  1321. the data into a contiguous block at runtime.
  1322. This should result in faster accesses to the array. However it can
  1323. introduce significant overhead to the function call, especially
  1324. when the passed data is noncontiguous.
  1325. '-fshort-enums'
  1326. This option is provided for interoperability with C code that was
  1327. compiled with the '-fshort-enums' option. It will make GNU Fortran
  1328. choose the smallest 'INTEGER' kind a given enumerator set will fit
  1329. in, and give all its enumerators this kind.
  1330. '-fexternal-blas'
  1331. This option will make 'gfortran' generate calls to BLAS functions
  1332. for some matrix operations like 'MATMUL', instead of using our own
  1333. algorithms, if the size of the matrices involved is larger than a
  1334. given limit (see '-fblas-matmul-limit'). This may be profitable if
  1335. an optimized vendor BLAS library is available. The BLAS library
  1336. will have to be specified at link time.
  1337. '-fblas-matmul-limit=N'
  1338. Only significant when '-fexternal-blas' is in effect. Matrix
  1339. multiplication of matrices with size larger than (or equal to) N
  1340. will be performed by calls to BLAS functions, while others will be
  1341. handled by 'gfortran' internal algorithms. If the matrices
  1342. involved are not square, the size comparison is performed using the
  1343. geometric mean of the dimensions of the argument and result
  1344. matrices.
  1345. The default value for N is 30.
  1346. '-finline-matmul-limit=N'
  1347. When front-end optimiztion is active, some calls to the 'MATMUL'
  1348. intrinsic function will be inlined. This may result in code size
  1349. increase if the size of the matrix cannot be determined at compile
  1350. time, as code for both cases is generated. Setting
  1351. '-finline-matmul-limit=0' will disable inlining in all cases.
  1352. Setting this option with a value of N will produce inline code for
  1353. matrices with size up to N. If the matrices involved are not
  1354. square, the size comparison is performed using the geometric mean
  1355. of the dimensions of the argument and result matrices.
  1356. The default value for N is 30. The '-fblas-matmul-limit' can be
  1357. used to change this value.
  1358. '-frecursive'
  1359. Allow indirect recursion by forcing all local arrays to be
  1360. allocated on the stack. This flag cannot be used together with
  1361. '-fmax-stack-var-size=' or '-fno-automatic'.
  1362. '-finit-local-zero'
  1363. '-finit-derived'
  1364. '-finit-integer=N'
  1365. '-finit-real=<ZERO|INF|-INF|NAN|SNAN>'
  1366. '-finit-logical=<TRUE|FALSE>'
  1367. '-finit-character=N'
  1368. The '-finit-local-zero' option instructs the compiler to initialize
  1369. local 'INTEGER', 'REAL', and 'COMPLEX' variables to zero, 'LOGICAL'
  1370. variables to false, and 'CHARACTER' variables to a string of null
  1371. bytes. Finer-grained initialization options are provided by the
  1372. '-finit-integer=N', '-finit-real=<ZERO|INF|-INF|NAN|SNAN>' (which
  1373. also initializes the real and imaginary parts of local 'COMPLEX'
  1374. variables), '-finit-logical=<TRUE|FALSE>', and '-finit-character=N'
  1375. (where N is an ASCII character value) options. Components of
  1376. derived type variables will be initialized according to these flags
  1377. only with '-finit-derived'. These options do not initialize
  1378. * allocatable arrays
  1379. * variables that appear in an 'EQUIVALENCE' statement.
  1380. (These limitations may be removed in future releases).
  1381. Note that the '-finit-real=nan' option initializes 'REAL' and
  1382. 'COMPLEX' variables with a quiet NaN. For a signalling NaN use
  1383. '-finit-real=snan'; note, however, that compile-time optimizations
  1384. may convert them into quiet NaN and that trapping needs to be
  1385. enabled (e.g. via '-ffpe-trap').
  1386. Finally, note that enabling any of the '-finit-*' options will
  1387. silence warnings that would have been emitted by '-Wuninitialized'
  1388. for the affected local variables.
  1389. '-falign-commons'
  1390. By default, 'gfortran' enforces proper alignment of all variables
  1391. in a 'COMMON' block by padding them as needed. On certain
  1392. platforms this is mandatory, on others it increases performance.
  1393. If a 'COMMON' block is not declared with consistent data types
  1394. everywhere, this padding can cause trouble, and
  1395. '-fno-align-commons' can be used to disable automatic alignment.
  1396. The same form of this option should be used for all files that
  1397. share a 'COMMON' block. To avoid potential alignment issues in
  1398. 'COMMON' blocks, it is recommended to order objects from largest to
  1399. smallest.
  1400. '-fno-protect-parens'
  1401. By default the parentheses in expression are honored for all
  1402. optimization levels such that the compiler does not do any
  1403. re-association. Using '-fno-protect-parens' allows the compiler to
  1404. reorder 'REAL' and 'COMPLEX' expressions to produce faster code.
  1405. Note that for the re-association optimization '-fno-signed-zeros'
  1406. and '-fno-trapping-math' need to be in effect. The parentheses
  1407. protection is enabled by default, unless '-Ofast' is given.
  1408. '-frealloc-lhs'
  1409. An allocatable left-hand side of an intrinsic assignment is
  1410. automatically (re)allocated if it is either unallocated or has a
  1411. different shape. The option is enabled by default except when
  1412. '-std=f95' is given. See also '-Wrealloc-lhs'.
  1413. '-faggressive-function-elimination'
  1414. Functions with identical argument lists are eliminated within
  1415. statements, regardless of whether these functions are marked 'PURE'
  1416. or not. For example, in
  1417. a = f(b,c) + f(b,c)
  1418. there will only be a single call to 'f'. This option only works if
  1419. '-ffrontend-optimize' is in effect.
  1420. '-ffrontend-optimize'
  1421. This option performs front-end optimization, based on manipulating
  1422. parts the Fortran parse tree. Enabled by default by any '-O'
  1423. option. Optimizations enabled by this option include inlining
  1424. calls to 'MATMUL', elimination of identical function calls within
  1425. expressions, removing unnecessary calls to 'TRIM' in comparisons
  1426. and assignments and replacing 'TRIM(a)' with 'a(1:LEN_TRIM(a))'.
  1427. It can be deselected by specifying '-fno-frontend-optimize'.
  1428. *Note Options for Code Generation Conventions: (gcc)Code Gen Options,
  1429. for information on more options offered by the GBE shared by 'gfortran',
  1430. 'gcc', and other GNU compilers.
  1431. 
  1432. File: gfortran.info, Node: Environment Variables, Prev: Code Gen Options, Up: Invoking GNU Fortran
  1433. 2.10 Environment variables affecting 'gfortran'
  1434. ===============================================
  1435. The 'gfortran' compiler currently does not make use of any environment
  1436. variables to control its operation above and beyond those that affect
  1437. the operation of 'gcc'.
  1438. *Note Environment Variables Affecting GCC: (gcc)Environment
  1439. Variables, for information on environment variables.
  1440. *Note Runtime::, for environment variables that affect the run-time
  1441. behavior of programs compiled with GNU Fortran.
  1442. 
  1443. File: gfortran.info, Node: Runtime, Next: Fortran 2003 and 2008 status, Prev: Invoking GNU Fortran, Up: Top
  1444. 3 Runtime: Influencing runtime behavior with environment variables
  1445. ******************************************************************
  1446. The behavior of the 'gfortran' can be influenced by environment
  1447. variables.
  1448. Malformed environment variables are silently ignored.
  1449. * Menu:
  1450. * TMPDIR:: Directory for scratch files
  1451. * GFORTRAN_STDIN_UNIT:: Unit number for standard input
  1452. * GFORTRAN_STDOUT_UNIT:: Unit number for standard output
  1453. * GFORTRAN_STDERR_UNIT:: Unit number for standard error
  1454. * GFORTRAN_UNBUFFERED_ALL:: Do not buffer I/O for all units.
  1455. * GFORTRAN_UNBUFFERED_PRECONNECTED:: Do not buffer I/O for preconnected units.
  1456. * GFORTRAN_SHOW_LOCUS:: Show location for runtime errors
  1457. * GFORTRAN_OPTIONAL_PLUS:: Print leading + where permitted
  1458. * GFORTRAN_DEFAULT_RECL:: Default record length for new files
  1459. * GFORTRAN_LIST_SEPARATOR:: Separator for list output
  1460. * GFORTRAN_CONVERT_UNIT:: Set endianness for unformatted I/O
  1461. * GFORTRAN_ERROR_BACKTRACE:: Show backtrace on run-time errors
  1462. 
  1463. File: gfortran.info, Node: TMPDIR, Next: GFORTRAN_STDIN_UNIT, Up: Runtime
  1464. 3.1 'TMPDIR'--Directory for scratch files
  1465. =========================================
  1466. When opening a file with 'STATUS='SCRATCH'', GNU Fortran tries to create
  1467. the file in one of the potential directories by testing each directory
  1468. in the order below.
  1469. 1. The environment variable 'TMPDIR', if it exists.
  1470. 2. On the MinGW target, the directory returned by the 'GetTempPath'
  1471. function. Alternatively, on the Cygwin target, the 'TMP' and
  1472. 'TEMP' environment variables, if they exist, in that order.
  1473. 3. The 'P_tmpdir' macro if it is defined, otherwise the directory
  1474. '/tmp'.
  1475. 
  1476. File: gfortran.info, Node: GFORTRAN_STDIN_UNIT, Next: GFORTRAN_STDOUT_UNIT, Prev: TMPDIR, Up: Runtime
  1477. 3.2 'GFORTRAN_STDIN_UNIT'--Unit number for standard input
  1478. =========================================================
  1479. This environment variable can be used to select the unit number
  1480. preconnected to standard input. This must be a positive integer. The
  1481. default value is 5.
  1482. 
  1483. File: gfortran.info, Node: GFORTRAN_STDOUT_UNIT, Next: GFORTRAN_STDERR_UNIT, Prev: GFORTRAN_STDIN_UNIT, Up: Runtime
  1484. 3.3 'GFORTRAN_STDOUT_UNIT'--Unit number for standard output
  1485. ===========================================================
  1486. This environment variable can be used to select the unit number
  1487. preconnected to standard output. This must be a positive integer. The
  1488. default value is 6.
  1489. 
  1490. File: gfortran.info, Node: GFORTRAN_STDERR_UNIT, Next: GFORTRAN_UNBUFFERED_ALL, Prev: GFORTRAN_STDOUT_UNIT, Up: Runtime
  1491. 3.4 'GFORTRAN_STDERR_UNIT'--Unit number for standard error
  1492. ==========================================================
  1493. This environment variable can be used to select the unit number
  1494. preconnected to standard error. This must be a positive integer. The
  1495. default value is 0.
  1496. 
  1497. File: gfortran.info, Node: GFORTRAN_UNBUFFERED_ALL, Next: GFORTRAN_UNBUFFERED_PRECONNECTED, Prev: GFORTRAN_STDERR_UNIT, Up: Runtime
  1498. 3.5 'GFORTRAN_UNBUFFERED_ALL'--Do not buffer I/O on all units
  1499. =============================================================
  1500. This environment variable controls whether all I/O is unbuffered. If
  1501. the first letter is 'y', 'Y' or '1', all I/O is unbuffered. This will
  1502. slow down small sequential reads and writes. If the first letter is
  1503. 'n', 'N' or '0', I/O is buffered. This is the default.
  1504. 
  1505. File: gfortran.info, Node: GFORTRAN_UNBUFFERED_PRECONNECTED, Next: GFORTRAN_SHOW_LOCUS, Prev: GFORTRAN_UNBUFFERED_ALL, Up: Runtime
  1506. 3.6 'GFORTRAN_UNBUFFERED_PRECONNECTED'--Do not buffer I/O on preconnected units
  1507. ===============================================================================
  1508. The environment variable named 'GFORTRAN_UNBUFFERED_PRECONNECTED'
  1509. controls whether I/O on a preconnected unit (i.e. STDOUT or STDERR) is
  1510. unbuffered. If the first letter is 'y', 'Y' or '1', I/O is unbuffered.
  1511. This will slow down small sequential reads and writes. If the first
  1512. letter is 'n', 'N' or '0', I/O is buffered. This is the default.
  1513. 
  1514. File: gfortran.info, Node: GFORTRAN_SHOW_LOCUS, Next: GFORTRAN_OPTIONAL_PLUS, Prev: GFORTRAN_UNBUFFERED_PRECONNECTED, Up: Runtime
  1515. 3.7 'GFORTRAN_SHOW_LOCUS'--Show location for runtime errors
  1516. ===========================================================
  1517. If the first letter is 'y', 'Y' or '1', filename and line numbers for
  1518. runtime errors are printed. If the first letter is 'n', 'N' or '0', do
  1519. not print filename and line numbers for runtime errors. The default is
  1520. to print the location.
  1521. 
  1522. File: gfortran.info, Node: GFORTRAN_OPTIONAL_PLUS, Next: GFORTRAN_DEFAULT_RECL, Prev: GFORTRAN_SHOW_LOCUS, Up: Runtime
  1523. 3.8 'GFORTRAN_OPTIONAL_PLUS'--Print leading + where permitted
  1524. =============================================================
  1525. If the first letter is 'y', 'Y' or '1', a plus sign is printed where
  1526. permitted by the Fortran standard. If the first letter is 'n', 'N' or
  1527. '0', a plus sign is not printed in most cases. Default is not to print
  1528. plus signs.
  1529. 
  1530. File: gfortran.info, Node: GFORTRAN_DEFAULT_RECL, Next: GFORTRAN_LIST_SEPARATOR, Prev: GFORTRAN_OPTIONAL_PLUS, Up: Runtime
  1531. 3.9 'GFORTRAN_DEFAULT_RECL'--Default record length for new files
  1532. ================================================================
  1533. This environment variable specifies the default record length, in bytes,
  1534. for files which are opened without a 'RECL' tag in the 'OPEN' statement.
  1535. This must be a positive integer. The default value is 1073741824 bytes
  1536. (1 GB).
  1537. 
  1538. File: gfortran.info, Node: GFORTRAN_LIST_SEPARATOR, Next: GFORTRAN_CONVERT_UNIT, Prev: GFORTRAN_DEFAULT_RECL, Up: Runtime
  1539. 3.10 'GFORTRAN_LIST_SEPARATOR'--Separator for list output
  1540. =========================================================
  1541. This environment variable specifies the separator when writing
  1542. list-directed output. It may contain any number of spaces and at most
  1543. one comma. If you specify this on the command line, be sure to quote
  1544. spaces, as in
  1545. $ GFORTRAN_LIST_SEPARATOR=' , ' ./a.out
  1546. when 'a.out' is the compiled Fortran program that you want to run.
  1547. Default is a single space.
  1548. 
  1549. File: gfortran.info, Node: GFORTRAN_CONVERT_UNIT, Next: GFORTRAN_ERROR_BACKTRACE, Prev: GFORTRAN_LIST_SEPARATOR, Up: Runtime
  1550. 3.11 'GFORTRAN_CONVERT_UNIT'--Set endianness for unformatted I/O
  1551. ================================================================
  1552. By setting the 'GFORTRAN_CONVERT_UNIT' variable, it is possible to
  1553. change the representation of data for unformatted files. The syntax for
  1554. the 'GFORTRAN_CONVERT_UNIT' variable is:
  1555. GFORTRAN_CONVERT_UNIT: mode | mode ';' exception | exception ;
  1556. mode: 'native' | 'swap' | 'big_endian' | 'little_endian' ;
  1557. exception: mode ':' unit_list | unit_list ;
  1558. unit_list: unit_spec | unit_list unit_spec ;
  1559. unit_spec: INTEGER | INTEGER '-' INTEGER ;
  1560. The variable consists of an optional default mode, followed by a list
  1561. of optional exceptions, which are separated by semicolons from the
  1562. preceding default and each other. Each exception consists of a format
  1563. and a comma-separated list of units. Valid values for the modes are the
  1564. same as for the 'CONVERT' specifier:
  1565. 'NATIVE' Use the native format. This is the default.
  1566. 'SWAP' Swap between little- and big-endian.
  1567. 'LITTLE_ENDIAN' Use the little-endian format for unformatted files.
  1568. 'BIG_ENDIAN' Use the big-endian format for unformatted files.
  1569. A missing mode for an exception is taken to mean 'BIG_ENDIAN'.
  1570. Examples of values for 'GFORTRAN_CONVERT_UNIT' are:
  1571. ''big_endian'' Do all unformatted I/O in big_endian mode.
  1572. ''little_endian;native:10-20,25'' Do all unformatted I/O in
  1573. little_endian mode, except for units 10 to 20 and 25, which are in
  1574. native format.
  1575. ''10-20'' Units 10 to 20 are big-endian, the rest is native.
  1576. Setting the environment variables should be done on the command line
  1577. or via the 'export' command for 'sh'-compatible shells and via 'setenv'
  1578. for 'csh'-compatible shells.
  1579. Example for 'sh':
  1580. $ gfortran foo.f90
  1581. $ GFORTRAN_CONVERT_UNIT='big_endian;native:10-20' ./a.out
  1582. Example code for 'csh':
  1583. % gfortran foo.f90
  1584. % setenv GFORTRAN_CONVERT_UNIT 'big_endian;native:10-20'
  1585. % ./a.out
  1586. Using anything but the native representation for unformatted data
  1587. carries a significant speed overhead. If speed in this area matters to
  1588. you, it is best if you use this only for data that needs to be portable.
  1589. *Note CONVERT specifier::, for an alternative way to specify the data
  1590. representation for unformatted files. *Note Runtime Options::, for
  1591. setting a default data representation for the whole program. The
  1592. 'CONVERT' specifier overrides the '-fconvert' compile options.
  1593. _Note that the values specified via the GFORTRAN_CONVERT_UNIT
  1594. environment variable will override the CONVERT specifier in the open
  1595. statement_. This is to give control over data formats to users who do
  1596. not have the source code of their program available.
  1597. 
  1598. File: gfortran.info, Node: GFORTRAN_ERROR_BACKTRACE, Prev: GFORTRAN_CONVERT_UNIT, Up: Runtime
  1599. 3.12 'GFORTRAN_ERROR_BACKTRACE'--Show backtrace on run-time errors
  1600. ==================================================================
  1601. If the 'GFORTRAN_ERROR_BACKTRACE' variable is set to 'y', 'Y' or '1'
  1602. (only the first letter is relevant) then a backtrace is printed when a
  1603. serious run-time error occurs. To disable the backtracing, set the
  1604. variable to 'n', 'N', '0'. Default is to print a backtrace unless the
  1605. '-fno-backtrace' compile option was used.
  1606. 
  1607. File: gfortran.info, Node: Fortran 2003 and 2008 status, Next: Compiler Characteristics, Prev: Runtime, Up: Top
  1608. 4 Fortran 2003 and 2008 Status
  1609. ******************************
  1610. * Menu:
  1611. * Fortran 2003 status::
  1612. * Fortran 2008 status::
  1613. * TS 29113 status::
  1614. * TS 18508 status::
  1615. 
  1616. File: gfortran.info, Node: Fortran 2003 status, Next: Fortran 2008 status, Up: Fortran 2003 and 2008 status
  1617. 4.1 Fortran 2003 status
  1618. =======================
  1619. GNU Fortran supports several Fortran 2003 features; an incomplete list
  1620. can be found below. See also the wiki page
  1621. (https://gcc.gnu.org/wiki/Fortran2003) about Fortran 2003.
  1622. * Procedure pointers including procedure-pointer components with
  1623. 'PASS' attribute.
  1624. * Procedures which are bound to a derived type (type-bound
  1625. procedures) including 'PASS', 'PROCEDURE' and 'GENERIC', and
  1626. operators bound to a type.
  1627. * Abstract interfaces and type extension with the possibility to
  1628. override type-bound procedures or to have deferred binding.
  1629. * Polymorphic entities ("'CLASS'") for derived types and unlimited
  1630. polymorphism ("'CLASS(*)'") - including 'SAME_TYPE_AS',
  1631. 'EXTENDS_TYPE_OF' and 'SELECT TYPE' for scalars and arrays and
  1632. finalization.
  1633. * Generic interface names, which have the same name as derived types,
  1634. are now supported. This allows one to write constructor functions.
  1635. Note that Fortran does not support static constructor functions.
  1636. For static variables, only default initialization or
  1637. structure-constructor initialization are available.
  1638. * The 'ASSOCIATE' construct.
  1639. * Interoperability with C including enumerations,
  1640. * In structure constructors the components with default values may be
  1641. omitted.
  1642. * Extensions to the 'ALLOCATE' statement, allowing for a
  1643. type-specification with type parameter and for allocation and
  1644. initialization from a 'SOURCE=' expression; 'ALLOCATE' and
  1645. 'DEALLOCATE' optionally return an error message string via
  1646. 'ERRMSG='.
  1647. * Reallocation on assignment: If an intrinsic assignment is used, an
  1648. allocatable variable on the left-hand side is automatically
  1649. allocated (if unallocated) or reallocated (if the shape is
  1650. different). Currently, scalar deferred character length left-hand
  1651. sides are correctly handled but arrays are not yet fully
  1652. implemented.
  1653. * Deferred-length character variables and scalar deferred-length
  1654. character components of derived types are supported. (Note that
  1655. array-valued compoents are not yet implemented.)
  1656. * Transferring of allocations via 'MOVE_ALLOC'.
  1657. * The 'PRIVATE' and 'PUBLIC' attributes may be given individually to
  1658. derived-type components.
  1659. * In pointer assignments, the lower bound may be specified and the
  1660. remapping of elements is supported.
  1661. * For pointers an 'INTENT' may be specified which affect the
  1662. association status not the value of the pointer target.
  1663. * Intrinsics 'command_argument_count', 'get_command',
  1664. 'get_command_argument', and 'get_environment_variable'.
  1665. * Support for Unicode characters (ISO 10646) and UTF-8, including the
  1666. 'SELECTED_CHAR_KIND' and 'NEW_LINE' intrinsic functions.
  1667. * Support for binary, octal and hexadecimal (BOZ) constants in the
  1668. intrinsic functions 'INT', 'REAL', 'CMPLX' and 'DBLE'.
  1669. * Support for namelist variables with allocatable and pointer
  1670. attribute and nonconstant length type parameter.
  1671. * Array constructors using square brackets. That is, '[...]' rather
  1672. than '(/.../)'. Type-specification for array constructors like '(/
  1673. some-type :: ... /)'.
  1674. * Extensions to the specification and initialization expressions,
  1675. including the support for intrinsics with real and complex
  1676. arguments.
  1677. * Support for the asynchronous input/output syntax; however, the data
  1678. transfer is currently always synchronously performed.
  1679. * 'FLUSH' statement.
  1680. * 'IOMSG=' specifier for I/O statements.
  1681. * Support for the declaration of enumeration constants via the 'ENUM'
  1682. and 'ENUMERATOR' statements. Interoperability with 'gcc' is
  1683. guaranteed also for the case where the '-fshort-enums' command line
  1684. option is given.
  1685. * TR 15581:
  1686. * 'ALLOCATABLE' dummy arguments.
  1687. * 'ALLOCATABLE' function results
  1688. * 'ALLOCATABLE' components of derived types
  1689. * The 'OPEN' statement supports the 'ACCESS='STREAM'' specifier,
  1690. allowing I/O without any record structure.
  1691. * Namelist input/output for internal files.
  1692. * Minor I/O features: Rounding during formatted output, using of a
  1693. decimal comma instead of a decimal point, setting whether a plus
  1694. sign should appear for positive numbers. On systems where 'strtod'
  1695. honours the rounding mode, the rounding mode is also supported for
  1696. input.
  1697. * The 'PROTECTED' statement and attribute.
  1698. * The 'VALUE' statement and attribute.
  1699. * The 'VOLATILE' statement and attribute.
  1700. * The 'IMPORT' statement, allowing to import host-associated derived
  1701. types.
  1702. * The intrinsic modules 'ISO_FORTRAN_ENVIRONMENT' is supported, which
  1703. contains parameters of the I/O units, storage sizes. Additionally,
  1704. procedures for C interoperability are available in the
  1705. 'ISO_C_BINDING' module.
  1706. * 'USE' statement with 'INTRINSIC' and 'NON_INTRINSIC' attribute;
  1707. supported intrinsic modules: 'ISO_FORTRAN_ENV', 'ISO_C_BINDING',
  1708. 'OMP_LIB' and 'OMP_LIB_KINDS', and 'OPENACC'.
  1709. * Renaming of operators in the 'USE' statement.
  1710. 
  1711. File: gfortran.info, Node: Fortran 2008 status, Next: TS 29113 status, Prev: Fortran 2003 status, Up: Fortran 2003 and 2008 status
  1712. 4.2 Fortran 2008 status
  1713. =======================
  1714. The latest version of the Fortran standard is ISO/IEC 1539-1:2010,
  1715. informally known as Fortran 2008. The official version is available
  1716. from International Organization for Standardization (ISO) or its
  1717. national member organizations. The the final draft (FDIS) can be
  1718. downloaded free of charge from
  1719. <http://www.nag.co.uk/sc22wg5/links.html>. Fortran is developed by the
  1720. Working Group 5 of Sub-Committee 22 of the Joint Technical Committee 1
  1721. of the International Organization for Standardization and the
  1722. International Electrotechnical Commission (IEC). This group is known as
  1723. WG5 (http://www.nag.co.uk/sc22wg5/).
  1724. The GNU Fortran compiler supports several of the new features of
  1725. Fortran 2008; the wiki (https://gcc.gnu.org/wiki/Fortran2008Status) has
  1726. some information about the current Fortran 2008 implementation status.
  1727. In particular, the following is implemented.
  1728. * The '-std=f2008' option and support for the file extensions '.f08'
  1729. and '.F08'.
  1730. * The 'OPEN' statement now supports the 'NEWUNIT=' option, which
  1731. returns a unique file unit, thus preventing inadvertent use of the
  1732. same unit in different parts of the program.
  1733. * The 'g0' format descriptor and unlimited format items.
  1734. * The mathematical intrinsics 'ASINH', 'ACOSH', 'ATANH', 'ERF',
  1735. 'ERFC', 'GAMMA', 'LOG_GAMMA', 'BESSEL_J0', 'BESSEL_J1',
  1736. 'BESSEL_JN', 'BESSEL_Y0', 'BESSEL_Y1', 'BESSEL_YN', 'HYPOT',
  1737. 'NORM2', and 'ERFC_SCALED'.
  1738. * Using complex arguments with 'TAN', 'SINH', 'COSH', 'TANH', 'ASIN',
  1739. 'ACOS', and 'ATAN' is now possible; 'ATAN'(Y,X) is now an alias for
  1740. 'ATAN2'(Y,X).
  1741. * Support of the 'PARITY' intrinsic functions.
  1742. * The following bit intrinsics: 'LEADZ' and 'TRAILZ' for counting the
  1743. number of leading and trailing zero bits, 'POPCNT' and 'POPPAR' for
  1744. counting the number of one bits and returning the parity; 'BGE',
  1745. 'BGT', 'BLE', and 'BLT' for bitwise comparisons; 'DSHIFTL' and
  1746. 'DSHIFTR' for combined left and right shifts, 'MASKL' and 'MASKR'
  1747. for simple left and right justified masks, 'MERGE_BITS' for a
  1748. bitwise merge using a mask, 'SHIFTA', 'SHIFTL' and 'SHIFTR' for
  1749. shift operations, and the transformational bit intrinsics 'IALL',
  1750. 'IANY' and 'IPARITY'.
  1751. * Support of the 'EXECUTE_COMMAND_LINE' intrinsic subroutine.
  1752. * Support for the 'STORAGE_SIZE' intrinsic inquiry function.
  1753. * The 'INT{8,16,32}' and 'REAL{32,64,128}' kind type parameters and
  1754. the array-valued named constants 'INTEGER_KINDS', 'LOGICAL_KINDS',
  1755. 'REAL_KINDS' and 'CHARACTER_KINDS' of the intrinsic module
  1756. 'ISO_FORTRAN_ENV'.
  1757. * The module procedures 'C_SIZEOF' of the intrinsic module
  1758. 'ISO_C_BINDINGS' and 'COMPILER_VERSION' and 'COMPILER_OPTIONS' of
  1759. 'ISO_FORTRAN_ENV'.
  1760. * Coarray support for serial programs with '-fcoarray=single' flag
  1761. and experimental support for multiple images with the
  1762. '-fcoarray=lib' flag.
  1763. * Submodules are supported. It should noted that 'MODULEs' do not
  1764. produce the smod file needed by the descendent 'SUBMODULEs' unless
  1765. they contain at least one 'MODULE PROCEDURE' interface. The reason
  1766. for this is that 'SUBMODULEs' are useless without 'MODULE
  1767. PROCEDUREs'. See http://j3-fortran.org/doc/meeting/207/15-209.txt
  1768. for a discussion and a draft interpretation. Adopting this
  1769. interpretation has the advantage that code that does not use
  1770. submodules does not generate smod files.
  1771. * The 'DO CONCURRENT' construct is supported.
  1772. * The 'BLOCK' construct is supported.
  1773. * The 'STOP' and the new 'ERROR STOP' statements now support all
  1774. constant expressions. Both show the signals which were signaling
  1775. at termination.
  1776. * Support for the 'CONTIGUOUS' attribute.
  1777. * Support for 'ALLOCATE' with 'MOLD'.
  1778. * Support for the 'IMPURE' attribute for procedures, which allows for
  1779. 'ELEMENTAL' procedures without the restrictions of 'PURE'.
  1780. * Null pointers (including 'NULL()') and not-allocated variables can
  1781. be used as actual argument to optional non-pointer, non-allocatable
  1782. dummy arguments, denoting an absent argument.
  1783. * Non-pointer variables with 'TARGET' attribute can be used as actual
  1784. argument to 'POINTER' dummies with 'INTENT(IN)'.
  1785. * Pointers including procedure pointers and those in a derived type
  1786. (pointer components) can now be initialized by a target instead of
  1787. only by 'NULL'.
  1788. * The 'EXIT' statement (with construct-name) can be now be used to
  1789. leave not only the 'DO' but also the 'ASSOCIATE', 'BLOCK', 'IF',
  1790. 'SELECT CASE' and 'SELECT TYPE' constructs.
  1791. * Internal procedures can now be used as actual argument.
  1792. * Minor features: obsolesce diagnostics for 'ENTRY' with
  1793. '-std=f2008'; a line may start with a semicolon; for internal and
  1794. module procedures 'END' can be used instead of 'END SUBROUTINE' and
  1795. 'END FUNCTION'; 'SELECTED_REAL_KIND' now also takes a 'RADIX'
  1796. argument; intrinsic types are supported for
  1797. 'TYPE'(INTRINSIC-TYPE-SPEC); multiple type-bound procedures can be
  1798. declared in a single 'PROCEDURE' statement; implied-shape arrays
  1799. are supported for named constants ('PARAMETER').
  1800. 
  1801. File: gfortran.info, Node: TS 29113 status, Next: TS 18508 status, Prev: Fortran 2008 status, Up: Fortran 2003 and 2008 status
  1802. 4.3 Technical Specification 29113 Status
  1803. ========================================
  1804. GNU Fortran supports some of the new features of the Technical
  1805. Specification (TS) 29113 on Further Interoperability of Fortran with C.
  1806. The wiki (https://gcc.gnu.org/wiki/TS29113Status) has some information
  1807. about the current TS 29113 implementation status. In particular, the
  1808. following is implemented.
  1809. See also *note Further Interoperability of Fortran with C::.
  1810. * The '-std=f2008ts' option.
  1811. * The 'OPTIONAL' attribute is allowed for dummy arguments of 'BIND(C)
  1812. procedures.'
  1813. * The 'RANK' intrinsic is supported.
  1814. * GNU Fortran's implementation for variables with 'ASYNCHRONOUS'
  1815. attribute is compatible with TS 29113.
  1816. * Assumed types ('TYPE(*)').
  1817. * Assumed-rank ('DIMENSION(..)'). However, the array descriptor of
  1818. the TS is not yet supported.
  1819. 
  1820. File: gfortran.info, Node: TS 18508 status, Prev: TS 29113 status, Up: Fortran 2003 and 2008 status
  1821. 4.4 Technical Specification 18508 Status
  1822. ========================================
  1823. GNU Fortran supports the following new features of the Technical
  1824. Specification 18508 on Additional Parallel Features in Fortran:
  1825. * The new atomic ADD, CAS, FETCH and ADD/OR/XOR, OR and XOR
  1826. intrinsics.
  1827. * The 'CO_MIN' and 'CO_MAX' and 'SUM' reduction intrinsics. And the
  1828. 'CO_BROADCAST' and 'CO_REDUCE' intrinsic, except that those do not
  1829. support polymorphic types or types with allocatable, pointer or
  1830. polymorphic components.
  1831. * Events ('EVENT POST', 'EVENT WAIT', 'EVENT_QUERY')
  1832. * Failed images ('FAIL IMAGE', 'IMAGE_STATUS', 'FAILED_IMAGES',
  1833. 'STOPPED_IMAGES')
  1834. 
  1835. File: gfortran.info, Node: Compiler Characteristics, Next: Extensions, Prev: Fortran 2003 and 2008 status, Up: Top
  1836. 5 Compiler Characteristics
  1837. **************************
  1838. This chapter describes certain characteristics of the GNU Fortran
  1839. compiler, that are not specified by the Fortran standard, but which
  1840. might in some way or another become visible to the programmer.
  1841. * Menu:
  1842. * KIND Type Parameters::
  1843. * Internal representation of LOGICAL variables::
  1844. * Thread-safety of the runtime library::
  1845. * Data consistency and durability::
  1846. * Files opened without an explicit ACTION= specifier::
  1847. * File operations on symbolic links::
  1848. 
  1849. File: gfortran.info, Node: KIND Type Parameters, Next: Internal representation of LOGICAL variables, Up: Compiler Characteristics
  1850. 5.1 KIND Type Parameters
  1851. ========================
  1852. The 'KIND' type parameters supported by GNU Fortran for the primitive
  1853. data types are:
  1854. 'INTEGER'
  1855. 1, 2, 4, 8*, 16*, default: 4**
  1856. 'LOGICAL'
  1857. 1, 2, 4, 8*, 16*, default: 4**
  1858. 'REAL'
  1859. 4, 8, 10*, 16*, default: 4***
  1860. 'COMPLEX'
  1861. 4, 8, 10*, 16*, default: 4***
  1862. 'DOUBLE PRECISION'
  1863. 4, 8, 10*, 16*, default: 8***
  1864. 'CHARACTER'
  1865. 1, 4, default: 1
  1866. * not available on all systems
  1867. ** unless '-fdefault-integer-8' is used
  1868. *** unless '-fdefault-real-8' is used (see *note Fortran Dialect
  1869. Options::)
  1870. The 'KIND' value matches the storage size in bytes, except for 'COMPLEX'
  1871. where the storage size is twice as much (or both real and imaginary part
  1872. are a real value of the given size). It is recommended to use the *note
  1873. SELECTED_CHAR_KIND::, *note SELECTED_INT_KIND:: and *note
  1874. SELECTED_REAL_KIND:: intrinsics or the 'INT8', 'INT16', 'INT32',
  1875. 'INT64', 'REAL32', 'REAL64', and 'REAL128' parameters of the
  1876. 'ISO_FORTRAN_ENV' module instead of the concrete values. The available
  1877. kind parameters can be found in the constant arrays 'CHARACTER_KINDS',
  1878. 'INTEGER_KINDS', 'LOGICAL_KINDS' and 'REAL_KINDS' in the *note
  1879. ISO_FORTRAN_ENV:: module. For C interoperability, the kind parameters
  1880. of the *note ISO_C_BINDING:: module should be used.
  1881. 
  1882. File: gfortran.info, Node: Internal representation of LOGICAL variables, Next: Thread-safety of the runtime library, Prev: KIND Type Parameters, Up: Compiler Characteristics
  1883. 5.2 Internal representation of LOGICAL variables
  1884. ================================================
  1885. The Fortran standard does not specify how variables of 'LOGICAL' type
  1886. are represented, beyond requiring that 'LOGICAL' variables of default
  1887. kind have the same storage size as default 'INTEGER' and 'REAL'
  1888. variables. The GNU Fortran internal representation is as follows.
  1889. A 'LOGICAL(KIND=N)' variable is represented as an 'INTEGER(KIND=N)'
  1890. variable, however, with only two permissible values: '1' for '.TRUE.'
  1891. and '0' for '.FALSE.'. Any other integer value results in undefined
  1892. behavior.
  1893. See also *note Argument passing conventions:: and *note
  1894. Interoperability with C::.
  1895. 
  1896. File: gfortran.info, Node: Thread-safety of the runtime library, Next: Data consistency and durability, Prev: Internal representation of LOGICAL variables, Up: Compiler Characteristics
  1897. 5.3 Thread-safety of the runtime library
  1898. ========================================
  1899. GNU Fortran can be used in programs with multiple threads, e.g. by using
  1900. OpenMP, by calling OS thread handling functions via the 'ISO_C_BINDING'
  1901. facility, or by GNU Fortran compiled library code being called from a
  1902. multi-threaded program.
  1903. The GNU Fortran runtime library, ('libgfortran'), supports being
  1904. called concurrently from multiple threads with the following exceptions.
  1905. During library initialization, the C 'getenv' function is used, which
  1906. need not be thread-safe. Similarly, the 'getenv' function is used to
  1907. implement the 'GET_ENVIRONMENT_VARIABLE' and 'GETENV' intrinsics. It is
  1908. the responsibility of the user to ensure that the environment is not
  1909. being updated concurrently when any of these actions are taking place.
  1910. The 'EXECUTE_COMMAND_LINE' and 'SYSTEM' intrinsics are implemented
  1911. with the 'system' function, which need not be thread-safe. It is the
  1912. responsibility of the user to ensure that 'system' is not called
  1913. concurrently.
  1914. For platforms not supporting thread-safe POSIX functions, further
  1915. functionality might not be thread-safe. For details, please consult the
  1916. documentation for your operating system.
  1917. The GNU Fortran runtime library uses various C library functions that
  1918. depend on the locale, such as 'strtod' and 'snprintf'. In order to work
  1919. correctly in locale-aware programs that set the locale using
  1920. 'setlocale', the locale is reset to the default "C" locale while
  1921. executing a formatted 'READ' or 'WRITE' statement. On targets
  1922. supporting the POSIX 2008 per-thread locale functions (e.g.
  1923. 'newlocale', 'uselocale', 'freelocale'), these are used and thus the
  1924. global locale set using 'setlocale' or the per-thread locales in other
  1925. threads are not affected. However, on targets lacking this
  1926. functionality, the global LC_NUMERIC locale is set to "C" during the
  1927. formatted I/O. Thus, on such targets it's not safe to call 'setlocale'
  1928. concurrently from another thread while a Fortran formatted I/O operation
  1929. is in progress. Also, other threads doing something dependent on the
  1930. LC_NUMERIC locale might not work correctly if a formatted I/O operation
  1931. is in progress in another thread.
  1932. 
  1933. 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
  1934. 5.4 Data consistency and durability
  1935. ===================================
  1936. This section contains a brief overview of data and metadata consistency
  1937. and durability issues when doing I/O.
  1938. With respect to durability, GNU Fortran makes no effort to ensure
  1939. that data is committed to stable storage. If this is required, the GNU
  1940. Fortran programmer can use the intrinsic 'FNUM' to retrieve the low
  1941. level file descriptor corresponding to an open Fortran unit. Then,
  1942. using e.g. the 'ISO_C_BINDING' feature, one can call the underlying
  1943. system call to flush dirty data to stable storage, such as 'fsync' on
  1944. POSIX, '_commit' on MingW, or 'fcntl(fd, F_FULLSYNC, 0)' on Mac OS X.
  1945. The following example shows how to call fsync:
  1946. ! Declare the interface for POSIX fsync function
  1947. interface
  1948. function fsync (fd) bind(c,name="fsync")
  1949. use iso_c_binding, only: c_int
  1950. integer(c_int), value :: fd
  1951. integer(c_int) :: fsync
  1952. end function fsync
  1953. end interface
  1954. ! Variable declaration
  1955. integer :: ret
  1956. ! Opening unit 10
  1957. open (10,file="foo")
  1958. ! ...
  1959. ! Perform I/O on unit 10
  1960. ! ...
  1961. ! Flush and sync
  1962. flush(10)
  1963. ret = fsync(fnum(10))
  1964. ! Handle possible error
  1965. if (ret /= 0) stop "Error calling FSYNC"
  1966. With respect to consistency, for regular files GNU Fortran uses
  1967. buffered I/O in order to improve performance. This buffer is flushed
  1968. automatically when full and in some other situations, e.g. when closing
  1969. a unit. It can also be explicitly flushed with the 'FLUSH' statement.
  1970. Also, the buffering can be turned off with the 'GFORTRAN_UNBUFFERED_ALL'
  1971. and 'GFORTRAN_UNBUFFERED_PRECONNECTED' environment variables. Special
  1972. files, such as terminals and pipes, are always unbuffered. Sometimes,
  1973. however, further things may need to be done in order to allow other
  1974. processes to see data that GNU Fortran has written, as follows.
  1975. The Windows platform supports a relaxed metadata consistency model,
  1976. where file metadata is written to the directory lazily. This means
  1977. that, for instance, the 'dir' command can show a stale size for a file.
  1978. One can force a directory metadata update by closing the unit, or by
  1979. calling '_commit' on the file descriptor. Note, though, that '_commit'
  1980. will force all dirty data to stable storage, which is often a very slow
  1981. operation.
  1982. The Network File System (NFS) implements a relaxed consistency model
  1983. called open-to-close consistency. Closing a file forces dirty data and
  1984. metadata to be flushed to the server, and opening a file forces the
  1985. client to contact the server in order to revalidate cached data.
  1986. 'fsync' will also force a flush of dirty data and metadata to the
  1987. server. Similar to 'open' and 'close', acquiring and releasing 'fcntl'
  1988. file locks, if the server supports them, will also force cache
  1989. validation and flushing dirty data and metadata.
  1990. 
  1991. 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
  1992. 5.5 Files opened without an explicit ACTION= specifier
  1993. ======================================================
  1994. The Fortran standard says that if an 'OPEN' statement is executed
  1995. without an explicit 'ACTION=' specifier, the default value is processor
  1996. dependent. GNU Fortran behaves as follows:
  1997. 1. Attempt to open the file with 'ACTION='READWRITE''
  1998. 2. If that fails, try to open with 'ACTION='READ''
  1999. 3. If that fails, try to open with 'ACTION='WRITE''
  2000. 4. If that fails, generate an error
  2001. 
  2002. File: gfortran.info, Node: File operations on symbolic links, Prev: Files opened without an explicit ACTION= specifier, Up: Compiler Characteristics
  2003. 5.6 File operations on symbolic links
  2004. =====================================
  2005. This section documents the behavior of GNU Fortran for file operations
  2006. on symbolic links, on systems that support them.
  2007. * Results of INQUIRE statements of the "inquire by file" form will
  2008. relate to the target of the symbolic link. For example,
  2009. 'INQUIRE(FILE="foo",EXIST=ex)' will set EX to .TRUE. if FOO is a
  2010. symbolic link pointing to an existing file, and .FALSE. if FOO
  2011. points to an non-existing file ("dangling" symbolic link).
  2012. * Using the 'OPEN' statement with a 'STATUS="NEW"' specifier on a
  2013. symbolic link will result in an error condition, whether the
  2014. symbolic link points to an existing target or is dangling.
  2015. * If a symbolic link was connected, using the 'CLOSE' statement with
  2016. a 'STATUS="DELETE"' specifier will cause the symbolic link itself
  2017. to be deleted, not its target.
  2018. 
  2019. File: gfortran.info, Node: Extensions, Next: Mixed-Language Programming, Prev: Compiler Characteristics, Up: Top
  2020. 6 Extensions
  2021. ************
  2022. The two sections below detail the extensions to standard Fortran that
  2023. are implemented in GNU Fortran, as well as some of the popular or
  2024. historically important extensions that are not (or not yet) implemented.
  2025. For the latter case, we explain the alternatives available to GNU
  2026. Fortran users, including replacement by standard-conforming code or GNU
  2027. extensions.
  2028. * Menu:
  2029. * Extensions implemented in GNU Fortran::
  2030. * Extensions not implemented in GNU Fortran::
  2031. 
  2032. File: gfortran.info, Node: Extensions implemented in GNU Fortran, Next: Extensions not implemented in GNU Fortran, Up: Extensions
  2033. 6.1 Extensions implemented in GNU Fortran
  2034. =========================================
  2035. GNU Fortran implements a number of extensions over standard Fortran.
  2036. This chapter contains information on their syntax and meaning. There
  2037. are currently two categories of GNU Fortran extensions, those that
  2038. provide functionality beyond that provided by any standard, and those
  2039. that are supported by GNU Fortran purely for backward compatibility with
  2040. legacy compilers. By default, '-std=gnu' allows the compiler to accept
  2041. both types of extensions, but to warn about the use of the latter.
  2042. Specifying either '-std=f95', '-std=f2003' or '-std=f2008' disables both
  2043. types of extensions, and '-std=legacy' allows both without warning. The
  2044. special compile flag '-fdec' enables additional compatibility extensions
  2045. along with those enabled by '-std=legacy'.
  2046. * Menu:
  2047. * Old-style kind specifications::
  2048. * Old-style variable initialization::
  2049. * Extensions to namelist::
  2050. * X format descriptor without count field::
  2051. * Commas in FORMAT specifications::
  2052. * Missing period in FORMAT specifications::
  2053. * I/O item lists::
  2054. * 'Q' exponent-letter::
  2055. * BOZ literal constants::
  2056. * Real array indices::
  2057. * Unary operators::
  2058. * Implicitly convert LOGICAL and INTEGER values::
  2059. * Hollerith constants support::
  2060. * Cray pointers::
  2061. * CONVERT specifier::
  2062. * OpenMP::
  2063. * OpenACC::
  2064. * Argument list functions::
  2065. * Read/Write after EOF marker::
  2066. * STRUCTURE and RECORD::
  2067. * UNION and MAP::
  2068. * Type variants for integer intrinsics::
  2069. * AUTOMATIC and STATIC attributes::
  2070. * Extended math intrinsics::
  2071. * Form feed as whitespace::
  2072. * TYPE as an alias for PRINT::
  2073. * %LOC as an rvalue::
  2074. * .XOR. operator::
  2075. * Bitwise logical operators::
  2076. * Extended I/O specifiers::
  2077. * Legacy PARAMETER statements::
  2078. * Default exponents::
  2079. 
  2080. File: gfortran.info, Node: Old-style kind specifications, Next: Old-style variable initialization, Up: Extensions implemented in GNU Fortran
  2081. 6.1.1 Old-style kind specifications
  2082. -----------------------------------
  2083. GNU Fortran allows old-style kind specifications in declarations. These
  2084. look like:
  2085. TYPESPEC*size x,y,z
  2086. where 'TYPESPEC' is a basic type ('INTEGER', 'REAL', etc.), and where
  2087. 'size' is a byte count corresponding to the storage size of a valid kind
  2088. for that type. (For 'COMPLEX' variables, 'size' is the total size of
  2089. the real and imaginary parts.) The statement then declares 'x', 'y' and
  2090. 'z' to be of type 'TYPESPEC' with the appropriate kind. This is
  2091. equivalent to the standard-conforming declaration
  2092. TYPESPEC(k) x,y,z
  2093. where 'k' is the kind parameter suitable for the intended precision. As
  2094. kind parameters are implementation-dependent, use the 'KIND',
  2095. 'SELECTED_INT_KIND' and 'SELECTED_REAL_KIND' intrinsics to retrieve the
  2096. correct value, for instance 'REAL*8 x' can be replaced by:
  2097. INTEGER, PARAMETER :: dbl = KIND(1.0d0)
  2098. REAL(KIND=dbl) :: x
  2099. 
  2100. File: gfortran.info, Node: Old-style variable initialization, Next: Extensions to namelist, Prev: Old-style kind specifications, Up: Extensions implemented in GNU Fortran
  2101. 6.1.2 Old-style variable initialization
  2102. ---------------------------------------
  2103. GNU Fortran allows old-style initialization of variables of the form:
  2104. INTEGER i/1/,j/2/
  2105. REAL x(2,2) /3*0.,1./
  2106. The syntax for the initializers is as for the 'DATA' statement, but
  2107. unlike in a 'DATA' statement, an initializer only applies to the
  2108. variable immediately preceding the initialization. In other words,
  2109. something like 'INTEGER I,J/2,3/' is not valid. This style of
  2110. initialization is only allowed in declarations without double colons
  2111. ('::'); the double colons were introduced in Fortran 90, which also
  2112. introduced a standard syntax for initializing variables in type
  2113. declarations.
  2114. Examples of standard-conforming code equivalent to the above example
  2115. are:
  2116. ! Fortran 90
  2117. INTEGER :: i = 1, j = 2
  2118. REAL :: x(2,2) = RESHAPE((/0.,0.,0.,1./),SHAPE(x))
  2119. ! Fortran 77
  2120. INTEGER i, j
  2121. REAL x(2,2)
  2122. DATA i/1/, j/2/, x/3*0.,1./
  2123. Note that variables which are explicitly initialized in declarations
  2124. or in 'DATA' statements automatically acquire the 'SAVE' attribute.
  2125. 
  2126. 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
  2127. 6.1.3 Extensions to namelist
  2128. ----------------------------
  2129. GNU Fortran fully supports the Fortran 95 standard for namelist I/O
  2130. including array qualifiers, substrings and fully qualified derived
  2131. types. The output from a namelist write is compatible with namelist
  2132. read. The output has all names in upper case and indentation to column
  2133. 1 after the namelist name. Two extensions are permitted:
  2134. Old-style use of '$' instead of '&'
  2135. $MYNML
  2136. X(:)%Y(2) = 1.0 2.0 3.0
  2137. CH(1:4) = "abcd"
  2138. $END
  2139. It should be noted that the default terminator is '/' rather than
  2140. '&END'.
  2141. Querying of the namelist when inputting from stdin. After at least
  2142. one space, entering '?' sends to stdout the namelist name and the names
  2143. of the variables in the namelist:
  2144. ?
  2145. &mynml
  2146. x
  2147. x%y
  2148. ch
  2149. &end
  2150. Entering '=?' outputs the namelist to stdout, as if 'WRITE(*,NML =
  2151. mynml)' had been called:
  2152. =?
  2153. &MYNML
  2154. X(1)%Y= 0.000000 , 1.000000 , 0.000000 ,
  2155. X(2)%Y= 0.000000 , 2.000000 , 0.000000 ,
  2156. X(3)%Y= 0.000000 , 3.000000 , 0.000000 ,
  2157. CH=abcd, /
  2158. To aid this dialog, when input is from stdin, errors send their
  2159. messages to stderr and execution continues, even if 'IOSTAT' is set.
  2160. 'PRINT' namelist is permitted. This causes an error if '-std=f95' is
  2161. used.
  2162. PROGRAM test_print
  2163. REAL, dimension (4) :: x = (/1.0, 2.0, 3.0, 4.0/)
  2164. NAMELIST /mynml/ x
  2165. PRINT mynml
  2166. END PROGRAM test_print
  2167. Expanded namelist reads are permitted. This causes an error if
  2168. '-std=f95' is used. In the following example, the first element of the
  2169. array will be given the value 0.00 and the two succeeding elements will
  2170. be given the values 1.00 and 2.00.
  2171. &MYNML
  2172. X(1,1) = 0.00 , 1.00 , 2.00
  2173. /
  2174. When writing a namelist, if no 'DELIM=' is specified, by default a
  2175. double quote is used to delimit character strings. If -std=F95, F2003,
  2176. or F2008, etc, the delim status is set to 'none'. Defaulting to quotes
  2177. ensures that namelists with character strings can be subsequently read
  2178. back in accurately.
  2179. 
  2180. 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
  2181. 6.1.4 'X' format descriptor without count field
  2182. -----------------------------------------------
  2183. To support legacy codes, GNU Fortran permits the count field of the 'X'
  2184. edit descriptor in 'FORMAT' statements to be omitted. When omitted, the
  2185. count is implicitly assumed to be one.
  2186. PRINT 10, 2, 3
  2187. 10 FORMAT (I1, X, I1)
  2188. 
  2189. 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
  2190. 6.1.5 Commas in 'FORMAT' specifications
  2191. ---------------------------------------
  2192. To support legacy codes, GNU Fortran allows the comma separator to be
  2193. omitted immediately before and after character string edit descriptors
  2194. in 'FORMAT' statements.
  2195. PRINT 10, 2, 3
  2196. 10 FORMAT ('FOO='I1' BAR='I2)
  2197. 
  2198. File: gfortran.info, Node: Missing period in FORMAT specifications, Next: I/O item lists, Prev: Commas in FORMAT specifications, Up: Extensions implemented in GNU Fortran
  2199. 6.1.6 Missing period in 'FORMAT' specifications
  2200. -----------------------------------------------
  2201. To support legacy codes, GNU Fortran allows missing periods in format
  2202. specifications if and only if '-std=legacy' is given on the command
  2203. line. This is considered non-conforming code and is discouraged.
  2204. REAL :: value
  2205. READ(*,10) value
  2206. 10 FORMAT ('F4')
  2207. 
  2208. File: gfortran.info, Node: I/O item lists, Next: 'Q' exponent-letter, Prev: Missing period in FORMAT specifications, Up: Extensions implemented in GNU Fortran
  2209. 6.1.7 I/O item lists
  2210. --------------------
  2211. To support legacy codes, GNU Fortran allows the input item list of the
  2212. 'READ' statement, and the output item lists of the 'WRITE' and 'PRINT'
  2213. statements, to start with a comma.
  2214. 
  2215. File: gfortran.info, Node: 'Q' exponent-letter, Next: BOZ literal constants, Prev: I/O item lists, Up: Extensions implemented in GNU Fortran
  2216. 6.1.8 'Q' exponent-letter
  2217. -------------------------
  2218. GNU Fortran accepts real literal constants with an exponent-letter of
  2219. 'Q', for example, '1.23Q45'. The constant is interpreted as a
  2220. 'REAL(16)' entity on targets that support this type. If the target does
  2221. not support 'REAL(16)' but has a 'REAL(10)' type, then the
  2222. real-literal-constant will be interpreted as a 'REAL(10)' entity. In
  2223. the absence of 'REAL(16)' and 'REAL(10)', an error will occur.
  2224. 
  2225. File: gfortran.info, Node: BOZ literal constants, Next: Real array indices, Prev: 'Q' exponent-letter, Up: Extensions implemented in GNU Fortran
  2226. 6.1.9 BOZ literal constants
  2227. ---------------------------
  2228. Besides decimal constants, Fortran also supports binary ('b'), octal
  2229. ('o') and hexadecimal ('z') integer constants. The syntax is: 'prefix
  2230. quote digits quote', were the prefix is either 'b', 'o' or 'z', quote is
  2231. either ''' or '"' and the digits are for binary '0' or '1', for octal
  2232. between '0' and '7', and for hexadecimal between '0' and 'F'. (Example:
  2233. 'b'01011101''.)
  2234. Up to Fortran 95, BOZ literals were only allowed to initialize
  2235. integer variables in DATA statements. Since Fortran 2003 BOZ literals
  2236. are also allowed as argument of 'REAL', 'DBLE', 'INT' and 'CMPLX'; the
  2237. result is the same as if the integer BOZ literal had been converted by
  2238. 'TRANSFER' to, respectively, 'real', 'double precision', 'integer' or
  2239. 'complex'. As GNU Fortran extension the intrinsic procedures 'FLOAT',
  2240. 'DFLOAT', 'COMPLEX' and 'DCMPLX' are treated alike.
  2241. As an extension, GNU Fortran allows hexadecimal BOZ literal constants
  2242. to be specified using the 'X' prefix, in addition to the standard 'Z'
  2243. prefix. The BOZ literal can also be specified by adding a suffix to the
  2244. string, for example, 'Z'ABC'' and ''ABC'Z' are equivalent.
  2245. Furthermore, GNU Fortran allows using BOZ literal constants outside
  2246. DATA statements and the four intrinsic functions allowed by Fortran
  2247. 2003. In DATA statements, in direct assignments, where the right-hand
  2248. side only contains a BOZ literal constant, and for old-style
  2249. initializers of the form 'integer i /o'0173'/', the constant is
  2250. transferred as if 'TRANSFER' had been used; for 'COMPLEX' numbers, only
  2251. the real part is initialized unless 'CMPLX' is used. In all other
  2252. cases, the BOZ literal constant is converted to an 'INTEGER' value with
  2253. the largest decimal representation. This value is then converted
  2254. numerically to the type and kind of the variable in question. (For
  2255. instance, 'real :: r = b'0000001' + 1' initializes 'r' with '2.0'.) As
  2256. different compilers implement the extension differently, one should be
  2257. careful when doing bitwise initialization of non-integer variables.
  2258. Note that initializing an 'INTEGER' variable with a statement such as
  2259. 'DATA i/Z'FFFFFFFF'/' will give an integer overflow error rather than
  2260. the desired result of -1 when 'i' is a 32-bit integer on a system that
  2261. supports 64-bit integers. The '-fno-range-check' option can be used as
  2262. a workaround for legacy code that initializes integers in this manner.
  2263. 
  2264. File: gfortran.info, Node: Real array indices, Next: Unary operators, Prev: BOZ literal constants, Up: Extensions implemented in GNU Fortran
  2265. 6.1.10 Real array indices
  2266. -------------------------
  2267. As an extension, GNU Fortran allows the use of 'REAL' expressions or
  2268. variables as array indices.
  2269. 
  2270. File: gfortran.info, Node: Unary operators, Next: Implicitly convert LOGICAL and INTEGER values, Prev: Real array indices, Up: Extensions implemented in GNU Fortran
  2271. 6.1.11 Unary operators
  2272. ----------------------
  2273. As an extension, GNU Fortran allows unary plus and unary minus operators
  2274. to appear as the second operand of binary arithmetic operators without
  2275. the need for parenthesis.
  2276. X = Y * -Z
  2277. 
  2278. File: gfortran.info, Node: Implicitly convert LOGICAL and INTEGER values, Next: Hollerith constants support, Prev: Unary operators, Up: Extensions implemented in GNU Fortran
  2279. 6.1.12 Implicitly convert 'LOGICAL' and 'INTEGER' values
  2280. --------------------------------------------------------
  2281. As an extension for backwards compatibility with other compilers, GNU
  2282. Fortran allows the implicit conversion of 'LOGICAL' values to 'INTEGER'
  2283. values and vice versa. When converting from a 'LOGICAL' to an
  2284. 'INTEGER', '.FALSE.' is interpreted as zero, and '.TRUE.' is interpreted
  2285. as one. When converting from 'INTEGER' to 'LOGICAL', the value zero is
  2286. interpreted as '.FALSE.' and any nonzero value is interpreted as
  2287. '.TRUE.'.
  2288. LOGICAL :: l
  2289. l = 1
  2290. INTEGER :: i
  2291. i = .TRUE.
  2292. However, there is no implicit conversion of 'INTEGER' values in
  2293. 'if'-statements, nor of 'LOGICAL' or 'INTEGER' values in I/O operations.
  2294. 
  2295. File: gfortran.info, Node: Hollerith constants support, Next: Cray pointers, Prev: Implicitly convert LOGICAL and INTEGER values, Up: Extensions implemented in GNU Fortran
  2296. 6.1.13 Hollerith constants support
  2297. ----------------------------------
  2298. GNU Fortran supports Hollerith constants in assignments, function
  2299. arguments, and 'DATA' and 'ASSIGN' statements. A Hollerith constant is
  2300. written as a string of characters preceded by an integer constant
  2301. indicating the character count, and the letter 'H' or 'h', and stored in
  2302. bytewise fashion in a numeric ('INTEGER', 'REAL', or 'complex') or
  2303. 'LOGICAL' variable. The constant will be padded or truncated to fit the
  2304. size of the variable in which it is stored.
  2305. Examples of valid uses of Hollerith constants:
  2306. complex*16 x(2)
  2307. data x /16Habcdefghijklmnop, 16Hqrstuvwxyz012345/
  2308. x(1) = 16HABCDEFGHIJKLMNOP
  2309. call foo (4h abc)
  2310. Invalid Hollerith constants examples:
  2311. integer*4 a
  2312. a = 8H12345678 ! Valid, but the Hollerith constant will be truncated.
  2313. a = 0H ! At least one character is needed.
  2314. In general, Hollerith constants were used to provide a rudimentary
  2315. facility for handling character strings in early Fortran compilers,
  2316. prior to the introduction of 'CHARACTER' variables in Fortran 77; in
  2317. those cases, the standard-compliant equivalent is to convert the program
  2318. to use proper character strings. On occasion, there may be a case where
  2319. the intent is specifically to initialize a numeric variable with a given
  2320. byte sequence. In these cases, the same result can be obtained by using
  2321. the 'TRANSFER' statement, as in this example.
  2322. INTEGER(KIND=4) :: a
  2323. a = TRANSFER ("abcd", a) ! equivalent to: a = 4Habcd
  2324. 
  2325. File: gfortran.info, Node: Cray pointers, Next: CONVERT specifier, Prev: Hollerith constants support, Up: Extensions implemented in GNU Fortran
  2326. 6.1.14 Cray pointers
  2327. --------------------
  2328. Cray pointers are part of a non-standard extension that provides a
  2329. C-like pointer in Fortran. This is accomplished through a pair of
  2330. variables: an integer "pointer" that holds a memory address, and a
  2331. "pointee" that is used to dereference the pointer.
  2332. Pointer/pointee pairs are declared in statements of the form:
  2333. pointer ( <pointer> , <pointee> )
  2334. or,
  2335. pointer ( <pointer1> , <pointee1> ), ( <pointer2> , <pointee2> ), ...
  2336. The pointer is an integer that is intended to hold a memory address.
  2337. The pointee may be an array or scalar. A pointee can be an assumed size
  2338. array--that is, the last dimension may be left unspecified by using a
  2339. '*' in place of a value--but a pointee cannot be an assumed shape array.
  2340. No space is allocated for the pointee.
  2341. The pointee may have its type declared before or after the pointer
  2342. statement, and its array specification (if any) may be declared before,
  2343. during, or after the pointer statement. The pointer may be declared as
  2344. an integer prior to the pointer statement. However, some machines have
  2345. default integer sizes that are different than the size of a pointer, and
  2346. so the following code is not portable:
  2347. integer ipt
  2348. pointer (ipt, iarr)
  2349. If a pointer is declared with a kind that is too small, the compiler
  2350. will issue a warning; the resulting binary will probably not work
  2351. correctly, because the memory addresses stored in the pointers may be
  2352. truncated. It is safer to omit the first line of the above example; if
  2353. explicit declaration of ipt's type is omitted, then the compiler will
  2354. ensure that ipt is an integer variable large enough to hold a pointer.
  2355. Pointer arithmetic is valid with Cray pointers, but it is not the
  2356. same as C pointer arithmetic. Cray pointers are just ordinary integers,
  2357. so the user is responsible for determining how many bytes to add to a
  2358. pointer in order to increment it. Consider the following example:
  2359. real target(10)
  2360. real pointee(10)
  2361. pointer (ipt, pointee)
  2362. ipt = loc (target)
  2363. ipt = ipt + 1
  2364. The last statement does not set 'ipt' to the address of 'target(1)',
  2365. as it would in C pointer arithmetic. Adding '1' to 'ipt' just adds one
  2366. byte to the address stored in 'ipt'.
  2367. Any expression involving the pointee will be translated to use the
  2368. value stored in the pointer as the base address.
  2369. To get the address of elements, this extension provides an intrinsic
  2370. function 'LOC()'. The 'LOC()' function is equivalent to the '&'
  2371. operator in C, except the address is cast to an integer type:
  2372. real ar(10)
  2373. pointer(ipt, arpte(10))
  2374. real arpte
  2375. ipt = loc(ar) ! Makes arpte is an alias for ar
  2376. arpte(1) = 1.0 ! Sets ar(1) to 1.0
  2377. The pointer can also be set by a call to the 'MALLOC' intrinsic (see
  2378. *note MALLOC::).
  2379. Cray pointees often are used to alias an existing variable. For
  2380. example:
  2381. integer target(10)
  2382. integer iarr(10)
  2383. pointer (ipt, iarr)
  2384. ipt = loc(target)
  2385. As long as 'ipt' remains unchanged, 'iarr' is now an alias for
  2386. 'target'. The optimizer, however, will not detect this aliasing, so it
  2387. is unsafe to use 'iarr' and 'target' simultaneously. Using a pointee in
  2388. any way that violates the Fortran aliasing rules or assumptions is
  2389. illegal. It is the user's responsibility to avoid doing this; the
  2390. compiler works under the assumption that no such aliasing occurs.
  2391. Cray pointers will work correctly when there is no aliasing (i.e.,
  2392. when they are used to access a dynamically allocated block of memory),
  2393. and also in any routine where a pointee is used, but any variable with
  2394. which it shares storage is not used. Code that violates these rules may
  2395. not run as the user intends. This is not a bug in the optimizer; any
  2396. code that violates the aliasing rules is illegal. (Note that this is
  2397. not unique to GNU Fortran; any Fortran compiler that supports Cray
  2398. pointers will "incorrectly" optimize code with illegal aliasing.)
  2399. There are a number of restrictions on the attributes that can be
  2400. applied to Cray pointers and pointees. Pointees may not have the
  2401. 'ALLOCATABLE', 'INTENT', 'OPTIONAL', 'DUMMY', 'TARGET', 'INTRINSIC', or
  2402. 'POINTER' attributes. Pointers may not have the 'DIMENSION', 'POINTER',
  2403. 'TARGET', 'ALLOCATABLE', 'EXTERNAL', or 'INTRINSIC' attributes, nor may
  2404. they be function results. Pointees may not occur in more than one
  2405. pointer statement. A pointee cannot be a pointer. Pointees cannot
  2406. occur in equivalence, common, or data statements.
  2407. A Cray pointer may also point to a function or a subroutine. For
  2408. example, the following excerpt is valid:
  2409. implicit none
  2410. external sub
  2411. pointer (subptr,subpte)
  2412. external subpte
  2413. subptr = loc(sub)
  2414. call subpte()
  2415. [...]
  2416. subroutine sub
  2417. [...]
  2418. end subroutine sub
  2419. A pointer may be modified during the course of a program, and this
  2420. will change the location to which the pointee refers. However, when
  2421. pointees are passed as arguments, they are treated as ordinary variables
  2422. in the invoked function. Subsequent changes to the pointer will not
  2423. change the base address of the array that was passed.
  2424. 
  2425. File: gfortran.info, Node: CONVERT specifier, Next: OpenMP, Prev: Cray pointers, Up: Extensions implemented in GNU Fortran
  2426. 6.1.15 'CONVERT' specifier
  2427. --------------------------
  2428. GNU Fortran allows the conversion of unformatted data between little-
  2429. and big-endian representation to facilitate moving of data between
  2430. different systems. The conversion can be indicated with the 'CONVERT'
  2431. specifier on the 'OPEN' statement. *Note GFORTRAN_CONVERT_UNIT::, for
  2432. an alternative way of specifying the data format via an environment
  2433. variable.
  2434. Valid values for 'CONVERT' are:
  2435. 'CONVERT='NATIVE'' Use the native format. This is the default.
  2436. 'CONVERT='SWAP'' Swap between little- and big-endian.
  2437. 'CONVERT='LITTLE_ENDIAN'' Use the little-endian representation for
  2438. unformatted files.
  2439. 'CONVERT='BIG_ENDIAN'' Use the big-endian representation for
  2440. unformatted files.
  2441. Using the option could look like this:
  2442. open(file='big.dat',form='unformatted',access='sequential', &
  2443. convert='big_endian')
  2444. The value of the conversion can be queried by using
  2445. 'INQUIRE(CONVERT=ch)'. The values returned are ''BIG_ENDIAN'' and
  2446. ''LITTLE_ENDIAN''.
  2447. 'CONVERT' works between big- and little-endian for 'INTEGER' values
  2448. of all supported kinds and for 'REAL' on IEEE systems of kinds 4 and 8.
  2449. Conversion between different "extended double" types on different
  2450. architectures such as m68k and x86_64, which GNU Fortran supports as
  2451. 'REAL(KIND=10)' and 'REAL(KIND=16)', will probably not work.
  2452. _Note that the values specified via the GFORTRAN_CONVERT_UNIT
  2453. environment variable will override the CONVERT specifier in the open
  2454. statement_. This is to give control over data formats to users who do
  2455. not have the source code of their program available.
  2456. Using anything but the native representation for unformatted data
  2457. carries a significant speed overhead. If speed in this area matters to
  2458. you, it is best if you use this only for data that needs to be portable.
  2459. 
  2460. File: gfortran.info, Node: OpenMP, Next: OpenACC, Prev: CONVERT specifier, Up: Extensions implemented in GNU Fortran
  2461. 6.1.16 OpenMP
  2462. -------------
  2463. OpenMP (Open Multi-Processing) is an application programming interface
  2464. (API) that supports multi-platform shared memory multiprocessing
  2465. programming in C/C++ and Fortran on many architectures, including Unix
  2466. and Microsoft Windows platforms. It consists of a set of compiler
  2467. directives, library routines, and environment variables that influence
  2468. run-time behavior.
  2469. GNU Fortran strives to be compatible to the OpenMP Application
  2470. Program Interface v4.5 (http://openmp.org/wp/openmp-specifications/).
  2471. To enable the processing of the OpenMP directive '!$omp' in free-form
  2472. source code; the 'c$omp', '*$omp' and '!$omp' directives in fixed form;
  2473. the '!$' conditional compilation sentinels in free form; and the 'c$',
  2474. '*$' and '!$' sentinels in fixed form, 'gfortran' needs to be invoked
  2475. with the '-fopenmp'. This also arranges for automatic linking of the
  2476. GNU Offloading and Multi Processing Runtime Library *note libgomp:
  2477. (libgomp)Top.
  2478. The OpenMP Fortran runtime library routines are provided both in a
  2479. form of a Fortran 90 module named 'omp_lib' and in a form of a Fortran
  2480. 'include' file named 'omp_lib.h'.
  2481. An example of a parallelized loop taken from Appendix A.1 of the
  2482. OpenMP Application Program Interface v2.5:
  2483. SUBROUTINE A1(N, A, B)
  2484. INTEGER I, N
  2485. REAL B(N), A(N)
  2486. !$OMP PARALLEL DO !I is private by default
  2487. DO I=2,N
  2488. B(I) = (A(I) + A(I-1)) / 2.0
  2489. ENDDO
  2490. !$OMP END PARALLEL DO
  2491. END SUBROUTINE A1
  2492. Please note:
  2493. * '-fopenmp' implies '-frecursive', i.e., all local arrays will be
  2494. allocated on the stack. When porting existing code to OpenMP, this
  2495. may lead to surprising results, especially to segmentation faults
  2496. if the stacksize is limited.
  2497. * On glibc-based systems, OpenMP enabled applications cannot be
  2498. statically linked due to limitations of the underlying
  2499. pthreads-implementation. It might be possible to get a working
  2500. solution if '-Wl,--whole-archive -lpthread -Wl,--no-whole-archive'
  2501. is added to the command line. However, this is not supported by
  2502. 'gcc' and thus not recommended.
  2503. 
  2504. File: gfortran.info, Node: OpenACC, Next: Argument list functions, Prev: OpenMP, Up: Extensions implemented in GNU Fortran
  2505. 6.1.17 OpenACC
  2506. --------------
  2507. OpenACC is an application programming interface (API) that supports
  2508. offloading of code to accelerator devices. It consists of a set of
  2509. compiler directives, library routines, and environment variables that
  2510. influence run-time behavior.
  2511. GNU Fortran strives to be compatible to the OpenACC Application
  2512. Programming Interface v2.0 (http://www.openacc.org/).
  2513. To enable the processing of the OpenACC directive '!$acc' in
  2514. free-form source code; the 'c$acc', '*$acc' and '!$acc' directives in
  2515. fixed form; the '!$' conditional compilation sentinels in free form; and
  2516. the 'c$', '*$' and '!$' sentinels in fixed form, 'gfortran' needs to be
  2517. invoked with the '-fopenacc'. This also arranges for automatic linking
  2518. of the GNU Offloading and Multi Processing Runtime Library *note
  2519. libgomp: (libgomp)Top.
  2520. The OpenACC Fortran runtime library routines are provided both in a
  2521. form of a Fortran 90 module named 'openacc' and in a form of a Fortran
  2522. 'include' file named 'openacc_lib.h'.
  2523. Note that this is an experimental feature, incomplete, and subject to
  2524. change in future versions of GCC. See <https://gcc.gnu.org/wiki/OpenACC>
  2525. for more information.
  2526. 
  2527. File: gfortran.info, Node: Argument list functions, Next: Read/Write after EOF marker, Prev: OpenACC, Up: Extensions implemented in GNU Fortran
  2528. 6.1.18 Argument list functions '%VAL', '%REF' and '%LOC'
  2529. --------------------------------------------------------
  2530. GNU Fortran supports argument list functions '%VAL', '%REF' and '%LOC'
  2531. statements, for backward compatibility with g77. It is recommended that
  2532. these should be used only for code that is accessing facilities outside
  2533. of GNU Fortran, such as operating system or windowing facilities. It is
  2534. best to constrain such uses to isolated portions of a program-portions
  2535. that deal specifically and exclusively with low-level, system-dependent
  2536. facilities. Such portions might well provide a portable interface for
  2537. use by the program as a whole, but are themselves not portable, and
  2538. should be thoroughly tested each time they are rebuilt using a new
  2539. compiler or version of a compiler.
  2540. '%VAL' passes a scalar argument by value, '%REF' passes it by
  2541. reference and '%LOC' passes its memory location. Since gfortran already
  2542. passes scalar arguments by reference, '%REF' is in effect a do-nothing.
  2543. '%LOC' has the same effect as a Fortran pointer.
  2544. An example of passing an argument by value to a C subroutine foo.:
  2545. C
  2546. C prototype void foo_ (float x);
  2547. C
  2548. external foo
  2549. real*4 x
  2550. x = 3.14159
  2551. call foo (%VAL (x))
  2552. end
  2553. For details refer to the g77 manual
  2554. <https://gcc.gnu.org/onlinedocs/gcc-3.4.6/g77/index.html#Top>.
  2555. Also, 'c_by_val.f' and its partner 'c_by_val.c' of the GNU Fortran
  2556. testsuite are worth a look.
  2557. 
  2558. File: gfortran.info, Node: Read/Write after EOF marker, Next: STRUCTURE and RECORD, Prev: Argument list functions, Up: Extensions implemented in GNU Fortran
  2559. 6.1.19 Read/Write after EOF marker
  2560. ----------------------------------
  2561. Some legacy codes rely on allowing 'READ' or 'WRITE' after the EOF file
  2562. marker in order to find the end of a file. GNU Fortran normally rejects
  2563. these codes with a run-time error message and suggests the user consider
  2564. 'BACKSPACE' or 'REWIND' to properly position the file before the EOF
  2565. marker. As an extension, the run-time error may be disabled using
  2566. -std=legacy.
  2567. 
  2568. File: gfortran.info, Node: STRUCTURE and RECORD, Next: UNION and MAP, Prev: Read/Write after EOF marker, Up: Extensions implemented in GNU Fortran
  2569. 6.1.20 'STRUCTURE' and 'RECORD'
  2570. -------------------------------
  2571. Record structures are a pre-Fortran-90 vendor extension to create
  2572. user-defined aggregate data types. Support for record structures in GNU
  2573. Fortran can be enabled with the '-fdec-structure' compile flag. If you
  2574. have a choice, you should instead use Fortran 90's "derived types",
  2575. which have a different syntax.
  2576. In many cases, record structures can easily be converted to derived
  2577. types. To convert, replace 'STRUCTURE /'STRUCTURE-NAME'/' by 'TYPE'
  2578. TYPE-NAME. Additionally, replace 'RECORD /'STRUCTURE-NAME'/' by
  2579. 'TYPE('TYPE-NAME')'. Finally, in the component access, replace the
  2580. period ('.') by the percent sign ('%').
  2581. Here is an example of code using the non portable record structure
  2582. syntax:
  2583. ! Declaring a structure named ``item'' and containing three fields:
  2584. ! an integer ID, an description string and a floating-point price.
  2585. STRUCTURE /item/
  2586. INTEGER id
  2587. CHARACTER(LEN=200) description
  2588. REAL price
  2589. END STRUCTURE
  2590. ! Define two variables, an single record of type ``item''
  2591. ! named ``pear'', and an array of items named ``store_catalog''
  2592. RECORD /item/ pear, store_catalog(100)
  2593. ! We can directly access the fields of both variables
  2594. pear.id = 92316
  2595. pear.description = "juicy D'Anjou pear"
  2596. pear.price = 0.15
  2597. store_catalog(7).id = 7831
  2598. store_catalog(7).description = "milk bottle"
  2599. store_catalog(7).price = 1.2
  2600. ! We can also manipulate the whole structure
  2601. store_catalog(12) = pear
  2602. print *, store_catalog(12)
  2603. This code can easily be rewritten in the Fortran 90 syntax as following:
  2604. ! ``STRUCTURE /name/ ... END STRUCTURE'' becomes
  2605. ! ``TYPE name ... END TYPE''
  2606. TYPE item
  2607. INTEGER id
  2608. CHARACTER(LEN=200) description
  2609. REAL price
  2610. END TYPE
  2611. ! ``RECORD /name/ variable'' becomes ``TYPE(name) variable''
  2612. TYPE(item) pear, store_catalog(100)
  2613. ! Instead of using a dot (.) to access fields of a record, the
  2614. ! standard syntax uses a percent sign (%)
  2615. pear%id = 92316
  2616. pear%description = "juicy D'Anjou pear"
  2617. pear%price = 0.15
  2618. store_catalog(7)%id = 7831
  2619. store_catalog(7)%description = "milk bottle"
  2620. store_catalog(7)%price = 1.2
  2621. ! Assignments of a whole variable do not change
  2622. store_catalog(12) = pear
  2623. print *, store_catalog(12)
  2624. GNU Fortran implements STRUCTURES like derived types with the following
  2625. rules and exceptions:
  2626. * Structures act like derived types with the 'SEQUENCE' attribute.
  2627. Otherwise they may contain no specifiers.
  2628. * Structures may share names with other symbols. For example, the
  2629. following is invalid for derived types, but valid for structures:
  2630. structure /header/
  2631. ! ...
  2632. end structure
  2633. record /header/ header
  2634. * Structure types may be declared nested within another parent
  2635. structure. The syntax is:
  2636. structure /type-name/
  2637. ...
  2638. structure [/<type-name>/] <field-list>
  2639. ...
  2640. The type name may be ommitted, in which case the structure type
  2641. itself is anonymous, and other structures of the same type cannot
  2642. be instantiated. The following shows some examples:
  2643. structure /appointment/
  2644. ! nested structure definition: app_time is an array of two 'time'
  2645. structure /time/ app_time (2)
  2646. integer(1) hour, minute
  2647. end structure
  2648. character(10) memo
  2649. end structure
  2650. ! The 'time' structure is still usable
  2651. record /time/ now
  2652. now = time(5, 30)
  2653. ...
  2654. structure /appointment/
  2655. ! anonymous nested structure definition
  2656. structure start, end
  2657. integer(1) hour, minute
  2658. end structure
  2659. character(10) memo
  2660. end structure
  2661. * Structures may contain 'UNION' blocks. For more detail see the
  2662. section on *note UNION and MAP::.
  2663. * Structures support old-style initialization of components, like
  2664. those described in *note Old-style variable initialization::. For
  2665. array initializers, an initializer may contain a repeat
  2666. specification of the form '<literal-integer> *
  2667. <constant-initializer>'. The value of the integer indicates the
  2668. number of times to repeat the constant initializer when expanding
  2669. the initializer list.
  2670. 
  2671. File: gfortran.info, Node: UNION and MAP, Next: Type variants for integer intrinsics, Prev: STRUCTURE and RECORD, Up: Extensions implemented in GNU Fortran
  2672. 6.1.21 'UNION' and 'MAP'
  2673. ------------------------
  2674. Unions are an old vendor extension which were commonly used with the
  2675. non-standard *note STRUCTURE and RECORD:: extensions. Use of 'UNION'
  2676. and 'MAP' is automatically enabled with '-fdec-structure'.
  2677. A 'UNION' declaration occurs within a structure; within the
  2678. definition of each union is a number of 'MAP' blocks. Each 'MAP' shares
  2679. storage with its sibling maps (in the same union), and the size of the
  2680. union is the size of the largest map within it, just as with unions in
  2681. C. The major difference is that component references do not indicate
  2682. which union or map the component is in (the compiler gets to figure that
  2683. out).
  2684. Here is a small example:
  2685. structure /myunion/
  2686. union
  2687. map
  2688. character(2) w0, w1, w2
  2689. end map
  2690. map
  2691. character(6) long
  2692. end map
  2693. end union
  2694. end structure
  2695. record /myunion/ rec
  2696. ! After this assignment...
  2697. rec.long = 'hello!'
  2698. ! The following is true:
  2699. ! rec.w0 === 'he'
  2700. ! rec.w1 === 'll'
  2701. ! rec.w2 === 'o!'
  2702. The two maps share memory, and the size of the union is ultimately
  2703. six bytes:
  2704. 0 1 2 3 4 5 6 Byte offset
  2705. -------------------------------
  2706. | | | | | | |
  2707. -------------------------------
  2708. ^ W0 ^ W1 ^ W2 ^
  2709. \-------/ \-------/ \-------/
  2710. ^ LONG ^
  2711. \---------------------------/
  2712. Following is an example mirroring the layout of an Intel x86_64
  2713. register:
  2714. structure /reg/
  2715. union ! U0 ! rax
  2716. map
  2717. character(16) rx
  2718. end map
  2719. map
  2720. character(8) rh ! rah
  2721. union ! U1
  2722. map
  2723. character(8) rl ! ral
  2724. end map
  2725. map
  2726. character(8) ex ! eax
  2727. end map
  2728. map
  2729. character(4) eh ! eah
  2730. union ! U2
  2731. map
  2732. character(4) el ! eal
  2733. end map
  2734. map
  2735. character(4) x ! ax
  2736. end map
  2737. map
  2738. character(2) h ! ah
  2739. character(2) l ! al
  2740. end map
  2741. end union
  2742. end map
  2743. end union
  2744. end map
  2745. end union
  2746. end structure
  2747. record /reg/ a
  2748. ! After this assignment...
  2749. a.rx = 'AAAAAAAA.BBB.C.D'
  2750. ! The following is true:
  2751. a.rx === 'AAAAAAAA.BBB.C.D'
  2752. a.rh === 'AAAAAAAA'
  2753. a.rl === '.BBB.C.D'
  2754. a.ex === '.BBB.C.D'
  2755. a.eh === '.BBB'
  2756. a.el === '.C.D'
  2757. a.x === '.C.D'
  2758. a.h === '.C'
  2759. a.l === '.D'
  2760. 
  2761. File: gfortran.info, Node: Type variants for integer intrinsics, Next: AUTOMATIC and STATIC attributes, Prev: UNION and MAP, Up: Extensions implemented in GNU Fortran
  2762. 6.1.22 Type variants for integer intrinsics
  2763. -------------------------------------------
  2764. Similar to the D/C prefixes to real functions to specify the
  2765. input/output types, GNU Fortran offers B/I/J/K prefixes to integer
  2766. functions for compatibility with DEC programs. The types implied by
  2767. each are:
  2768. B - INTEGER(kind=1)
  2769. I - INTEGER(kind=2)
  2770. J - INTEGER(kind=4)
  2771. K - INTEGER(kind=8)
  2772. GNU Fortran supports these with the flag '-fdec-intrinsic-ints'.
  2773. Intrinsics for which prefixed versions are available and in what form
  2774. are noted in *note Intrinsic Procedures::. The complete list of
  2775. supported intrinsics is here:
  2776. Intrinsic B I J K
  2777. ---------------------------------------------------------------------------
  2778. '*note 'BABS' 'IIABS' 'JIABS' 'KIABS'
  2779. ABS::'
  2780. '*note 'BBTEST' 'BITEST' 'BJTEST' 'BKTEST'
  2781. BTEST::'
  2782. '*note 'BIAND' 'IIAND' 'JIAND' 'KIAND'
  2783. IAND::'
  2784. '*note 'BBCLR' 'IIBCLR' 'JIBCLR' 'KIBCLR'
  2785. IBCLR::'
  2786. '*note 'BBITS' 'IIBITS' 'JIBITS' 'KIBITS'
  2787. IBITS::'
  2788. '*note 'BBSET' 'IIBSET' 'JIBSET' 'KIBSET'
  2789. IBSET::'
  2790. '*note 'BIEOR' 'IIEOR' 'JIEOR' 'KIEOR'
  2791. IEOR::'
  2792. '*note 'BIOR' 'IIOR' 'JIOR' 'KIOR'
  2793. IOR::'
  2794. '*note 'BSHFT' 'IISHFT' 'JISHFT' 'KISHFT'
  2795. ISHFT::'
  2796. '*note 'BSHFTC' 'IISHFTC' 'JISHFTC' 'KISHFTC'
  2797. ISHFTC::'
  2798. '*note 'BMOD' 'IMOD' 'JMOD' 'KMOD'
  2799. MOD::'
  2800. '*note 'BNOT' 'INOT' 'JNOT' 'KNOT'
  2801. NOT::'
  2802. '*note '--' 'FLOATI' 'FLOATJ' 'FLOATK'
  2803. REAL::'
  2804. 
  2805. File: gfortran.info, Node: AUTOMATIC and STATIC attributes, Next: Extended math intrinsics, Prev: Type variants for integer intrinsics, Up: Extensions implemented in GNU Fortran
  2806. 6.1.23 'AUTOMATIC' and 'STATIC' attributes
  2807. ------------------------------------------
  2808. With '-fdec-static' GNU Fortran supports the DEC extended attributes
  2809. 'STATIC' and 'AUTOMATIC' to provide explicit specification of entity
  2810. storage. These follow the syntax of the Fortran standard 'SAVE'
  2811. attribute.
  2812. 'STATIC' is exactly equivalent to 'SAVE', and specifies that an
  2813. entity should be allocated in static memory. As an example, 'STATIC'
  2814. local variables will retain their values across multiple calls to a
  2815. function.
  2816. Entities marked 'AUTOMATIC' will be stack automatic whenever
  2817. possible. 'AUTOMATIC' is the default for local variables smaller than
  2818. '-fmax-stack-var-size', unless '-fno-automatic' is given. This
  2819. attribute overrides '-fno-automatic', '-fmax-stack-var-size', and
  2820. blanket 'SAVE' statements.
  2821. Examples:
  2822. subroutine f
  2823. integer, automatic :: i ! automatic variable
  2824. integer x, y ! static variables
  2825. save
  2826. ...
  2827. endsubroutine
  2828. subroutine f
  2829. integer a, b, c, x, y, z
  2830. static :: x
  2831. save y
  2832. automatic z, c
  2833. ! a, b, c, and z are automatic
  2834. ! x and y are static
  2835. endsubroutine
  2836. ! Compiled with -fno-automatic
  2837. subroutine f
  2838. integer a, b, c, d
  2839. automatic :: a
  2840. ! a is automatic; b, c, and d are static
  2841. endsubroutine
  2842. 
  2843. File: gfortran.info, Node: Extended math intrinsics, Next: Form feed as whitespace, Prev: AUTOMATIC and STATIC attributes, Up: Extensions implemented in GNU Fortran
  2844. 6.1.24 Extended math intrinsics
  2845. -------------------------------
  2846. GNU Fortran supports an extended list of mathematical intrinsics with
  2847. the compile flag '-fdec-math' for compatability with legacy code. These
  2848. intrinsics are described fully in *note Intrinsic Procedures:: where it
  2849. is noted that they are extensions and should be avoided whenever
  2850. possible.
  2851. Specifically, '-fdec-math' enables the *note COTAN:: intrinsic, and
  2852. trigonometric intrinsics which accept or produce values in degrees
  2853. instead of radians. Here is a summary of the new intrinsics:
  2854. Radians Degrees
  2855. --------------------------------------------------------------------------
  2856. '*note ACOS::' '*note ACOSD::'*
  2857. '*note ASIN::' '*note ASIND::'*
  2858. '*note ATAN::' '*note ATAND::'*
  2859. '*note ATAN2::' '*note ATAN2D::'*
  2860. '*note COS::' '*note COSD::'*
  2861. '*note COTAN::'* '*note COTAND::'*
  2862. '*note SIN::' '*note SIND::'*
  2863. '*note TAN::' '*note TAND::'*
  2864. * Enabled with '-fdec-math'.
  2865. For advanced users, it may be important to know the implementation of
  2866. these functions. They are simply wrappers around the standard radian
  2867. functions, which have more accurate builtin versions. These functions
  2868. convert their arguments (or results) to degrees (or radians) by taking
  2869. the value modulus 360 (or 2*pi) and then multiplying it by a constant
  2870. radian-to-degree (or degree-to-radian) factor, as appropriate. The
  2871. factor is computed at compile-time as 180/pi (or pi/180).
  2872. 
  2873. 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
  2874. 6.1.25 Form feed as whitespace
  2875. ------------------------------
  2876. Historically, legacy compilers allowed insertion of form feed characters
  2877. ('\f', ASCII 0xC) at the beginning of lines for formatted output to line
  2878. printers, though the Fortran standard does not mention this. GNU
  2879. Fortran supports the interpretation of form feed characters in source as
  2880. whitespace for compatibility.
  2881. 
  2882. 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
  2883. 6.1.26 TYPE as an alias for PRINT
  2884. ---------------------------------
  2885. For compatibility, GNU Fortran will interpret 'TYPE' statements as
  2886. 'PRINT' statements with the flag '-fdec'. With this flag asserted, the
  2887. following two examples are equivalent:
  2888. TYPE *, 'hello world'
  2889. PRINT *, 'hello world'
  2890. 
  2891. File: gfortran.info, Node: %LOC as an rvalue, Next: .XOR. operator, Prev: TYPE as an alias for PRINT, Up: Extensions implemented in GNU Fortran
  2892. 6.1.27 %LOC as an rvalue
  2893. ------------------------
  2894. Normally '%LOC' is allowed only in parameter lists. However the
  2895. intrinsic function 'LOC' does the same thing, and is usable as the
  2896. right-hand-side of assignments. For compatibility, GNU Fortran supports
  2897. the use of '%LOC' as an alias for the builtin 'LOC' with '-std=legacy'.
  2898. With this feature enabled the following two examples are equivalent:
  2899. integer :: i, l
  2900. l = %loc(i)
  2901. call sub(l)
  2902. integer :: i
  2903. call sub(%loc(i))
  2904. 
  2905. File: gfortran.info, Node: .XOR. operator, Next: Bitwise logical operators, Prev: %LOC as an rvalue, Up: Extensions implemented in GNU Fortran
  2906. 6.1.28 .XOR. operator
  2907. ---------------------
  2908. GNU Fortran supports '.XOR.' as a logical operator with '-std=legacy'
  2909. for compatibility with legacy code. '.XOR.' is equivalent to '.NEQV.'.
  2910. That is, the output is true if and only if the inputs differ.
  2911. 
  2912. File: gfortran.info, Node: Bitwise logical operators, Next: Extended I/O specifiers, Prev: .XOR. operator, Up: Extensions implemented in GNU Fortran
  2913. 6.1.29 Bitwise logical operators
  2914. --------------------------------
  2915. With '-fdec', GNU Fortran relaxes the type constraints on logical
  2916. operators to allow integer operands, and performs the corresponding
  2917. bitwise operation instead. This flag is for compatibility only, and
  2918. should be avoided in new code. Consider:
  2919. INTEGER :: i, j
  2920. i = z'33'
  2921. j = z'cc'
  2922. print *, i .AND. j
  2923. In this example, compiled with '-fdec', GNU Fortran will replace the
  2924. '.AND.' operation with a call to the intrinsic '*note IAND::' function,
  2925. yielding the bitwise-and of 'i' and 'j'.
  2926. Note that this conversion will occur if at least one operand is of
  2927. integral type. As a result, a logical operand will be converted to an
  2928. integer when the other operand is an integer in a logical operation. In
  2929. this case, '.TRUE.' is converted to '1' and '.FALSE.' to '0'.
  2930. Here is the mapping of logical operator to bitwise intrinsic used
  2931. with '-fdec':
  2932. Operator Intrinsic Bitwise operation
  2933. ---------------------------------------------------------------------------
  2934. '.NOT.' '*note NOT::' complement
  2935. '.AND.' '*note IAND::' intersection
  2936. '.OR.' '*note IOR::' union
  2937. '.NEQV.' '*note IEOR::' exclusive or
  2938. '.EQV.' '*note complement of exclusive or
  2939. NOT::(*note
  2940. IEOR::)'
  2941. 
  2942. File: gfortran.info, Node: Extended I/O specifiers, Next: Legacy PARAMETER statements, Prev: Bitwise logical operators, Up: Extensions implemented in GNU Fortran
  2943. 6.1.30 Extended I/O specifiers
  2944. ------------------------------
  2945. GNU Fortran supports the additional legacy I/O specifiers
  2946. 'CARRIAGECONTROL', 'READONLY', and 'SHARE' with the compile flag
  2947. '-fdec', for compatibility.
  2948. 'CARRIAGECONTROL'
  2949. The 'CARRIAGECONTROL' specifier allows a user to control line
  2950. termination settings between output records for an I/O unit. The
  2951. specifier has no meaning for readonly files. When
  2952. 'CARRAIGECONTROL' is specified upon opening a unit for formatted
  2953. writing, the exact 'CARRIAGECONTROL' setting determines what
  2954. characters to write between output records. The syntax is:
  2955. OPEN(..., CARRIAGECONTROL=cc)
  2956. Where _cc_ is a character expression that evaluates to one of the
  2957. following values:
  2958. ''LIST'' One line feed between records (default)
  2959. ''FORTRAN'' Legacy interpretation of the first character (see below)
  2960. ''NONE'' No separator between records
  2961. With 'CARRIAGECONTROL='FORTRAN'', when a record is written, the
  2962. first character of the input record is not written, and instead
  2963. determines the output record separator as follows:
  2964. Leading character Meaning Output separating
  2965. character(s)
  2966. ----------------------------------------------------------------------------
  2967. ''+'' Overprinting Carriage return only
  2968. ''-'' New line Line feed and carriage
  2969. return
  2970. ''0'' Skip line Two line feeds and carriage
  2971. return
  2972. ''1'' New page Form feed and carriage
  2973. return
  2974. ''$'' Prompting Line feed (no carriage
  2975. return)
  2976. 'CHAR(0)' Overprinting (no None
  2977. advance)
  2978. 'READONLY'
  2979. The 'READONLY' specifier may be given upon opening a unit, and is
  2980. equivalent to specifying 'ACTION='READ'', except that the file may
  2981. not be deleted on close (i.e. 'CLOSE' with 'STATUS="DELETE"').
  2982. The syntax is:
  2983. OPEN(..., READONLY)
  2984. 'SHARE'
  2985. The 'SHARE' specifier allows system-level locking on a unit upon
  2986. opening it for controlled access from multiple processes/threads.
  2987. The 'SHARE' specifier has several forms:
  2988. OPEN(..., SHARE=sh)
  2989. OPEN(..., SHARED)
  2990. OPEN(..., NOSHARED)
  2991. Where _sh_ in the first form is a character expression that
  2992. evaluates to a value as seen in the table below. The latter two
  2993. forms are aliases for particular values of _sh_:
  2994. Explicit form Short form Meaning
  2995. ----------------------------------------------------------------------------
  2996. 'SHARE='DENYRW'' 'NOSHARED' Exclusive (write) lock
  2997. 'SHARE='DENYNONE'' 'SHARED' Shared (read) lock
  2998. In general only one process may hold an exclusive (write) lock for
  2999. a given file at a time, whereas many processes may hold shared
  3000. (read) locks for the same file.
  3001. The behavior of locking may vary with your operating system. On
  3002. POSIX systems, locking is implemented with 'fcntl'. Consult your
  3003. corresponding operating system's manual pages for further details.
  3004. Locking via 'SHARE=' is not supported on other systems.
  3005. 
  3006. File: gfortran.info, Node: Legacy PARAMETER statements, Next: Default exponents, Prev: Extended I/O specifiers, Up: Extensions implemented in GNU Fortran
  3007. 6.1.31 Legacy PARAMETER statements
  3008. ----------------------------------
  3009. For compatibility, GNU Fortran supports legacy PARAMETER statements
  3010. without parentheses with '-std=legacy'. A warning is emitted if used
  3011. with '-std=gnu', and an error is acknowledged with a real Fortran
  3012. standard flag ('-std=f95', etc...). These statements take the following
  3013. form:
  3014. implicit real (E)
  3015. parameter e = 2.718282
  3016. real c
  3017. parameter c = 3.0e8
  3018. 
  3019. File: gfortran.info, Node: Default exponents, Prev: Legacy PARAMETER statements, Up: Extensions implemented in GNU Fortran
  3020. 6.1.32 Default exponents
  3021. ------------------------
  3022. For compatibility, GNU Fortran supports a default exponent of zero in
  3023. real constants with '-fdec'. For example, '9e' would be interpreted as
  3024. '9e0', rather than an error.
  3025. 
  3026. File: gfortran.info, Node: Extensions not implemented in GNU Fortran, Prev: Extensions implemented in GNU Fortran, Up: Extensions
  3027. 6.2 Extensions not implemented in GNU Fortran
  3028. =============================================
  3029. The long history of the Fortran language, its wide use and broad
  3030. userbase, the large number of different compiler vendors and the lack of
  3031. some features crucial to users in the first standards have lead to the
  3032. existence of a number of important extensions to the language. While
  3033. some of the most useful or popular extensions are supported by the GNU
  3034. Fortran compiler, not all existing extensions are supported. This
  3035. section aims at listing these extensions and offering advice on how best
  3036. make code that uses them running with the GNU Fortran compiler.
  3037. * Menu:
  3038. * ENCODE and DECODE statements::
  3039. * Variable FORMAT expressions::
  3040. * Alternate complex function syntax::
  3041. * Volatile COMMON blocks::
  3042. * OPEN( ... NAME=)::
  3043. 
  3044. File: gfortran.info, Node: ENCODE and DECODE statements, Next: Variable FORMAT expressions, Up: Extensions not implemented in GNU Fortran
  3045. 6.2.1 'ENCODE' and 'DECODE' statements
  3046. --------------------------------------
  3047. GNU Fortran does not support the 'ENCODE' and 'DECODE' statements.
  3048. These statements are best replaced by 'READ' and 'WRITE' statements
  3049. involving internal files ('CHARACTER' variables and arrays), which have
  3050. been part of the Fortran standard since Fortran 77. For example,
  3051. replace a code fragment like
  3052. INTEGER*1 LINE(80)
  3053. REAL A, B, C
  3054. c ... Code that sets LINE
  3055. DECODE (80, 9000, LINE) A, B, C
  3056. 9000 FORMAT (1X, 3(F10.5))
  3057. with the following:
  3058. CHARACTER(LEN=80) LINE
  3059. REAL A, B, C
  3060. c ... Code that sets LINE
  3061. READ (UNIT=LINE, FMT=9000) A, B, C
  3062. 9000 FORMAT (1X, 3(F10.5))
  3063. Similarly, replace a code fragment like
  3064. INTEGER*1 LINE(80)
  3065. REAL A, B, C
  3066. c ... Code that sets A, B and C
  3067. ENCODE (80, 9000, LINE) A, B, C
  3068. 9000 FORMAT (1X, 'OUTPUT IS ', 3(F10.5))
  3069. with the following:
  3070. CHARACTER(LEN=80) LINE
  3071. REAL A, B, C
  3072. c ... Code that sets A, B and C
  3073. WRITE (UNIT=LINE, FMT=9000) A, B, C
  3074. 9000 FORMAT (1X, 'OUTPUT IS ', 3(F10.5))
  3075. 
  3076. File: gfortran.info, Node: Variable FORMAT expressions, Next: Alternate complex function syntax, Prev: ENCODE and DECODE statements, Up: Extensions not implemented in GNU Fortran
  3077. 6.2.2 Variable 'FORMAT' expressions
  3078. -----------------------------------
  3079. A variable 'FORMAT' expression is format statement which includes angle
  3080. brackets enclosing a Fortran expression: 'FORMAT(I<N>)'. GNU Fortran
  3081. does not support this legacy extension. The effect of variable format
  3082. expressions can be reproduced by using the more powerful (and standard)
  3083. combination of internal output and string formats. For example, replace
  3084. a code fragment like this:
  3085. WRITE(6,20) INT1
  3086. 20 FORMAT(I<N+1>)
  3087. with the following:
  3088. c Variable declaration
  3089. CHARACTER(LEN=20) FMT
  3090. c
  3091. c Other code here...
  3092. c
  3093. WRITE(FMT,'("(I", I0, ")")') N+1
  3094. WRITE(6,FMT) INT1
  3095. or with:
  3096. c Variable declaration
  3097. CHARACTER(LEN=20) FMT
  3098. c
  3099. c Other code here...
  3100. c
  3101. WRITE(FMT,*) N+1
  3102. WRITE(6,"(I" // ADJUSTL(FMT) // ")") INT1
  3103. 
  3104. File: gfortran.info, Node: Alternate complex function syntax, Next: Volatile COMMON blocks, Prev: Variable FORMAT expressions, Up: Extensions not implemented in GNU Fortran
  3105. 6.2.3 Alternate complex function syntax
  3106. ---------------------------------------
  3107. Some Fortran compilers, including 'g77', let the user declare complex
  3108. functions with the syntax 'COMPLEX FUNCTION name*16()', as well as
  3109. 'COMPLEX*16 FUNCTION name()'. Both are non-standard, legacy extensions.
  3110. 'gfortran' accepts the latter form, which is more common, but not the
  3111. former.
  3112. 
  3113. File: gfortran.info, Node: Volatile COMMON blocks, Next: OPEN( ... NAME=), Prev: Alternate complex function syntax, Up: Extensions not implemented in GNU Fortran
  3114. 6.2.4 Volatile 'COMMON' blocks
  3115. ------------------------------
  3116. Some Fortran compilers, including 'g77', let the user declare 'COMMON'
  3117. with the 'VOLATILE' attribute. This is invalid standard Fortran syntax
  3118. and is not supported by 'gfortran'. Note that 'gfortran' accepts
  3119. 'VOLATILE' variables in 'COMMON' blocks since revision 4.3.
  3120. 
  3121. File: gfortran.info, Node: OPEN( ... NAME=), Prev: Volatile COMMON blocks, Up: Extensions not implemented in GNU Fortran
  3122. 6.2.5 'OPEN( ... NAME=)'
  3123. ------------------------
  3124. Some Fortran compilers, including 'g77', let the user declare 'OPEN( ...
  3125. NAME=)'. This is invalid standard Fortran syntax and is not supported
  3126. by 'gfortran'. 'OPEN( ... NAME=)' should be replaced with 'OPEN( ...
  3127. FILE=)'.
  3128. 
  3129. File: gfortran.info, Node: Mixed-Language Programming, Next: Coarray Programming, Prev: Extensions, Up: Top
  3130. 7 Mixed-Language Programming
  3131. ****************************
  3132. * Menu:
  3133. * Interoperability with C::
  3134. * GNU Fortran Compiler Directives::
  3135. * Non-Fortran Main Program::
  3136. * Naming and argument-passing conventions::
  3137. This chapter is about mixed-language interoperability, but also applies
  3138. if one links Fortran code compiled by different compilers. In most
  3139. cases, use of the C Binding features of the Fortran 2003 standard is
  3140. sufficient, and their use is highly recommended.
  3141. 
  3142. File: gfortran.info, Node: Interoperability with C, Next: GNU Fortran Compiler Directives, Up: Mixed-Language Programming
  3143. 7.1 Interoperability with C
  3144. ===========================
  3145. * Menu:
  3146. * Intrinsic Types::
  3147. * Derived Types and struct::
  3148. * Interoperable Global Variables::
  3149. * Interoperable Subroutines and Functions::
  3150. * Working with Pointers::
  3151. * Further Interoperability of Fortran with C::
  3152. Since Fortran 2003 (ISO/IEC 1539-1:2004(E)) there is a standardized way
  3153. to generate procedure and derived-type declarations and global variables
  3154. which are interoperable with C (ISO/IEC 9899:1999). The 'bind(C)'
  3155. attribute has been added to inform the compiler that a symbol shall be
  3156. interoperable with C; also, some constraints are added. Note, however,
  3157. that not all C features have a Fortran equivalent or vice versa. For
  3158. instance, neither C's unsigned integers nor C's functions with variable
  3159. number of arguments have an equivalent in Fortran.
  3160. Note that array dimensions are reversely ordered in C and that arrays
  3161. in C always start with index 0 while in Fortran they start by default
  3162. with 1. Thus, an array declaration 'A(n,m)' in Fortran matches
  3163. 'A[m][n]' in C and accessing the element 'A(i,j)' matches 'A[j-1][i-1]'.
  3164. The element following 'A(i,j)' (C: 'A[j-1][i-1]'; assuming i < n) in
  3165. memory is 'A(i+1,j)' (C: 'A[j-1][i]').
  3166. 
  3167. File: gfortran.info, Node: Intrinsic Types, Next: Derived Types and struct, Up: Interoperability with C
  3168. 7.1.1 Intrinsic Types
  3169. ---------------------
  3170. In order to ensure that exactly the same variable type and kind is used
  3171. in C and Fortran, the named constants shall be used which are defined in
  3172. the 'ISO_C_BINDING' intrinsic module. That module contains named
  3173. constants for kind parameters and character named constants for the
  3174. escape sequences in C. For a list of the constants, see *note
  3175. ISO_C_BINDING::.
  3176. For logical types, please note that the Fortran standard only
  3177. guarantees interoperability between C99's '_Bool' and Fortran's
  3178. 'C_Bool'-kind logicals and C99 defines that 'true' has the value 1 and
  3179. 'false' the value 0. Using any other integer value with GNU Fortran's
  3180. 'LOGICAL' (with any kind parameter) gives an undefined result. (Passing
  3181. other integer values than 0 and 1 to GCC's '_Bool' is also undefined,
  3182. unless the integer is explicitly or implicitly casted to '_Bool'.)
  3183. 
  3184. File: gfortran.info, Node: Derived Types and struct, Next: Interoperable Global Variables, Prev: Intrinsic Types, Up: Interoperability with C
  3185. 7.1.2 Derived Types and struct
  3186. ------------------------------
  3187. For compatibility of derived types with 'struct', one needs to use the
  3188. 'BIND(C)' attribute in the type declaration. For instance, the
  3189. following type declaration
  3190. USE ISO_C_BINDING
  3191. TYPE, BIND(C) :: myType
  3192. INTEGER(C_INT) :: i1, i2
  3193. INTEGER(C_SIGNED_CHAR) :: i3
  3194. REAL(C_DOUBLE) :: d1
  3195. COMPLEX(C_FLOAT_COMPLEX) :: c1
  3196. CHARACTER(KIND=C_CHAR) :: str(5)
  3197. END TYPE
  3198. matches the following 'struct' declaration in C
  3199. struct {
  3200. int i1, i2;
  3201. /* Note: "char" might be signed or unsigned. */
  3202. signed char i3;
  3203. double d1;
  3204. float _Complex c1;
  3205. char str[5];
  3206. } myType;
  3207. Derived types with the C binding attribute shall not have the
  3208. 'sequence' attribute, type parameters, the 'extends' attribute, nor
  3209. type-bound procedures. Every component must be of interoperable type
  3210. and kind and may not have the 'pointer' or 'allocatable' attribute. The
  3211. names of the components are irrelevant for interoperability.
  3212. As there exist no direct Fortran equivalents, neither unions nor
  3213. structs with bit field or variable-length array members are
  3214. interoperable.
  3215. 
  3216. File: gfortran.info, Node: Interoperable Global Variables, Next: Interoperable Subroutines and Functions, Prev: Derived Types and struct, Up: Interoperability with C
  3217. 7.1.3 Interoperable Global Variables
  3218. ------------------------------------
  3219. Variables can be made accessible from C using the C binding attribute,
  3220. optionally together with specifying a binding name. Those variables
  3221. have to be declared in the declaration part of a 'MODULE', be of
  3222. interoperable type, and have neither the 'pointer' nor the 'allocatable'
  3223. attribute.
  3224. MODULE m
  3225. USE myType_module
  3226. USE ISO_C_BINDING
  3227. integer(C_INT), bind(C, name="_MyProject_flags") :: global_flag
  3228. type(myType), bind(C) :: tp
  3229. END MODULE
  3230. Here, '_MyProject_flags' is the case-sensitive name of the variable
  3231. as seen from C programs while 'global_flag' is the case-insensitive name
  3232. as seen from Fortran. If no binding name is specified, as for TP, the C
  3233. binding name is the (lowercase) Fortran binding name. If a binding name
  3234. is specified, only a single variable may be after the double colon.
  3235. Note of warning: You cannot use a global variable to access ERRNO of the
  3236. C library as the C standard allows it to be a macro. Use the 'IERRNO'
  3237. intrinsic (GNU extension) instead.
  3238. 
  3239. File: gfortran.info, Node: Interoperable Subroutines and Functions, Next: Working with Pointers, Prev: Interoperable Global Variables, Up: Interoperability with C
  3240. 7.1.4 Interoperable Subroutines and Functions
  3241. ---------------------------------------------
  3242. Subroutines and functions have to have the 'BIND(C)' attribute to be
  3243. compatible with C. The dummy argument declaration is relatively
  3244. straightforward. However, one needs to be careful because C uses
  3245. call-by-value by default while Fortran behaves usually similar to
  3246. call-by-reference. Furthermore, strings and pointers are handled
  3247. differently. Note that in Fortran 2003 and 2008 only explicit size and
  3248. assumed-size arrays are supported but not assumed-shape or
  3249. deferred-shape (i.e. allocatable or pointer) arrays. However, those
  3250. are allowed since the Technical Specification 29113, see *note Further
  3251. Interoperability of Fortran with C::
  3252. To pass a variable by value, use the 'VALUE' attribute. Thus, the
  3253. following C prototype
  3254. int func(int i, int *j)
  3255. matches the Fortran declaration
  3256. integer(c_int) function func(i,j)
  3257. use iso_c_binding, only: c_int
  3258. integer(c_int), VALUE :: i
  3259. integer(c_int) :: j
  3260. Note that pointer arguments also frequently need the 'VALUE'
  3261. attribute, see *note Working with Pointers::.
  3262. Strings are handled quite differently in C and Fortran. In C a
  3263. string is a 'NUL'-terminated array of characters while in Fortran each
  3264. string has a length associated with it and is thus not terminated (by
  3265. e.g. 'NUL'). For example, if one wants to use the following C
  3266. function,
  3267. #include <stdio.h>
  3268. void print_C(char *string) /* equivalent: char string[] */
  3269. {
  3270. printf("%s\n", string);
  3271. }
  3272. to print "Hello World" from Fortran, one can call it using
  3273. use iso_c_binding, only: C_CHAR, C_NULL_CHAR
  3274. interface
  3275. subroutine print_c(string) bind(C, name="print_C")
  3276. use iso_c_binding, only: c_char
  3277. character(kind=c_char) :: string(*)
  3278. end subroutine print_c
  3279. end interface
  3280. call print_c(C_CHAR_"Hello World"//C_NULL_CHAR)
  3281. As the example shows, one needs to ensure that the string is 'NUL'
  3282. terminated. Additionally, the dummy argument STRING of 'print_C' is a
  3283. length-one assumed-size array; using 'character(len=*)' is not allowed.
  3284. The example above uses 'c_char_"Hello World"' to ensure the string
  3285. literal has the right type; typically the default character kind and
  3286. 'c_char' are the same and thus '"Hello World"' is equivalent. However,
  3287. the standard does not guarantee this.
  3288. The use of strings is now further illustrated using the C library
  3289. function 'strncpy', whose prototype is
  3290. char *strncpy(char *restrict s1, const char *restrict s2, size_t n);
  3291. The function 'strncpy' copies at most N characters from string S2 to
  3292. S1 and returns S1. In the following example, we ignore the return
  3293. value:
  3294. use iso_c_binding
  3295. implicit none
  3296. character(len=30) :: str,str2
  3297. interface
  3298. ! Ignore the return value of strncpy -> subroutine
  3299. ! "restrict" is always assumed if we do not pass a pointer
  3300. subroutine strncpy(dest, src, n) bind(C)
  3301. import
  3302. character(kind=c_char), intent(out) :: dest(*)
  3303. character(kind=c_char), intent(in) :: src(*)
  3304. integer(c_size_t), value, intent(in) :: n
  3305. end subroutine strncpy
  3306. end interface
  3307. str = repeat('X',30) ! Initialize whole string with 'X'
  3308. call strncpy(str, c_char_"Hello World"//C_NULL_CHAR, &
  3309. len(c_char_"Hello World",kind=c_size_t))
  3310. print '(a)', str ! prints: "Hello WorldXXXXXXXXXXXXXXXXXXX"
  3311. end
  3312. The intrinsic procedures are described in *note Intrinsic
  3313. Procedures::.
  3314. 
  3315. File: gfortran.info, Node: Working with Pointers, Next: Further Interoperability of Fortran with C, Prev: Interoperable Subroutines and Functions, Up: Interoperability with C
  3316. 7.1.5 Working with Pointers
  3317. ---------------------------
  3318. C pointers are represented in Fortran via the special opaque derived
  3319. type 'type(c_ptr)' (with private components). Thus one needs to use
  3320. intrinsic conversion procedures to convert from or to C pointers.
  3321. For some applications, using an assumed type ('TYPE(*)') can be an
  3322. alternative to a C pointer; see *note Further Interoperability of
  3323. Fortran with C::.
  3324. For example,
  3325. use iso_c_binding
  3326. type(c_ptr) :: cptr1, cptr2
  3327. integer, target :: array(7), scalar
  3328. integer, pointer :: pa(:), ps
  3329. cptr1 = c_loc(array(1)) ! The programmer needs to ensure that the
  3330. ! array is contiguous if required by the C
  3331. ! procedure
  3332. cptr2 = c_loc(scalar)
  3333. call c_f_pointer(cptr2, ps)
  3334. call c_f_pointer(cptr2, pa, shape=[7])
  3335. When converting C to Fortran arrays, the one-dimensional 'SHAPE'
  3336. argument has to be passed.
  3337. If a pointer is a dummy-argument of an interoperable procedure, it
  3338. usually has to be declared using the 'VALUE' attribute. 'void*' matches
  3339. 'TYPE(C_PTR), VALUE', while 'TYPE(C_PTR)' alone matches 'void**'.
  3340. Procedure pointers are handled analogously to pointers; the C type is
  3341. 'TYPE(C_FUNPTR)' and the intrinsic conversion procedures are
  3342. 'C_F_PROCPOINTER' and 'C_FUNLOC'.
  3343. Let us consider two examples of actually passing a procedure pointer
  3344. from C to Fortran and vice versa. Note that these examples are also
  3345. very similar to passing ordinary pointers between both languages.
  3346. First, consider this code in C:
  3347. /* Procedure implemented in Fortran. */
  3348. void get_values (void (*)(double));
  3349. /* Call-back routine we want called from Fortran. */
  3350. void
  3351. print_it (double x)
  3352. {
  3353. printf ("Number is %f.\n", x);
  3354. }
  3355. /* Call Fortran routine and pass call-back to it. */
  3356. void
  3357. foobar ()
  3358. {
  3359. get_values (&print_it);
  3360. }
  3361. A matching implementation for 'get_values' in Fortran, that correctly
  3362. receives the procedure pointer from C and is able to call it, is given
  3363. in the following 'MODULE':
  3364. MODULE m
  3365. IMPLICIT NONE
  3366. ! Define interface of call-back routine.
  3367. ABSTRACT INTERFACE
  3368. SUBROUTINE callback (x)
  3369. USE, INTRINSIC :: ISO_C_BINDING
  3370. REAL(KIND=C_DOUBLE), INTENT(IN), VALUE :: x
  3371. END SUBROUTINE callback
  3372. END INTERFACE
  3373. CONTAINS
  3374. ! Define C-bound procedure.
  3375. SUBROUTINE get_values (cproc) BIND(C)
  3376. USE, INTRINSIC :: ISO_C_BINDING
  3377. TYPE(C_FUNPTR), INTENT(IN), VALUE :: cproc
  3378. PROCEDURE(callback), POINTER :: proc
  3379. ! Convert C to Fortran procedure pointer.
  3380. CALL C_F_PROCPOINTER (cproc, proc)
  3381. ! Call it.
  3382. CALL proc (1.0_C_DOUBLE)
  3383. CALL proc (-42.0_C_DOUBLE)
  3384. CALL proc (18.12_C_DOUBLE)
  3385. END SUBROUTINE get_values
  3386. END MODULE m
  3387. Next, we want to call a C routine that expects a procedure pointer
  3388. argument and pass it a Fortran procedure (which clearly must be
  3389. interoperable!). Again, the C function may be:
  3390. int
  3391. call_it (int (*func)(int), int arg)
  3392. {
  3393. return func (arg);
  3394. }
  3395. It can be used as in the following Fortran code:
  3396. MODULE m
  3397. USE, INTRINSIC :: ISO_C_BINDING
  3398. IMPLICIT NONE
  3399. ! Define interface of C function.
  3400. INTERFACE
  3401. INTEGER(KIND=C_INT) FUNCTION call_it (func, arg) BIND(C)
  3402. USE, INTRINSIC :: ISO_C_BINDING
  3403. TYPE(C_FUNPTR), INTENT(IN), VALUE :: func
  3404. INTEGER(KIND=C_INT), INTENT(IN), VALUE :: arg
  3405. END FUNCTION call_it
  3406. END INTERFACE
  3407. CONTAINS
  3408. ! Define procedure passed to C function.
  3409. ! It must be interoperable!
  3410. INTEGER(KIND=C_INT) FUNCTION double_it (arg) BIND(C)
  3411. INTEGER(KIND=C_INT), INTENT(IN), VALUE :: arg
  3412. double_it = arg + arg
  3413. END FUNCTION double_it
  3414. ! Call C function.
  3415. SUBROUTINE foobar ()
  3416. TYPE(C_FUNPTR) :: cproc
  3417. INTEGER(KIND=C_INT) :: i
  3418. ! Get C procedure pointer.
  3419. cproc = C_FUNLOC (double_it)
  3420. ! Use it.
  3421. DO i = 1_C_INT, 10_C_INT
  3422. PRINT *, call_it (cproc, i)
  3423. END DO
  3424. END SUBROUTINE foobar
  3425. END MODULE m
  3426. 
  3427. File: gfortran.info, Node: Further Interoperability of Fortran with C, Prev: Working with Pointers, Up: Interoperability with C
  3428. 7.1.6 Further Interoperability of Fortran with C
  3429. ------------------------------------------------
  3430. The Technical Specification ISO/IEC TS 29113:2012 on further
  3431. interoperability of Fortran with C extends the interoperability support
  3432. of Fortran 2003 and Fortran 2008. Besides removing some restrictions
  3433. and constraints, it adds assumed-type ('TYPE(*)') and assumed-rank
  3434. ('dimension') variables and allows for interoperability of
  3435. assumed-shape, assumed-rank and deferred-shape arrays, including
  3436. allocatables and pointers.
  3437. Note: Currently, GNU Fortran does not support the array descriptor
  3438. (dope vector) as specified in the Technical Specification, but uses an
  3439. array descriptor with different fields. The Chasm Language
  3440. Interoperability Tools, <http://chasm-interop.sourceforge.net/>, provide
  3441. an interface to GNU Fortran's array descriptor.
  3442. The Technical Specification adds the following new features, which
  3443. are supported by GNU Fortran:
  3444. * The 'ASYNCHRONOUS' attribute has been clarified and extended to
  3445. allow its use with asynchronous communication in user-provided
  3446. libraries such as in implementations of the Message Passing
  3447. Interface specification.
  3448. * Many constraints have been relaxed, in particular for the 'C_LOC'
  3449. and 'C_F_POINTER' intrinsics.
  3450. * The 'OPTIONAL' attribute is now allowed for dummy arguments; an
  3451. absent argument matches a 'NULL' pointer.
  3452. * Assumed types ('TYPE(*)') have been added, which may only be used
  3453. for dummy arguments. They are unlimited polymorphic but contrary
  3454. to 'CLASS(*)' they do not contain any type information, similar to
  3455. C's 'void *' pointers. Expressions of any type and kind can be
  3456. passed; thus, it can be used as replacement for 'TYPE(C_PTR)',
  3457. avoiding the use of 'C_LOC' in the caller.
  3458. Note, however, that 'TYPE(*)' only accepts scalar arguments, unless
  3459. the 'DIMENSION' is explicitly specified. As 'DIMENSION(*)' only
  3460. supports array (including array elements) but no scalars, it is not
  3461. a full replacement for 'C_LOC'. On the other hand, assumed-type
  3462. assumed-rank dummy arguments ('TYPE(*), DIMENSION(..)') allow for
  3463. both scalars and arrays, but require special code on the callee
  3464. side to handle the array descriptor.
  3465. * Assumed-rank arrays ('DIMENSION(..)') as dummy argument allow that
  3466. scalars and arrays of any rank can be passed as actual argument.
  3467. As the Technical Specification does not provide for direct means to
  3468. operate with them, they have to be used either from the C side or
  3469. be converted using 'C_LOC' and 'C_F_POINTER' to scalars or arrays
  3470. of a specific rank. The rank can be determined using the 'RANK'
  3471. intrinisic.
  3472. Currently unimplemented:
  3473. * GNU Fortran always uses an array descriptor, which does not match
  3474. the one of the Technical Specification. The
  3475. 'ISO_Fortran_binding.h' header file and the C functions it
  3476. specifies are not available.
  3477. * Using assumed-shape, assumed-rank and deferred-shape arrays in
  3478. 'BIND(C)' procedures is not fully supported. In particular, C
  3479. interoperable strings of other length than one are not supported as
  3480. this requires the new array descriptor.
  3481. 
  3482. File: gfortran.info, Node: GNU Fortran Compiler Directives, Next: Non-Fortran Main Program, Prev: Interoperability with C, Up: Mixed-Language Programming
  3483. 7.2 GNU Fortran Compiler Directives
  3484. ===================================
  3485. The Fortran standard describes how a conforming program shall behave;
  3486. however, the exact implementation is not standardized. In order to
  3487. allow the user to choose specific implementation details, compiler
  3488. directives can be used to set attributes of variables and procedures
  3489. which are not part of the standard. Whether a given attribute is
  3490. supported and its exact effects depend on both the operating system and
  3491. on the processor; see *note C Extensions: (gcc)Top. for details.
  3492. For procedures and procedure pointers, the following attributes can
  3493. be used to change the calling convention:
  3494. * 'CDECL' - standard C calling convention
  3495. * 'STDCALL' - convention where the called procedure pops the stack
  3496. * 'FASTCALL' - part of the arguments are passed via registers instead
  3497. using the stack
  3498. Besides changing the calling convention, the attributes also
  3499. influence the decoration of the symbol name, e.g., by a leading
  3500. underscore or by a trailing at-sign followed by the number of bytes on
  3501. the stack. When assigning a procedure to a procedure pointer, both
  3502. should use the same calling convention.
  3503. On some systems, procedures and global variables (module variables
  3504. and 'COMMON' blocks) need special handling to be accessible when they
  3505. are in a shared library. The following attributes are available:
  3506. * 'DLLEXPORT' - provide a global pointer to a pointer in the DLL
  3507. * 'DLLIMPORT' - reference the function or variable using a global
  3508. pointer
  3509. For dummy arguments, the 'NO_ARG_CHECK' attribute can be used; in
  3510. other compilers, it is also known as 'IGNORE_TKR'. For dummy arguments
  3511. with this attribute actual arguments of any type and kind (similar to
  3512. 'TYPE(*)'), scalars and arrays of any rank (no equivalent in Fortran
  3513. standard) are accepted. As with 'TYPE(*)', the argument is unlimited
  3514. polymorphic and no type information is available. Additionally, the
  3515. argument may only be passed to dummy arguments with the 'NO_ARG_CHECK'
  3516. attribute and as argument to the 'PRESENT' intrinsic function and to
  3517. 'C_LOC' of the 'ISO_C_BINDING' module.
  3518. Variables with 'NO_ARG_CHECK' attribute shall be of assumed-type
  3519. ('TYPE(*)'; recommended) or of type 'INTEGER', 'LOGICAL', 'REAL' or
  3520. 'COMPLEX'. They shall not have the 'ALLOCATE', 'CODIMENSION',
  3521. 'INTENT(OUT)', 'POINTER' or 'VALUE' attribute; furthermore, they shall
  3522. be either scalar or of assumed-size ('dimension(*)'). As 'TYPE(*)', the
  3523. 'NO_ARG_CHECK' attribute requires an explicit interface.
  3524. * 'NO_ARG_CHECK' - disable the type, kind and rank checking
  3525. The attributes are specified using the syntax
  3526. '!GCC$ ATTRIBUTES' ATTRIBUTE-LIST '::' VARIABLE-LIST
  3527. where in free-form source code only whitespace is allowed before
  3528. '!GCC$' and in fixed-form source code '!GCC$', 'cGCC$' or '*GCC$' shall
  3529. start in the first column.
  3530. For procedures, the compiler directives shall be placed into the body
  3531. of the procedure; for variables and procedure pointers, they shall be in
  3532. the same declaration part as the variable or procedure pointer.
  3533. 
  3534. File: gfortran.info, Node: Non-Fortran Main Program, Next: Naming and argument-passing conventions, Prev: GNU Fortran Compiler Directives, Up: Mixed-Language Programming
  3535. 7.3 Non-Fortran Main Program
  3536. ============================
  3537. * Menu:
  3538. * _gfortran_set_args:: Save command-line arguments
  3539. * _gfortran_set_options:: Set library option flags
  3540. * _gfortran_set_convert:: Set endian conversion
  3541. * _gfortran_set_record_marker:: Set length of record markers
  3542. * _gfortran_set_fpe:: Set when a Floating Point Exception should be raised
  3543. * _gfortran_set_max_subrecord_length:: Set subrecord length
  3544. Even if you are doing mixed-language programming, it is very likely that
  3545. you do not need to know or use the information in this section. Since
  3546. it is about the internal structure of GNU Fortran, it may also change in
  3547. GCC minor releases.
  3548. When you compile a 'PROGRAM' with GNU Fortran, a function with the
  3549. name 'main' (in the symbol table of the object file) is generated, which
  3550. initializes the libgfortran library and then calls the actual program
  3551. which uses the name 'MAIN__', for historic reasons. If you link GNU
  3552. Fortran compiled procedures to, e.g., a C or C++ program or to a Fortran
  3553. program compiled by a different compiler, the libgfortran library is not
  3554. initialized and thus a few intrinsic procedures do not work properly,
  3555. e.g. those for obtaining the command-line arguments.
  3556. Therefore, if your 'PROGRAM' is not compiled with GNU Fortran and the
  3557. GNU Fortran compiled procedures require intrinsics relying on the
  3558. library initialization, you need to initialize the library yourself.
  3559. Using the default options, gfortran calls '_gfortran_set_args' and
  3560. '_gfortran_set_options'. The initialization of the former is needed if
  3561. the called procedures access the command line (and for backtracing); the
  3562. latter sets some flags based on the standard chosen or to enable
  3563. backtracing. In typical programs, it is not necessary to call any
  3564. initialization function.
  3565. If your 'PROGRAM' is compiled with GNU Fortran, you shall not call
  3566. any of the following functions. The libgfortran initialization
  3567. functions are shown in C syntax but using C bindings they are also
  3568. accessible from Fortran.
  3569. 
  3570. File: gfortran.info, Node: _gfortran_set_args, Next: _gfortran_set_options, Up: Non-Fortran Main Program
  3571. 7.3.1 '_gfortran_set_args' -- Save command-line arguments
  3572. ---------------------------------------------------------
  3573. _Description_:
  3574. '_gfortran_set_args' saves the command-line arguments; this
  3575. initialization is required if any of the command-line intrinsics is
  3576. called. Additionally, it shall be called if backtracing is enabled
  3577. (see '_gfortran_set_options').
  3578. _Syntax_:
  3579. 'void _gfortran_set_args (int argc, char *argv[])'
  3580. _Arguments_:
  3581. ARGC number of command line argument strings
  3582. ARGV the command-line argument strings; argv[0] is
  3583. the pathname of the executable itself.
  3584. _Example_:
  3585. int main (int argc, char *argv[])
  3586. {
  3587. /* Initialize libgfortran. */
  3588. _gfortran_set_args (argc, argv);
  3589. return 0;
  3590. }
  3591. 
  3592. File: gfortran.info, Node: _gfortran_set_options, Next: _gfortran_set_convert, Prev: _gfortran_set_args, Up: Non-Fortran Main Program
  3593. 7.3.2 '_gfortran_set_options' -- Set library option flags
  3594. ---------------------------------------------------------
  3595. _Description_:
  3596. '_gfortran_set_options' sets several flags related to the Fortran
  3597. standard to be used, whether backtracing should be enabled and
  3598. whether range checks should be performed. The syntax allows for
  3599. upward compatibility since the number of passed flags is specified;
  3600. for non-passed flags, the default value is used. See also *note
  3601. Code Gen Options::. Please note that not all flags are actually
  3602. used.
  3603. _Syntax_:
  3604. 'void _gfortran_set_options (int num, int options[])'
  3605. _Arguments_:
  3606. NUM number of options passed
  3607. ARGV The list of flag values
  3608. _option flag list_:
  3609. OPTION[0] Allowed standard; can give run-time errors if
  3610. e.g. an input-output edit descriptor is invalid
  3611. in a given standard. Possible values are
  3612. (bitwise or-ed) 'GFC_STD_F77' (1),
  3613. 'GFC_STD_F95_OBS' (2), 'GFC_STD_F95_DEL' (4),
  3614. 'GFC_STD_F95' (8), 'GFC_STD_F2003' (16),
  3615. 'GFC_STD_GNU' (32), 'GFC_STD_LEGACY' (64),
  3616. 'GFC_STD_F2008' (128), 'GFC_STD_F2008_OBS' (256)
  3617. and GFC_STD_F2008_TS (512). Default:
  3618. 'GFC_STD_F95_OBS | GFC_STD_F95_DEL | GFC_STD_F95
  3619. | GFC_STD_F2003 | GFC_STD_F2008 |
  3620. GFC_STD_F2008_TS | GFC_STD_F2008_OBS |
  3621. GFC_STD_F77 | GFC_STD_GNU | GFC_STD_LEGACY'.
  3622. OPTION[1] Standard-warning flag; prints a warning to
  3623. standard error. Default: 'GFC_STD_F95_DEL |
  3624. GFC_STD_LEGACY'.
  3625. OPTION[2] If non zero, enable pedantic checking. Default:
  3626. off.
  3627. OPTION[3] Unused.
  3628. OPTION[4] If non zero, enable backtracing on run-time
  3629. errors. Default: off. (Default in the
  3630. compiler: on.) Note: Installs a signal handler
  3631. and requires command-line initialization using
  3632. '_gfortran_set_args'.
  3633. OPTION[5] If non zero, supports signed zeros. Default:
  3634. enabled.
  3635. OPTION[6] Enables run-time checking. Possible values are
  3636. (bitwise or-ed): GFC_RTCHECK_BOUNDS (1),
  3637. GFC_RTCHECK_ARRAY_TEMPS (2),
  3638. GFC_RTCHECK_RECURSION (4), GFC_RTCHECK_DO (16),
  3639. GFC_RTCHECK_POINTER (32). Default: disabled.
  3640. OPTION[7] Unused.
  3641. OPTION[8] Show a warning when invoking 'STOP' and 'ERROR
  3642. STOP' if a floating-point exception occurred.
  3643. Possible values are (bitwise or-ed)
  3644. 'GFC_FPE_INVALID' (1), 'GFC_FPE_DENORMAL' (2),
  3645. 'GFC_FPE_ZERO' (4), 'GFC_FPE_OVERFLOW' (8),
  3646. 'GFC_FPE_UNDERFLOW' (16), 'GFC_FPE_INEXACT'
  3647. (32). Default: None (0). (Default in the
  3648. compiler: 'GFC_FPE_INVALID | GFC_FPE_DENORMAL |
  3649. GFC_FPE_ZERO | GFC_FPE_OVERFLOW |
  3650. GFC_FPE_UNDERFLOW'.)
  3651. _Example_:
  3652. /* Use gfortran 4.9 default options. */
  3653. static int options[] = {68, 511, 0, 0, 1, 1, 0, 0, 31};
  3654. _gfortran_set_options (9, &options);
  3655. 
  3656. File: gfortran.info, Node: _gfortran_set_convert, Next: _gfortran_set_record_marker, Prev: _gfortran_set_options, Up: Non-Fortran Main Program
  3657. 7.3.3 '_gfortran_set_convert' -- Set endian conversion
  3658. ------------------------------------------------------
  3659. _Description_:
  3660. '_gfortran_set_convert' set the representation of data for
  3661. unformatted files.
  3662. _Syntax_:
  3663. 'void _gfortran_set_convert (int conv)'
  3664. _Arguments_:
  3665. CONV Endian conversion, possible values:
  3666. GFC_CONVERT_NATIVE (0, default),
  3667. GFC_CONVERT_SWAP (1), GFC_CONVERT_BIG (2),
  3668. GFC_CONVERT_LITTLE (3).
  3669. _Example_:
  3670. int main (int argc, char *argv[])
  3671. {
  3672. /* Initialize libgfortran. */
  3673. _gfortran_set_args (argc, argv);
  3674. _gfortran_set_convert (1);
  3675. return 0;
  3676. }
  3677. 
  3678. File: gfortran.info, Node: _gfortran_set_record_marker, Next: _gfortran_set_fpe, Prev: _gfortran_set_convert, Up: Non-Fortran Main Program
  3679. 7.3.4 '_gfortran_set_record_marker' -- Set length of record markers
  3680. -------------------------------------------------------------------
  3681. _Description_:
  3682. '_gfortran_set_record_marker' sets the length of record markers for
  3683. unformatted files.
  3684. _Syntax_:
  3685. 'void _gfortran_set_record_marker (int val)'
  3686. _Arguments_:
  3687. VAL Length of the record marker; valid values are 4
  3688. and 8. Default is 4.
  3689. _Example_:
  3690. int main (int argc, char *argv[])
  3691. {
  3692. /* Initialize libgfortran. */
  3693. _gfortran_set_args (argc, argv);
  3694. _gfortran_set_record_marker (8);
  3695. return 0;
  3696. }
  3697. 
  3698. File: gfortran.info, Node: _gfortran_set_fpe, Next: _gfortran_set_max_subrecord_length, Prev: _gfortran_set_record_marker, Up: Non-Fortran Main Program
  3699. 7.3.5 '_gfortran_set_fpe' -- Enable floating point exception traps
  3700. ------------------------------------------------------------------
  3701. _Description_:
  3702. '_gfortran_set_fpe' enables floating point exception traps for the
  3703. specified exceptions. On most systems, this will result in a
  3704. SIGFPE signal being sent and the program being aborted.
  3705. _Syntax_:
  3706. 'void _gfortran_set_fpe (int val)'
  3707. _Arguments_:
  3708. OPTION[0] IEEE exceptions. Possible values are (bitwise
  3709. or-ed) zero (0, default) no trapping,
  3710. 'GFC_FPE_INVALID' (1), 'GFC_FPE_DENORMAL' (2),
  3711. 'GFC_FPE_ZERO' (4), 'GFC_FPE_OVERFLOW' (8),
  3712. 'GFC_FPE_UNDERFLOW' (16), and 'GFC_FPE_INEXACT'
  3713. (32).
  3714. _Example_:
  3715. int main (int argc, char *argv[])
  3716. {
  3717. /* Initialize libgfortran. */
  3718. _gfortran_set_args (argc, argv);
  3719. /* FPE for invalid operations such as SQRT(-1.0). */
  3720. _gfortran_set_fpe (1);
  3721. return 0;
  3722. }
  3723. 
  3724. File: gfortran.info, Node: _gfortran_set_max_subrecord_length, Prev: _gfortran_set_fpe, Up: Non-Fortran Main Program
  3725. 7.3.6 '_gfortran_set_max_subrecord_length' -- Set subrecord length
  3726. ------------------------------------------------------------------
  3727. _Description_:
  3728. '_gfortran_set_max_subrecord_length' set the maximum length for a
  3729. subrecord. This option only makes sense for testing and debugging
  3730. of unformatted I/O.
  3731. _Syntax_:
  3732. 'void _gfortran_set_max_subrecord_length (int val)'
  3733. _Arguments_:
  3734. VAL the maximum length for a subrecord; the maximum
  3735. permitted value is 2147483639, which is also the
  3736. default.
  3737. _Example_:
  3738. int main (int argc, char *argv[])
  3739. {
  3740. /* Initialize libgfortran. */
  3741. _gfortran_set_args (argc, argv);
  3742. _gfortran_set_max_subrecord_length (8);
  3743. return 0;
  3744. }
  3745. 
  3746. File: gfortran.info, Node: Naming and argument-passing conventions, Prev: Non-Fortran Main Program, Up: Mixed-Language Programming
  3747. 7.4 Naming and argument-passing conventions
  3748. ===========================================
  3749. This section gives an overview about the naming convention of procedures
  3750. and global variables and about the argument passing conventions used by
  3751. GNU Fortran. If a C binding has been specified, the naming convention
  3752. and some of the argument-passing conventions change. If possible,
  3753. mixed-language and mixed-compiler projects should use the better defined
  3754. C binding for interoperability. See *note Interoperability with C::.
  3755. * Menu:
  3756. * Naming conventions::
  3757. * Argument passing conventions::
  3758. 
  3759. File: gfortran.info, Node: Naming conventions, Next: Argument passing conventions, Up: Naming and argument-passing conventions
  3760. 7.4.1 Naming conventions
  3761. ------------------------
  3762. According the Fortran standard, valid Fortran names consist of a letter
  3763. between 'A' to 'Z', 'a' to 'z', digits '0', '1' to '9' and underscores
  3764. ('_') with the restriction that names may only start with a letter. As
  3765. vendor extension, the dollar sign ('$') is additionally permitted with
  3766. the option '-fdollar-ok', but not as first character and only if the
  3767. target system supports it.
  3768. By default, the procedure name is the lower-cased Fortran name with
  3769. an appended underscore ('_'); using '-fno-underscoring' no underscore is
  3770. appended while '-fsecond-underscore' appends two underscores. Depending
  3771. on the target system and the calling convention, the procedure might be
  3772. additionally dressed; for instance, on 32bit Windows with 'stdcall', an
  3773. at-sign '@' followed by an integer number is appended. For the changing
  3774. the calling convention, see *note GNU Fortran Compiler Directives::.
  3775. For common blocks, the same convention is used, i.e. by default an
  3776. underscore is appended to the lower-cased Fortran name. Blank commons
  3777. have the name '__BLNK__'.
  3778. For procedures and variables declared in the specification space of a
  3779. module, the name is formed by '__', followed by the lower-cased module
  3780. name, '_MOD_', and the lower-cased Fortran name. Note that no
  3781. underscore is appended.
  3782. 
  3783. File: gfortran.info, Node: Argument passing conventions, Prev: Naming conventions, Up: Naming and argument-passing conventions
  3784. 7.4.2 Argument passing conventions
  3785. ----------------------------------
  3786. Subroutines do not return a value (matching C99's 'void') while
  3787. functions either return a value as specified in the platform ABI or the
  3788. result variable is passed as hidden argument to the function and no
  3789. result is returned. A hidden result variable is used when the result
  3790. variable is an array or of type 'CHARACTER'.
  3791. Arguments are passed according to the platform ABI. In particular,
  3792. complex arguments might not be compatible to a struct with two real
  3793. components for the real and imaginary part. The argument passing
  3794. matches the one of C99's '_Complex'. Functions with scalar complex
  3795. result variables return their value and do not use a by-reference
  3796. argument. Note that with the '-ff2c' option, the argument passing is
  3797. modified and no longer completely matches the platform ABI. Some other
  3798. Fortran compilers use 'f2c' semantic by default; this might cause
  3799. problems with interoperablility.
  3800. GNU Fortran passes most arguments by reference, i.e. by passing a
  3801. pointer to the data. Note that the compiler might use a temporary
  3802. variable into which the actual argument has been copied, if required
  3803. semantically (copy-in/copy-out).
  3804. For arguments with 'ALLOCATABLE' and 'POINTER' attribute (including
  3805. procedure pointers), a pointer to the pointer is passed such that the
  3806. pointer address can be modified in the procedure.
  3807. For dummy arguments with the 'VALUE' attribute: Scalar arguments of
  3808. the type 'INTEGER', 'LOGICAL', 'REAL' and 'COMPLEX' are passed by value
  3809. according to the platform ABI. (As vendor extension and not recommended,
  3810. using '%VAL()' in the call to a procedure has the same effect.) For
  3811. 'TYPE(C_PTR)' and procedure pointers, the pointer itself is passed such
  3812. that it can be modified without affecting the caller.
  3813. For Boolean ('LOGICAL') arguments, please note that GCC expects only
  3814. the integer value 0 and 1. If a GNU Fortran 'LOGICAL' variable contains
  3815. another integer value, the result is undefined. As some other Fortran
  3816. compilers use -1 for '.TRUE.', extra care has to be taken - such as
  3817. passing the value as 'INTEGER'. (The same value restriction also
  3818. applies to other front ends of GCC, e.g. to GCC's C99 compiler for
  3819. '_Bool' or GCC's Ada compiler for 'Boolean'.)
  3820. For arguments of 'CHARACTER' type, the character length is passed as
  3821. hidden argument. For deferred-length strings, the value is passed by
  3822. reference, otherwise by value. The character length has the type
  3823. 'INTEGER(kind=4)'. Note with C binding, 'CHARACTER(len=1)' result
  3824. variables are returned according to the platform ABI and no hidden
  3825. length argument is used for dummy arguments; with 'VALUE', those
  3826. variables are passed by value.
  3827. For 'OPTIONAL' dummy arguments, an absent argument is denoted by a
  3828. NULL pointer, except for scalar dummy arguments of type 'INTEGER',
  3829. 'LOGICAL', 'REAL' and 'COMPLEX' which have the 'VALUE' attribute. For
  3830. those, a hidden Boolean argument ('logical(kind=C_bool),value') is used
  3831. to indicate whether the argument is present.
  3832. Arguments which are assumed-shape, assumed-rank or deferred-rank
  3833. arrays or, with '-fcoarray=lib', allocatable scalar coarrays use an
  3834. array descriptor. All other arrays pass the address of the first
  3835. element of the array. With '-fcoarray=lib', the token and the offset
  3836. belonging to nonallocatable coarrays dummy arguments are passed as
  3837. hidden argument along the character length hidden arguments. The token
  3838. is an oparque pointer identifying the coarray and the offset is a
  3839. passed-by-value integer of kind 'C_PTRDIFF_T', denoting the byte offset
  3840. between the base address of the coarray and the passed scalar or first
  3841. element of the passed array.
  3842. The arguments are passed in the following order
  3843. * Result variable, when the function result is passed by reference
  3844. * Character length of the function result, if it is a of type
  3845. 'CHARACTER' and no C binding is used
  3846. * The arguments in the order in which they appear in the Fortran
  3847. declaration
  3848. * The the present status for optional arguments with value attribute,
  3849. which are internally passed by value
  3850. * The character length and/or coarray token and offset for the first
  3851. argument which is a 'CHARACTER' or a nonallocatable coarray dummy
  3852. argument, followed by the hidden arguments of the next dummy
  3853. argument of such a type
  3854. 
  3855. File: gfortran.info, Node: Coarray Programming, Next: Intrinsic Procedures, Prev: Mixed-Language Programming, Up: Top
  3856. 8 Coarray Programming
  3857. *********************
  3858. * Menu:
  3859. * Type and enum ABI Documentation::
  3860. * Function ABI Documentation::
  3861. 
  3862. File: gfortran.info, Node: Type and enum ABI Documentation, Next: Function ABI Documentation, Up: Coarray Programming
  3863. 8.1 Type and enum ABI Documentation
  3864. ===================================
  3865. * Menu:
  3866. * caf_token_t::
  3867. * caf_register_t::
  3868. * caf_deregister_t::
  3869. * caf_reference_t::
  3870. * caf_team_t::
  3871. 
  3872. File: gfortran.info, Node: caf_token_t, Next: caf_register_t, Up: Type and enum ABI Documentation
  3873. 8.1.1 'caf_token_t'
  3874. -------------------
  3875. Typedef of type 'void *' on the compiler side. Can be any data type on
  3876. the library side.
  3877. 
  3878. File: gfortran.info, Node: caf_register_t, Next: caf_deregister_t, Prev: caf_token_t, Up: Type and enum ABI Documentation
  3879. 8.1.2 'caf_register_t'
  3880. ----------------------
  3881. Indicates which kind of coarray variable should be registered.
  3882. typedef enum caf_register_t {
  3883. CAF_REGTYPE_COARRAY_STATIC,
  3884. CAF_REGTYPE_COARRAY_ALLOC,
  3885. CAF_REGTYPE_LOCK_STATIC,
  3886. CAF_REGTYPE_LOCK_ALLOC,
  3887. CAF_REGTYPE_CRITICAL,
  3888. CAF_REGTYPE_EVENT_STATIC,
  3889. CAF_REGTYPE_EVENT_ALLOC,
  3890. CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY,
  3891. CAF_REGTYPE_COARRAY_ALLOC_ALLOCATE_ONLY
  3892. }
  3893. caf_register_t;
  3894. The values 'CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY' and
  3895. 'CAF_REGTYPE_COARRAY_ALLOC_ALLOCATE_ONLY' are for allocatable components
  3896. in derived type coarrays only. The first one sets up the token without
  3897. allocating memory for allocatable component. The latter one only
  3898. allocates the memory for an allocatable component in a derived type
  3899. coarray. The token needs to be setup previously by the REGISTER_ONLY.
  3900. This allows to have allocatable components un-allocated on some images.
  3901. The status whether an allocatable component is allocated on a remote
  3902. image can be queried by '_caf_is_present' which used internally by the
  3903. 'ALLOCATED' intrinsic.
  3904. 
  3905. File: gfortran.info, Node: caf_deregister_t, Next: caf_reference_t, Prev: caf_register_t, Up: Type and enum ABI Documentation
  3906. 8.1.3 'caf_deregister_t'
  3907. ------------------------
  3908. typedef enum caf_deregister_t {
  3909. CAF_DEREGTYPE_COARRAY_DEREGISTER,
  3910. CAF_DEREGTYPE_COARRAY_DEALLOCATE_ONLY
  3911. }
  3912. caf_deregister_t;
  3913. Allows to specifiy the type of deregistration of a coarray object.
  3914. The 'CAF_DEREGTYPE_COARRAY_DEALLOCATE_ONLY' flag is only allowed for
  3915. allocatable components in derived type coarrays.
  3916. 
  3917. File: gfortran.info, Node: caf_reference_t, Next: caf_team_t, Prev: caf_deregister_t, Up: Type and enum ABI Documentation
  3918. 8.1.4 'caf_reference_t'
  3919. -----------------------
  3920. The structure used for implementing arbitrary reference chains. A
  3921. 'CAF_REFERENCE_T' allows to specify a component reference or any kind of
  3922. array reference of any rank supported by gfortran. For array references
  3923. all kinds as known by the compiler/Fortran standard are supported
  3924. indicated by a 'MODE'.
  3925. typedef enum caf_ref_type_t {
  3926. /* Reference a component of a derived type, either regular one or an
  3927. allocatable or pointer type. For regular ones idx in caf_reference_t is
  3928. set to -1. */
  3929. CAF_REF_COMPONENT,
  3930. /* Reference an allocatable array. */
  3931. CAF_REF_ARRAY,
  3932. /* Reference a non-allocatable/non-pointer array. I.e., the coarray object
  3933. has no array descriptor associated and the addressing is done
  3934. completely using the ref. */
  3935. CAF_REF_STATIC_ARRAY
  3936. } caf_ref_type_t;
  3937. typedef enum caf_array_ref_t {
  3938. /* No array ref. This terminates the array ref. */
  3939. CAF_ARR_REF_NONE = 0,
  3940. /* Reference array elements given by a vector. Only for this mode
  3941. caf_reference_t.u.a.dim[i].v is valid. */
  3942. CAF_ARR_REF_VECTOR,
  3943. /* A full array ref (:). */
  3944. CAF_ARR_REF_FULL,
  3945. /* Reference a range on elements given by start, end and stride. */
  3946. CAF_ARR_REF_RANGE,
  3947. /* Only a single item is referenced given in the start member. */
  3948. CAF_ARR_REF_SINGLE,
  3949. /* An array ref of the kind (i:), where i is an arbitrary valid index in the
  3950. array. The index i is given in the start member. */
  3951. CAF_ARR_REF_OPEN_END,
  3952. /* An array ref of the kind (:i), where the lower bound of the array ref
  3953. is given by the remote side. The index i is given in the end member. */
  3954. CAF_ARR_REF_OPEN_START
  3955. } caf_array_ref_t;
  3956. /* References to remote components of a derived type. */
  3957. typedef struct caf_reference_t {
  3958. /* A pointer to the next ref or NULL. */
  3959. struct caf_reference_t *next;
  3960. /* The type of the reference. */
  3961. /* caf_ref_type_t, replaced by int to allow specification in fortran FE. */
  3962. int type;
  3963. /* The size of an item referenced in bytes. I.e. in an array ref this is
  3964. the factor to advance the array pointer with to get to the next item.
  3965. For component refs this gives just the size of the element referenced. */
  3966. size_t item_size;
  3967. union {
  3968. struct {
  3969. /* The offset (in bytes) of the component in the derived type.
  3970. Unused for allocatable or pointer components. */
  3971. ptrdiff_t offset;
  3972. /* The offset (in bytes) to the caf_token associated with this
  3973. component. NULL, when not allocatable/pointer ref. */
  3974. ptrdiff_t caf_token_offset;
  3975. } c;
  3976. struct {
  3977. /* The mode of the array ref. See CAF_ARR_REF_*. */
  3978. /* caf_array_ref_t, replaced by unsigend char to allow specification in
  3979. fortran FE. */
  3980. unsigned char mode[GFC_MAX_DIMENSIONS];
  3981. /* The type of a static array. Unset for array's with descriptors. */
  3982. int static_array_type;
  3983. /* Subscript refs (s) or vector refs (v). */
  3984. union {
  3985. struct {
  3986. /* The start and end boundary of the ref and the stride. */
  3987. index_type start, end, stride;
  3988. } s;
  3989. struct {
  3990. /* nvec entries of kind giving the elements to reference. */
  3991. void *vector;
  3992. /* The number of entries in vector. */
  3993. size_t nvec;
  3994. /* The integer kind used for the elements in vector. */
  3995. int kind;
  3996. } v;
  3997. } dim[GFC_MAX_DIMENSIONS];
  3998. } a;
  3999. } u;
  4000. } caf_reference_t;
  4001. The references make up a single linked list of reference operations.
  4002. The 'NEXT' member links to the next reference or NULL to indicate the
  4003. end of the chain. Component and array refs can be arbitrarly mixed as
  4004. long as they comply to the Fortran standard.
  4005. _NOTES_ The member 'STATIC_ARRAY_TYPE' is used only when the 'TYPE'
  4006. is 'CAF_REF_STATIC_ARRAY'. The member gives the type of the data
  4007. referenced. Because no array descriptor is available for a
  4008. descriptor-less array and type conversion still needs to take place the
  4009. type is transported here.
  4010. At the moment 'CAF_ARR_REF_VECTOR' is not implemented in the front
  4011. end for descriptor-less arrays. The library caf_single has untested
  4012. support for it.
  4013. 
  4014. File: gfortran.info, Node: caf_team_t, Prev: caf_reference_t, Up: Type and enum ABI Documentation
  4015. 8.1.5 'caf_team_t'
  4016. ------------------
  4017. Opaque pointer to represent a team-handle. This type is a stand-in for
  4018. the future implementation of teams. It is about to change without
  4019. further notice.
  4020. 
  4021. File: gfortran.info, Node: Function ABI Documentation, Prev: Type and enum ABI Documentation, Up: Coarray Programming
  4022. 8.2 Function ABI Documentation
  4023. ==============================
  4024. * Menu:
  4025. * _gfortran_caf_init:: Initialiation function
  4026. * _gfortran_caf_finish:: Finalization function
  4027. * _gfortran_caf_this_image:: Querying the image number
  4028. * _gfortran_caf_num_images:: Querying the maximal number of images
  4029. * _gfortran_caf_image_status :: Query the status of an image
  4030. * _gfortran_caf_failed_images :: Get an array of the indexes of the failed images
  4031. * _gfortran_caf_stopped_images :: Get an array of the indexes of the stopped images
  4032. * _gfortran_caf_register:: Registering coarrays
  4033. * _gfortran_caf_deregister:: Deregistering coarrays
  4034. * _gfortran_caf_is_present:: Query whether an allocatable or pointer component in a derived type coarray is allocated
  4035. * _gfortran_caf_send:: Sending data from a local image to a remote image
  4036. * _gfortran_caf_get:: Getting data from a remote image
  4037. * _gfortran_caf_sendget:: Sending data between remote images
  4038. * _gfortran_caf_send_by_ref:: Sending data from a local image to a remote image using enhanced references
  4039. * _gfortran_caf_get_by_ref:: Getting data from a remote image using enhanced references
  4040. * _gfortran_caf_sendget_by_ref:: Sending data between remote images using enhanced references
  4041. * _gfortran_caf_lock:: Locking a lock variable
  4042. * _gfortran_caf_unlock:: Unlocking a lock variable
  4043. * _gfortran_caf_event_post:: Post an event
  4044. * _gfortran_caf_event_wait:: Wait that an event occurred
  4045. * _gfortran_caf_event_query:: Query event count
  4046. * _gfortran_caf_sync_all:: All-image barrier
  4047. * _gfortran_caf_sync_images:: Barrier for selected images
  4048. * _gfortran_caf_sync_memory:: Wait for completion of segment-memory operations
  4049. * _gfortran_caf_error_stop:: Error termination with exit code
  4050. * _gfortran_caf_error_stop_str:: Error termination with string
  4051. * _gfortran_caf_fail_image :: Mark the image failed and end its execution
  4052. * _gfortran_caf_atomic_define:: Atomic variable assignment
  4053. * _gfortran_caf_atomic_ref:: Atomic variable reference
  4054. * _gfortran_caf_atomic_cas:: Atomic compare and swap
  4055. * _gfortran_caf_atomic_op:: Atomic operation
  4056. * _gfortran_caf_co_broadcast:: Sending data to all images
  4057. * _gfortran_caf_co_max:: Collective maximum reduction
  4058. * _gfortran_caf_co_min:: Collective minimum reduction
  4059. * _gfortran_caf_co_sum:: Collective summing reduction
  4060. * _gfortran_caf_co_reduce:: Generic collective reduction
  4061. 
  4062. File: gfortran.info, Node: _gfortran_caf_init, Next: _gfortran_caf_finish, Up: Function ABI Documentation
  4063. 8.2.1 '_gfortran_caf_init' -- Initialiation function
  4064. ----------------------------------------------------
  4065. _Description_:
  4066. This function is called at startup of the program before the
  4067. Fortran main program, if the latter has been compiled with
  4068. '-fcoarray=lib'. It takes as arguments the command-line arguments
  4069. of the program. It is permitted to pass two 'NULL' pointers as
  4070. argument; if non-'NULL', the library is permitted to modify the
  4071. arguments.
  4072. _Syntax_:
  4073. 'void _gfortran_caf_init (int *argc, char ***argv)'
  4074. _Arguments_:
  4075. ARGC intent(inout) An integer pointer with the number
  4076. of arguments passed to the program or 'NULL'.
  4077. ARGV intent(inout) A pointer to an array of strings
  4078. with the command-line arguments or 'NULL'.
  4079. _NOTES_
  4080. The function is modelled after the initialization function of the
  4081. Message Passing Interface (MPI) specification. Due to the way
  4082. coarray registration works, it might not be the first call to the
  4083. library. If the main program is not written in Fortran and only a
  4084. library uses coarrays, it can happen that this function is never
  4085. called. Therefore, it is recommended that the library does not
  4086. rely on the passed arguments and whether the call has been done.
  4087. 
  4088. File: gfortran.info, Node: _gfortran_caf_finish, Next: _gfortran_caf_this_image, Prev: _gfortran_caf_init, Up: Function ABI Documentation
  4089. 8.2.2 '_gfortran_caf_finish' -- Finalization function
  4090. -----------------------------------------------------
  4091. _Description_:
  4092. This function is called at the end of the Fortran main program, if
  4093. it has been compiled with the '-fcoarray=lib' option.
  4094. _Syntax_:
  4095. 'void _gfortran_caf_finish (void)'
  4096. _NOTES_
  4097. For non-Fortran programs, it is recommended to call the function at
  4098. the end of the main program. To ensure that the shutdown is also
  4099. performed for programs where this function is not explicitly
  4100. invoked, for instance non-Fortran programs or calls to the system's
  4101. exit() function, the library can use a destructor function. Note
  4102. that programs can also be terminated using the STOP and ERROR STOP
  4103. statements; those use different library calls.
  4104. 
  4105. File: gfortran.info, Node: _gfortran_caf_this_image, Next: _gfortran_caf_num_images, Prev: _gfortran_caf_finish, Up: Function ABI Documentation
  4106. 8.2.3 '_gfortran_caf_this_image' -- Querying the image number
  4107. -------------------------------------------------------------
  4108. _Description_:
  4109. This function returns the current image number, which is a positive
  4110. number.
  4111. _Syntax_:
  4112. 'int _gfortran_caf_this_image (int distance)'
  4113. _Arguments_:
  4114. DISTANCE As specified for the 'this_image' intrinsic in
  4115. TS18508. Shall be a non-negative number.
  4116. _NOTES_
  4117. If the Fortran intrinsic 'this_image' is invoked without an
  4118. argument, which is the only permitted form in Fortran 2008, GCC
  4119. passes '0' as first argument.
  4120. 
  4121. File: gfortran.info, Node: _gfortran_caf_num_images, Next: _gfortran_caf_image_status, Prev: _gfortran_caf_this_image, Up: Function ABI Documentation
  4122. 8.2.4 '_gfortran_caf_num_images' -- Querying the maximal number of images
  4123. -------------------------------------------------------------------------
  4124. _Description_:
  4125. This function returns the number of images in the current team, if
  4126. DISTANCE is 0 or the number of images in the parent team at the
  4127. specified distance. If failed is -1, the function returns the
  4128. number of all images at the specified distance; if it is 0, the
  4129. function returns the number of nonfailed images, and if it is 1, it
  4130. returns the number of failed images.
  4131. _Syntax_:
  4132. 'int _gfortran_caf_num_images(int distance, int failed)'
  4133. _Arguments_:
  4134. DISTANCE the distance from this image to the ancestor.
  4135. Shall be positive.
  4136. FAILED shall be -1, 0, or 1
  4137. _NOTES_
  4138. This function follows TS18508. If the num_image intrinsic has no
  4139. arguments, then the compiler passes 'distance=0' and 'failed=-1' to
  4140. the function.
  4141. 
  4142. File: gfortran.info, Node: _gfortran_caf_image_status, Next: _gfortran_caf_failed_images, Prev: _gfortran_caf_num_images, Up: Function ABI Documentation
  4143. 8.2.5 '_gfortran_caf_image_status' -- Query the status of an image
  4144. ------------------------------------------------------------------
  4145. _Description_:
  4146. Get the status of the image given by the id IMAGE of the team given
  4147. by TEAM. Valid results are zero, for image is ok,
  4148. 'STAT_STOPPED_IMAGE' from the ISO_FORTRAN_ENV module to indicate
  4149. that the image has been stopped and 'STAT_FAILED_IMAGE' also from
  4150. ISO_FORTRAN_ENV to indicate that the image has executed a 'FAIL
  4151. IMAGE' statement.
  4152. _Syntax_:
  4153. 'int _gfortran_caf_image_status (int image, caf_team_t * team)'
  4154. _Arguments_:
  4155. IMAGE the positive scalar id of the image in the
  4156. current TEAM.
  4157. TEAM optional; team on the which the inquiry is to be
  4158. performed.
  4159. _NOTES_
  4160. This function follows TS18508. Because team-functionality is not
  4161. yet implemented a null-pointer is passed for the TEAM argument at
  4162. the moment.
  4163. 
  4164. File: gfortran.info, Node: _gfortran_caf_failed_images, Next: _gfortran_caf_stopped_images, Prev: _gfortran_caf_image_status, Up: Function ABI Documentation
  4165. 8.2.6 '_gfortran_caf_failed_images' -- Get an array of the indexes of the failed images
  4166. ---------------------------------------------------------------------------------------
  4167. _Description_:
  4168. Get an array of image indexes in the current TEAM that have failed.
  4169. The array is sorted ascendingly. When TEAM is not provided the
  4170. current team is to be used. When KIND is provided then the
  4171. resulting array is of that integer kind else it is of default
  4172. integer kind. The returns an unallocated size zero array when no
  4173. images have failed.
  4174. _Syntax_:
  4175. 'int _gfortran_caf_failed_images (caf_team_t * team, int * kind)'
  4176. _Arguments_:
  4177. TEAM optional; team on the which the inquiry is to be
  4178. performed.
  4179. IMAGE optional; the kind of the resulting integer
  4180. array.
  4181. _NOTES_
  4182. This function follows TS18508. Because team-functionality is not
  4183. yet implemented a null-pointer is passed for the TEAM argument at
  4184. the moment.
  4185. 
  4186. File: gfortran.info, Node: _gfortran_caf_stopped_images, Next: _gfortran_caf_register, Prev: _gfortran_caf_failed_images, Up: Function ABI Documentation
  4187. 8.2.7 '_gfortran_caf_stopped_images' -- Get an array of the indexes of the stopped images
  4188. -----------------------------------------------------------------------------------------
  4189. _Description_:
  4190. Get an array of image indexes in the current TEAM that have
  4191. stopped. The array is sorted ascendingly. When TEAM is not
  4192. provided the current team is to be used. When KIND is provided
  4193. then the resulting array is of that integer kind else it is of
  4194. default integer kind. The returns an unallocated size zero array
  4195. when no images have failed.
  4196. _Syntax_:
  4197. 'int _gfortran_caf_stopped_images (caf_team_t * team, int * kind)'
  4198. _Arguments_:
  4199. TEAM optional; team on the which the inquiry is to be
  4200. performed.
  4201. IMAGE optional; the kind of the resulting integer
  4202. array.
  4203. _NOTES_
  4204. This function follows TS18508. Because team-functionality is not
  4205. yet implemented a null-pointer is passed for the TEAM argument at
  4206. the moment.
  4207. 
  4208. File: gfortran.info, Node: _gfortran_caf_register, Next: _gfortran_caf_deregister, Prev: _gfortran_caf_stopped_images, Up: Function ABI Documentation
  4209. 8.2.8 '_gfortran_caf_register' -- Registering coarrays
  4210. ------------------------------------------------------
  4211. _Description_:
  4212. Registers memory for a coarray and creates a token to identify the
  4213. coarray. The routine is called for both coarrays with 'SAVE'
  4214. attribute and using an explicit 'ALLOCATE' statement. If an error
  4215. occurs and STAT is a 'NULL' pointer, the function shall abort with
  4216. printing an error message and starting the error termination. If
  4217. no error occurs and STAT is present, it shall be set to zero.
  4218. Otherwise, it shall be set to a positive value and, if not-'NULL',
  4219. ERRMSG shall be set to a string describing the failure. The
  4220. routine shall register the memory provided in the 'DATA'-component
  4221. of the array descriptor DESC, when that component is non-'NULL',
  4222. else it shall allocate sufficient memory and provide a pointer to
  4223. it in the 'DATA'-component of DESC. The array descriptor has rank
  4224. zero, when a scalar object is to be registered and the array
  4225. descriptor may be invalid after the call to
  4226. '_gfortran_caf_register'. When an array is to be allocated the
  4227. descriptor persists.
  4228. For 'CAF_REGTYPE_COARRAY_STATIC' and 'CAF_REGTYPE_COARRAY_ALLOC',
  4229. the passed size is the byte size requested. For
  4230. 'CAF_REGTYPE_LOCK_STATIC', 'CAF_REGTYPE_LOCK_ALLOC' and
  4231. 'CAF_REGTYPE_CRITICAL' it is the array size or one for a scalar.
  4232. When 'CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY' is used, then only a
  4233. token for an allocatable or pointer component is created. The
  4234. 'SIZE' parameter is not used then. On the contrary when
  4235. 'CAF_REGTYPE_COARRAY_ALLOC_ALLOCATE_ONLY' is specified, then the
  4236. TOKEN needs to be registered by a previous call with regtype
  4237. 'CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY' and either the memory
  4238. specified in the DESC's data-ptr is registered or allocate when the
  4239. data-ptr is NULL.
  4240. _Syntax_:
  4241. 'void caf_register (size_t size, caf_register_t type, caf_token_t
  4242. *token, gfc_descriptor_t *desc, int *stat, char *errmsg, int
  4243. errmsg_len)'
  4244. _Arguments_:
  4245. SIZE For normal coarrays, the byte size of the
  4246. coarray to be allocated; for lock types and
  4247. event types, the number of elements.
  4248. TYPE one of the caf_register_t types.
  4249. TOKEN intent(out) An opaque pointer identifying the
  4250. coarray.
  4251. DESC intent(inout) The (pseudo) array descriptor.
  4252. STAT intent(out) For allocatable coarrays, stores the
  4253. STAT=; may be NULL
  4254. ERRMSG intent(out) When an error occurs, this will be
  4255. set to an error message; may be NULL
  4256. ERRMSG_LEN the buffer size of errmsg.
  4257. _NOTES_
  4258. Nonalloatable coarrays have to be registered prior use from remote
  4259. images. In order to guarantee this, they have to be registered
  4260. before the main program. This can be achieved by creating
  4261. constructor functions. That is what GCC does such that also
  4262. nonallocatable coarrays the memory is allocated and no static
  4263. memory is used. The token permits to identify the coarray; to the
  4264. processor, the token is a nonaliasing pointer. The library can,
  4265. for instance, store the base address of the coarray in the token,
  4266. some handle or a more complicated struct. The library may also
  4267. store the array descriptor DESC when its rank is non-zero.
  4268. For lock types, the value shall only used for checking the
  4269. allocation status. Note that for critical blocks, the locking is
  4270. only required on one image; in the locking statement, the processor
  4271. shall always pass an image index of one for critical-block lock
  4272. variables ('CAF_REGTYPE_CRITICAL'). For lock types and
  4273. critical-block variables, the initial value shall be unlocked (or,
  4274. respecitively, not in critical section) such as the value false;
  4275. for event types, the initial state should be no event, e.g. zero.
  4276. 
  4277. File: gfortran.info, Node: _gfortran_caf_deregister, Next: _gfortran_caf_is_present, Prev: _gfortran_caf_register, Up: Function ABI Documentation
  4278. 8.2.9 '_gfortran_caf_deregister' -- Deregistering coarrays
  4279. ----------------------------------------------------------
  4280. _Description_:
  4281. Called to free or deregister the memory of a coarray; the processor
  4282. calls this function for automatic and explicit deallocation. In
  4283. case of an error, this function shall fail with an error message,
  4284. unless the STAT variable is not null. The library is only expected
  4285. to free memory it allocated itself during a call to
  4286. '_gfortran_caf_register'.
  4287. _Syntax_:
  4288. 'void caf_deregister (caf_token_t *token, caf_deregister_t type,
  4289. int *stat, char *errmsg, int errmsg_len)'
  4290. _Arguments_:
  4291. TOKEN the token to free.
  4292. TYPE the type of action to take for the coarray. A
  4293. 'CAF_DEREGTYPE_COARRAY_DEALLOCATE_ONLY' is
  4294. allowed only for allocatable or pointer
  4295. components of derived type coarrays. The action
  4296. only deallocates the local memory without
  4297. deleting the token.
  4298. STAT intent(out) Stores the STAT=; may be NULL
  4299. ERRMSG intent(out) When an error occurs, this will be
  4300. set to an error message; may be NULL
  4301. ERRMSG_LEN the buffer size of errmsg.
  4302. _NOTES_
  4303. For nonalloatable coarrays this function is never called. If a
  4304. cleanup is required, it has to be handled via the finish, stop and
  4305. error stop functions, and via destructors.
  4306. 
  4307. File: gfortran.info, Node: _gfortran_caf_is_present, Next: _gfortran_caf_send, Prev: _gfortran_caf_deregister, Up: Function ABI Documentation
  4308. 8.2.10 '_gfortran_caf_is_present' -- Query whether an allocatable or pointer component in a derived type coarray is allocated
  4309. -----------------------------------------------------------------------------------------------------------------------------
  4310. _Description_:
  4311. Used to query the coarray library whether an allocatable component
  4312. in a derived type coarray is allocated on a remote image.
  4313. _Syntax_:
  4314. 'void _gfortran_caf_is_present (caf_token_t token, int image_index,
  4315. gfc_reference_t *ref)'
  4316. _Arguments_:
  4317. TOKEN An opaque pointer identifying the coarray.
  4318. IMAGE_INDEX The ID of the remote image; must be a positive
  4319. number.
  4320. REF A chain of references to address the allocatable
  4321. or pointer component in the derived type
  4322. coarray. The object reference needs to be a
  4323. scalar or a full array reference, respectively.
  4324. 
  4325. File: gfortran.info, Node: _gfortran_caf_send, Next: _gfortran_caf_get, Prev: _gfortran_caf_is_present, Up: Function ABI Documentation
  4326. 8.2.11 '_gfortran_caf_send' -- Sending data from a local image to a remote image
  4327. --------------------------------------------------------------------------------
  4328. _Description_:
  4329. Called to send a scalar, an array section or a whole array from a
  4330. local to a remote image identified by the image_index.
  4331. _Syntax_:
  4332. 'void _gfortran_caf_send (caf_token_t token, size_t offset, int
  4333. image_index, gfc_descriptor_t *dest, caf_vector_t *dst_vector,
  4334. gfc_descriptor_t *src, int dst_kind, int src_kind, bool
  4335. may_require_tmp, int *stat)'
  4336. _Arguments_:
  4337. TOKEN intent(in) An opaque pointer identifying the
  4338. coarray.
  4339. OFFSET intent(in) By which amount of bytes the actual
  4340. data is shifted compared to the base address of
  4341. the coarray.
  4342. IMAGE_INDEX intent(in) The ID of the remote image; must be a
  4343. positive number.
  4344. DEST intent(in) Array descriptor for the remote image
  4345. for the bounds and the size. The 'base_addr'
  4346. shall not be accessed.
  4347. DST_VECTOR intent(in) If not NULL, it contains the vector
  4348. subscript of the destination array; the values
  4349. are relative to the dimension triplet of the
  4350. dest argument.
  4351. SRC intent(in) Array descriptor of the local array
  4352. to be transferred to the remote image
  4353. DST_KIND intent(in) Kind of the destination argument
  4354. SRC_KIND intent(in) Kind of the source argument
  4355. MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
  4356. known at compile time that the DEST and SRC
  4357. either cannot overlap or overlap (fully or
  4358. partially) such that walking SRC and DEST in
  4359. element wise element order (honoring the stride
  4360. value) will not lead to wrong results.
  4361. Otherwise, the value is 'true'.
  4362. STAT intent(out) when non-NULL give the result of the
  4363. operation, i.e., zero on success and non-zero on
  4364. error. When NULL and an error occurs, then an
  4365. error message is printed and the program is
  4366. terminated.
  4367. _NOTES_
  4368. It is permitted to have IMAGE_INDEX equal the current image; the
  4369. memory of the send-to and the send-from might (partially) overlap
  4370. in that case. The implementation has to take care that it handles
  4371. this case, e.g. using 'memmove' which handles (partially)
  4372. overlapping memory. If MAY_REQUIRE_TMP is true, the library might
  4373. additionally create a temporary variable, unless additional checks
  4374. show that this is not required (e.g. because walking backward is
  4375. possible or because both arrays are contiguous and 'memmove' takes
  4376. care of overlap issues).
  4377. Note that the assignment of a scalar to an array is permitted. In
  4378. addition, the library has to handle numeric-type conversion and for
  4379. strings, padding and different character kinds.
  4380. 
  4381. File: gfortran.info, Node: _gfortran_caf_get, Next: _gfortran_caf_sendget, Prev: _gfortran_caf_send, Up: Function ABI Documentation
  4382. 8.2.12 '_gfortran_caf_get' -- Getting data from a remote image
  4383. --------------------------------------------------------------
  4384. _Description_:
  4385. Called to get an array section or a whole array from a remote,
  4386. image identified by the image_index.
  4387. _Syntax_:
  4388. 'void _gfortran_caf_get (caf_token_t token, size_t offset, int
  4389. image_index, gfc_descriptor_t *src, caf_vector_t *src_vector,
  4390. gfc_descriptor_t *dest, int src_kind, int dst_kind, bool
  4391. may_require_tmp, int *stat)'
  4392. _Arguments_:
  4393. TOKEN intent(in) An opaque pointer identifying the
  4394. coarray.
  4395. OFFSET intent(in) By which amount of bytes the actual
  4396. data is shifted compared to the base address of
  4397. the coarray.
  4398. IMAGE_INDEX intent(in) The ID of the remote image; must be a
  4399. positive number.
  4400. DEST intent(out) Array descriptor of the local array
  4401. to store the data retrieved from the remote
  4402. image
  4403. SRC intent(in) Array descriptor for the remote image
  4404. for the bounds and the size. The 'base_addr'
  4405. shall not be accessed.
  4406. SRC_VECTOR intent(in) If not NULL, it contains the vector
  4407. subscript of the source array; the values are
  4408. relative to the dimension triplet of the SRC
  4409. argument.
  4410. DST_KIND intent(in) Kind of the destination argument
  4411. SRC_KIND intent(in) Kind of the source argument
  4412. MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
  4413. known at compile time that the DEST and SRC
  4414. either cannot overlap or overlap (fully or
  4415. partially) such that walking SRC and DEST in
  4416. element wise element order (honoring the stride
  4417. value) will not lead to wrong results.
  4418. Otherwise, the value is 'true'.
  4419. STAT intent(out) When non-NULL give the result of the
  4420. operation, i.e., zero on success and non-zero on
  4421. error. When NULL and an error occurs, then an
  4422. error message is printed and the program is
  4423. terminated.
  4424. _NOTES_
  4425. It is permitted to have IMAGE_INDEX equal the current image; the
  4426. memory of the send-to and the send-from might (partially) overlap
  4427. in that case. The implementation has to take care that it handles
  4428. this case, e.g. using 'memmove' which handles (partially)
  4429. overlapping memory. If MAY_REQUIRE_TMP is true, the library might
  4430. additionally create a temporary variable, unless additional checks
  4431. show that this is not required (e.g. because walking backward is
  4432. possible or because both arrays are contiguous and 'memmove' takes
  4433. care of overlap issues).
  4434. Note that the library has to handle numeric-type conversion and for
  4435. strings, padding and different character kinds.
  4436. 
  4437. File: gfortran.info, Node: _gfortran_caf_sendget, Next: _gfortran_caf_send_by_ref, Prev: _gfortran_caf_get, Up: Function ABI Documentation
  4438. 8.2.13 '_gfortran_caf_sendget' -- Sending data between remote images
  4439. --------------------------------------------------------------------
  4440. _Description_:
  4441. Called to send a scalar, an array section or a whole array from a
  4442. remote image identified by the SRC_IMAGE_INDEX to a remote image
  4443. identified by the DST_IMAGE_INDEX.
  4444. _Syntax_:
  4445. 'void _gfortran_caf_sendget (caf_token_t dst_token, size_t
  4446. dst_offset, int dst_image_index, gfc_descriptor_t *dest,
  4447. caf_vector_t *dst_vector, caf_token_t src_token, size_t src_offset,
  4448. int src_image_index, gfc_descriptor_t *src, caf_vector_t
  4449. *src_vector, int dst_kind, int src_kind, bool may_require_tmp, int
  4450. *stat)'
  4451. _Arguments_:
  4452. DST_TOKEN intent(in) An opaque pointer identifying the
  4453. destination coarray.
  4454. DST_OFFSET intent(in) By which amount of bytes the actual
  4455. data is shifted compared to the base address of
  4456. the destination coarray.
  4457. DST_IMAGE_INDEXintent(in) The ID of the destination remote
  4458. image; must be a positive number.
  4459. DEST intent(in) Array descriptor for the destination
  4460. remote image for the bounds and the size. The
  4461. 'base_addr' shall not be accessed.
  4462. DST_VECTOR intent(int) If not NULL, it contains the vector
  4463. subscript of the destination array; the values
  4464. are relative to the dimension triplet of the
  4465. DEST argument.
  4466. SRC_TOKEN intent(in) An opaque pointer identifying the
  4467. source coarray.
  4468. SRC_OFFSET intent(in) By which amount of bytes the actual
  4469. data is shifted compared to the base address of
  4470. the source coarray.
  4471. SRC_IMAGE_INDEXintent(in) The ID of the source remote image;
  4472. must be a positive number.
  4473. SRC intent(in) Array descriptor of the local array
  4474. to be transferred to the remote image.
  4475. SRC_VECTOR intent(in) Array descriptor of the local array
  4476. to be transferred to the remote image
  4477. DST_KIND intent(in) Kind of the destination argument
  4478. SRC_KIND intent(in) Kind of the source argument
  4479. MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
  4480. known at compile time that the DEST and SRC
  4481. either cannot overlap or overlap (fully or
  4482. partially) such that walking SRC and DEST in
  4483. element wise element order (honoring the stride
  4484. value) will not lead to wrong results.
  4485. Otherwise, the value is 'true'.
  4486. STAT intent(out) when non-NULL give the result of the
  4487. operation, i.e., zero on success and non-zero on
  4488. error. When NULL and an error occurs, then an
  4489. error message is printed and the program is
  4490. terminated.
  4491. _NOTES_
  4492. It is permitted to have the same image index for both
  4493. SRC_IMAGE_INDEX and DST_IMAGE_INDEX; the memory of the send-to and
  4494. the send-from might (partially) overlap in that case. The
  4495. implementation has to take care that it handles this case, e.g.
  4496. using 'memmove' which handles (partially) overlapping memory. If
  4497. MAY_REQUIRE_TMP is true, the library might additionally create a
  4498. temporary variable, unless additional checks show that this is not
  4499. required (e.g. because walking backward is possible or because
  4500. both arrays are contiguous and 'memmove' takes care of overlap
  4501. issues).
  4502. Note that the assignment of a scalar to an array is permitted. In
  4503. addition, the library has to handle numeric-type conversion and for
  4504. strings, padding and different character kinds.
  4505. 
  4506. File: gfortran.info, Node: _gfortran_caf_send_by_ref, Next: _gfortran_caf_get_by_ref, Prev: _gfortran_caf_sendget, Up: Function ABI Documentation
  4507. 8.2.14 '_gfortran_caf_send_by_ref' -- Sending data from a local image to a remote image with enhanced referencing options
  4508. -------------------------------------------------------------------------------------------------------------------------
  4509. _Description_:
  4510. Called to send a scalar, an array section or a whole array from a
  4511. local to a remote image identified by the IMAGE_INDEX.
  4512. _Syntax_:
  4513. 'void _gfortran_caf_send_by_ref (caf_token_t token, int
  4514. image_index, gfc_descriptor_t *src, caf_reference_t *refs, int
  4515. dst_kind, int src_kind, bool may_require_tmp, bool
  4516. dst_reallocatable, int *stat)'
  4517. _Arguments_:
  4518. TOKEN intent(in) An opaque pointer identifying the
  4519. coarray.
  4520. IMAGE_INDEX intent(in) The ID of the remote image; must be a
  4521. positive number.
  4522. SRC intent(in) Array descriptor of the local array
  4523. to be transferred to the remote image
  4524. REFS intent(in) The references on the remote array to
  4525. store the data given by src. Guaranteed to have
  4526. at least one entry.
  4527. DST_KIND intent(in) Kind of the destination argument
  4528. SRC_KIND intent(in) Kind of the source argument
  4529. MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
  4530. known at compile time that the DEST and SRC
  4531. either cannot overlap or overlap (fully or
  4532. partially) such that walking SRC and DEST in
  4533. element wise element order (honoring the stride
  4534. value) will not lead to wrong results.
  4535. Otherwise, the value is 'true'.
  4536. DST_REALLOCATABLEintent(in) Set when the destination is of
  4537. allocatable or pointer type and the refs will
  4538. allow reallocation, i.e., the ref is a full
  4539. array or component ref.
  4540. STAT intent(out) When non-'NULL' give the result of
  4541. the operation, i.e., zero on success and
  4542. non-zero on error. When 'NULL' and an error
  4543. occurs, then an error message is printed and the
  4544. program is terminated.
  4545. _NOTES_
  4546. It is permitted to have IMAGE_INDEX equal the current image; the
  4547. memory of the send-to and the send-from might (partially) overlap
  4548. in that case. The implementation has to take care that it handles
  4549. this case, e.g. using 'memmove' which handles (partially)
  4550. overlapping memory. If MAY_REQUIRE_TMP is true, the library might
  4551. additionally create a temporary variable, unless additional checks
  4552. show that this is not required (e.g. because walking backward is
  4553. possible or because both arrays are contiguous and 'memmove' takes
  4554. care of overlap issues).
  4555. Note that the assignment of a scalar to an array is permitted. In
  4556. addition, the library has to handle numeric-type conversion and for
  4557. strings, padding and different character kinds.
  4558. Because of the more complicated references possible some operations
  4559. may be unsupported by certain libraries. The library is expected
  4560. to issue a precise error message why the operation is not
  4561. permitted.
  4562. 
  4563. 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
  4564. 8.2.15 '_gfortran_caf_get_by_ref' -- Getting data from a remote image using enhanced references
  4565. -----------------------------------------------------------------------------------------------
  4566. _Description_:
  4567. Called to get a scalar, an array section or a whole array from a
  4568. remote image identified by the IMAGE_INDEX.
  4569. _Syntax_:
  4570. 'void _gfortran_caf_get_by_ref (caf_token_t token, int image_index,
  4571. caf_reference_t *refs, gfc_descriptor_t *dst, int dst_kind, int
  4572. src_kind, bool may_require_tmp, bool dst_reallocatable, int *stat)'
  4573. _Arguments_:
  4574. TOKEN intent(in) An opaque pointer identifying the
  4575. coarray.
  4576. IMAGE_INDEX intent(in) The ID of the remote image; must be a
  4577. positive number.
  4578. REFS intent(in) The references to apply to the remote
  4579. structure to get the data.
  4580. DST intent(in) Array descriptor of the local array
  4581. to store the data transferred from the remote
  4582. image. May be reallocated where needed and when
  4583. DST_REALLOCATABLE allows it.
  4584. DST_KIND intent(in) Kind of the destination argument
  4585. SRC_KIND intent(in) Kind of the source argument
  4586. MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
  4587. known at compile time that the DEST and SRC
  4588. either cannot overlap or overlap (fully or
  4589. partially) such that walking SRC and DEST in
  4590. element wise element order (honoring the stride
  4591. value) will not lead to wrong results.
  4592. Otherwise, the value is 'true'.
  4593. DST_REALLOCATABLEintent(in) Set when DST is of allocatable or
  4594. pointer type and its refs allow reallocation,
  4595. i.e., the full array or a component is
  4596. referenced.
  4597. STAT intent(out) When non-'NULL' give the result of
  4598. the operation, i.e., zero on success and
  4599. non-zero on error. When 'NULL' and an error
  4600. occurs, then an error message is printed and the
  4601. program is terminated.
  4602. _NOTES_
  4603. It is permitted to have 'image_index' equal the current image; the
  4604. memory of the send-to and the send-from might (partially) overlap
  4605. in that case. The implementation has to take care that it handles
  4606. this case, e.g. using 'memmove' which handles (partially)
  4607. overlapping memory. If MAY_REQUIRE_TMP is true, the library might
  4608. additionally create a temporary variable, unless additional checks
  4609. show that this is not required (e.g. because walking backward is
  4610. possible or because both arrays are contiguous and 'memmove' takes
  4611. care of overlap issues).
  4612. Note that the library has to handle numeric-type conversion and for
  4613. strings, padding and different character kinds.
  4614. Because of the more complicated references possible some operations
  4615. may be unsupported by certain libraries. The library is expected
  4616. to issue a precise error message why the operation is not
  4617. permitted.
  4618. 
  4619. File: gfortran.info, Node: _gfortran_caf_sendget_by_ref, Next: _gfortran_caf_lock, Prev: _gfortran_caf_get_by_ref, Up: Function ABI Documentation
  4620. 8.2.16 '_gfortran_caf_sendget_by_ref' -- Sending data between remote images using enhanced references on both sides
  4621. -------------------------------------------------------------------------------------------------------------------
  4622. _Description_:
  4623. Called to send a scalar, an array section or a whole array from a
  4624. remote image identified by the SRC_IMAGE_INDEX to a remote image
  4625. identified by the DST_IMAGE_INDEX.
  4626. _Syntax_:
  4627. 'void _gfortran_caf_sendget_by_ref (caf_token_t dst_token, int
  4628. dst_image_index, caf_reference_t *dst_refs, caf_token_t src_token,
  4629. int src_image_index, caf_reference_t *src_refs, int dst_kind, int
  4630. src_kind, bool may_require_tmp, int *dst_stat, int *src_stat)'
  4631. _Arguments_:
  4632. DST_TOKEN intent(in) An opaque pointer identifying the
  4633. destination coarray.
  4634. DST_IMAGE_INDEXintent(in) The ID of the destination remote
  4635. image; must be a positive number.
  4636. DST_REFS intent(in) The references on the remote array to
  4637. store the data given by the source. Guaranteed
  4638. to have at least one entry.
  4639. SRC_TOKEN intent(in) An opaque pointer identifying the
  4640. source coarray.
  4641. SRC_IMAGE_INDEXintent(in) The ID of the source remote image;
  4642. must be a positive number.
  4643. SRC_REFS intent(in) The references to apply to the remote
  4644. structure to get the data.
  4645. DST_KIND intent(in) Kind of the destination argument
  4646. SRC_KIND intent(in) Kind of the source argument
  4647. MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
  4648. known at compile time that the DEST and SRC
  4649. either cannot overlap or overlap (fully or
  4650. partially) such that walking SRC and DEST in
  4651. element wise element order (honoring the stride
  4652. value) will not lead to wrong results.
  4653. Otherwise, the value is 'true'.
  4654. DST_STAT intent(out) when non-'NULL' give the result of
  4655. the send-operation, i.e., zero on success and
  4656. non-zero on error. When 'NULL' and an error
  4657. occurs, then an error message is printed and the
  4658. program is terminated.
  4659. SRC_STAT intent(out) When non-'NULL' give the result of
  4660. the get-operation, i.e., zero on success and
  4661. non-zero on error. When 'NULL' and an error
  4662. occurs, then an error message is printed and the
  4663. program is terminated.
  4664. _NOTES_
  4665. It is permitted to have the same image index for both
  4666. SRC_IMAGE_INDEX and DST_IMAGE_INDEX; the memory of the send-to and
  4667. the send-from might (partially) overlap in that case. The
  4668. implementation has to take care that it handles this case, e.g.
  4669. using 'memmove' which handles (partially) overlapping memory. If
  4670. MAY_REQUIRE_TMP is true, the library might additionally create a
  4671. temporary variable, unless additional checks show that this is not
  4672. required (e.g. because walking backward is possible or because
  4673. both arrays are contiguous and 'memmove' takes care of overlap
  4674. issues).
  4675. Note that the assignment of a scalar to an array is permitted. In
  4676. addition, the library has to handle numeric-type conversion and for
  4677. strings, padding and different character kinds.
  4678. Because of the more complicated references possible some operations
  4679. may be unsupported by certain libraries. The library is expected
  4680. to issue a precise error message why the operation is not
  4681. permitted.
  4682. 
  4683. File: gfortran.info, Node: _gfortran_caf_lock, Next: _gfortran_caf_unlock, Prev: _gfortran_caf_sendget_by_ref, Up: Function ABI Documentation
  4684. 8.2.17 '_gfortran_caf_lock' -- Locking a lock variable
  4685. ------------------------------------------------------
  4686. _Description_:
  4687. Acquire a lock on the given image on a scalar locking variable or
  4688. for the given array element for an array-valued variable. If the
  4689. AQUIRED_LOCK is 'NULL', the function returns after having obtained
  4690. the lock. If it is non-'NULL', then ACQUIRED_LOCK is assigned the
  4691. value true (one) when the lock could be obtained and false (zero)
  4692. otherwise. Locking a lock variable which has already been locked
  4693. by the same image is an error.
  4694. _Syntax_:
  4695. 'void _gfortran_caf_lock (caf_token_t token, size_t index, int
  4696. image_index, int *aquired_lock, int *stat, char *errmsg, int
  4697. errmsg_len)'
  4698. _Arguments_:
  4699. TOKEN intent(in) An opaque pointer identifying the
  4700. coarray.
  4701. INDEX intent(in) Array index; first array index is 0.
  4702. For scalars, it is always 0.
  4703. IMAGE_INDEX intent(in) The ID of the remote image; must be a
  4704. positive number.
  4705. AQUIRED_LOCKintent(out) If not NULL, it returns whether lock
  4706. could be obtained.
  4707. STAT intent(out) Stores the STAT=; may be NULL.
  4708. ERRMSG intent(out) When an error occurs, this will be
  4709. set to an error message; may be NULL.
  4710. ERRMSG_LEN intent(in) the buffer size of errmsg
  4711. _NOTES_
  4712. This function is also called for critical blocks; for those, the
  4713. array index is always zero and the image index is one. Libraries
  4714. are permitted to use other images for critical-block locking
  4715. variables.
  4716. 
  4717. File: gfortran.info, Node: _gfortran_caf_unlock, Next: _gfortran_caf_event_post, Prev: _gfortran_caf_lock, Up: Function ABI Documentation
  4718. 8.2.18 '_gfortran_caf_lock' -- Unlocking a lock variable
  4719. --------------------------------------------------------
  4720. _Description_:
  4721. Release a lock on the given image on a scalar locking variable or
  4722. for the given array element for an array-valued variable.
  4723. Unlocking a lock variable which is unlocked or has been locked by a
  4724. different image is an error.
  4725. _Syntax_:
  4726. 'void _gfortran_caf_unlock (caf_token_t token, size_t index, int
  4727. image_index, int *stat, char *errmsg, int errmsg_len)'
  4728. _Arguments_:
  4729. TOKEN intent(in) An opaque pointer identifying the
  4730. coarray.
  4731. INDEX intent(in) Array index; first array index is 0.
  4732. For scalars, it is always 0.
  4733. IMAGE_INDEX intent(in) The ID of the remote image; must be a
  4734. positive number.
  4735. STAT intent(out) For allocatable coarrays, stores the
  4736. STAT=; may be NULL.
  4737. ERRMSG intent(out) When an error occurs, this will be
  4738. set to an error message; may be NULL.
  4739. ERRMSG_LEN intent(in) the buffer size of errmsg
  4740. _NOTES_
  4741. This function is also called for critical block; for those, the
  4742. array index is always zero and the image index is one. Libraries
  4743. are permitted to use other images for critical-block locking
  4744. variables.
  4745. 
  4746. File: gfortran.info, Node: _gfortran_caf_event_post, Next: _gfortran_caf_event_wait, Prev: _gfortran_caf_unlock, Up: Function ABI Documentation
  4747. 8.2.19 '_gfortran_caf_event_post' -- Post an event
  4748. --------------------------------------------------
  4749. _Description_:
  4750. Increment the event count of the specified event variable.
  4751. _Syntax_:
  4752. 'void _gfortran_caf_event_post (caf_token_t token, size_t index,
  4753. int image_index, int *stat, char *errmsg, int errmsg_len)'
  4754. _Arguments_:
  4755. TOKEN intent(in) An opaque pointer identifying the
  4756. coarray.
  4757. INDEX intent(in) Array index; first array index is 0.
  4758. For scalars, it is always 0.
  4759. IMAGE_INDEX intent(in) The ID of the remote image; must be a
  4760. positive number; zero indicates the current
  4761. image, when accessed noncoindexed.
  4762. STAT intent(out) Stores the STAT=; may be NULL.
  4763. ERRMSG intent(out) When an error occurs, this will be
  4764. set to an error message; may be NULL.
  4765. ERRMSG_LEN intent(in) the buffer size of errmsg
  4766. _NOTES_
  4767. This acts like an atomic add of one to the remote image's event
  4768. variable. The statement is an image-control statement but does not
  4769. imply sync memory. Still, all preceeding push communications of
  4770. this image to the specified remote image have to be completed
  4771. before 'event_wait' on the remote image returns.
  4772. 
  4773. File: gfortran.info, Node: _gfortran_caf_event_wait, Next: _gfortran_caf_event_query, Prev: _gfortran_caf_event_post, Up: Function ABI Documentation
  4774. 8.2.20 '_gfortran_caf_event_wait' -- Wait that an event occurred
  4775. ----------------------------------------------------------------
  4776. _Description_:
  4777. Wait until the event count has reached at least the specified
  4778. UNTIL_COUNT; if so, atomically decrement the event variable by this
  4779. amount and return.
  4780. _Syntax_:
  4781. 'void _gfortran_caf_event_wait (caf_token_t token, size_t index,
  4782. int until_count, int *stat, char *errmsg, int errmsg_len)'
  4783. _Arguments_:
  4784. TOKEN intent(in) An opaque pointer identifying the
  4785. coarray.
  4786. INDEX intent(in) Array index; first array index is 0.
  4787. For scalars, it is always 0.
  4788. UNTIL_COUNT intent(in) The number of events which have to be
  4789. available before the function returns.
  4790. STAT intent(out) Stores the STAT=; may be NULL.
  4791. ERRMSG intent(out) When an error occurs, this will be
  4792. set to an error message; may be NULL.
  4793. ERRMSG_LEN intent(in) the buffer size of errmsg
  4794. _NOTES_
  4795. This function only operates on a local coarray. It acts like a
  4796. loop checking atomically the value of the event variable, breaking
  4797. if the value is greater or equal the requested number of counts.
  4798. Before the function returns, the event variable has to be
  4799. decremented by the requested UNTIL_COUNT value. A possible
  4800. implementation would be a busy loop for a certain number of spins
  4801. (possibly depending on the number of threads relative to the number
  4802. of available cores) followed by another waiting strategy such as a
  4803. sleeping wait (possibly with an increasing number of sleep time)
  4804. or, if possible, a futex wait.
  4805. The statement is an image-control statement but does not imply sync
  4806. memory. Still, all preceeding push communications of this image to
  4807. the specified remote image have to be completed before 'event_wait'
  4808. on the remote image returns.
  4809. 
  4810. File: gfortran.info, Node: _gfortran_caf_event_query, Next: _gfortran_caf_sync_all, Prev: _gfortran_caf_event_wait, Up: Function ABI Documentation
  4811. 8.2.21 '_gfortran_caf_event_query' -- Query event count
  4812. -------------------------------------------------------
  4813. _Description_:
  4814. Return the event count of the specified event variable.
  4815. _Syntax_:
  4816. 'void _gfortran_caf_event_query (caf_token_t token, size_t index,
  4817. int image_index, int *count, int *stat)'
  4818. _Arguments_:
  4819. TOKEN intent(in) An opaque pointer identifying the
  4820. coarray.
  4821. INDEX intent(in) Array index; first array index is 0.
  4822. For scalars, it is always 0.
  4823. IMAGE_INDEX intent(in) The ID of the remote image; must be a
  4824. positive number; zero indicates the current
  4825. image when accessed noncoindexed.
  4826. COUNT intent(out) The number of events currently
  4827. posted to the event variable.
  4828. STAT intent(out) Stores the STAT=; may be NULL.
  4829. _NOTES_
  4830. The typical use is to check the local event variable to only call
  4831. 'event_wait' when the data is available. However, a coindexed
  4832. variable is permitted; there is no ordering or synchronization
  4833. implied. It acts like an atomic fetch of the value of the event
  4834. variable.
  4835. 
  4836. File: gfortran.info, Node: _gfortran_caf_sync_all, Next: _gfortran_caf_sync_images, Prev: _gfortran_caf_event_query, Up: Function ABI Documentation
  4837. 8.2.22 '_gfortran_caf_sync_all' -- All-image barrier
  4838. ----------------------------------------------------
  4839. _Description_:
  4840. Synchronization of all images in the current team; the program only
  4841. continues on a given image after this function has been called on
  4842. all images of the current team. Additionally, it ensures that all
  4843. pending data transfers of previous segment have completed.
  4844. _Syntax_:
  4845. 'void _gfortran_caf_sync_all (int *stat, char *errmsg, int
  4846. errmsg_len)'
  4847. _Arguments_:
  4848. STAT intent(out) Stores the status STAT= and may be
  4849. NULL.
  4850. ERRMSG intent(out) When an error occurs, this will be
  4851. set to an error message; may be NULL.
  4852. ERRMSG_LEN intent(in) the buffer size of errmsg
  4853. 
  4854. File: gfortran.info, Node: _gfortran_caf_sync_images, Next: _gfortran_caf_sync_memory, Prev: _gfortran_caf_sync_all, Up: Function ABI Documentation
  4855. 8.2.23 '_gfortran_caf_sync_images' -- Barrier for selected images
  4856. -----------------------------------------------------------------
  4857. _Description_:
  4858. Synchronization between the specified images; the program only
  4859. continues on a given image after this function has been called on
  4860. all images specified for that image. Note that one image can wait
  4861. for all other images in the current team (e.g. via 'sync
  4862. images(*)') while those only wait for that specific image.
  4863. Additionally, 'sync images' ensures that all pending data transfers
  4864. of previous segments have completed.
  4865. _Syntax_:
  4866. 'void _gfortran_caf_sync_images (int count, int images[], int
  4867. *stat, char *errmsg, int errmsg_len)'
  4868. _Arguments_:
  4869. COUNT intent(in) The number of images which are
  4870. provided in the next argument. For a zero-sized
  4871. array, the value is zero. For 'sync images
  4872. (*)', the value is -1.
  4873. IMAGES intent(in) An array with the images provided by
  4874. the user. If COUNT is zero, a NULL pointer is
  4875. passed.
  4876. STAT intent(out) Stores the status STAT= and may be
  4877. NULL.
  4878. ERRMSG intent(out) When an error occurs, this will be
  4879. set to an error message; may be NULL.
  4880. ERRMSG_LEN intent(in) the buffer size of errmsg
  4881. 
  4882. File: gfortran.info, Node: _gfortran_caf_sync_memory, Next: _gfortran_caf_error_stop, Prev: _gfortran_caf_sync_images, Up: Function ABI Documentation
  4883. 8.2.24 '_gfortran_caf_sync_memory' -- Wait for completion of segment-memory operations
  4884. --------------------------------------------------------------------------------------
  4885. _Description_:
  4886. Acts as optimization barrier between different segments. It also
  4887. ensures that all pending memory operations of this image have been
  4888. completed.
  4889. _Syntax_:
  4890. 'void _gfortran_caf_sync_memory (int *stat, char *errmsg, int
  4891. errmsg_len)'
  4892. _Arguments_:
  4893. STAT intent(out) Stores the status STAT= and may be
  4894. NULL.
  4895. ERRMSG intent(out) When an error occurs, this will be
  4896. set to an error message; may be NULL.
  4897. ERRMSG_LEN intent(in) the buffer size of errmsg
  4898. _NOTE_ A simple implementation could be
  4899. '__asm__ __volatile__ ("":::"memory")' to prevent code movements.
  4900. 
  4901. File: gfortran.info, Node: _gfortran_caf_error_stop, Next: _gfortran_caf_error_stop_str, Prev: _gfortran_caf_sync_memory, Up: Function ABI Documentation
  4902. 8.2.25 '_gfortran_caf_error_stop' -- Error termination with exit code
  4903. ---------------------------------------------------------------------
  4904. _Description_:
  4905. Invoked for an 'ERROR STOP' statement which has an integer
  4906. argument. The function should terminate the program with the
  4907. specified exit code.
  4908. _Syntax_:
  4909. 'void _gfortran_caf_error_stop (int32_t error)'
  4910. _Arguments_:
  4911. ERROR intent(in) The exit status to be used.
  4912. 
  4913. File: gfortran.info, Node: _gfortran_caf_error_stop_str, Next: _gfortran_caf_fail_image, Prev: _gfortran_caf_error_stop, Up: Function ABI Documentation
  4914. 8.2.26 '_gfortran_caf_error_stop_str' -- Error termination with string
  4915. ----------------------------------------------------------------------
  4916. _Description_:
  4917. Invoked for an 'ERROR STOP' statement which has a string as
  4918. argument. The function should terminate the program with a
  4919. nonzero-exit code.
  4920. _Syntax_:
  4921. 'void _gfortran_caf_error_stop (const char *string, int32_t len)'
  4922. _Arguments_:
  4923. STRING intent(in) the error message (not zero
  4924. terminated)
  4925. LEN intent(in) the length of the string
  4926. 
  4927. File: gfortran.info, Node: _gfortran_caf_fail_image, Next: _gfortran_caf_atomic_define, Prev: _gfortran_caf_error_stop_str, Up: Function ABI Documentation
  4928. 8.2.27 '_gfortran_caf_fail_image' -- Mark the image failed and end its execution
  4929. --------------------------------------------------------------------------------
  4930. _Description_:
  4931. Invoked for an 'FAIL IMAGE' statement. The function should
  4932. terminate the current image.
  4933. _Syntax_:
  4934. 'void _gfortran_caf_fail_image ()'
  4935. _NOTES_
  4936. This function follows TS18508.
  4937. 
  4938. File: gfortran.info, Node: _gfortran_caf_atomic_define, Next: _gfortran_caf_atomic_ref, Prev: _gfortran_caf_fail_image, Up: Function ABI Documentation
  4939. 8.2.28 '_gfortran_caf_atomic_define' -- Atomic variable assignment
  4940. ------------------------------------------------------------------
  4941. _Description_:
  4942. Assign atomically a value to an integer or logical variable.
  4943. _Syntax_:
  4944. 'void _gfortran_caf_atomic_define (caf_token_t token, size_t
  4945. offset, int image_index, void *value, int *stat, int type, int
  4946. kind)'
  4947. _Arguments_:
  4948. TOKEN intent(in) An opaque pointer identifying the
  4949. coarray.
  4950. OFFSET intent(in) By which amount of bytes the actual
  4951. data is shifted compared to the base address of
  4952. the coarray.
  4953. IMAGE_INDEX intent(in) The ID of the remote image; must be a
  4954. positive number; zero indicates the current
  4955. image when used noncoindexed.
  4956. VALUE intent(in) the value to be assigned, passed by
  4957. reference
  4958. STAT intent(out) Stores the status STAT= and may be
  4959. NULL.
  4960. TYPE intent(in) The data type, i.e. 'BT_INTEGER' (1)
  4961. or 'BT_LOGICAL' (2).
  4962. KIND intent(in) The kind value (only 4; always 'int')
  4963. 
  4964. File: gfortran.info, Node: _gfortran_caf_atomic_ref, Next: _gfortran_caf_atomic_cas, Prev: _gfortran_caf_atomic_define, Up: Function ABI Documentation
  4965. 8.2.29 '_gfortran_caf_atomic_ref' -- Atomic variable reference
  4966. --------------------------------------------------------------
  4967. _Description_:
  4968. Reference atomically a value of a kind-4 integer or logical
  4969. variable.
  4970. _Syntax_:
  4971. 'void _gfortran_caf_atomic_ref (caf_token_t token, size_t offset,
  4972. int image_index, void *value, int *stat, int type, int kind)'
  4973. _Arguments_:
  4974. TOKEN intent(in) An opaque pointer identifying the
  4975. coarray.
  4976. OFFSET intent(in) By which amount of bytes the actual
  4977. data is shifted compared to the base address of
  4978. the coarray.
  4979. IMAGE_INDEX intent(in) The ID of the remote image; must be a
  4980. positive number; zero indicates the current
  4981. image when used noncoindexed.
  4982. VALUE intent(out) The variable assigned the atomically
  4983. referenced variable.
  4984. STAT intent(out) Stores the status STAT= and may be
  4985. NULL.
  4986. TYPE the data type, i.e. 'BT_INTEGER' (1) or
  4987. 'BT_LOGICAL' (2).
  4988. KIND The kind value (only 4; always 'int')
  4989. 
  4990. File: gfortran.info, Node: _gfortran_caf_atomic_cas, Next: _gfortran_caf_atomic_op, Prev: _gfortran_caf_atomic_ref, Up: Function ABI Documentation
  4991. 8.2.30 '_gfortran_caf_atomic_cas' -- Atomic compare and swap
  4992. ------------------------------------------------------------
  4993. _Description_:
  4994. Atomic compare and swap of a kind-4 integer or logical variable.
  4995. Assigns atomically the specified value to the atomic variable, if
  4996. the latter has the value specified by the passed condition value.
  4997. _Syntax_:
  4998. 'void _gfortran_caf_atomic_cas (caf_token_t token, size_t offset,
  4999. int image_index, void *old, void *compare, void *new_val, int
  5000. *stat, int type, int kind)'
  5001. _Arguments_:
  5002. TOKEN intent(in) An opaque pointer identifying the
  5003. coarray.
  5004. OFFSET intent(in) By which amount of bytes the actual
  5005. data is shifted compared to the base address of
  5006. the coarray.
  5007. IMAGE_INDEX intent(in) The ID of the remote image; must be a
  5008. positive number; zero indicates the current
  5009. image when used noncoindexed.
  5010. OLD intent(out) The value which the atomic variable
  5011. had just before the cas operation.
  5012. COMPARE intent(in) The value used for comparision.
  5013. NEW_VAL intent(in) The new value for the atomic
  5014. variable, assigned to the atomic variable, if
  5015. 'compare' equals the value of the atomic
  5016. variable.
  5017. STAT intent(out) Stores the status STAT= and may be
  5018. NULL.
  5019. TYPE intent(in) the data type, i.e. 'BT_INTEGER' (1)
  5020. or 'BT_LOGICAL' (2).
  5021. KIND intent(in) The kind value (only 4; always 'int')
  5022. 
  5023. File: gfortran.info, Node: _gfortran_caf_atomic_op, Next: _gfortran_caf_co_broadcast, Prev: _gfortran_caf_atomic_cas, Up: Function ABI Documentation
  5024. 8.2.31 '_gfortran_caf_atomic_op' -- Atomic operation
  5025. ----------------------------------------------------
  5026. _Description_:
  5027. Apply an operation atomically to an atomic integer or logical
  5028. variable. After the operation, OLD contains the value just before
  5029. the operation, which, respectively, adds (GFC_CAF_ATOMIC_ADD)
  5030. atomically the 'value' to the atomic integer variable or does a
  5031. bitwise AND, OR or exclusive OR between the atomic variable and
  5032. VALUE; the result is then stored in the atomic variable.
  5033. _Syntax_:
  5034. 'void _gfortran_caf_atomic_op (int op, caf_token_t token, size_t
  5035. offset, int image_index, void *value, void *old, int *stat, int
  5036. type, int kind)'
  5037. _Arguments_:
  5038. OP intent(in) the operation to be performed;
  5039. possible values 'GFC_CAF_ATOMIC_ADD' (1),
  5040. 'GFC_CAF_ATOMIC_AND' (2), 'GFC_CAF_ATOMIC_OR'
  5041. (3), 'GFC_CAF_ATOMIC_XOR' (4).
  5042. TOKEN intent(in) An opaque pointer identifying the
  5043. coarray.
  5044. OFFSET intent(in) By which amount of bytes the actual
  5045. data is shifted compared to the base address of
  5046. the coarray.
  5047. IMAGE_INDEX intent(in) The ID of the remote image; must be a
  5048. positive number; zero indicates the current
  5049. image when used noncoindexed.
  5050. OLD intent(out) The value which the atomic variable
  5051. had just before the atomic operation.
  5052. VAL intent(in) The new value for the atomic
  5053. variable, assigned to the atomic variable, if
  5054. 'compare' equals the value of the atomic
  5055. variable.
  5056. STAT intent(out) Stores the status STAT= and may be
  5057. NULL.
  5058. TYPE intent(in) the data type, i.e. 'BT_INTEGER' (1)
  5059. or 'BT_LOGICAL' (2)
  5060. KIND intent(in) the kind value (only 4; always 'int')
  5061. 
  5062. File: gfortran.info, Node: _gfortran_caf_co_broadcast, Next: _gfortran_caf_co_max, Prev: _gfortran_caf_atomic_op, Up: Function ABI Documentation
  5063. 8.2.32 '_gfortran_caf_co_broadcast' -- Sending data to all images
  5064. -----------------------------------------------------------------
  5065. _Description_:
  5066. Distribute a value from a given image to all other images in the
  5067. team. Has to be called collectively.
  5068. _Syntax_:
  5069. 'void _gfortran_caf_co_broadcast (gfc_descriptor_t *a, int
  5070. source_image, int *stat, char *errmsg, int errmsg_len)'
  5071. _Arguments_:
  5072. A intent(inout) An array descriptor with the data
  5073. to be broadcasted (on SOURCE_IMAGE) or to be
  5074. received (other images).
  5075. SOURCE_IMAGEintent(in) The ID of the image from which the
  5076. data should be broadcasted.
  5077. STAT intent(out) Stores the status STAT= and may be
  5078. NULL.
  5079. ERRMSG intent(out) When an error occurs, this will be
  5080. set to an error message; may be NULL.
  5081. ERRMSG_LEN intent(in) the buffer size of errmsg.
  5082. 
  5083. File: gfortran.info, Node: _gfortran_caf_co_max, Next: _gfortran_caf_co_min, Prev: _gfortran_caf_co_broadcast, Up: Function ABI Documentation
  5084. 8.2.33 '_gfortran_caf_co_max' -- Collective maximum reduction
  5085. -------------------------------------------------------------
  5086. _Description_:
  5087. Calculates for each array element of the variable A the maximum
  5088. value for that element in the current team; if RESULT_IMAGE has the
  5089. value 0, the result shall be stored on all images, otherwise, only
  5090. on the specified image. This function operates on numeric values
  5091. and character strings.
  5092. _Syntax_:
  5093. 'void _gfortran_caf_co_max (gfc_descriptor_t *a, int result_image,
  5094. int *stat, char *errmsg, int a_len, int errmsg_len)'
  5095. _Arguments_:
  5096. A intent(inout) An array descriptor for the data
  5097. to be processed. On the destination image(s)
  5098. the result overwrites the old content.
  5099. RESULT_IMAGEintent(in) The ID of the image to which the
  5100. reduced value should be copied to; if zero, it
  5101. has to be copied to all images.
  5102. STAT intent(out) Stores the status STAT= and may be
  5103. NULL.
  5104. ERRMSG intent(out) When an error occurs, this will be
  5105. set to an error message; may be NULL.
  5106. A_LEN intent(in) the string length of argument A
  5107. ERRMSG_LEN intent(in) the buffer size of errmsg
  5108. _NOTES_
  5109. If RESULT_IMAGE is nonzero, the data in the array descriptor A on
  5110. all images except of the specified one become undefined; hence, the
  5111. library may make use of this.
  5112. 
  5113. File: gfortran.info, Node: _gfortran_caf_co_min, Next: _gfortran_caf_co_sum, Prev: _gfortran_caf_co_max, Up: Function ABI Documentation
  5114. 8.2.34 '_gfortran_caf_co_min' -- Collective minimum reduction
  5115. -------------------------------------------------------------
  5116. _Description_:
  5117. Calculates for each array element of the variable A the minimum
  5118. value for that element in the current team; if RESULT_IMAGE has the
  5119. value 0, the result shall be stored on all images, otherwise, only
  5120. on the specified image. This function operates on numeric values
  5121. and character strings.
  5122. _Syntax_:
  5123. 'void _gfortran_caf_co_min (gfc_descriptor_t *a, int result_image,
  5124. int *stat, char *errmsg, int a_len, int errmsg_len)'
  5125. _Arguments_:
  5126. A intent(inout) An array descriptor for the data
  5127. to be processed. On the destination image(s)
  5128. the result overwrites the old content.
  5129. RESULT_IMAGEintent(in) The ID of the image to which the
  5130. reduced value should be copied to; if zero, it
  5131. has to be copied to all images.
  5132. STAT intent(out) Stores the status STAT= and may be
  5133. NULL.
  5134. ERRMSG intent(out) When an error occurs, this will be
  5135. set to an error message; may be NULL.
  5136. A_LEN intent(in) the string length of argument A
  5137. ERRMSG_LEN intent(in) the buffer size of errmsg
  5138. _NOTES_
  5139. If RESULT_IMAGE is nonzero, the data in the array descriptor A on
  5140. all images except of the specified one become undefined; hence, the
  5141. library may make use of this.
  5142. 
  5143. File: gfortran.info, Node: _gfortran_caf_co_sum, Next: _gfortran_caf_co_reduce, Prev: _gfortran_caf_co_min, Up: Function ABI Documentation
  5144. 8.2.35 '_gfortran_caf_co_sum' -- Collective summing reduction
  5145. -------------------------------------------------------------
  5146. _Description_:
  5147. Calculates for each array element of the variable A the sum of all
  5148. values for that element in the current team; if RESULT_IMAGE has
  5149. the value 0, the result shall be stored on all images, otherwise,
  5150. only on the specified image. This function operates on numeric
  5151. values only.
  5152. _Syntax_:
  5153. 'void _gfortran_caf_co_sum (gfc_descriptor_t *a, int result_image,
  5154. int *stat, char *errmsg, int errmsg_len)'
  5155. _Arguments_:
  5156. A intent(inout) An array descriptor with the data
  5157. to be processed. On the destination image(s)
  5158. the result overwrites the old content.
  5159. RESULT_IMAGEintent(in) The ID of the image to which the
  5160. reduced value should be copied to; if zero, it
  5161. has to be copied to all images.
  5162. STAT intent(out) Stores the status STAT= and may be
  5163. NULL.
  5164. ERRMSG intent(out) When an error occurs, this will be
  5165. set to an error message; may be NULL.
  5166. ERRMSG_LEN intent(in) the buffer size of errmsg
  5167. _NOTES_
  5168. If RESULT_IMAGE is nonzero, the data in the array descriptor A on
  5169. all images except of the specified one become undefined; hence, the
  5170. library may make use of this.
  5171. 
  5172. File: gfortran.info, Node: _gfortran_caf_co_reduce, Prev: _gfortran_caf_co_sum, Up: Function ABI Documentation
  5173. 8.2.36 '_gfortran_caf_co_reduce' -- Generic collective reduction
  5174. ----------------------------------------------------------------
  5175. _Description_:
  5176. Calculates for each array element of the variable A the reduction
  5177. value for that element in the current team; if RESULT_IMAGE has the
  5178. value 0, the result shall be stored on all images, otherwise, only
  5179. on the specified image. The OPR is a pure function doing a
  5180. mathematically commutative and associative operation.
  5181. The OPR_FLAGS denote the following; the values are bitwise ored.
  5182. 'GFC_CAF_BYREF' (1) if the result should be returned by reference;
  5183. 'GFC_CAF_HIDDENLEN' (2) whether the result and argument string
  5184. lengths shall be specified as hidden arguments; 'GFC_CAF_ARG_VALUE'
  5185. (4) whether the arguments shall be passed by value,
  5186. 'GFC_CAF_ARG_DESC' (8) whether the arguments shall be passed by
  5187. descriptor.
  5188. _Syntax_:
  5189. 'void _gfortran_caf_co_reduce (gfc_descriptor_t *a, void * (*opr)
  5190. (void *, void *), int opr_flags, int result_image, int *stat, char
  5191. *errmsg, int a_len, int errmsg_len)'
  5192. _Arguments_:
  5193. A intent(inout) An array descriptor with the data
  5194. to be processed. On the destination image(s)
  5195. the result overwrites the old content.
  5196. OPR intent(in) Function pointer to the reduction
  5197. function
  5198. OPR_FLAGS intent(in) Flags regarding the reduction
  5199. function
  5200. RESULT_IMAGEintent(in) The ID of the image to which the
  5201. reduced value should be copied to; if zero, it
  5202. has to be copied to all images.
  5203. STAT intent(out) Stores the status STAT= and may be
  5204. NULL.
  5205. ERRMSG intent(out) When an error occurs, this will be
  5206. set to an error message; may be NULL.
  5207. A_LEN intent(in) the string length of argument A
  5208. ERRMSG_LEN intent(in) the buffer size of errmsg
  5209. _NOTES_
  5210. If RESULT_IMAGE is nonzero, the data in the array descriptor A on
  5211. all images except of the specified one become undefined; hence, the
  5212. library may make use of this.
  5213. For character arguments, the result is passed as first argument,
  5214. followed by the result string length, next come the two string
  5215. arguments, followed by the two hidden string length arguments.
  5216. With C binding, there are no hidden arguments and by-reference
  5217. passing and either only a single character is passed or an array
  5218. descriptor.
  5219. 
  5220. File: gfortran.info, Node: Intrinsic Procedures, Next: Intrinsic Modules, Prev: Coarray Programming, Up: Top
  5221. 9 Intrinsic Procedures
  5222. **********************
  5223. * Menu:
  5224. * Introduction: Introduction to Intrinsics
  5225. * 'ABORT': ABORT, Abort the program
  5226. * 'ABS': ABS, Absolute value
  5227. * 'ACCESS': ACCESS, Checks file access modes
  5228. * 'ACHAR': ACHAR, Character in ASCII collating sequence
  5229. * 'ACOS': ACOS, Arccosine function
  5230. * 'ACOSD': ACOSD, Arccosine function, degrees
  5231. * 'ACOSH': ACOSH, Inverse hyperbolic cosine function
  5232. * 'ADJUSTL': ADJUSTL, Left adjust a string
  5233. * 'ADJUSTR': ADJUSTR, Right adjust a string
  5234. * 'AIMAG': AIMAG, Imaginary part of complex number
  5235. * 'AINT': AINT, Truncate to a whole number
  5236. * 'ALARM': ALARM, Set an alarm clock
  5237. * 'ALL': ALL, Determine if all values are true
  5238. * 'ALLOCATED': ALLOCATED, Status of allocatable entity
  5239. * 'AND': AND, Bitwise logical AND
  5240. * 'ANINT': ANINT, Nearest whole number
  5241. * 'ANY': ANY, Determine if any values are true
  5242. * 'ASIN': ASIN, Arcsine function
  5243. * 'ASIND': ASIND, Arcsine function, degrees
  5244. * 'ASINH': ASINH, Inverse hyperbolic sine function
  5245. * 'ASSOCIATED': ASSOCIATED, Status of a pointer or pointer/target pair
  5246. * 'ATAN': ATAN, Arctangent function
  5247. * 'ATAND': ATAND, Arctangent function, degrees
  5248. * 'ATAN2': ATAN2, Arctangent function
  5249. * 'ATAN2D': ATAN2D, Arctangent function, degrees
  5250. * 'ATANH': ATANH, Inverse hyperbolic tangent function
  5251. * 'ATOMIC_ADD': ATOMIC_ADD, Atomic ADD operation
  5252. * 'ATOMIC_AND': ATOMIC_AND, Atomic bitwise AND operation
  5253. * 'ATOMIC_CAS': ATOMIC_CAS, Atomic compare and swap
  5254. * 'ATOMIC_DEFINE': ATOMIC_DEFINE, Setting a variable atomically
  5255. * 'ATOMIC_FETCH_ADD': ATOMIC_FETCH_ADD, Atomic ADD operation with prior fetch
  5256. * 'ATOMIC_FETCH_AND': ATOMIC_FETCH_AND, Atomic bitwise AND operation with prior fetch
  5257. * 'ATOMIC_FETCH_OR': ATOMIC_FETCH_OR, Atomic bitwise OR operation with prior fetch
  5258. * 'ATOMIC_FETCH_XOR': ATOMIC_FETCH_XOR, Atomic bitwise XOR operation with prior fetch
  5259. * 'ATOMIC_OR': ATOMIC_OR, Atomic bitwise OR operation
  5260. * 'ATOMIC_REF': ATOMIC_REF, Obtaining the value of a variable atomically
  5261. * 'ATOMIC_XOR': ATOMIC_XOR, Atomic bitwise OR operation
  5262. * 'BACKTRACE': BACKTRACE, Show a backtrace
  5263. * 'BESSEL_J0': BESSEL_J0, Bessel function of the first kind of order 0
  5264. * 'BESSEL_J1': BESSEL_J1, Bessel function of the first kind of order 1
  5265. * 'BESSEL_JN': BESSEL_JN, Bessel function of the first kind
  5266. * 'BESSEL_Y0': BESSEL_Y0, Bessel function of the second kind of order 0
  5267. * 'BESSEL_Y1': BESSEL_Y1, Bessel function of the second kind of order 1
  5268. * 'BESSEL_YN': BESSEL_YN, Bessel function of the second kind
  5269. * 'BGE': BGE, Bitwise greater than or equal to
  5270. * 'BGT': BGT, Bitwise greater than
  5271. * 'BIT_SIZE': BIT_SIZE, Bit size inquiry function
  5272. * 'BLE': BLE, Bitwise less than or equal to
  5273. * 'BLT': BLT, Bitwise less than
  5274. * 'BTEST': BTEST, Bit test function
  5275. * 'C_ASSOCIATED': C_ASSOCIATED, Status of a C pointer
  5276. * 'C_F_POINTER': C_F_POINTER, Convert C into Fortran pointer
  5277. * 'C_F_PROCPOINTER': C_F_PROCPOINTER, Convert C into Fortran procedure pointer
  5278. * 'C_FUNLOC': C_FUNLOC, Obtain the C address of a procedure
  5279. * 'C_LOC': C_LOC, Obtain the C address of an object
  5280. * 'C_SIZEOF': C_SIZEOF, Size in bytes of an expression
  5281. * 'CEILING': CEILING, Integer ceiling function
  5282. * 'CHAR': CHAR, Integer-to-character conversion function
  5283. * 'CHDIR': CHDIR, Change working directory
  5284. * 'CHMOD': CHMOD, Change access permissions of files
  5285. * 'CMPLX': CMPLX, Complex conversion function
  5286. * 'CO_BROADCAST': CO_BROADCAST, Copy a value to all images the current set of images
  5287. * 'CO_MAX': CO_MAX, Maximal value on the current set of images
  5288. * 'CO_MIN': CO_MIN, Minimal value on the current set of images
  5289. * 'CO_REDUCE': CO_REDUCE, Reduction of values on the current set of images
  5290. * 'CO_SUM': CO_SUM, Sum of values on the current set of images
  5291. * 'COMMAND_ARGUMENT_COUNT': COMMAND_ARGUMENT_COUNT, Get number of command line arguments
  5292. * 'COMPILER_OPTIONS': COMPILER_OPTIONS, Options passed to the compiler
  5293. * 'COMPILER_VERSION': COMPILER_VERSION, Compiler version string
  5294. * 'COMPLEX': COMPLEX, Complex conversion function
  5295. * 'CONJG': CONJG, Complex conjugate function
  5296. * 'COS': COS, Cosine function
  5297. * 'COSD': COSD, Cosine function, degrees
  5298. * 'COSH': COSH, Hyperbolic cosine function
  5299. * 'COTAN': COTAN, Cotangent function
  5300. * 'COTAND': COTAND, Cotangent function, degrees
  5301. * 'COUNT': COUNT, Count occurrences of TRUE in an array
  5302. * 'CPU_TIME': CPU_TIME, CPU time subroutine
  5303. * 'CSHIFT': CSHIFT, Circular shift elements of an array
  5304. * 'CTIME': CTIME, Subroutine (or function) to convert a time into a string
  5305. * 'DATE_AND_TIME': DATE_AND_TIME, Date and time subroutine
  5306. * 'DBLE': DBLE, Double precision conversion function
  5307. * 'DCMPLX': DCMPLX, Double complex conversion function
  5308. * 'DIGITS': DIGITS, Significant digits function
  5309. * 'DIM': DIM, Positive difference
  5310. * 'DOT_PRODUCT': DOT_PRODUCT, Dot product function
  5311. * 'DPROD': DPROD, Double product function
  5312. * 'DREAL': DREAL, Double real part function
  5313. * 'DSHIFTL': DSHIFTL, Combined left shift
  5314. * 'DSHIFTR': DSHIFTR, Combined right shift
  5315. * 'DTIME': DTIME, Execution time subroutine (or function)
  5316. * 'EOSHIFT': EOSHIFT, End-off shift elements of an array
  5317. * 'EPSILON': EPSILON, Epsilon function
  5318. * 'ERF': ERF, Error function
  5319. * 'ERFC': ERFC, Complementary error function
  5320. * 'ERFC_SCALED': ERFC_SCALED, Exponentially-scaled complementary error function
  5321. * 'ETIME': ETIME, Execution time subroutine (or function)
  5322. * 'EVENT_QUERY': EVENT_QUERY, Query whether a coarray event has occurred
  5323. * 'EXECUTE_COMMAND_LINE': EXECUTE_COMMAND_LINE, Execute a shell command
  5324. * 'EXIT': EXIT, Exit the program with status.
  5325. * 'EXP': EXP, Exponential function
  5326. * 'EXPONENT': EXPONENT, Exponent function
  5327. * 'EXTENDS_TYPE_OF': EXTENDS_TYPE_OF, Query dynamic type for extension
  5328. * 'FDATE': FDATE, Subroutine (or function) to get the current time as a string
  5329. * 'FGET': FGET, Read a single character in stream mode from stdin
  5330. * 'FGETC': FGETC, Read a single character in stream mode
  5331. * 'FLOOR': FLOOR, Integer floor function
  5332. * 'FLUSH': FLUSH, Flush I/O unit(s)
  5333. * 'FNUM': FNUM, File number function
  5334. * 'FPUT': FPUT, Write a single character in stream mode to stdout
  5335. * 'FPUTC': FPUTC, Write a single character in stream mode
  5336. * 'FRACTION': FRACTION, Fractional part of the model representation
  5337. * 'FREE': FREE, Memory de-allocation subroutine
  5338. * 'FSEEK': FSEEK, Low level file positioning subroutine
  5339. * 'FSTAT': FSTAT, Get file status
  5340. * 'FTELL': FTELL, Current stream position
  5341. * 'GAMMA': GAMMA, Gamma function
  5342. * 'GERROR': GERROR, Get last system error message
  5343. * 'GETARG': GETARG, Get command line arguments
  5344. * 'GET_COMMAND': GET_COMMAND, Get the entire command line
  5345. * 'GET_COMMAND_ARGUMENT': GET_COMMAND_ARGUMENT, Get command line arguments
  5346. * 'GETCWD': GETCWD, Get current working directory
  5347. * 'GETENV': GETENV, Get an environmental variable
  5348. * 'GET_ENVIRONMENT_VARIABLE': GET_ENVIRONMENT_VARIABLE, Get an environmental variable
  5349. * 'GETGID': GETGID, Group ID function
  5350. * 'GETLOG': GETLOG, Get login name
  5351. * 'GETPID': GETPID, Process ID function
  5352. * 'GETUID': GETUID, User ID function
  5353. * 'GMTIME': GMTIME, Convert time to GMT info
  5354. * 'HOSTNM': HOSTNM, Get system host name
  5355. * 'HUGE': HUGE, Largest number of a kind
  5356. * 'HYPOT': HYPOT, Euclidean distance function
  5357. * 'IACHAR': IACHAR, Code in ASCII collating sequence
  5358. * 'IALL': IALL, Bitwise AND of array elements
  5359. * 'IAND': IAND, Bitwise logical and
  5360. * 'IANY': IANY, Bitwise OR of array elements
  5361. * 'IARGC': IARGC, Get the number of command line arguments
  5362. * 'IBCLR': IBCLR, Clear bit
  5363. * 'IBITS': IBITS, Bit extraction
  5364. * 'IBSET': IBSET, Set bit
  5365. * 'ICHAR': ICHAR, Character-to-integer conversion function
  5366. * 'IDATE': IDATE, Current local time (day/month/year)
  5367. * 'IEOR': IEOR, Bitwise logical exclusive or
  5368. * 'IERRNO': IERRNO, Function to get the last system error number
  5369. * 'IMAGE_INDEX': IMAGE_INDEX, Cosubscript to image index conversion
  5370. * 'INDEX': INDEX intrinsic, Position of a substring within a string
  5371. * 'INT': INT, Convert to integer type
  5372. * 'INT2': INT2, Convert to 16-bit integer type
  5373. * 'INT8': INT8, Convert to 64-bit integer type
  5374. * 'IOR': IOR, Bitwise logical or
  5375. * 'IPARITY': IPARITY, Bitwise XOR of array elements
  5376. * 'IRAND': IRAND, Integer pseudo-random number
  5377. * 'IS_IOSTAT_END': IS_IOSTAT_END, Test for end-of-file value
  5378. * 'IS_IOSTAT_EOR': IS_IOSTAT_EOR, Test for end-of-record value
  5379. * 'ISATTY': ISATTY, Whether a unit is a terminal device
  5380. * 'ISHFT': ISHFT, Shift bits
  5381. * 'ISHFTC': ISHFTC, Shift bits circularly
  5382. * 'ISNAN': ISNAN, Tests for a NaN
  5383. * 'ITIME': ITIME, Current local time (hour/minutes/seconds)
  5384. * 'KILL': KILL, Send a signal to a process
  5385. * 'KIND': KIND, Kind of an entity
  5386. * 'LBOUND': LBOUND, Lower dimension bounds of an array
  5387. * 'LCOBOUND': LCOBOUND, Lower codimension bounds of an array
  5388. * 'LEADZ': LEADZ, Number of leading zero bits of an integer
  5389. * 'LEN': LEN, Length of a character entity
  5390. * 'LEN_TRIM': LEN_TRIM, Length of a character entity without trailing blank characters
  5391. * 'LGE': LGE, Lexical greater than or equal
  5392. * 'LGT': LGT, Lexical greater than
  5393. * 'LINK': LINK, Create a hard link
  5394. * 'LLE': LLE, Lexical less than or equal
  5395. * 'LLT': LLT, Lexical less than
  5396. * 'LNBLNK': LNBLNK, Index of the last non-blank character in a string
  5397. * 'LOC': LOC, Returns the address of a variable
  5398. * 'LOG': LOG, Logarithm function
  5399. * 'LOG10': LOG10, Base 10 logarithm function
  5400. * 'LOG_GAMMA': LOG_GAMMA, Logarithm of the Gamma function
  5401. * 'LOGICAL': LOGICAL, Convert to logical type
  5402. * 'LONG': LONG, Convert to integer type
  5403. * 'LSHIFT': LSHIFT, Left shift bits
  5404. * 'LSTAT': LSTAT, Get file status
  5405. * 'LTIME': LTIME, Convert time to local time info
  5406. * 'MALLOC': MALLOC, Dynamic memory allocation function
  5407. * 'MASKL': MASKL, Left justified mask
  5408. * 'MASKR': MASKR, Right justified mask
  5409. * 'MATMUL': MATMUL, matrix multiplication
  5410. * 'MAX': MAX, Maximum value of an argument list
  5411. * 'MAXEXPONENT': MAXEXPONENT, Maximum exponent of a real kind
  5412. * 'MAXLOC': MAXLOC, Location of the maximum value within an array
  5413. * 'MAXVAL': MAXVAL, Maximum value of an array
  5414. * 'MCLOCK': MCLOCK, Time function
  5415. * 'MCLOCK8': MCLOCK8, Time function (64-bit)
  5416. * 'MERGE': MERGE, Merge arrays
  5417. * 'MERGE_BITS': MERGE_BITS, Merge of bits under mask
  5418. * 'MIN': MIN, Minimum value of an argument list
  5419. * 'MINEXPONENT': MINEXPONENT, Minimum exponent of a real kind
  5420. * 'MINLOC': MINLOC, Location of the minimum value within an array
  5421. * 'MINVAL': MINVAL, Minimum value of an array
  5422. * 'MOD': MOD, Remainder function
  5423. * 'MODULO': MODULO, Modulo function
  5424. * 'MOVE_ALLOC': MOVE_ALLOC, Move allocation from one object to another
  5425. * 'MVBITS': MVBITS, Move bits from one integer to another
  5426. * 'NEAREST': NEAREST, Nearest representable number
  5427. * 'NEW_LINE': NEW_LINE, New line character
  5428. * 'NINT': NINT, Nearest whole number
  5429. * 'NORM2': NORM2, Euclidean vector norm
  5430. * 'NOT': NOT, Logical negation
  5431. * 'NULL': NULL, Function that returns an disassociated pointer
  5432. * 'NUM_IMAGES': NUM_IMAGES, Number of images
  5433. * 'OR': OR, Bitwise logical OR
  5434. * 'PACK': PACK, Pack an array into an array of rank one
  5435. * 'PARITY': PARITY, Reduction with exclusive OR
  5436. * 'PERROR': PERROR, Print system error message
  5437. * 'POPCNT': POPCNT, Number of bits set
  5438. * 'POPPAR': POPPAR, Parity of the number of bits set
  5439. * 'PRECISION': PRECISION, Decimal precision of a real kind
  5440. * 'PRESENT': PRESENT, Determine whether an optional dummy argument is specified
  5441. * 'PRODUCT': PRODUCT, Product of array elements
  5442. * 'RADIX': RADIX, Base of a data model
  5443. * 'RAN': RAN, Real pseudo-random number
  5444. * 'RAND': RAND, Real pseudo-random number
  5445. * 'RANDOM_NUMBER': RANDOM_NUMBER, Pseudo-random number
  5446. * 'RANDOM_SEED': RANDOM_SEED, Initialize a pseudo-random number sequence
  5447. * 'RANGE': RANGE, Decimal exponent range
  5448. * 'RANK' : RANK, Rank of a data object
  5449. * 'REAL': REAL, Convert to real type
  5450. * 'RENAME': RENAME, Rename a file
  5451. * 'REPEAT': REPEAT, Repeated string concatenation
  5452. * 'RESHAPE': RESHAPE, Function to reshape an array
  5453. * 'RRSPACING': RRSPACING, Reciprocal of the relative spacing
  5454. * 'RSHIFT': RSHIFT, Right shift bits
  5455. * 'SAME_TYPE_AS': SAME_TYPE_AS, Query dynamic types for equality
  5456. * 'SCALE': SCALE, Scale a real value
  5457. * 'SCAN': SCAN, Scan a string for the presence of a set of characters
  5458. * 'SECNDS': SECNDS, Time function
  5459. * 'SECOND': SECOND, CPU time function
  5460. * 'SELECTED_CHAR_KIND': SELECTED_CHAR_KIND, Choose character kind
  5461. * 'SELECTED_INT_KIND': SELECTED_INT_KIND, Choose integer kind
  5462. * 'SELECTED_REAL_KIND': SELECTED_REAL_KIND, Choose real kind
  5463. * 'SET_EXPONENT': SET_EXPONENT, Set the exponent of the model
  5464. * 'SHAPE': SHAPE, Determine the shape of an array
  5465. * 'SHIFTA': SHIFTA, Right shift with fill
  5466. * 'SHIFTL': SHIFTL, Left shift
  5467. * 'SHIFTR': SHIFTR, Right shift
  5468. * 'SIGN': SIGN, Sign copying function
  5469. * 'SIGNAL': SIGNAL, Signal handling subroutine (or function)
  5470. * 'SIN': SIN, Sine function
  5471. * 'SIND': SIND, Sine function, degrees
  5472. * 'SINH': SINH, Hyperbolic sine function
  5473. * 'SIZE': SIZE, Function to determine the size of an array
  5474. * 'SIZEOF': SIZEOF, Determine the size in bytes of an expression
  5475. * 'SLEEP': SLEEP, Sleep for the specified number of seconds
  5476. * 'SPACING': SPACING, Smallest distance between two numbers of a given type
  5477. * 'SPREAD': SPREAD, Add a dimension to an array
  5478. * 'SQRT': SQRT, Square-root function
  5479. * 'SRAND': SRAND, Reinitialize the random number generator
  5480. * 'STAT': STAT, Get file status
  5481. * 'STORAGE_SIZE': STORAGE_SIZE, Storage size in bits
  5482. * 'SUM': SUM, Sum of array elements
  5483. * 'SYMLNK': SYMLNK, Create a symbolic link
  5484. * 'SYSTEM': SYSTEM, Execute a shell command
  5485. * 'SYSTEM_CLOCK': SYSTEM_CLOCK, Time function
  5486. * 'TAN': TAN, Tangent function
  5487. * 'TAND': TAND, Tangent function, degrees
  5488. * 'TANH': TANH, Hyperbolic tangent function
  5489. * 'THIS_IMAGE': THIS_IMAGE, Cosubscript index of this image
  5490. * 'TIME': TIME, Time function
  5491. * 'TIME8': TIME8, Time function (64-bit)
  5492. * 'TINY': TINY, Smallest positive number of a real kind
  5493. * 'TRAILZ': TRAILZ, Number of trailing zero bits of an integer
  5494. * 'TRANSFER': TRANSFER, Transfer bit patterns
  5495. * 'TRANSPOSE': TRANSPOSE, Transpose an array of rank two
  5496. * 'TRIM': TRIM, Remove trailing blank characters of a string
  5497. * 'TTYNAM': TTYNAM, Get the name of a terminal device.
  5498. * 'UBOUND': UBOUND, Upper dimension bounds of an array
  5499. * 'UCOBOUND': UCOBOUND, Upper codimension bounds of an array
  5500. * 'UMASK': UMASK, Set the file creation mask
  5501. * 'UNLINK': UNLINK, Remove a file from the file system
  5502. * 'UNPACK': UNPACK, Unpack an array of rank one into an array
  5503. * 'VERIFY': VERIFY, Scan a string for the absence of a set of characters
  5504. * 'XOR': XOR, Bitwise logical exclusive or
  5505. 
  5506. File: gfortran.info, Node: Introduction to Intrinsics, Next: ABORT, Up: Intrinsic Procedures
  5507. 9.1 Introduction to intrinsic procedures
  5508. ========================================
  5509. The intrinsic procedures provided by GNU Fortran include all of the
  5510. intrinsic procedures required by the Fortran 95 standard, a set of
  5511. intrinsic procedures for backwards compatibility with G77, and a
  5512. selection of intrinsic procedures from the Fortran 2003 and Fortran 2008
  5513. standards. Any conflict between a description here and a description in
  5514. either the Fortran 95 standard, the Fortran 2003 standard or the Fortran
  5515. 2008 standard is unintentional, and the standard(s) should be considered
  5516. authoritative.
  5517. The enumeration of the 'KIND' type parameter is processor defined in
  5518. the Fortran 95 standard. GNU Fortran defines the default integer type
  5519. and default real type by 'INTEGER(KIND=4)' and 'REAL(KIND=4)',
  5520. respectively. The standard mandates that both data types shall have
  5521. another kind, which have more precision. On typical target
  5522. architectures supported by 'gfortran', this kind type parameter is
  5523. 'KIND=8'. Hence, 'REAL(KIND=8)' and 'DOUBLE PRECISION' are equivalent.
  5524. In the description of generic intrinsic procedures, the kind type
  5525. parameter will be specified by 'KIND=*', and in the description of
  5526. specific names for an intrinsic procedure the kind type parameter will
  5527. be explicitly given (e.g., 'REAL(KIND=4)' or 'REAL(KIND=8)'). Finally,
  5528. for brevity the optional 'KIND=' syntax will be omitted.
  5529. Many of the intrinsic procedures take one or more optional arguments.
  5530. This document follows the convention used in the Fortran 95 standard,
  5531. and denotes such arguments by square brackets.
  5532. GNU Fortran offers the '-std=f95' and '-std=gnu' options, which can
  5533. be used to restrict the set of intrinsic procedures to a given standard.
  5534. By default, 'gfortran' sets the '-std=gnu' option, and so all intrinsic
  5535. procedures described here are accepted. There is one caveat. For a
  5536. select group of intrinsic procedures, 'g77' implemented both a function
  5537. and a subroutine. Both classes have been implemented in 'gfortran' for
  5538. backwards compatibility with 'g77'. It is noted here that these
  5539. functions and subroutines cannot be intermixed in a given subprogram.
  5540. In the descriptions that follow, the applicable standard for each
  5541. intrinsic procedure is noted.
  5542. 
  5543. File: gfortran.info, Node: ABORT, Next: ABS, Prev: Introduction to Intrinsics, Up: Intrinsic Procedures
  5544. 9.2 'ABORT' -- Abort the program
  5545. ================================
  5546. _Description_:
  5547. 'ABORT' causes immediate termination of the program. On operating
  5548. systems that support a core dump, 'ABORT' will produce a core dump.
  5549. It will also print a backtrace, unless '-fno-backtrace' is given.
  5550. _Standard_:
  5551. GNU extension
  5552. _Class_:
  5553. Subroutine
  5554. _Syntax_:
  5555. 'CALL ABORT'
  5556. _Return value_:
  5557. Does not return.
  5558. _Example_:
  5559. program test_abort
  5560. integer :: i = 1, j = 2
  5561. if (i /= j) call abort
  5562. end program test_abort
  5563. _See also_:
  5564. *note EXIT::, *note KILL::, *note BACKTRACE::
  5565. 
  5566. File: gfortran.info, Node: ABS, Next: ACCESS, Prev: ABORT, Up: Intrinsic Procedures
  5567. 9.3 'ABS' -- Absolute value
  5568. ===========================
  5569. _Description_:
  5570. 'ABS(A)' computes the absolute value of 'A'.
  5571. _Standard_:
  5572. Fortran 77 and later, has overloads that are GNU extensions
  5573. _Class_:
  5574. Elemental function
  5575. _Syntax_:
  5576. 'RESULT = ABS(A)'
  5577. _Arguments_:
  5578. A The type of the argument shall be an 'INTEGER',
  5579. 'REAL', or 'COMPLEX'.
  5580. _Return value_:
  5581. The return value is of the same type and kind as the argument
  5582. except the return value is 'REAL' for a 'COMPLEX' argument.
  5583. _Example_:
  5584. program test_abs
  5585. integer :: i = -1
  5586. real :: x = -1.e0
  5587. complex :: z = (-1.e0,0.e0)
  5588. i = abs(i)
  5589. x = abs(x)
  5590. x = abs(z)
  5591. end program test_abs
  5592. _Specific names_:
  5593. Name Argument Return type Standard
  5594. 'ABS(A)' 'REAL(4) A' 'REAL(4)' Fortran 77 and
  5595. later
  5596. 'CABS(A)' 'COMPLEX(4) 'REAL(4)' Fortran 77 and
  5597. A' later
  5598. 'DABS(A)' 'REAL(8) A' 'REAL(8)' Fortran 77 and
  5599. later
  5600. 'IABS(A)' 'INTEGER(4) 'INTEGER(4)' Fortran 77 and
  5601. A' later
  5602. 'BABS(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension
  5603. A'
  5604. 'IIABS(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension
  5605. A'
  5606. 'JIABS(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension
  5607. A'
  5608. 'KIABS(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension
  5609. A'
  5610. 'ZABS(A)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension
  5611. A'
  5612. 'CDABS(A)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension
  5613. A'
  5614. 
  5615. File: gfortran.info, Node: ACCESS, Next: ACHAR, Prev: ABS, Up: Intrinsic Procedures
  5616. 9.4 'ACCESS' -- Checks file access modes
  5617. ========================================
  5618. _Description_:
  5619. 'ACCESS(NAME, MODE)' checks whether the file NAME exists, is
  5620. readable, writable or executable. Except for the executable check,
  5621. 'ACCESS' can be replaced by Fortran 95's 'INQUIRE'.
  5622. _Standard_:
  5623. GNU extension
  5624. _Class_:
  5625. Inquiry function
  5626. _Syntax_:
  5627. 'RESULT = ACCESS(NAME, MODE)'
  5628. _Arguments_:
  5629. NAME Scalar 'CHARACTER' of default kind with the file
  5630. name. Tailing blank are ignored unless the
  5631. character 'achar(0)' is present, then all
  5632. characters up to and excluding 'achar(0)' are
  5633. used as file name.
  5634. MODE Scalar 'CHARACTER' of default kind with the file
  5635. access mode, may be any concatenation of '"r"'
  5636. (readable), '"w"' (writable) and '"x"'
  5637. (executable), or '" "' to check for existence.
  5638. _Return value_:
  5639. Returns a scalar 'INTEGER', which is '0' if the file is accessible
  5640. in the given mode; otherwise or if an invalid argument has been
  5641. given for 'MODE' the value '1' is returned.
  5642. _Example_:
  5643. program access_test
  5644. implicit none
  5645. character(len=*), parameter :: file = 'test.dat'
  5646. character(len=*), parameter :: file2 = 'test.dat '//achar(0)
  5647. if(access(file,' ') == 0) print *, trim(file),' is exists'
  5648. if(access(file,'r') == 0) print *, trim(file),' is readable'
  5649. if(access(file,'w') == 0) print *, trim(file),' is writable'
  5650. if(access(file,'x') == 0) print *, trim(file),' is executable'
  5651. if(access(file2,'rwx') == 0) &
  5652. print *, trim(file2),' is readable, writable and executable'
  5653. end program access_test
  5654. _Specific names_:
  5655. _See also_:
  5656. 
  5657. File: gfortran.info, Node: ACHAR, Next: ACOS, Prev: ACCESS, Up: Intrinsic Procedures
  5658. 9.5 'ACHAR' -- Character in ASCII collating sequence
  5659. ====================================================
  5660. _Description_:
  5661. 'ACHAR(I)' returns the character located at position 'I' in the
  5662. ASCII collating sequence.
  5663. _Standard_:
  5664. Fortran 77 and later, with KIND argument Fortran 2003 and later
  5665. _Class_:
  5666. Elemental function
  5667. _Syntax_:
  5668. 'RESULT = ACHAR(I [, KIND])'
  5669. _Arguments_:
  5670. I The type shall be 'INTEGER'.
  5671. KIND (Optional) An 'INTEGER' initialization
  5672. expression indicating the kind parameter of the
  5673. result.
  5674. _Return value_:
  5675. The return value is of type 'CHARACTER' with a length of one. If
  5676. the KIND argument is present, the return value is of the specified
  5677. kind and of the default kind otherwise.
  5678. _Example_:
  5679. program test_achar
  5680. character c
  5681. c = achar(32)
  5682. end program test_achar
  5683. _Note_:
  5684. See *note ICHAR:: for a discussion of converting between numerical
  5685. values and formatted string representations.
  5686. _See also_:
  5687. *note CHAR::, *note IACHAR::, *note ICHAR::
  5688. 
  5689. File: gfortran.info, Node: ACOS, Next: ACOSD, Prev: ACHAR, Up: Intrinsic Procedures
  5690. 9.6 'ACOS' -- Arccosine function
  5691. ================================
  5692. _Description_:
  5693. 'ACOS(X)' computes the arccosine of X (inverse of 'COS(X)').
  5694. _Standard_:
  5695. Fortran 77 and later, for a complex argument Fortran 2008 or later
  5696. _Class_:
  5697. Elemental function
  5698. _Syntax_:
  5699. 'RESULT = ACOS(X)'
  5700. _Arguments_:
  5701. X The type shall either be 'REAL' with a magnitude
  5702. that is less than or equal to one - or the type
  5703. shall be 'COMPLEX'.
  5704. _Return value_:
  5705. The return value is of the same type and kind as X. The real part
  5706. of the result is in radians and lies in the range 0 \leq \Re
  5707. \acos(x) \leq \pi.
  5708. _Example_:
  5709. program test_acos
  5710. real(8) :: x = 0.866_8
  5711. x = acos(x)
  5712. end program test_acos
  5713. _Specific names_:
  5714. Name Argument Return type Standard
  5715. 'ACOS(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and
  5716. later
  5717. 'DACOS(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and
  5718. later
  5719. _See also_:
  5720. Inverse function: *note COS:: Degrees function: *note ACOSD::
  5721. 
  5722. File: gfortran.info, Node: ACOSD, Next: ACOSH, Prev: ACOS, Up: Intrinsic Procedures
  5723. 9.7 'ACOSD' -- Arccosine function, degrees
  5724. ==========================================
  5725. _Description_:
  5726. 'ACOSD(X)' computes the arccosine of X in degrees (inverse of
  5727. 'COSD(X)').
  5728. This function is for compatibility only and should be avoided in
  5729. favor of standard constructs wherever possible.
  5730. _Standard_:
  5731. GNU Extension, enabled with '-fdec-math'
  5732. _Class_:
  5733. Elemental function
  5734. _Syntax_:
  5735. 'RESULT = ACOSD(X)'
  5736. _Arguments_:
  5737. X The type shall either be 'REAL' with a magnitude
  5738. that is less than or equal to one - or the type
  5739. shall be 'COMPLEX'.
  5740. _Return value_:
  5741. The return value is of the same type and kind as X. The real part
  5742. of the result is in degrees and lies in the range 0 \leq \Re
  5743. \acos(x) \leq 180.
  5744. _Example_:
  5745. program test_acosd
  5746. real(8) :: x = 0.866_8
  5747. x = acosd(x)
  5748. end program test_acosd
  5749. _Specific names_:
  5750. Name Argument Return type Standard
  5751. 'ACOSD(X)' 'REAL(4) X' 'REAL(4)' GNU Extension
  5752. 'DACOSD(X)' 'REAL(8) X' 'REAL(8)' GNU Extension
  5753. _See also_:
  5754. Inverse function: *note COSD:: Radians function: *note ACOS::
  5755. 
  5756. File: gfortran.info, Node: ACOSH, Next: ADJUSTL, Prev: ACOSD, Up: Intrinsic Procedures
  5757. 9.8 'ACOSH' -- Inverse hyperbolic cosine function
  5758. =================================================
  5759. _Description_:
  5760. 'ACOSH(X)' computes the inverse hyperbolic cosine of X.
  5761. _Standard_:
  5762. Fortran 2008 and later
  5763. _Class_:
  5764. Elemental function
  5765. _Syntax_:
  5766. 'RESULT = ACOSH(X)'
  5767. _Arguments_:
  5768. X The type shall be 'REAL' or 'COMPLEX'.
  5769. _Return value_:
  5770. The return value has the same type and kind as X. If X is complex,
  5771. the imaginary part of the result is in radians and lies between 0
  5772. \leq \Im \acosh(x) \leq \pi.
  5773. _Example_:
  5774. PROGRAM test_acosh
  5775. REAL(8), DIMENSION(3) :: x = (/ 1.0, 2.0, 3.0 /)
  5776. WRITE (*,*) ACOSH(x)
  5777. END PROGRAM
  5778. _Specific names_:
  5779. Name Argument Return type Standard
  5780. 'DACOSH(X)' 'REAL(8) X' 'REAL(8)' GNU extension
  5781. _See also_:
  5782. Inverse function: *note COSH::
  5783. 
  5784. File: gfortran.info, Node: ADJUSTL, Next: ADJUSTR, Prev: ACOSH, Up: Intrinsic Procedures
  5785. 9.9 'ADJUSTL' -- Left adjust a string
  5786. =====================================
  5787. _Description_:
  5788. 'ADJUSTL(STRING)' will left adjust a string by removing leading
  5789. spaces. Spaces are inserted at the end of the string as needed.
  5790. _Standard_:
  5791. Fortran 90 and later
  5792. _Class_:
  5793. Elemental function
  5794. _Syntax_:
  5795. 'RESULT = ADJUSTL(STRING)'
  5796. _Arguments_:
  5797. STRING The type shall be 'CHARACTER'.
  5798. _Return value_:
  5799. The return value is of type 'CHARACTER' and of the same kind as
  5800. STRING where leading spaces are removed and the same number of
  5801. spaces are inserted on the end of STRING.
  5802. _Example_:
  5803. program test_adjustl
  5804. character(len=20) :: str = ' gfortran'
  5805. str = adjustl(str)
  5806. print *, str
  5807. end program test_adjustl
  5808. _See also_:
  5809. *note ADJUSTR::, *note TRIM::
  5810. 
  5811. File: gfortran.info, Node: ADJUSTR, Next: AIMAG, Prev: ADJUSTL, Up: Intrinsic Procedures
  5812. 9.10 'ADJUSTR' -- Right adjust a string
  5813. =======================================
  5814. _Description_:
  5815. 'ADJUSTR(STRING)' will right adjust a string by removing trailing
  5816. spaces. Spaces are inserted at the start of the string as needed.
  5817. _Standard_:
  5818. Fortran 95 and later
  5819. _Class_:
  5820. Elemental function
  5821. _Syntax_:
  5822. 'RESULT = ADJUSTR(STRING)'
  5823. _Arguments_:
  5824. STR The type shall be 'CHARACTER'.
  5825. _Return value_:
  5826. The return value is of type 'CHARACTER' and of the same kind as
  5827. STRING where trailing spaces are removed and the same number of
  5828. spaces are inserted at the start of STRING.
  5829. _Example_:
  5830. program test_adjustr
  5831. character(len=20) :: str = 'gfortran'
  5832. str = adjustr(str)
  5833. print *, str
  5834. end program test_adjustr
  5835. _See also_:
  5836. *note ADJUSTL::, *note TRIM::
  5837. 
  5838. File: gfortran.info, Node: AIMAG, Next: AINT, Prev: ADJUSTR, Up: Intrinsic Procedures
  5839. 9.11 'AIMAG' -- Imaginary part of complex number
  5840. ================================================
  5841. _Description_:
  5842. 'AIMAG(Z)' yields the imaginary part of complex argument 'Z'. The
  5843. 'IMAG(Z)' and 'IMAGPART(Z)' intrinsic functions are provided for
  5844. compatibility with 'g77', and their use in new code is strongly
  5845. discouraged.
  5846. _Standard_:
  5847. Fortran 77 and later, has overloads that are GNU extensions
  5848. _Class_:
  5849. Elemental function
  5850. _Syntax_:
  5851. 'RESULT = AIMAG(Z)'
  5852. _Arguments_:
  5853. Z The type of the argument shall be 'COMPLEX'.
  5854. _Return value_:
  5855. The return value is of type 'REAL' with the kind type parameter of
  5856. the argument.
  5857. _Example_:
  5858. program test_aimag
  5859. complex(4) z4
  5860. complex(8) z8
  5861. z4 = cmplx(1.e0_4, 0.e0_4)
  5862. z8 = cmplx(0.e0_8, 1.e0_8)
  5863. print *, aimag(z4), dimag(z8)
  5864. end program test_aimag
  5865. _Specific names_:
  5866. Name Argument Return type Standard
  5867. 'AIMAG(Z)' 'COMPLEX Z' 'REAL' GNU extension
  5868. 'DIMAG(Z)' 'COMPLEX(8) 'REAL(8)' GNU extension
  5869. Z'
  5870. 'IMAG(Z)' 'COMPLEX Z' 'REAL' GNU extension
  5871. 'IMAGPART(Z)' 'COMPLEX Z' 'REAL' GNU extension
  5872. 
  5873. File: gfortran.info, Node: AINT, Next: ALARM, Prev: AIMAG, Up: Intrinsic Procedures
  5874. 9.12 'AINT' -- Truncate to a whole number
  5875. =========================================
  5876. _Description_:
  5877. 'AINT(A [, KIND])' truncates its argument to a whole number.
  5878. _Standard_:
  5879. Fortran 77 and later
  5880. _Class_:
  5881. Elemental function
  5882. _Syntax_:
  5883. 'RESULT = AINT(A [, KIND])'
  5884. _Arguments_:
  5885. A The type of the argument shall be 'REAL'.
  5886. KIND (Optional) An 'INTEGER' initialization
  5887. expression indicating the kind parameter of the
  5888. result.
  5889. _Return value_:
  5890. The return value is of type 'REAL' with the kind type parameter of
  5891. the argument if the optional KIND is absent; otherwise, the kind
  5892. type parameter will be given by KIND. If the magnitude of X is
  5893. less than one, 'AINT(X)' returns zero. If the magnitude is equal
  5894. to or greater than one then it returns the largest whole number
  5895. that does not exceed its magnitude. The sign is the same as the
  5896. sign of X.
  5897. _Example_:
  5898. program test_aint
  5899. real(4) x4
  5900. real(8) x8
  5901. x4 = 1.234E0_4
  5902. x8 = 4.321_8
  5903. print *, aint(x4), dint(x8)
  5904. x8 = aint(x4,8)
  5905. end program test_aint
  5906. _Specific names_:
  5907. Name Argument Return type Standard
  5908. 'AINT(A)' 'REAL(4) A' 'REAL(4)' Fortran 77 and
  5909. later
  5910. 'DINT(A)' 'REAL(8) A' 'REAL(8)' Fortran 77 and
  5911. later
  5912. 
  5913. File: gfortran.info, Node: ALARM, Next: ALL, Prev: AINT, Up: Intrinsic Procedures
  5914. 9.13 'ALARM' -- Execute a routine after a given delay
  5915. =====================================================
  5916. _Description_:
  5917. 'ALARM(SECONDS, HANDLER [, STATUS])' causes external subroutine
  5918. HANDLER to be executed after a delay of SECONDS by using 'alarm(2)'
  5919. to set up a signal and 'signal(2)' to catch it. If STATUS is
  5920. supplied, it will be returned with the number of seconds remaining
  5921. until any previously scheduled alarm was due to be delivered, or
  5922. zero if there was no previously scheduled alarm.
  5923. _Standard_:
  5924. GNU extension
  5925. _Class_:
  5926. Subroutine
  5927. _Syntax_:
  5928. 'CALL ALARM(SECONDS, HANDLER [, STATUS])'
  5929. _Arguments_:
  5930. SECONDS The type of the argument shall be a scalar
  5931. 'INTEGER'. It is 'INTENT(IN)'.
  5932. HANDLER Signal handler ('INTEGER FUNCTION' or
  5933. 'SUBROUTINE') or dummy/global 'INTEGER' scalar.
  5934. The scalar values may be either 'SIG_IGN=1' to
  5935. ignore the alarm generated or 'SIG_DFL=0' to set
  5936. the default action. It is 'INTENT(IN)'.
  5937. STATUS (Optional) STATUS shall be a scalar variable of
  5938. the default 'INTEGER' kind. It is
  5939. 'INTENT(OUT)'.
  5940. _Example_:
  5941. program test_alarm
  5942. external handler_print
  5943. integer i
  5944. call alarm (3, handler_print, i)
  5945. print *, i
  5946. call sleep(10)
  5947. end program test_alarm
  5948. This will cause the external routine HANDLER_PRINT to be called
  5949. after 3 seconds.
  5950. 
  5951. File: gfortran.info, Node: ALL, Next: ALLOCATED, Prev: ALARM, Up: Intrinsic Procedures
  5952. 9.14 'ALL' -- All values in MASK along DIM are true
  5953. ===================================================
  5954. _Description_:
  5955. 'ALL(MASK [, DIM])' determines if all the values are true in MASK
  5956. in the array along dimension DIM.
  5957. _Standard_:
  5958. Fortran 95 and later
  5959. _Class_:
  5960. Transformational function
  5961. _Syntax_:
  5962. 'RESULT = ALL(MASK [, DIM])'
  5963. _Arguments_:
  5964. MASK The type of the argument shall be 'LOGICAL' and
  5965. it shall not be scalar.
  5966. DIM (Optional) DIM shall be a scalar integer with a
  5967. value that lies between one and the rank of
  5968. MASK.
  5969. _Return value_:
  5970. 'ALL(MASK)' returns a scalar value of type 'LOGICAL' where the kind
  5971. type parameter is the same as the kind type parameter of MASK. If
  5972. DIM is present, then 'ALL(MASK, DIM)' returns an array with the
  5973. rank of MASK minus 1. The shape is determined from the shape of
  5974. MASK where the DIM dimension is elided.
  5975. (A)
  5976. 'ALL(MASK)' is true if all elements of MASK are true. It also
  5977. is true if MASK has zero size; otherwise, it is false.
  5978. (B)
  5979. If the rank of MASK is one, then 'ALL(MASK,DIM)' is equivalent
  5980. to 'ALL(MASK)'. If the rank is greater than one, then
  5981. 'ALL(MASK,DIM)' is determined by applying 'ALL' to the array
  5982. sections.
  5983. _Example_:
  5984. program test_all
  5985. logical l
  5986. l = all((/.true., .true., .true./))
  5987. print *, l
  5988. call section
  5989. contains
  5990. subroutine section
  5991. integer a(2,3), b(2,3)
  5992. a = 1
  5993. b = 1
  5994. b(2,2) = 2
  5995. print *, all(a .eq. b, 1)
  5996. print *, all(a .eq. b, 2)
  5997. end subroutine section
  5998. end program test_all
  5999. 
  6000. File: gfortran.info, Node: ALLOCATED, Next: AND, Prev: ALL, Up: Intrinsic Procedures
  6001. 9.15 'ALLOCATED' -- Status of an allocatable entity
  6002. ===================================================
  6003. _Description_:
  6004. 'ALLOCATED(ARRAY)' and 'ALLOCATED(SCALAR)' check the allocation
  6005. status of ARRAY and SCALAR, respectively.
  6006. _Standard_:
  6007. Fortran 95 and later. Note, the 'SCALAR=' keyword and allocatable
  6008. scalar entities are available in Fortran 2003 and later.
  6009. _Class_:
  6010. Inquiry function
  6011. _Syntax_:
  6012. 'RESULT = ALLOCATED(ARRAY)'
  6013. 'RESULT = ALLOCATED(SCALAR)'
  6014. _Arguments_:
  6015. ARRAY The argument shall be an 'ALLOCATABLE' array.
  6016. SCALAR The argument shall be an 'ALLOCATABLE' scalar.
  6017. _Return value_:
  6018. The return value is a scalar 'LOGICAL' with the default logical
  6019. kind type parameter. If the argument is allocated, then the result
  6020. is '.TRUE.'; otherwise, it returns '.FALSE.'
  6021. _Example_:
  6022. program test_allocated
  6023. integer :: i = 4
  6024. real(4), allocatable :: x(:)
  6025. if (.not. allocated(x)) allocate(x(i))
  6026. end program test_allocated
  6027. 
  6028. File: gfortran.info, Node: AND, Next: ANINT, Prev: ALLOCATED, Up: Intrinsic Procedures
  6029. 9.16 'AND' -- Bitwise logical AND
  6030. =================================
  6031. _Description_:
  6032. Bitwise logical 'AND'.
  6033. This intrinsic routine is provided for backwards compatibility with
  6034. GNU Fortran 77. For integer arguments, programmers should consider
  6035. the use of the *note IAND:: intrinsic defined by the Fortran
  6036. standard.
  6037. _Standard_:
  6038. GNU extension
  6039. _Class_:
  6040. Function
  6041. _Syntax_:
  6042. 'RESULT = AND(I, J)'
  6043. _Arguments_:
  6044. I The type shall be either a scalar 'INTEGER' type
  6045. or a scalar 'LOGICAL' type.
  6046. J The type shall be the same as the type of I.
  6047. _Return value_:
  6048. The return type is either a scalar 'INTEGER' or a scalar 'LOGICAL'.
  6049. If the kind type parameters differ, then the smaller kind type is
  6050. implicitly converted to larger kind, and the return has the larger
  6051. kind.
  6052. _Example_:
  6053. PROGRAM test_and
  6054. LOGICAL :: T = .TRUE., F = .FALSE.
  6055. INTEGER :: a, b
  6056. DATA a / Z'F' /, b / Z'3' /
  6057. WRITE (*,*) AND(T, T), AND(T, F), AND(F, T), AND(F, F)
  6058. WRITE (*,*) AND(a, b)
  6059. END PROGRAM
  6060. _See also_:
  6061. Fortran 95 elemental function: *note IAND::
  6062. 
  6063. File: gfortran.info, Node: ANINT, Next: ANY, Prev: AND, Up: Intrinsic Procedures
  6064. 9.17 'ANINT' -- Nearest whole number
  6065. ====================================
  6066. _Description_:
  6067. 'ANINT(A [, KIND])' rounds its argument to the nearest whole
  6068. number.
  6069. _Standard_:
  6070. Fortran 77 and later
  6071. _Class_:
  6072. Elemental function
  6073. _Syntax_:
  6074. 'RESULT = ANINT(A [, KIND])'
  6075. _Arguments_:
  6076. A The type of the argument shall be 'REAL'.
  6077. KIND (Optional) An 'INTEGER' initialization
  6078. expression indicating the kind parameter of the
  6079. result.
  6080. _Return value_:
  6081. The return value is of type real with the kind type parameter of
  6082. the argument if the optional KIND is absent; otherwise, the kind
  6083. type parameter will be given by KIND. If A is greater than zero,
  6084. 'ANINT(A)' returns 'AINT(X+0.5)'. If A is less than or equal to
  6085. zero then it returns 'AINT(X-0.5)'.
  6086. _Example_:
  6087. program test_anint
  6088. real(4) x4
  6089. real(8) x8
  6090. x4 = 1.234E0_4
  6091. x8 = 4.321_8
  6092. print *, anint(x4), dnint(x8)
  6093. x8 = anint(x4,8)
  6094. end program test_anint
  6095. _Specific names_:
  6096. Name Argument Return type Standard
  6097. 'AINT(A)' 'REAL(4) A' 'REAL(4)' Fortran 77 and
  6098. later
  6099. 'DNINT(A)' 'REAL(8) A' 'REAL(8)' Fortran 77 and
  6100. later
  6101. 
  6102. File: gfortran.info, Node: ANY, Next: ASIN, Prev: ANINT, Up: Intrinsic Procedures
  6103. 9.18 'ANY' -- Any value in MASK along DIM is true
  6104. =================================================
  6105. _Description_:
  6106. 'ANY(MASK [, DIM])' determines if any of the values in the logical
  6107. array MASK along dimension DIM are '.TRUE.'.
  6108. _Standard_:
  6109. Fortran 95 and later
  6110. _Class_:
  6111. Transformational function
  6112. _Syntax_:
  6113. 'RESULT = ANY(MASK [, DIM])'
  6114. _Arguments_:
  6115. MASK The type of the argument shall be 'LOGICAL' and
  6116. it shall not be scalar.
  6117. DIM (Optional) DIM shall be a scalar integer with a
  6118. value that lies between one and the rank of
  6119. MASK.
  6120. _Return value_:
  6121. 'ANY(MASK)' returns a scalar value of type 'LOGICAL' where the kind
  6122. type parameter is the same as the kind type parameter of MASK. If
  6123. DIM is present, then 'ANY(MASK, DIM)' returns an array with the
  6124. rank of MASK minus 1. The shape is determined from the shape of
  6125. MASK where the DIM dimension is elided.
  6126. (A)
  6127. 'ANY(MASK)' is true if any element of MASK is true; otherwise,
  6128. it is false. It also is false if MASK has zero size.
  6129. (B)
  6130. If the rank of MASK is one, then 'ANY(MASK,DIM)' is equivalent
  6131. to 'ANY(MASK)'. If the rank is greater than one, then
  6132. 'ANY(MASK,DIM)' is determined by applying 'ANY' to the array
  6133. sections.
  6134. _Example_:
  6135. program test_any
  6136. logical l
  6137. l = any((/.true., .true., .true./))
  6138. print *, l
  6139. call section
  6140. contains
  6141. subroutine section
  6142. integer a(2,3), b(2,3)
  6143. a = 1
  6144. b = 1
  6145. b(2,2) = 2
  6146. print *, any(a .eq. b, 1)
  6147. print *, any(a .eq. b, 2)
  6148. end subroutine section
  6149. end program test_any
  6150. 
  6151. File: gfortran.info, Node: ASIN, Next: ASIND, Prev: ANY, Up: Intrinsic Procedures
  6152. 9.19 'ASIN' -- Arcsine function
  6153. ===============================
  6154. _Description_:
  6155. 'ASIN(X)' computes the arcsine of its X (inverse of 'SIN(X)').
  6156. _Standard_:
  6157. Fortran 77 and later, for a complex argument Fortran 2008 or later
  6158. _Class_:
  6159. Elemental function
  6160. _Syntax_:
  6161. 'RESULT = ASIN(X)'
  6162. _Arguments_:
  6163. X The type shall be either 'REAL' and a magnitude
  6164. that is less than or equal to one - or be
  6165. 'COMPLEX'.
  6166. _Return value_:
  6167. The return value is of the same type and kind as X. The real part
  6168. of the result is in radians and lies in the range -\pi/2 \leq \Re
  6169. \asin(x) \leq \pi/2.
  6170. _Example_:
  6171. program test_asin
  6172. real(8) :: x = 0.866_8
  6173. x = asin(x)
  6174. end program test_asin
  6175. _Specific names_:
  6176. Name Argument Return type Standard
  6177. 'ASIN(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and
  6178. later
  6179. 'DASIN(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and
  6180. later
  6181. _See also_:
  6182. Inverse function: *note SIN:: Degrees function: *note ASIND::
  6183. 
  6184. File: gfortran.info, Node: ASIND, Next: ASINH, Prev: ASIN, Up: Intrinsic Procedures
  6185. 9.20 'ASIND' -- Arcsine function, degrees
  6186. =========================================
  6187. _Description_:
  6188. 'ASIND(X)' computes the arcsine of its X in degrees (inverse of
  6189. 'SIND(X)').
  6190. This function is for compatibility only and should be avoided in
  6191. favor of standard constructs wherever possible.
  6192. _Standard_:
  6193. GNU Extension, enabled with '-fdec-math'.
  6194. _Class_:
  6195. Elemental function
  6196. _Syntax_:
  6197. 'RESULT = ASIND(X)'
  6198. _Arguments_:
  6199. X The type shall be either 'REAL' and a magnitude
  6200. that is less than or equal to one - or be
  6201. 'COMPLEX'.
  6202. _Return value_:
  6203. The return value is of the same type and kind as X. The real part
  6204. of the result is in degrees and lies in the range -90 \leq \Re
  6205. \asin(x) \leq 90.
  6206. _Example_:
  6207. program test_asind
  6208. real(8) :: x = 0.866_8
  6209. x = asind(x)
  6210. end program test_asind
  6211. _Specific names_:
  6212. Name Argument Return type Standard
  6213. 'ASIND(X)' 'REAL(4) X' 'REAL(4)' GNU Extension
  6214. 'DASIND(X)' 'REAL(8) X' 'REAL(8)' GNU Extension
  6215. _See also_:
  6216. Inverse function: *note SIND:: Radians function: *note ASIN::
  6217. 
  6218. File: gfortran.info, Node: ASINH, Next: ASSOCIATED, Prev: ASIND, Up: Intrinsic Procedures
  6219. 9.21 'ASINH' -- Inverse hyperbolic sine function
  6220. ================================================
  6221. _Description_:
  6222. 'ASINH(X)' computes the inverse hyperbolic sine of X.
  6223. _Standard_:
  6224. Fortran 2008 and later
  6225. _Class_:
  6226. Elemental function
  6227. _Syntax_:
  6228. 'RESULT = ASINH(X)'
  6229. _Arguments_:
  6230. X The type shall be 'REAL' or 'COMPLEX'.
  6231. _Return value_:
  6232. The return value is of the same type and kind as X. If X is
  6233. complex, the imaginary part of the result is in radians and lies
  6234. between -\pi/2 \leq \Im \asinh(x) \leq \pi/2.
  6235. _Example_:
  6236. PROGRAM test_asinh
  6237. REAL(8), DIMENSION(3) :: x = (/ -1.0, 0.0, 1.0 /)
  6238. WRITE (*,*) ASINH(x)
  6239. END PROGRAM
  6240. _Specific names_:
  6241. Name Argument Return type Standard
  6242. 'DASINH(X)' 'REAL(8) X' 'REAL(8)' GNU extension.
  6243. _See also_:
  6244. Inverse function: *note SINH::
  6245. 
  6246. File: gfortran.info, Node: ASSOCIATED, Next: ATAN, Prev: ASINH, Up: Intrinsic Procedures
  6247. 9.22 'ASSOCIATED' -- Status of a pointer or pointer/target pair
  6248. ===============================================================
  6249. _Description_:
  6250. 'ASSOCIATED(POINTER [, TARGET])' determines the status of the
  6251. pointer POINTER or if POINTER is associated with the target TARGET.
  6252. _Standard_:
  6253. Fortran 95 and later
  6254. _Class_:
  6255. Inquiry function
  6256. _Syntax_:
  6257. 'RESULT = ASSOCIATED(POINTER [, TARGET])'
  6258. _Arguments_:
  6259. POINTER POINTER shall have the 'POINTER' attribute and
  6260. it can be of any type.
  6261. TARGET (Optional) TARGET shall be a pointer or a
  6262. target. It must have the same type, kind type
  6263. parameter, and array rank as POINTER.
  6264. The association status of neither POINTER nor TARGET shall be
  6265. undefined.
  6266. _Return value_:
  6267. 'ASSOCIATED(POINTER)' returns a scalar value of type 'LOGICAL(4)'.
  6268. There are several cases:
  6269. (A) When the optional TARGET is not present then
  6270. 'ASSOCIATED(POINTER)' is true if POINTER is associated with a
  6271. target; otherwise, it returns false.
  6272. (B) If TARGET is present and a scalar target, the result is true if
  6273. TARGET is not a zero-sized storage sequence and the target
  6274. associated with POINTER occupies the same storage units. If
  6275. POINTER is disassociated, the result is false.
  6276. (C) If TARGET is present and an array target, the result is true if
  6277. TARGET and POINTER have the same shape, are not zero-sized
  6278. arrays, are arrays whose elements are not zero-sized storage
  6279. sequences, and TARGET and POINTER occupy the same storage
  6280. units in array element order. As in case(B), the result is
  6281. false, if POINTER is disassociated.
  6282. (D) If TARGET is present and an scalar pointer, the result is true
  6283. if TARGET is associated with POINTER, the target associated
  6284. with TARGET are not zero-sized storage sequences and occupy
  6285. the same storage units. The result is false, if either TARGET
  6286. or POINTER is disassociated.
  6287. (E) If TARGET is present and an array pointer, the result is true if
  6288. target associated with POINTER and the target associated with
  6289. TARGET have the same shape, are not zero-sized arrays, are
  6290. arrays whose elements are not zero-sized storage sequences,
  6291. and TARGET and POINTER occupy the same storage units in array
  6292. element order. The result is false, if either TARGET or
  6293. POINTER is disassociated.
  6294. _Example_:
  6295. program test_associated
  6296. implicit none
  6297. real, target :: tgt(2) = (/1., 2./)
  6298. real, pointer :: ptr(:)
  6299. ptr => tgt
  6300. if (associated(ptr) .eqv. .false.) call abort
  6301. if (associated(ptr,tgt) .eqv. .false.) call abort
  6302. end program test_associated
  6303. _See also_:
  6304. *note NULL::
  6305. 
  6306. File: gfortran.info, Node: ATAN, Next: ATAND, Prev: ASSOCIATED, Up: Intrinsic Procedures
  6307. 9.23 'ATAN' -- Arctangent function
  6308. ==================================
  6309. _Description_:
  6310. 'ATAN(X)' computes the arctangent of X.
  6311. _Standard_:
  6312. Fortran 77 and later, for a complex argument and for two arguments
  6313. Fortran 2008 or later
  6314. _Class_:
  6315. Elemental function
  6316. _Syntax_:
  6317. 'RESULT = ATAN(X)'
  6318. 'RESULT = ATAN(Y, X)'
  6319. _Arguments_:
  6320. X The type shall be 'REAL' or 'COMPLEX'; if Y is
  6321. present, X shall be REAL.
  6322. Y shall
  6323. be of the
  6324. same type
  6325. and kind
  6326. as X.
  6327. _Return value_:
  6328. The return value is of the same type and kind as X. If Y is
  6329. present, the result is identical to 'ATAN2(Y,X)'. Otherwise, it
  6330. the arcus tangent of X, where the real part of the result is in
  6331. radians and lies in the range -\pi/2 \leq \Re \atan(x) \leq \pi/2.
  6332. _Example_:
  6333. program test_atan
  6334. real(8) :: x = 2.866_8
  6335. x = atan(x)
  6336. end program test_atan
  6337. _Specific names_:
  6338. Name Argument Return type Standard
  6339. 'ATAN(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and
  6340. later
  6341. 'DATAN(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and
  6342. later
  6343. _See also_:
  6344. Inverse function: *note TAN:: Degrees function: *note ATAND::
  6345. 
  6346. File: gfortran.info, Node: ATAND, Next: ATAN2, Prev: ATAN, Up: Intrinsic Procedures
  6347. 9.24 'ATAND' -- Arctangent function, degrees
  6348. ============================================
  6349. _Description_:
  6350. 'ATAND(X)' computes the arctangent of X in degrees (inverse of
  6351. *note TAND::).
  6352. This function is for compatibility only and should be avoided in
  6353. favor of standard constructs wherever possible.
  6354. _Standard_:
  6355. GNU Extension, enabled with '-fdec-math'.
  6356. _Class_:
  6357. Elemental function
  6358. _Syntax_:
  6359. 'RESULT = ATAND(X)'
  6360. 'RESULT = ATAND(Y, X)'
  6361. _Arguments_:
  6362. X The type shall be 'REAL' or 'COMPLEX'; if Y is
  6363. present, X shall be REAL.
  6364. Y shall
  6365. be of the
  6366. same type
  6367. and kind
  6368. as X.
  6369. _Return value_:
  6370. The return value is of the same type and kind as X. If Y is
  6371. present, the result is identical to 'ATAND2(Y,X)'. Otherwise, it
  6372. is the arcus tangent of X, where the real part of the result is in
  6373. degrees and lies in the range -90 \leq \Re \atand(x) \leq 90.
  6374. _Example_:
  6375. program test_atand
  6376. real(8) :: x = 2.866_8
  6377. x = atand(x)
  6378. end program test_atand
  6379. _Specific names_:
  6380. Name Argument Return type Standard
  6381. 'ATAND(X)' 'REAL(4) X' 'REAL(4)' GNU Extension
  6382. 'DATAND(X)' 'REAL(8) X' 'REAL(8)' GNU Extension
  6383. _See also_:
  6384. Inverse function: *note TAND:: Radians function: *note ATAN::
  6385. 
  6386. File: gfortran.info, Node: ATAN2, Next: ATAN2D, Prev: ATAND, Up: Intrinsic Procedures
  6387. 9.25 'ATAN2' -- Arctangent function
  6388. ===================================
  6389. _Description_:
  6390. 'ATAN2(Y, X)' computes the principal value of the argument function
  6391. of the complex number X + i Y. This function can be used to
  6392. transform from Cartesian into polar coordinates and allows to
  6393. determine the angle in the correct quadrant.
  6394. _Standard_:
  6395. Fortran 77 and later
  6396. _Class_:
  6397. Elemental function
  6398. _Syntax_:
  6399. 'RESULT = ATAN2(Y, X)'
  6400. _Arguments_:
  6401. Y The type shall be 'REAL'.
  6402. X The type and kind type parameter shall be the
  6403. same as Y. If Y is zero, then X must be
  6404. nonzero.
  6405. _Return value_:
  6406. The return value has the same type and kind type parameter as Y.
  6407. It is the principal value of the complex number X + i Y. If X is
  6408. nonzero, then it lies in the range -\pi \le \atan (x) \leq \pi.
  6409. The sign is positive if Y is positive. If Y is zero, then the
  6410. return value is zero if X is strictly positive, \pi if X is
  6411. negative and Y is positive zero (or the processor does not handle
  6412. signed zeros), and -\pi if X is negative and Y is negative zero.
  6413. Finally, if X is zero, then the magnitude of the result is \pi/2.
  6414. _Example_:
  6415. program test_atan2
  6416. real(4) :: x = 1.e0_4, y = 0.5e0_4
  6417. x = atan2(y,x)
  6418. end program test_atan2
  6419. _Specific names_:
  6420. Name Argument Return type Standard
  6421. 'ATAN2(X, 'REAL(4) X, 'REAL(4)' Fortran 77 and
  6422. Y)' Y' later
  6423. 'DATAN2(X, 'REAL(8) X, 'REAL(8)' Fortran 77 and
  6424. Y)' Y' later
  6425. _See also_:
  6426. Alias: *note ATAN:: Degrees function: *note ATAN2D::
  6427. 
  6428. File: gfortran.info, Node: ATAN2D, Next: ATANH, Prev: ATAN2, Up: Intrinsic Procedures
  6429. 9.26 'ATAN2D' -- Arctangent function, degrees
  6430. =============================================
  6431. _Description_:
  6432. 'ATAN2D(Y, X)' computes the principal value of the argument
  6433. function of the complex number X + i Y in degrees. This function
  6434. can be used to transform from Cartesian into polar coordinates and
  6435. allows to determine the angle in the correct quadrant.
  6436. This function is for compatibility only and should be avoided in
  6437. favor of standard constructs wherever possible.
  6438. _Standard_:
  6439. GNU Extension, enabled with '-fdec-math'.
  6440. _Class_:
  6441. Elemental function
  6442. _Syntax_:
  6443. 'RESULT = ATAN2D(Y, X)'
  6444. _Arguments_:
  6445. Y The type shall be 'REAL'.
  6446. X The type and kind type parameter shall be the
  6447. same as Y. If Y is zero, then X must be
  6448. nonzero.
  6449. _Return value_:
  6450. The return value has the same type and kind type parameter as Y.
  6451. It is the principal value of the complex number X + i Y. If X is
  6452. nonzero, then it lies in the range -180 \le \atan (x) \leq 180.
  6453. The sign is positive if Y is positive. If Y is zero, then the
  6454. return value is zero if X is strictly positive, 180 if X is
  6455. negative and Y is positive zero (or the processor does not handle
  6456. signed zeros), and -180 if X is negative and Y is negative zero.
  6457. Finally, if X is zero, then the magnitude of the result is 90.
  6458. _Example_:
  6459. program test_atan2d
  6460. real(4) :: x = 1.e0_4, y = 0.5e0_4
  6461. x = atan2d(y,x)
  6462. end program test_atan2d
  6463. _Specific names_:
  6464. Name Argument Return type Standard
  6465. 'ATAN2D(X, 'REAL(4) X, 'REAL(4)' GNU Extension
  6466. Y)' Y'
  6467. 'DATAN2D(X, 'REAL(8) X, 'REAL(8)' GNU Extension
  6468. Y)' Y'
  6469. _See also_:
  6470. Alias: *note ATAND:: Radians function: *note ATAN2::
  6471. 
  6472. File: gfortran.info, Node: ATANH, Next: ATOMIC_ADD, Prev: ATAN2D, Up: Intrinsic Procedures
  6473. 9.27 'ATANH' -- Inverse hyperbolic tangent function
  6474. ===================================================
  6475. _Description_:
  6476. 'ATANH(X)' computes the inverse hyperbolic tangent of X.
  6477. _Standard_:
  6478. Fortran 2008 and later
  6479. _Class_:
  6480. Elemental function
  6481. _Syntax_:
  6482. 'RESULT = ATANH(X)'
  6483. _Arguments_:
  6484. X The type shall be 'REAL' or 'COMPLEX'.
  6485. _Return value_:
  6486. The return value has same type and kind as X. If X is complex, the
  6487. imaginary part of the result is in radians and lies between -\pi/2
  6488. \leq \Im \atanh(x) \leq \pi/2.
  6489. _Example_:
  6490. PROGRAM test_atanh
  6491. REAL, DIMENSION(3) :: x = (/ -1.0, 0.0, 1.0 /)
  6492. WRITE (*,*) ATANH(x)
  6493. END PROGRAM
  6494. _Specific names_:
  6495. Name Argument Return type Standard
  6496. 'DATANH(X)' 'REAL(8) X' 'REAL(8)' GNU extension
  6497. _See also_:
  6498. Inverse function: *note TANH::
  6499. 
  6500. File: gfortran.info, Node: ATOMIC_ADD, Next: ATOMIC_AND, Prev: ATANH, Up: Intrinsic Procedures
  6501. 9.28 'ATOMIC_ADD' -- Atomic ADD operation
  6502. =========================================
  6503. _Description_:
  6504. 'ATOMIC_ADD(ATOM, VALUE)' atomically adds the value of VAR to the
  6505. variable ATOM. When STAT is present and the invocation was
  6506. successful, it is assigned the value 0. If it is present and the
  6507. invocation has failed, it is assigned a positive value; in
  6508. particular, for a coindexed ATOM, if the remote image has stopped,
  6509. it is assigned the value of 'ISO_FORTRAN_ENV''s
  6510. 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
  6511. 'STAT_FAILED_IMAGE'.
  6512. _Standard_:
  6513. TS 18508 or later
  6514. _Class_:
  6515. Atomic subroutine
  6516. _Syntax_:
  6517. 'CALL ATOMIC_ADD (ATOM, VALUE [, STAT])'
  6518. _Arguments_:
  6519. ATOM Scalar coarray or coindexed variable of integer
  6520. type with 'ATOMIC_INT_KIND' kind.
  6521. VALUE Scalar of the same type as ATOM. If the kind is
  6522. different, the value is converted to the kind of
  6523. ATOM.
  6524. STAT (optional) Scalar default-kind integer variable.
  6525. _Example_:
  6526. program atomic
  6527. use iso_fortran_env
  6528. integer(atomic_int_kind) :: atom[*]
  6529. call atomic_add (atom[1], this_image())
  6530. end program atomic
  6531. _See also_:
  6532. *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_ADD::, *note
  6533. ISO_FORTRAN_ENV::, *note ATOMIC_AND::, *note ATOMIC_OR::, *note
  6534. ATOMIC_XOR::
  6535. 
  6536. File: gfortran.info, Node: ATOMIC_AND, Next: ATOMIC_CAS, Prev: ATOMIC_ADD, Up: Intrinsic Procedures
  6537. 9.29 'ATOMIC_AND' -- Atomic bitwise AND operation
  6538. =================================================
  6539. _Description_:
  6540. 'ATOMIC_AND(ATOM, VALUE)' atomically defines ATOM with the bitwise
  6541. AND between the values of ATOM and VALUE. When STAT is present and
  6542. the invocation was successful, it is assigned the value 0. If it
  6543. is present and the invocation has failed, it is assigned a positive
  6544. value; in particular, for a coindexed ATOM, if the remote image has
  6545. stopped, it is assigned the value of 'ISO_FORTRAN_ENV''s
  6546. 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
  6547. 'STAT_FAILED_IMAGE'.
  6548. _Standard_:
  6549. TS 18508 or later
  6550. _Class_:
  6551. Atomic subroutine
  6552. _Syntax_:
  6553. 'CALL ATOMIC_AND (ATOM, VALUE [, STAT])'
  6554. _Arguments_:
  6555. ATOM Scalar coarray or coindexed variable of integer
  6556. type with 'ATOMIC_INT_KIND' kind.
  6557. VALUE Scalar of the same type as ATOM. If the kind is
  6558. different, the value is converted to the kind of
  6559. ATOM.
  6560. STAT (optional) Scalar default-kind integer variable.
  6561. _Example_:
  6562. program atomic
  6563. use iso_fortran_env
  6564. integer(atomic_int_kind) :: atom[*]
  6565. call atomic_and (atom[1], int(b'10100011101'))
  6566. end program atomic
  6567. _See also_:
  6568. *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_AND::, *note
  6569. ISO_FORTRAN_ENV::, *note ATOMIC_ADD::, *note ATOMIC_OR::, *note
  6570. ATOMIC_XOR::
  6571. 
  6572. File: gfortran.info, Node: ATOMIC_CAS, Next: ATOMIC_DEFINE, Prev: ATOMIC_AND, Up: Intrinsic Procedures
  6573. 9.30 'ATOMIC_CAS' -- Atomic compare and swap
  6574. ============================================
  6575. _Description_:
  6576. 'ATOMIC_CAS' compares the variable ATOM with the value of COMPARE;
  6577. if the value is the same, ATOM is set to the value of NEW.
  6578. Additionally, OLD is set to the value of ATOM that was used for the
  6579. comparison. When STAT is present and the invocation was
  6580. successful, it is assigned the value 0. If it is present and the
  6581. invocation has failed, it is assigned a positive value; in
  6582. particular, for a coindexed ATOM, if the remote image has stopped,
  6583. it is assigned the value of 'ISO_FORTRAN_ENV''s
  6584. 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
  6585. 'STAT_FAILED_IMAGE'.
  6586. _Standard_:
  6587. TS 18508 or later
  6588. _Class_:
  6589. Atomic subroutine
  6590. _Syntax_:
  6591. 'CALL ATOMIC_CAS (ATOM, OLD, COMPARE, NEW [, STAT])'
  6592. _Arguments_:
  6593. ATOM Scalar coarray or coindexed variable of either
  6594. integer type with 'ATOMIC_INT_KIND' kind or
  6595. logical type with 'ATOMIC_LOGICAL_KIND' kind.
  6596. OLD Scalar of the same type and kind as ATOM.
  6597. COMPARE Scalar variable of the same type and kind as
  6598. ATOM.
  6599. NEW Scalar variable of the same type as ATOM. If
  6600. kind is different, the value is converted to the
  6601. kind of ATOM.
  6602. STAT (optional) Scalar default-kind integer variable.
  6603. _Example_:
  6604. program atomic
  6605. use iso_fortran_env
  6606. logical(atomic_logical_kind) :: atom[*], prev
  6607. call atomic_cas (atom[1], prev, .false., .true.))
  6608. end program atomic
  6609. _See also_:
  6610. *note ATOMIC_DEFINE::, *note ATOMIC_REF::, *note ISO_FORTRAN_ENV::
  6611. 
  6612. File: gfortran.info, Node: ATOMIC_DEFINE, Next: ATOMIC_FETCH_ADD, Prev: ATOMIC_CAS, Up: Intrinsic Procedures
  6613. 9.31 'ATOMIC_DEFINE' -- Setting a variable atomically
  6614. =====================================================
  6615. _Description_:
  6616. 'ATOMIC_DEFINE(ATOM, VALUE)' defines the variable ATOM with the
  6617. value VALUE atomically. When STAT is present and the invocation
  6618. was successful, it is assigned the value 0. If it is present and
  6619. the invocation has failed, it is assigned a positive value; in
  6620. particular, for a coindexed ATOM, if the remote image has stopped,
  6621. it is assigned the value of 'ISO_FORTRAN_ENV''s
  6622. 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
  6623. 'STAT_FAILED_IMAGE'.
  6624. _Standard_:
  6625. Fortran 2008 and later; with STAT, TS 18508 or later
  6626. _Class_:
  6627. Atomic subroutine
  6628. _Syntax_:
  6629. 'CALL ATOMIC_DEFINE (ATOM, VALUE [, STAT])'
  6630. _Arguments_:
  6631. ATOM Scalar coarray or coindexed variable of either
  6632. integer type with 'ATOMIC_INT_KIND' kind or
  6633. logical type with 'ATOMIC_LOGICAL_KIND' kind.
  6634. VALUE Scalar of the same type as ATOM. If the kind is
  6635. different, the value is converted to the kind of
  6636. ATOM.
  6637. STAT (optional) Scalar default-kind integer variable.
  6638. _Example_:
  6639. program atomic
  6640. use iso_fortran_env
  6641. integer(atomic_int_kind) :: atom[*]
  6642. call atomic_define (atom[1], this_image())
  6643. end program atomic
  6644. _See also_:
  6645. *note ATOMIC_REF::, *note ATOMIC_CAS::, *note ISO_FORTRAN_ENV::,
  6646. *note ATOMIC_ADD::, *note ATOMIC_AND::, *note ATOMIC_OR::, *note
  6647. ATOMIC_XOR::
  6648. 
  6649. File: gfortran.info, Node: ATOMIC_FETCH_ADD, Next: ATOMIC_FETCH_AND, Prev: ATOMIC_DEFINE, Up: Intrinsic Procedures
  6650. 9.32 'ATOMIC_FETCH_ADD' -- Atomic ADD operation with prior fetch
  6651. ================================================================
  6652. _Description_:
  6653. 'ATOMIC_FETCH_ADD(ATOM, VALUE, OLD)' atomically stores the value of
  6654. ATOM in OLD and adds the value of VAR to the variable ATOM. When
  6655. STAT is present and the invocation was successful, it is assigned
  6656. the value 0. If it is present and the invocation has failed, it is
  6657. assigned a positive value; in particular, for a coindexed ATOM, if
  6658. the remote image has stopped, it is assigned the value of
  6659. 'ISO_FORTRAN_ENV''s 'STAT_STOPPED_IMAGE' and if the remote image
  6660. has failed, the value 'STAT_FAILED_IMAGE'.
  6661. _Standard_:
  6662. TS 18508 or later
  6663. _Class_:
  6664. Atomic subroutine
  6665. _Syntax_:
  6666. 'CALL ATOMIC_FETCH_ADD (ATOM, VALUE, old [, STAT])'
  6667. _Arguments_:
  6668. ATOM Scalar coarray or coindexed variable of integer
  6669. type with 'ATOMIC_INT_KIND' kind.
  6670. 'ATOMIC_LOGICAL_KIND' kind.
  6671. VALUE Scalar of the same type as ATOM. If the kind is
  6672. different, the value is converted to the kind of
  6673. ATOM.
  6674. OLD Scalar of the same type and kind as ATOM.
  6675. STAT (optional) Scalar default-kind integer variable.
  6676. _Example_:
  6677. program atomic
  6678. use iso_fortran_env
  6679. integer(atomic_int_kind) :: atom[*], old
  6680. call atomic_add (atom[1], this_image(), old)
  6681. end program atomic
  6682. _See also_:
  6683. *note ATOMIC_DEFINE::, *note ATOMIC_ADD::, *note ISO_FORTRAN_ENV::,
  6684. *note ATOMIC_FETCH_AND::, *note ATOMIC_FETCH_OR::, *note
  6685. ATOMIC_FETCH_XOR::
  6686. 
  6687. File: gfortran.info, Node: ATOMIC_FETCH_AND, Next: ATOMIC_FETCH_OR, Prev: ATOMIC_FETCH_ADD, Up: Intrinsic Procedures
  6688. 9.33 'ATOMIC_FETCH_AND' -- Atomic bitwise AND operation with prior fetch
  6689. ========================================================================
  6690. _Description_:
  6691. 'ATOMIC_AND(ATOM, VALUE)' atomically stores the value of ATOM in
  6692. OLD and defines ATOM with the bitwise AND between the values of
  6693. ATOM and VALUE. When STAT is present and the invocation was
  6694. successful, it is assigned the value 0. If it is present and the
  6695. invocation has failed, it is assigned a positive value; in
  6696. particular, for a coindexed ATOM, if the remote image has stopped,
  6697. it is assigned the value of 'ISO_FORTRAN_ENV''s
  6698. 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
  6699. 'STAT_FAILED_IMAGE'.
  6700. _Standard_:
  6701. TS 18508 or later
  6702. _Class_:
  6703. Atomic subroutine
  6704. _Syntax_:
  6705. 'CALL ATOMIC_FETCH_AND (ATOM, VALUE, OLD [, STAT])'
  6706. _Arguments_:
  6707. ATOM Scalar coarray or coindexed variable of integer
  6708. type with 'ATOMIC_INT_KIND' kind.
  6709. VALUE Scalar of the same type as ATOM. If the kind is
  6710. different, the value is converted to the kind of
  6711. ATOM.
  6712. OLD Scalar of the same type and kind as ATOM.
  6713. STAT (optional) Scalar default-kind integer variable.
  6714. _Example_:
  6715. program atomic
  6716. use iso_fortran_env
  6717. integer(atomic_int_kind) :: atom[*], old
  6718. call atomic_fetch_and (atom[1], int(b'10100011101'), old)
  6719. end program atomic
  6720. _See also_:
  6721. *note ATOMIC_DEFINE::, *note ATOMIC_AND::, *note ISO_FORTRAN_ENV::,
  6722. *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_OR::, *note
  6723. ATOMIC_FETCH_XOR::
  6724. 
  6725. File: gfortran.info, Node: ATOMIC_FETCH_OR, Next: ATOMIC_FETCH_XOR, Prev: ATOMIC_FETCH_AND, Up: Intrinsic Procedures
  6726. 9.34 'ATOMIC_FETCH_OR' -- Atomic bitwise OR operation with prior fetch
  6727. ======================================================================
  6728. _Description_:
  6729. 'ATOMIC_OR(ATOM, VALUE)' atomically stores the value of ATOM in OLD
  6730. and defines ATOM with the bitwise OR between the values of ATOM and
  6731. VALUE. When STAT is present and the invocation was successful, it
  6732. is assigned the value 0. If it is present and the invocation has
  6733. failed, it is assigned a positive value; in particular, for a
  6734. coindexed ATOM, if the remote image has stopped, it is assigned the
  6735. value of 'ISO_FORTRAN_ENV''s 'STAT_STOPPED_IMAGE' and if the remote
  6736. image has failed, the value 'STAT_FAILED_IMAGE'.
  6737. _Standard_:
  6738. TS 18508 or later
  6739. _Class_:
  6740. Atomic subroutine
  6741. _Syntax_:
  6742. 'CALL ATOMIC_FETCH_OR (ATOM, VALUE, OLD [, STAT])'
  6743. _Arguments_:
  6744. ATOM Scalar coarray or coindexed variable of integer
  6745. type with 'ATOMIC_INT_KIND' kind.
  6746. VALUE Scalar of the same type as ATOM. If the kind is
  6747. different, the value is converted to the kind of
  6748. ATOM.
  6749. OLD Scalar of the same type and kind as ATOM.
  6750. STAT (optional) Scalar default-kind integer variable.
  6751. _Example_:
  6752. program atomic
  6753. use iso_fortran_env
  6754. integer(atomic_int_kind) :: atom[*], old
  6755. call atomic_fetch_or (atom[1], int(b'10100011101'), old)
  6756. end program atomic
  6757. _See also_:
  6758. *note ATOMIC_DEFINE::, *note ATOMIC_OR::, *note ISO_FORTRAN_ENV::,
  6759. *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_AND::, *note
  6760. ATOMIC_FETCH_XOR::
  6761. 
  6762. File: gfortran.info, Node: ATOMIC_FETCH_XOR, Next: ATOMIC_OR, Prev: ATOMIC_FETCH_OR, Up: Intrinsic Procedures
  6763. 9.35 'ATOMIC_FETCH_XOR' -- Atomic bitwise XOR operation with prior fetch
  6764. ========================================================================
  6765. _Description_:
  6766. 'ATOMIC_XOR(ATOM, VALUE)' atomically stores the value of ATOM in
  6767. OLD and defines ATOM with the bitwise XOR between the values of
  6768. ATOM and VALUE. When STAT is present and the invocation was
  6769. successful, it is assigned the value 0. If it is present and the
  6770. invocation has failed, it is assigned a positive value; in
  6771. particular, for a coindexed ATOM, if the remote image has stopped,
  6772. it is assigned the value of 'ISO_FORTRAN_ENV''s
  6773. 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
  6774. 'STAT_FAILED_IMAGE'.
  6775. _Standard_:
  6776. TS 18508 or later
  6777. _Class_:
  6778. Atomic subroutine
  6779. _Syntax_:
  6780. 'CALL ATOMIC_FETCH_XOR (ATOM, VALUE, OLD [, STAT])'
  6781. _Arguments_:
  6782. ATOM Scalar coarray or coindexed variable of integer
  6783. type with 'ATOMIC_INT_KIND' kind.
  6784. VALUE Scalar of the same type as ATOM. If the kind is
  6785. different, the value is converted to the kind of
  6786. ATOM.
  6787. OLD Scalar of the same type and kind as ATOM.
  6788. STAT (optional) Scalar default-kind integer variable.
  6789. _Example_:
  6790. program atomic
  6791. use iso_fortran_env
  6792. integer(atomic_int_kind) :: atom[*], old
  6793. call atomic_fetch_xor (atom[1], int(b'10100011101'), old)
  6794. end program atomic
  6795. _See also_:
  6796. *note ATOMIC_DEFINE::, *note ATOMIC_XOR::, *note ISO_FORTRAN_ENV::,
  6797. *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_AND::, *note
  6798. ATOMIC_FETCH_OR::
  6799. 
  6800. File: gfortran.info, Node: ATOMIC_OR, Next: ATOMIC_REF, Prev: ATOMIC_FETCH_XOR, Up: Intrinsic Procedures
  6801. 9.36 'ATOMIC_OR' -- Atomic bitwise OR operation
  6802. ===============================================
  6803. _Description_:
  6804. 'ATOMIC_OR(ATOM, VALUE)' atomically defines ATOM with the bitwise
  6805. AND between the values of ATOM and VALUE. When STAT is present and
  6806. the invocation was successful, it is assigned the value 0. If it
  6807. is present and the invocation has failed, it is assigned a positive
  6808. value; in particular, for a coindexed ATOM, if the remote image has
  6809. stopped, it is assigned the value of 'ISO_FORTRAN_ENV''s
  6810. 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
  6811. 'STAT_FAILED_IMAGE'.
  6812. _Standard_:
  6813. TS 18508 or later
  6814. _Class_:
  6815. Atomic subroutine
  6816. _Syntax_:
  6817. 'CALL ATOMIC_OR (ATOM, VALUE [, STAT])'
  6818. _Arguments_:
  6819. ATOM Scalar coarray or coindexed variable of integer
  6820. type with 'ATOMIC_INT_KIND' kind.
  6821. VALUE Scalar of the same type as ATOM. If the kind is
  6822. different, the value is converted to the kind of
  6823. ATOM.
  6824. STAT (optional) Scalar default-kind integer variable.
  6825. _Example_:
  6826. program atomic
  6827. use iso_fortran_env
  6828. integer(atomic_int_kind) :: atom[*]
  6829. call atomic_or (atom[1], int(b'10100011101'))
  6830. end program atomic
  6831. _See also_:
  6832. *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_OR::, *note
  6833. ISO_FORTRAN_ENV::, *note ATOMIC_ADD::, *note ATOMIC_OR::, *note
  6834. ATOMIC_XOR::
  6835. 
  6836. File: gfortran.info, Node: ATOMIC_REF, Next: ATOMIC_XOR, Prev: ATOMIC_OR, Up: Intrinsic Procedures
  6837. 9.37 'ATOMIC_REF' -- Obtaining the value of a variable atomically
  6838. =================================================================
  6839. _Description_:
  6840. 'ATOMIC_DEFINE(ATOM, VALUE)' atomically assigns the value of the
  6841. variable ATOM to VALUE. When STAT is present and the invocation
  6842. was successful, it is assigned the value 0. If it is present and
  6843. the invocation has failed, it is assigned a positive value; in
  6844. particular, for a coindexed ATOM, if the remote image has stopped,
  6845. it is assigned the value of 'ISO_FORTRAN_ENV''s
  6846. 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
  6847. 'STAT_FAILED_IMAGE'.
  6848. _Standard_:
  6849. Fortran 2008 and later; with STAT, TS 18508 or later
  6850. _Class_:
  6851. Atomic subroutine
  6852. _Syntax_:
  6853. 'CALL ATOMIC_REF(VALUE, ATOM [, STAT])'
  6854. _Arguments_:
  6855. VALUE Scalar of the same type as ATOM. If the kind is
  6856. different, the value is converted to the kind of
  6857. ATOM.
  6858. ATOM Scalar coarray or coindexed variable of either
  6859. integer type with 'ATOMIC_INT_KIND' kind or
  6860. logical type with 'ATOMIC_LOGICAL_KIND' kind.
  6861. STAT (optional) Scalar default-kind integer variable.
  6862. _Example_:
  6863. program atomic
  6864. use iso_fortran_env
  6865. logical(atomic_logical_kind) :: atom[*]
  6866. logical :: val
  6867. call atomic_ref (atom, .false.)
  6868. ! ...
  6869. call atomic_ref (atom, val)
  6870. if (val) then
  6871. print *, "Obtained"
  6872. end if
  6873. end program atomic
  6874. _See also_:
  6875. *note ATOMIC_DEFINE::, *note ATOMIC_CAS::, *note ISO_FORTRAN_ENV::,
  6876. *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_AND::, *note
  6877. ATOMIC_FETCH_OR::, *note ATOMIC_FETCH_XOR::
  6878. 
  6879. File: gfortran.info, Node: ATOMIC_XOR, Next: BACKTRACE, Prev: ATOMIC_REF, Up: Intrinsic Procedures
  6880. 9.38 'ATOMIC_XOR' -- Atomic bitwise OR operation
  6881. ================================================
  6882. _Description_:
  6883. 'ATOMIC_AND(ATOM, VALUE)' atomically defines ATOM with the bitwise
  6884. XOR between the values of ATOM and VALUE. When STAT is present and
  6885. the invocation was successful, it is assigned the value 0. If it
  6886. is present and the invocation has failed, it is assigned a positive
  6887. value; in particular, for a coindexed ATOM, if the remote image has
  6888. stopped, it is assigned the value of 'ISO_FORTRAN_ENV''s
  6889. 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
  6890. 'STAT_FAILED_IMAGE'.
  6891. _Standard_:
  6892. TS 18508 or later
  6893. _Class_:
  6894. Atomic subroutine
  6895. _Syntax_:
  6896. 'CALL ATOMIC_XOR (ATOM, VALUE [, STAT])'
  6897. _Arguments_:
  6898. ATOM Scalar coarray or coindexed variable of integer
  6899. type with 'ATOMIC_INT_KIND' kind.
  6900. VALUE Scalar of the same type as ATOM. If the kind is
  6901. different, the value is converted to the kind of
  6902. ATOM.
  6903. STAT (optional) Scalar default-kind integer variable.
  6904. _Example_:
  6905. program atomic
  6906. use iso_fortran_env
  6907. integer(atomic_int_kind) :: atom[*]
  6908. call atomic_xor (atom[1], int(b'10100011101'))
  6909. end program atomic
  6910. _See also_:
  6911. *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_XOR::, *note
  6912. ISO_FORTRAN_ENV::, *note ATOMIC_ADD::, *note ATOMIC_OR::, *note
  6913. ATOMIC_XOR::
  6914. 
  6915. File: gfortran.info, Node: BACKTRACE, Next: BESSEL_J0, Prev: ATOMIC_XOR, Up: Intrinsic Procedures
  6916. 9.39 'BACKTRACE' -- Show a backtrace
  6917. ====================================
  6918. _Description_:
  6919. 'BACKTRACE' shows a backtrace at an arbitrary place in user code.
  6920. Program execution continues normally afterwards. The backtrace
  6921. information is printed to the unit corresponding to 'ERROR_UNIT' in
  6922. 'ISO_FORTRAN_ENV'.
  6923. _Standard_:
  6924. GNU Extension
  6925. _Class_:
  6926. Subroutine
  6927. _Syntax_:
  6928. 'CALL BACKTRACE'
  6929. _Arguments_:
  6930. None
  6931. _See also_:
  6932. *note ABORT::
  6933. 
  6934. File: gfortran.info, Node: BESSEL_J0, Next: BESSEL_J1, Prev: BACKTRACE, Up: Intrinsic Procedures
  6935. 9.40 'BESSEL_J0' -- Bessel function of the first kind of order 0
  6936. ================================================================
  6937. _Description_:
  6938. 'BESSEL_J0(X)' computes the Bessel function of the first kind of
  6939. order 0 of X. This function is available under the name 'BESJ0' as
  6940. a GNU extension.
  6941. _Standard_:
  6942. Fortran 2008 and later
  6943. _Class_:
  6944. Elemental function
  6945. _Syntax_:
  6946. 'RESULT = BESSEL_J0(X)'
  6947. _Arguments_:
  6948. X The type shall be 'REAL'.
  6949. _Return value_:
  6950. The return value is of type 'REAL' and lies in the range -
  6951. 0.4027... \leq Bessel (0,x) \leq 1. It has the same kind as X.
  6952. _Example_:
  6953. program test_besj0
  6954. real(8) :: x = 0.0_8
  6955. x = bessel_j0(x)
  6956. end program test_besj0
  6957. _Specific names_:
  6958. Name Argument Return type Standard
  6959. 'DBESJ0(X)' 'REAL(8) X' 'REAL(8)' GNU extension
  6960. 
  6961. File: gfortran.info, Node: BESSEL_J1, Next: BESSEL_JN, Prev: BESSEL_J0, Up: Intrinsic Procedures
  6962. 9.41 'BESSEL_J1' -- Bessel function of the first kind of order 1
  6963. ================================================================
  6964. _Description_:
  6965. 'BESSEL_J1(X)' computes the Bessel function of the first kind of
  6966. order 1 of X. This function is available under the name 'BESJ1' as
  6967. a GNU extension.
  6968. _Standard_:
  6969. Fortran 2008
  6970. _Class_:
  6971. Elemental function
  6972. _Syntax_:
  6973. 'RESULT = BESSEL_J1(X)'
  6974. _Arguments_:
  6975. X The type shall be 'REAL'.
  6976. _Return value_:
  6977. The return value is of type 'REAL' and lies in the range -
  6978. 0.5818... \leq Bessel (0,x) \leq 0.5818 . It has the same kind as
  6979. X.
  6980. _Example_:
  6981. program test_besj1
  6982. real(8) :: x = 1.0_8
  6983. x = bessel_j1(x)
  6984. end program test_besj1
  6985. _Specific names_:
  6986. Name Argument Return type Standard
  6987. 'DBESJ1(X)' 'REAL(8) X' 'REAL(8)' GNU extension
  6988. 
  6989. File: gfortran.info, Node: BESSEL_JN, Next: BESSEL_Y0, Prev: BESSEL_J1, Up: Intrinsic Procedures
  6990. 9.42 'BESSEL_JN' -- Bessel function of the first kind
  6991. =====================================================
  6992. _Description_:
  6993. 'BESSEL_JN(N, X)' computes the Bessel function of the first kind of
  6994. order N of X. This function is available under the name 'BESJN' as
  6995. a GNU extension. If N and X are arrays, their ranks and shapes
  6996. shall conform.
  6997. 'BESSEL_JN(N1, N2, X)' returns an array with the Bessel functions
  6998. of the first kind of the orders N1 to N2.
  6999. _Standard_:
  7000. Fortran 2008 and later, negative N is allowed as GNU extension
  7001. _Class_:
  7002. Elemental function, except for the transformational function
  7003. 'BESSEL_JN(N1, N2, X)'
  7004. _Syntax_:
  7005. 'RESULT = BESSEL_JN(N, X)'
  7006. 'RESULT = BESSEL_JN(N1, N2, X)'
  7007. _Arguments_:
  7008. N Shall be a scalar or an array of type 'INTEGER'.
  7009. N1 Shall be a non-negative scalar of type
  7010. 'INTEGER'.
  7011. N2 Shall be a non-negative scalar of type
  7012. 'INTEGER'.
  7013. X Shall be a scalar or an array of type 'REAL';
  7014. for 'BESSEL_JN(N1, N2, X)' it shall be scalar.
  7015. _Return value_:
  7016. The return value is a scalar of type 'REAL'. It has the same kind
  7017. as X.
  7018. _Note_:
  7019. The transformational function uses a recurrence algorithm which
  7020. might, for some values of X, lead to different results than calls
  7021. to the elemental function.
  7022. _Example_:
  7023. program test_besjn
  7024. real(8) :: x = 1.0_8
  7025. x = bessel_jn(5,x)
  7026. end program test_besjn
  7027. _Specific names_:
  7028. Name Argument Return type Standard
  7029. 'DBESJN(N, 'INTEGER N' 'REAL(8)' GNU extension
  7030. X)'
  7031. 'REAL(8) X'
  7032. 
  7033. File: gfortran.info, Node: BESSEL_Y0, Next: BESSEL_Y1, Prev: BESSEL_JN, Up: Intrinsic Procedures
  7034. 9.43 'BESSEL_Y0' -- Bessel function of the second kind of order 0
  7035. =================================================================
  7036. _Description_:
  7037. 'BESSEL_Y0(X)' computes the Bessel function of the second kind of
  7038. order 0 of X. This function is available under the name 'BESY0' as
  7039. a GNU extension.
  7040. _Standard_:
  7041. Fortran 2008 and later
  7042. _Class_:
  7043. Elemental function
  7044. _Syntax_:
  7045. 'RESULT = BESSEL_Y0(X)'
  7046. _Arguments_:
  7047. X The type shall be 'REAL'.
  7048. _Return value_:
  7049. The return value is of type 'REAL'. It has the same kind as X.
  7050. _Example_:
  7051. program test_besy0
  7052. real(8) :: x = 0.0_8
  7053. x = bessel_y0(x)
  7054. end program test_besy0
  7055. _Specific names_:
  7056. Name Argument Return type Standard
  7057. 'DBESY0(X)' 'REAL(8) X' 'REAL(8)' GNU extension
  7058. 
  7059. File: gfortran.info, Node: BESSEL_Y1, Next: BESSEL_YN, Prev: BESSEL_Y0, Up: Intrinsic Procedures
  7060. 9.44 'BESSEL_Y1' -- Bessel function of the second kind of order 1
  7061. =================================================================
  7062. _Description_:
  7063. 'BESSEL_Y1(X)' computes the Bessel function of the second kind of
  7064. order 1 of X. This function is available under the name 'BESY1' as
  7065. a GNU extension.
  7066. _Standard_:
  7067. Fortran 2008 and later
  7068. _Class_:
  7069. Elemental function
  7070. _Syntax_:
  7071. 'RESULT = BESSEL_Y1(X)'
  7072. _Arguments_:
  7073. X The type shall be 'REAL'.
  7074. _Return value_:
  7075. The return value is of type 'REAL'. It has the same kind as X.
  7076. _Example_:
  7077. program test_besy1
  7078. real(8) :: x = 1.0_8
  7079. x = bessel_y1(x)
  7080. end program test_besy1
  7081. _Specific names_:
  7082. Name Argument Return type Standard
  7083. 'DBESY1(X)' 'REAL(8) X' 'REAL(8)' GNU extension
  7084. 
  7085. File: gfortran.info, Node: BESSEL_YN, Next: BGE, Prev: BESSEL_Y1, Up: Intrinsic Procedures
  7086. 9.45 'BESSEL_YN' -- Bessel function of the second kind
  7087. ======================================================
  7088. _Description_:
  7089. 'BESSEL_YN(N, X)' computes the Bessel function of the second kind
  7090. of order N of X. This function is available under the name 'BESYN'
  7091. as a GNU extension. If N and X are arrays, their ranks and shapes
  7092. shall conform.
  7093. 'BESSEL_YN(N1, N2, X)' returns an array with the Bessel functions
  7094. of the first kind of the orders N1 to N2.
  7095. _Standard_:
  7096. Fortran 2008 and later, negative N is allowed as GNU extension
  7097. _Class_:
  7098. Elemental function, except for the transformational function
  7099. 'BESSEL_YN(N1, N2, X)'
  7100. _Syntax_:
  7101. 'RESULT = BESSEL_YN(N, X)'
  7102. 'RESULT = BESSEL_YN(N1, N2, X)'
  7103. _Arguments_:
  7104. N Shall be a scalar or an array of type 'INTEGER'
  7105. .
  7106. N1 Shall be a non-negative scalar of type
  7107. 'INTEGER'.
  7108. N2 Shall be a non-negative scalar of type
  7109. 'INTEGER'.
  7110. X Shall be a scalar or an array of type 'REAL';
  7111. for 'BESSEL_YN(N1, N2, X)' it shall be scalar.
  7112. _Return value_:
  7113. The return value is a scalar of type 'REAL'. It has the same kind
  7114. as X.
  7115. _Note_:
  7116. The transformational function uses a recurrence algorithm which
  7117. might, for some values of X, lead to different results than calls
  7118. to the elemental function.
  7119. _Example_:
  7120. program test_besyn
  7121. real(8) :: x = 1.0_8
  7122. x = bessel_yn(5,x)
  7123. end program test_besyn
  7124. _Specific names_:
  7125. Name Argument Return type Standard
  7126. 'DBESYN(N,X)' 'INTEGER N' 'REAL(8)' GNU extension
  7127. 'REAL(8) X'
  7128. 
  7129. File: gfortran.info, Node: BGE, Next: BGT, Prev: BESSEL_YN, Up: Intrinsic Procedures
  7130. 9.46 'BGE' -- Bitwise greater than or equal to
  7131. ==============================================
  7132. _Description_:
  7133. Determines whether an integral is a bitwise greater than or equal
  7134. to another.
  7135. _Standard_:
  7136. Fortran 2008 and later
  7137. _Class_:
  7138. Elemental function
  7139. _Syntax_:
  7140. 'RESULT = BGE(I, J)'
  7141. _Arguments_:
  7142. I Shall be of 'INTEGER' type.
  7143. J Shall be of 'INTEGER' type, and of the same kind
  7144. as I.
  7145. _Return value_:
  7146. The return value is of type 'LOGICAL' and of the default kind.
  7147. _See also_:
  7148. *note BGT::, *note BLE::, *note BLT::
  7149. 
  7150. File: gfortran.info, Node: BGT, Next: BIT_SIZE, Prev: BGE, Up: Intrinsic Procedures
  7151. 9.47 'BGT' -- Bitwise greater than
  7152. ==================================
  7153. _Description_:
  7154. Determines whether an integral is a bitwise greater than another.
  7155. _Standard_:
  7156. Fortran 2008 and later
  7157. _Class_:
  7158. Elemental function
  7159. _Syntax_:
  7160. 'RESULT = BGT(I, J)'
  7161. _Arguments_:
  7162. I Shall be of 'INTEGER' type.
  7163. J Shall be of 'INTEGER' type, and of the same kind
  7164. as I.
  7165. _Return value_:
  7166. The return value is of type 'LOGICAL' and of the default kind.
  7167. _See also_:
  7168. *note BGE::, *note BLE::, *note BLT::
  7169. 
  7170. File: gfortran.info, Node: BIT_SIZE, Next: BLE, Prev: BGT, Up: Intrinsic Procedures
  7171. 9.48 'BIT_SIZE' -- Bit size inquiry function
  7172. ============================================
  7173. _Description_:
  7174. 'BIT_SIZE(I)' returns the number of bits (integer precision plus
  7175. sign bit) represented by the type of I. The result of
  7176. 'BIT_SIZE(I)' is independent of the actual value of I.
  7177. _Standard_:
  7178. Fortran 95 and later
  7179. _Class_:
  7180. Inquiry function
  7181. _Syntax_:
  7182. 'RESULT = BIT_SIZE(I)'
  7183. _Arguments_:
  7184. I The type shall be 'INTEGER'.
  7185. _Return value_:
  7186. The return value is of type 'INTEGER'
  7187. _Example_:
  7188. program test_bit_size
  7189. integer :: i = 123
  7190. integer :: size
  7191. size = bit_size(i)
  7192. print *, size
  7193. end program test_bit_size
  7194. 
  7195. File: gfortran.info, Node: BLE, Next: BLT, Prev: BIT_SIZE, Up: Intrinsic Procedures
  7196. 9.49 'BLE' -- Bitwise less than or equal to
  7197. ===========================================
  7198. _Description_:
  7199. Determines whether an integral is a bitwise less than or equal to
  7200. another.
  7201. _Standard_:
  7202. Fortran 2008 and later
  7203. _Class_:
  7204. Elemental function
  7205. _Syntax_:
  7206. 'RESULT = BLE(I, J)'
  7207. _Arguments_:
  7208. I Shall be of 'INTEGER' type.
  7209. J Shall be of 'INTEGER' type, and of the same kind
  7210. as I.
  7211. _Return value_:
  7212. The return value is of type 'LOGICAL' and of the default kind.
  7213. _See also_:
  7214. *note BGT::, *note BGE::, *note BLT::
  7215. 
  7216. File: gfortran.info, Node: BLT, Next: BTEST, Prev: BLE, Up: Intrinsic Procedures
  7217. 9.50 'BLT' -- Bitwise less than
  7218. ===============================
  7219. _Description_:
  7220. Determines whether an integral is a bitwise less than another.
  7221. _Standard_:
  7222. Fortran 2008 and later
  7223. _Class_:
  7224. Elemental function
  7225. _Syntax_:
  7226. 'RESULT = BLT(I, J)'
  7227. _Arguments_:
  7228. I Shall be of 'INTEGER' type.
  7229. J Shall be of 'INTEGER' type, and of the same kind
  7230. as I.
  7231. _Return value_:
  7232. The return value is of type 'LOGICAL' and of the default kind.
  7233. _See also_:
  7234. *note BGE::, *note BGT::, *note BLE::
  7235. 
  7236. File: gfortran.info, Node: BTEST, Next: C_ASSOCIATED, Prev: BLT, Up: Intrinsic Procedures
  7237. 9.51 'BTEST' -- Bit test function
  7238. =================================
  7239. _Description_:
  7240. 'BTEST(I,POS)' returns logical '.TRUE.' if the bit at POS in I is
  7241. set. The counting of the bits starts at 0.
  7242. _Standard_:
  7243. Fortran 95 and later, has overloads that are GNU extensions
  7244. _Class_:
  7245. Elemental function
  7246. _Syntax_:
  7247. 'RESULT = BTEST(I, POS)'
  7248. _Arguments_:
  7249. I The type shall be 'INTEGER'.
  7250. POS The type shall be 'INTEGER'.
  7251. _Return value_:
  7252. The return value is of type 'LOGICAL'
  7253. _Example_:
  7254. program test_btest
  7255. integer :: i = 32768 + 1024 + 64
  7256. integer :: pos
  7257. logical :: bool
  7258. do pos=0,16
  7259. bool = btest(i, pos)
  7260. print *, pos, bool
  7261. end do
  7262. end program test_btest
  7263. _Specific names_:
  7264. Name Argument Return type Standard
  7265. 'BTEST(I,POS)' 'INTEGER 'LOGICAL' F95 and later
  7266. I,POS'
  7267. 'BBTEST(I,POS)''INTEGER(1) 'LOGICAL(1)' GNU extension
  7268. I,POS'
  7269. 'BITEST(I,POS)''INTEGER(2) 'LOGICAL(2)' GNU extension
  7270. I,POS'
  7271. 'BJTEST(I,POS)''INTEGER(4) 'LOGICAL(4)' GNU extension
  7272. I,POS'
  7273. 'BKTEST(I,POS)''INTEGER(8) 'LOGICAL(8)' GNU extension
  7274. I,POS'
  7275. 
  7276. File: gfortran.info, Node: C_ASSOCIATED, Next: C_F_POINTER, Prev: BTEST, Up: Intrinsic Procedures
  7277. 9.52 'C_ASSOCIATED' -- Status of a C pointer
  7278. ============================================
  7279. _Description_:
  7280. 'C_ASSOCIATED(c_ptr_1[, c_ptr_2])' determines the status of the C
  7281. pointer C_PTR_1 or if C_PTR_1 is associated with the target
  7282. C_PTR_2.
  7283. _Standard_:
  7284. Fortran 2003 and later
  7285. _Class_:
  7286. Inquiry function
  7287. _Syntax_:
  7288. 'RESULT = C_ASSOCIATED(c_ptr_1[, c_ptr_2])'
  7289. _Arguments_:
  7290. C_PTR_1 Scalar of the type 'C_PTR' or 'C_FUNPTR'.
  7291. C_PTR_2 (Optional) Scalar of the same type as C_PTR_1.
  7292. _Return value_:
  7293. The return value is of type 'LOGICAL'; it is '.false.' if either
  7294. C_PTR_1 is a C NULL pointer or if C_PTR1 and C_PTR_2 point to
  7295. different addresses.
  7296. _Example_:
  7297. subroutine association_test(a,b)
  7298. use iso_c_binding, only: c_associated, c_loc, c_ptr
  7299. implicit none
  7300. real, pointer :: a
  7301. type(c_ptr) :: b
  7302. if(c_associated(b, c_loc(a))) &
  7303. stop 'b and a do not point to same target'
  7304. end subroutine association_test
  7305. _See also_:
  7306. *note C_LOC::, *note C_FUNLOC::
  7307. 
  7308. File: gfortran.info, Node: C_F_POINTER, Next: C_F_PROCPOINTER, Prev: C_ASSOCIATED, Up: Intrinsic Procedures
  7309. 9.53 'C_F_POINTER' -- Convert C into Fortran pointer
  7310. ====================================================
  7311. _Description_:
  7312. 'C_F_POINTER(CPTR, FPTR[, SHAPE])' assigns the target of the C
  7313. pointer CPTR to the Fortran pointer FPTR and specifies its shape.
  7314. _Standard_:
  7315. Fortran 2003 and later
  7316. _Class_:
  7317. Subroutine
  7318. _Syntax_:
  7319. 'CALL C_F_POINTER(CPTR, FPTR[, SHAPE])'
  7320. _Arguments_:
  7321. CPTR scalar of the type 'C_PTR'. It is 'INTENT(IN)'.
  7322. FPTR pointer interoperable with CPTR. It is
  7323. 'INTENT(OUT)'.
  7324. SHAPE (Optional) Rank-one array of type 'INTEGER' with
  7325. 'INTENT(IN)'. It shall be present if and only
  7326. if FPTR is an array. The size must be equal to
  7327. the rank of FPTR.
  7328. _Example_:
  7329. program main
  7330. use iso_c_binding
  7331. implicit none
  7332. interface
  7333. subroutine my_routine(p) bind(c,name='myC_func')
  7334. import :: c_ptr
  7335. type(c_ptr), intent(out) :: p
  7336. end subroutine
  7337. end interface
  7338. type(c_ptr) :: cptr
  7339. real,pointer :: a(:)
  7340. call my_routine(cptr)
  7341. call c_f_pointer(cptr, a, [12])
  7342. end program main
  7343. _See also_:
  7344. *note C_LOC::, *note C_F_PROCPOINTER::
  7345. 
  7346. File: gfortran.info, Node: C_F_PROCPOINTER, Next: C_FUNLOC, Prev: C_F_POINTER, Up: Intrinsic Procedures
  7347. 9.54 'C_F_PROCPOINTER' -- Convert C into Fortran procedure pointer
  7348. ==================================================================
  7349. _Description_:
  7350. 'C_F_PROCPOINTER(CPTR, FPTR)' Assign the target of the C function
  7351. pointer CPTR to the Fortran procedure pointer FPTR.
  7352. _Standard_:
  7353. Fortran 2003 and later
  7354. _Class_:
  7355. Subroutine
  7356. _Syntax_:
  7357. 'CALL C_F_PROCPOINTER(cptr, fptr)'
  7358. _Arguments_:
  7359. CPTR scalar of the type 'C_FUNPTR'. It is
  7360. 'INTENT(IN)'.
  7361. FPTR procedure pointer interoperable with CPTR. It
  7362. is 'INTENT(OUT)'.
  7363. _Example_:
  7364. program main
  7365. use iso_c_binding
  7366. implicit none
  7367. abstract interface
  7368. function func(a)
  7369. import :: c_float
  7370. real(c_float), intent(in) :: a
  7371. real(c_float) :: func
  7372. end function
  7373. end interface
  7374. interface
  7375. function getIterFunc() bind(c,name="getIterFunc")
  7376. import :: c_funptr
  7377. type(c_funptr) :: getIterFunc
  7378. end function
  7379. end interface
  7380. type(c_funptr) :: cfunptr
  7381. procedure(func), pointer :: myFunc
  7382. cfunptr = getIterFunc()
  7383. call c_f_procpointer(cfunptr, myFunc)
  7384. end program main
  7385. _See also_:
  7386. *note C_LOC::, *note C_F_POINTER::
  7387. 
  7388. File: gfortran.info, Node: C_FUNLOC, Next: C_LOC, Prev: C_F_PROCPOINTER, Up: Intrinsic Procedures
  7389. 9.55 'C_FUNLOC' -- Obtain the C address of a procedure
  7390. ======================================================
  7391. _Description_:
  7392. 'C_FUNLOC(x)' determines the C address of the argument.
  7393. _Standard_:
  7394. Fortran 2003 and later
  7395. _Class_:
  7396. Inquiry function
  7397. _Syntax_:
  7398. 'RESULT = C_FUNLOC(x)'
  7399. _Arguments_:
  7400. X Interoperable function or pointer to such
  7401. function.
  7402. _Return value_:
  7403. The return value is of type 'C_FUNPTR' and contains the C address
  7404. of the argument.
  7405. _Example_:
  7406. module x
  7407. use iso_c_binding
  7408. implicit none
  7409. contains
  7410. subroutine sub(a) bind(c)
  7411. real(c_float) :: a
  7412. a = sqrt(a)+5.0
  7413. end subroutine sub
  7414. end module x
  7415. program main
  7416. use iso_c_binding
  7417. use x
  7418. implicit none
  7419. interface
  7420. subroutine my_routine(p) bind(c,name='myC_func')
  7421. import :: c_funptr
  7422. type(c_funptr), intent(in) :: p
  7423. end subroutine
  7424. end interface
  7425. call my_routine(c_funloc(sub))
  7426. end program main
  7427. _See also_:
  7428. *note C_ASSOCIATED::, *note C_LOC::, *note C_F_POINTER::, *note
  7429. C_F_PROCPOINTER::
  7430. 
  7431. File: gfortran.info, Node: C_LOC, Next: C_SIZEOF, Prev: C_FUNLOC, Up: Intrinsic Procedures
  7432. 9.56 'C_LOC' -- Obtain the C address of an object
  7433. =================================================
  7434. _Description_:
  7435. 'C_LOC(X)' determines the C address of the argument.
  7436. _Standard_:
  7437. Fortran 2003 and later
  7438. _Class_:
  7439. Inquiry function
  7440. _Syntax_:
  7441. 'RESULT = C_LOC(X)'
  7442. _Arguments_:
  7443. X Shall have either the POINTER or TARGET attribute.
  7444. It shall not be a coindexed object. It shall either
  7445. be a variable with interoperable type and kind type
  7446. parameters, or be a scalar, nonpolymorphic variable
  7447. with no length type parameters.
  7448. _Return value_:
  7449. The return value is of type 'C_PTR' and contains the C address of
  7450. the argument.
  7451. _Example_:
  7452. subroutine association_test(a,b)
  7453. use iso_c_binding, only: c_associated, c_loc, c_ptr
  7454. implicit none
  7455. real, pointer :: a
  7456. type(c_ptr) :: b
  7457. if(c_associated(b, c_loc(a))) &
  7458. stop 'b and a do not point to same target'
  7459. end subroutine association_test
  7460. _See also_:
  7461. *note C_ASSOCIATED::, *note C_FUNLOC::, *note C_F_POINTER::, *note
  7462. C_F_PROCPOINTER::
  7463. 
  7464. File: gfortran.info, Node: C_SIZEOF, Next: CEILING, Prev: C_LOC, Up: Intrinsic Procedures
  7465. 9.57 'C_SIZEOF' -- Size in bytes of an expression
  7466. =================================================
  7467. _Description_:
  7468. 'C_SIZEOF(X)' calculates the number of bytes of storage the
  7469. expression 'X' occupies.
  7470. _Standard_:
  7471. Fortran 2008
  7472. _Class_:
  7473. Inquiry function of the module 'ISO_C_BINDING'
  7474. _Syntax_:
  7475. 'N = C_SIZEOF(X)'
  7476. _Arguments_:
  7477. X The argument shall be an interoperable data
  7478. entity.
  7479. _Return value_:
  7480. The return value is of type integer and of the system-dependent
  7481. kind 'C_SIZE_T' (from the 'ISO_C_BINDING' module). Its value is
  7482. the number of bytes occupied by the argument. If the argument has
  7483. the 'POINTER' attribute, the number of bytes of the storage area
  7484. pointed to is returned. If the argument is of a derived type with
  7485. 'POINTER' or 'ALLOCATABLE' components, the return value does not
  7486. account for the sizes of the data pointed to by these components.
  7487. _Example_:
  7488. use iso_c_binding
  7489. integer(c_int) :: i
  7490. real(c_float) :: r, s(5)
  7491. print *, (c_sizeof(s)/c_sizeof(r) == 5)
  7492. end
  7493. The example will print '.TRUE.' unless you are using a platform
  7494. where default 'REAL' variables are unusually padded.
  7495. _See also_:
  7496. *note SIZEOF::, *note STORAGE_SIZE::
  7497. 
  7498. File: gfortran.info, Node: CEILING, Next: CHAR, Prev: C_SIZEOF, Up: Intrinsic Procedures
  7499. 9.58 'CEILING' -- Integer ceiling function
  7500. ==========================================
  7501. _Description_:
  7502. 'CEILING(A)' returns the least integer greater than or equal to A.
  7503. _Standard_:
  7504. Fortran 95 and later
  7505. _Class_:
  7506. Elemental function
  7507. _Syntax_:
  7508. 'RESULT = CEILING(A [, KIND])'
  7509. _Arguments_:
  7510. A The type shall be 'REAL'.
  7511. KIND (Optional) An 'INTEGER' initialization
  7512. expression indicating the kind parameter of the
  7513. result.
  7514. _Return value_:
  7515. The return value is of type 'INTEGER(KIND)' if KIND is present and
  7516. a default-kind 'INTEGER' otherwise.
  7517. _Example_:
  7518. program test_ceiling
  7519. real :: x = 63.29
  7520. real :: y = -63.59
  7521. print *, ceiling(x) ! returns 64
  7522. print *, ceiling(y) ! returns -63
  7523. end program test_ceiling
  7524. _See also_:
  7525. *note FLOOR::, *note NINT::
  7526. 
  7527. File: gfortran.info, Node: CHAR, Next: CHDIR, Prev: CEILING, Up: Intrinsic Procedures
  7528. 9.59 'CHAR' -- Character conversion function
  7529. ============================================
  7530. _Description_:
  7531. 'CHAR(I [, KIND])' returns the character represented by the integer
  7532. I.
  7533. _Standard_:
  7534. Fortran 77 and later
  7535. _Class_:
  7536. Elemental function
  7537. _Syntax_:
  7538. 'RESULT = CHAR(I [, KIND])'
  7539. _Arguments_:
  7540. I The type shall be 'INTEGER'.
  7541. KIND (Optional) An 'INTEGER' initialization
  7542. expression indicating the kind parameter of the
  7543. result.
  7544. _Return value_:
  7545. The return value is of type 'CHARACTER(1)'
  7546. _Example_:
  7547. program test_char
  7548. integer :: i = 74
  7549. character(1) :: c
  7550. c = char(i)
  7551. print *, i, c ! returns 'J'
  7552. end program test_char
  7553. _Specific names_:
  7554. Name Argument Return type Standard
  7555. 'CHAR(I)' 'INTEGER I' 'CHARACTER(LEN=1)'F77 and later
  7556. _Note_:
  7557. See *note ICHAR:: for a discussion of converting between numerical
  7558. values and formatted string representations.
  7559. _See also_:
  7560. *note ACHAR::, *note IACHAR::, *note ICHAR::
  7561. 
  7562. File: gfortran.info, Node: CHDIR, Next: CHMOD, Prev: CHAR, Up: Intrinsic Procedures
  7563. 9.60 'CHDIR' -- Change working directory
  7564. ========================================
  7565. _Description_:
  7566. Change current working directory to a specified path.
  7567. This intrinsic is provided in both subroutine and function forms;
  7568. however, only one form can be used in any given program unit.
  7569. _Standard_:
  7570. GNU extension
  7571. _Class_:
  7572. Subroutine, function
  7573. _Syntax_:
  7574. 'CALL CHDIR(NAME [, STATUS])'
  7575. 'STATUS = CHDIR(NAME)'
  7576. _Arguments_:
  7577. NAME The type shall be 'CHARACTER' of default kind
  7578. and shall specify a valid path within the file
  7579. system.
  7580. STATUS (Optional) 'INTEGER' status flag of the default
  7581. kind. Returns 0 on success, and a system
  7582. specific and nonzero error code otherwise.
  7583. _Example_:
  7584. PROGRAM test_chdir
  7585. CHARACTER(len=255) :: path
  7586. CALL getcwd(path)
  7587. WRITE(*,*) TRIM(path)
  7588. CALL chdir("/tmp")
  7589. CALL getcwd(path)
  7590. WRITE(*,*) TRIM(path)
  7591. END PROGRAM
  7592. _See also_:
  7593. *note GETCWD::
  7594. 
  7595. File: gfortran.info, Node: CHMOD, Next: CMPLX, Prev: CHDIR, Up: Intrinsic Procedures
  7596. 9.61 'CHMOD' -- Change access permissions of files
  7597. ==================================================
  7598. _Description_:
  7599. 'CHMOD' changes the permissions of a file.
  7600. This intrinsic is provided in both subroutine and function forms;
  7601. however, only one form can be used in any given program unit.
  7602. _Standard_:
  7603. GNU extension
  7604. _Class_:
  7605. Subroutine, function
  7606. _Syntax_:
  7607. 'CALL CHMOD(NAME, MODE[, STATUS])'
  7608. 'STATUS = CHMOD(NAME, MODE)'
  7609. _Arguments_:
  7610. NAME Scalar 'CHARACTER' of default kind with the file
  7611. name. Trailing blanks are ignored unless the
  7612. character 'achar(0)' is present, then all
  7613. characters up to and excluding 'achar(0)' are
  7614. used as the file name.
  7615. MODE Scalar 'CHARACTER' of default kind giving the
  7616. file permission. MODE uses the same syntax as
  7617. the 'chmod' utility as defined by the POSIX
  7618. standard. The argument shall either be a string
  7619. of a nonnegative octal number or a symbolic
  7620. mode.
  7621. STATUS (optional) scalar 'INTEGER', which is '0' on
  7622. success and nonzero otherwise.
  7623. _Return value_:
  7624. In either syntax, STATUS is set to '0' on success and nonzero
  7625. otherwise.
  7626. _Example_:
  7627. 'CHMOD' as subroutine
  7628. program chmod_test
  7629. implicit none
  7630. integer :: status
  7631. call chmod('test.dat','u+x',status)
  7632. print *, 'Status: ', status
  7633. end program chmod_test
  7634. 'CHMOD' as function:
  7635. program chmod_test
  7636. implicit none
  7637. integer :: status
  7638. status = chmod('test.dat','u+x')
  7639. print *, 'Status: ', status
  7640. end program chmod_test
  7641. 
  7642. File: gfortran.info, Node: CMPLX, Next: CO_BROADCAST, Prev: CHMOD, Up: Intrinsic Procedures
  7643. 9.62 'CMPLX' -- Complex conversion function
  7644. ===========================================
  7645. _Description_:
  7646. 'CMPLX(X [, Y [, KIND]])' returns a complex number where X is
  7647. converted to the real component. If Y is present it is converted
  7648. to the imaginary component. If Y is not present then the imaginary
  7649. component is set to 0.0. If X is complex then Y must not be
  7650. present.
  7651. _Standard_:
  7652. Fortran 77 and later
  7653. _Class_:
  7654. Elemental function
  7655. _Syntax_:
  7656. 'RESULT = CMPLX(X [, Y [, KIND]])'
  7657. _Arguments_:
  7658. X The type may be 'INTEGER', 'REAL', or 'COMPLEX'.
  7659. Y (Optional; only allowed if X is not 'COMPLEX'.)
  7660. May be 'INTEGER' or 'REAL'.
  7661. KIND (Optional) An 'INTEGER' initialization
  7662. expression indicating the kind parameter of the
  7663. result.
  7664. _Return value_:
  7665. The return value is of 'COMPLEX' type, with a kind equal to KIND if
  7666. it is specified. If KIND is not specified, the result is of the
  7667. default 'COMPLEX' kind, regardless of the kinds of X and Y.
  7668. _Example_:
  7669. program test_cmplx
  7670. integer :: i = 42
  7671. real :: x = 3.14
  7672. complex :: z
  7673. z = cmplx(i, x)
  7674. print *, z, cmplx(x)
  7675. end program test_cmplx
  7676. _See also_:
  7677. *note COMPLEX::
  7678. 
  7679. File: gfortran.info, Node: CO_BROADCAST, Next: CO_MAX, Prev: CMPLX, Up: Intrinsic Procedures
  7680. 9.63 'CO_BROADCAST' -- Copy a value to all images the current set of images
  7681. ===========================================================================
  7682. _Description_:
  7683. 'CO_BROADCAST' copies the value of argument A on the image with
  7684. image index 'SOURCE_IMAGE' to all images in the current team. A
  7685. becomes defined as if by intrinsic assignment. If the execution
  7686. was successful and STAT is present, it is assigned the value zero.
  7687. If the execution failed, STAT gets assigned a nonzero value and, if
  7688. present, ERRMSG gets assigned a value describing the occurred
  7689. error.
  7690. _Standard_:
  7691. Technical Specification (TS) 18508 or later
  7692. _Class_:
  7693. Collective subroutine
  7694. _Syntax_:
  7695. 'CALL CO_BROADCAST(A, SOURCE_IMAGE [, STAT, ERRMSG])'
  7696. _Arguments_:
  7697. A INTENT(INOUT) argument; shall have the same
  7698. dynamic type and type paramters on all images of
  7699. the current team. If it is an array, it shall
  7700. have the same shape on all images.
  7701. SOURCE_IMAGEa scalar integer expression. It shall have the
  7702. same the same value on all images and refer to
  7703. an image of the current team.
  7704. STAT (optional) a scalar integer variable
  7705. ERRMSG (optional) a scalar character variable
  7706. _Example_:
  7707. program test
  7708. integer :: val(3)
  7709. if (this_image() == 1) then
  7710. val = [1, 5, 3]
  7711. end if
  7712. call co_broadcast (val, source_image=1)
  7713. print *, this_image, ":", val
  7714. end program test
  7715. _See also_:
  7716. *note CO_MAX::, *note CO_MIN::, *note CO_SUM::, *note CO_REDUCE::
  7717. 
  7718. File: gfortran.info, Node: CO_MAX, Next: CO_MIN, Prev: CO_BROADCAST, Up: Intrinsic Procedures
  7719. 9.64 'CO_MAX' -- Maximal value on the current set of images
  7720. ===========================================================
  7721. _Description_:
  7722. 'CO_MAX' determines element-wise the maximal value of A on all
  7723. images of the current team. If RESULT_IMAGE is present, the
  7724. maximum values are returned in A on the specified image only and
  7725. the value of A on the other images become undefined. If
  7726. RESULT_IMAGE is not present, the value is returned on all images.
  7727. If the execution was successful and STAT is present, it is assigned
  7728. the value zero. If the execution failed, STAT gets assigned a
  7729. nonzero value and, if present, ERRMSG gets assigned a value
  7730. describing the occurred error.
  7731. _Standard_:
  7732. Technical Specification (TS) 18508 or later
  7733. _Class_:
  7734. Collective subroutine
  7735. _Syntax_:
  7736. 'CALL CO_MAX(A [, RESULT_IMAGE, STAT, ERRMSG])'
  7737. _Arguments_:
  7738. A shall be an integer, real or character variable,
  7739. which has the same type and type parameters on
  7740. all images of the team.
  7741. RESULT_IMAGE(optional) a scalar integer expression; if
  7742. present, it shall have the same the same value
  7743. on all images and refer to an image of the
  7744. current team.
  7745. STAT (optional) a scalar integer variable
  7746. ERRMSG (optional) a scalar character variable
  7747. _Example_:
  7748. program test
  7749. integer :: val
  7750. val = this_image ()
  7751. call co_max (val, result_image=1)
  7752. if (this_image() == 1) then
  7753. write(*,*) "Maximal value", val ! prints num_images()
  7754. end if
  7755. end program test
  7756. _See also_:
  7757. *note CO_MIN::, *note CO_SUM::, *note CO_REDUCE::, *note
  7758. CO_BROADCAST::
  7759. 
  7760. File: gfortran.info, Node: CO_MIN, Next: CO_REDUCE, Prev: CO_MAX, Up: Intrinsic Procedures
  7761. 9.65 'CO_MIN' -- Minimal value on the current set of images
  7762. ===========================================================
  7763. _Description_:
  7764. 'CO_MIN' determines element-wise the minimal value of A on all
  7765. images of the current team. If RESULT_IMAGE is present, the
  7766. minimal values are returned in A on the specified image only and
  7767. the value of A on the other images become undefined. If
  7768. RESULT_IMAGE is not present, the value is returned on all images.
  7769. If the execution was successful and STAT is present, it is assigned
  7770. the value zero. If the execution failed, STAT gets assigned a
  7771. nonzero value and, if present, ERRMSG gets assigned a value
  7772. describing the occurred error.
  7773. _Standard_:
  7774. Technical Specification (TS) 18508 or later
  7775. _Class_:
  7776. Collective subroutine
  7777. _Syntax_:
  7778. 'CALL CO_MIN(A [, RESULT_IMAGE, STAT, ERRMSG])'
  7779. _Arguments_:
  7780. A shall be an integer, real or character variable,
  7781. which has the same type and type parameters on
  7782. all images of the team.
  7783. RESULT_IMAGE(optional) a scalar integer expression; if
  7784. present, it shall have the same the same value
  7785. on all images and refer to an image of the
  7786. current team.
  7787. STAT (optional) a scalar integer variable
  7788. ERRMSG (optional) a scalar character variable
  7789. _Example_:
  7790. program test
  7791. integer :: val
  7792. val = this_image ()
  7793. call co_min (val, result_image=1)
  7794. if (this_image() == 1) then
  7795. write(*,*) "Minimal value", val ! prints 1
  7796. end if
  7797. end program test
  7798. _See also_:
  7799. *note CO_MAX::, *note CO_SUM::, *note CO_REDUCE::, *note
  7800. CO_BROADCAST::
  7801. 
  7802. File: gfortran.info, Node: CO_REDUCE, Next: CO_SUM, Prev: CO_MIN, Up: Intrinsic Procedures
  7803. 9.66 'CO_REDUCE' -- Reduction of values on the current set of images
  7804. ====================================================================
  7805. _Description_:
  7806. 'CO_REDUCE' determines element-wise the reduction of the value of A
  7807. on all images of the current team. The pure function passed as
  7808. OPERATOR is used to pairwise reduce the values of A by passing
  7809. either the value of A of different images or the result values of
  7810. such a reduction as argument. If A is an array, the deduction is
  7811. done element wise. If RESULT_IMAGE is present, the result values
  7812. are returned in A on the specified image only and the value of A on
  7813. the other images become undefined. If RESULT_IMAGE is not present,
  7814. the value is returned on all images. If the execution was
  7815. successful and STAT is present, it is assigned the value zero. If
  7816. the execution failed, STAT gets assigned a nonzero value and, if
  7817. present, ERRMSG gets assigned a value describing the occurred
  7818. error.
  7819. _Standard_:
  7820. Technical Specification (TS) 18508 or later
  7821. _Class_:
  7822. Collective subroutine
  7823. _Syntax_:
  7824. 'CALL CO_REDUCE(A, OPERATOR, [, RESULT_IMAGE, STAT, ERRMSG])'
  7825. _Arguments_:
  7826. A is an 'INTENT(INOUT)' argument and shall be
  7827. nonpolymorphic. If it is allocatable, it shall
  7828. be allocated; if it is a pointer, it shall be
  7829. associated. A shall have the same type and type
  7830. parameters on all images of the team; if it is
  7831. an array, it shall have the same shape on all
  7832. images.
  7833. OPERATOR pure function with two scalar nonallocatable
  7834. arguments, which shall be nonpolymorphic and
  7835. have the same type and type parameters as A.
  7836. The function shall return a nonallocatable
  7837. scalar of the same type and type parameters as
  7838. A. The function shall be the same on all images
  7839. and with regards to the arguments mathematically
  7840. commutative and associative. Note that OPERATOR
  7841. may not be an elemental function, unless it is
  7842. an intrisic function.
  7843. RESULT_IMAGE(optional) a scalar integer expression; if
  7844. present, it shall have the same the same value
  7845. on all images and refer to an image of the
  7846. current team.
  7847. STAT (optional) a scalar integer variable
  7848. ERRMSG (optional) a scalar character variable
  7849. _Example_:
  7850. program test
  7851. integer :: val
  7852. val = this_image ()
  7853. call co_reduce (val, result_image=1, operator=myprod)
  7854. if (this_image() == 1) then
  7855. write(*,*) "Product value", val ! prints num_images() factorial
  7856. end if
  7857. contains
  7858. pure function myprod(a, b)
  7859. integer, value :: a, b
  7860. integer :: myprod
  7861. myprod = a * b
  7862. end function myprod
  7863. end program test
  7864. _Note_:
  7865. While the rules permit in principle an intrinsic function, none of
  7866. the intrinsics in the standard fulfill the criteria of having a
  7867. specific function, which takes two arguments of the same type and
  7868. returning that type as result.
  7869. _See also_:
  7870. *note CO_MIN::, *note CO_MAX::, *note CO_SUM::, *note
  7871. CO_BROADCAST::
  7872. 
  7873. File: gfortran.info, Node: CO_SUM, Next: COMMAND_ARGUMENT_COUNT, Prev: CO_REDUCE, Up: Intrinsic Procedures
  7874. 9.67 'CO_SUM' -- Sum of values on the current set of images
  7875. ===========================================================
  7876. _Description_:
  7877. 'CO_SUM' sums up the values of each element of A on all images of
  7878. the current team. If RESULT_IMAGE is present, the summed-up values
  7879. are returned in A on the specified image only and the value of A on
  7880. the other images become undefined. If RESULT_IMAGE is not present,
  7881. the value is returned on all images. If the execution was
  7882. successful and STAT is present, it is assigned the value zero. If
  7883. the execution failed, STAT gets assigned a nonzero value and, if
  7884. present, ERRMSG gets assigned a value describing the occurred
  7885. error.
  7886. _Standard_:
  7887. Technical Specification (TS) 18508 or later
  7888. _Class_:
  7889. Collective subroutine
  7890. _Syntax_:
  7891. 'CALL CO_MIN(A [, RESULT_IMAGE, STAT, ERRMSG])'
  7892. _Arguments_:
  7893. A shall be an integer, real or complex variable,
  7894. which has the same type and type parameters on
  7895. all images of the team.
  7896. RESULT_IMAGE(optional) a scalar integer expression; if
  7897. present, it shall have the same the same value
  7898. on all images and refer to an image of the
  7899. current team.
  7900. STAT (optional) a scalar integer variable
  7901. ERRMSG (optional) a scalar character variable
  7902. _Example_:
  7903. program test
  7904. integer :: val
  7905. val = this_image ()
  7906. call co_sum (val, result_image=1)
  7907. if (this_image() == 1) then
  7908. write(*,*) "The sum is ", val ! prints (n**2 + n)/2, with n = num_images()
  7909. end if
  7910. end program test
  7911. _See also_:
  7912. *note CO_MAX::, *note CO_MIN::, *note CO_REDUCE::, *note
  7913. CO_BROADCAST::
  7914. 
  7915. File: gfortran.info, Node: COMMAND_ARGUMENT_COUNT, Next: COMPILER_OPTIONS, Prev: CO_SUM, Up: Intrinsic Procedures
  7916. 9.68 'COMMAND_ARGUMENT_COUNT' -- Get number of command line arguments
  7917. =====================================================================
  7918. _Description_:
  7919. 'COMMAND_ARGUMENT_COUNT' returns the number of arguments passed on
  7920. the command line when the containing program was invoked.
  7921. _Standard_:
  7922. Fortran 2003 and later
  7923. _Class_:
  7924. Inquiry function
  7925. _Syntax_:
  7926. 'RESULT = COMMAND_ARGUMENT_COUNT()'
  7927. _Arguments_:
  7928. None
  7929. _Return value_:
  7930. The return value is an 'INTEGER' of default kind.
  7931. _Example_:
  7932. program test_command_argument_count
  7933. integer :: count
  7934. count = command_argument_count()
  7935. print *, count
  7936. end program test_command_argument_count
  7937. _See also_:
  7938. *note GET_COMMAND::, *note GET_COMMAND_ARGUMENT::
  7939. 
  7940. File: gfortran.info, Node: COMPILER_OPTIONS, Next: COMPILER_VERSION, Prev: COMMAND_ARGUMENT_COUNT, Up: Intrinsic Procedures
  7941. 9.69 'COMPILER_OPTIONS' -- Options passed to the compiler
  7942. =========================================================
  7943. _Description_:
  7944. 'COMPILER_OPTIONS' returns a string with the options used for
  7945. compiling.
  7946. _Standard_:
  7947. Fortran 2008
  7948. _Class_:
  7949. Inquiry function of the module 'ISO_FORTRAN_ENV'
  7950. _Syntax_:
  7951. 'STR = COMPILER_OPTIONS()'
  7952. _Arguments_:
  7953. None.
  7954. _Return value_:
  7955. The return value is a default-kind string with system-dependent
  7956. length. It contains the compiler flags used to compile the file,
  7957. which called the 'COMPILER_OPTIONS' intrinsic.
  7958. _Example_:
  7959. use iso_fortran_env
  7960. print '(4a)', 'This file was compiled by ', &
  7961. compiler_version(), ' using the options ', &
  7962. compiler_options()
  7963. end
  7964. _See also_:
  7965. *note COMPILER_VERSION::, *note ISO_FORTRAN_ENV::
  7966. 
  7967. File: gfortran.info, Node: COMPILER_VERSION, Next: COMPLEX, Prev: COMPILER_OPTIONS, Up: Intrinsic Procedures
  7968. 9.70 'COMPILER_VERSION' -- Compiler version string
  7969. ==================================================
  7970. _Description_:
  7971. 'COMPILER_VERSION' returns a string with the name and the version
  7972. of the compiler.
  7973. _Standard_:
  7974. Fortran 2008
  7975. _Class_:
  7976. Inquiry function of the module 'ISO_FORTRAN_ENV'
  7977. _Syntax_:
  7978. 'STR = COMPILER_VERSION()'
  7979. _Arguments_:
  7980. None.
  7981. _Return value_:
  7982. The return value is a default-kind string with system-dependent
  7983. length. It contains the name of the compiler and its version
  7984. number.
  7985. _Example_:
  7986. use iso_fortran_env
  7987. print '(4a)', 'This file was compiled by ', &
  7988. compiler_version(), ' using the options ', &
  7989. compiler_options()
  7990. end
  7991. _See also_:
  7992. *note COMPILER_OPTIONS::, *note ISO_FORTRAN_ENV::
  7993. 
  7994. File: gfortran.info, Node: COMPLEX, Next: CONJG, Prev: COMPILER_VERSION, Up: Intrinsic Procedures
  7995. 9.71 'COMPLEX' -- Complex conversion function
  7996. =============================================
  7997. _Description_:
  7998. 'COMPLEX(X, Y)' returns a complex number where X is converted to
  7999. the real component and Y is converted to the imaginary component.
  8000. _Standard_:
  8001. GNU extension
  8002. _Class_:
  8003. Elemental function
  8004. _Syntax_:
  8005. 'RESULT = COMPLEX(X, Y)'
  8006. _Arguments_:
  8007. X The type may be 'INTEGER' or 'REAL'.
  8008. Y The type may be 'INTEGER' or 'REAL'.
  8009. _Return value_:
  8010. If X and Y are both of 'INTEGER' type, then the return value is of
  8011. default 'COMPLEX' type.
  8012. If X and Y are of 'REAL' type, or one is of 'REAL' type and one is
  8013. of 'INTEGER' type, then the return value is of 'COMPLEX' type with
  8014. a kind equal to that of the 'REAL' argument with the highest
  8015. precision.
  8016. _Example_:
  8017. program test_complex
  8018. integer :: i = 42
  8019. real :: x = 3.14
  8020. print *, complex(i, x)
  8021. end program test_complex
  8022. _See also_:
  8023. *note CMPLX::
  8024. 
  8025. File: gfortran.info, Node: CONJG, Next: COS, Prev: COMPLEX, Up: Intrinsic Procedures
  8026. 9.72 'CONJG' -- Complex conjugate function
  8027. ==========================================
  8028. _Description_:
  8029. 'CONJG(Z)' returns the conjugate of Z. If Z is '(x, y)' then the
  8030. result is '(x, -y)'
  8031. _Standard_:
  8032. Fortran 77 and later, has overloads that are GNU extensions
  8033. _Class_:
  8034. Elemental function
  8035. _Syntax_:
  8036. 'Z = CONJG(Z)'
  8037. _Arguments_:
  8038. Z The type shall be 'COMPLEX'.
  8039. _Return value_:
  8040. The return value is of type 'COMPLEX'.
  8041. _Example_:
  8042. program test_conjg
  8043. complex :: z = (2.0, 3.0)
  8044. complex(8) :: dz = (2.71_8, -3.14_8)
  8045. z= conjg(z)
  8046. print *, z
  8047. dz = dconjg(dz)
  8048. print *, dz
  8049. end program test_conjg
  8050. _Specific names_:
  8051. Name Argument Return type Standard
  8052. 'CONJG(Z)' 'COMPLEX Z' 'COMPLEX' GNU extension
  8053. 'DCONJG(Z)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension
  8054. Z'
  8055. 
  8056. File: gfortran.info, Node: COS, Next: COSD, Prev: CONJG, Up: Intrinsic Procedures
  8057. 9.73 'COS' -- Cosine function
  8058. =============================
  8059. _Description_:
  8060. 'COS(X)' computes the cosine of X.
  8061. _Standard_:
  8062. Fortran 77 and later, has overloads that are GNU extensions
  8063. _Class_:
  8064. Elemental function
  8065. _Syntax_:
  8066. 'RESULT = COS(X)'
  8067. _Arguments_:
  8068. X The type shall be 'REAL' or 'COMPLEX'.
  8069. _Return value_:
  8070. The return value is of the same type and kind as X. The real part
  8071. of the result is in radians. If X is of the type 'REAL', the
  8072. return value lies in the range -1 \leq \cos (x) \leq 1.
  8073. _Example_:
  8074. program test_cos
  8075. real :: x = 0.0
  8076. x = cos(x)
  8077. end program test_cos
  8078. _Specific names_:
  8079. Name Argument Return type Standard
  8080. 'COS(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and
  8081. later
  8082. 'DCOS(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and
  8083. later
  8084. 'CCOS(X)' 'COMPLEX(4) 'COMPLEX(4)' Fortran 77 and
  8085. X' later
  8086. 'ZCOS(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension
  8087. X'
  8088. 'CDCOS(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension
  8089. X'
  8090. _See also_:
  8091. Inverse function: *note ACOS:: Degrees function: *note COSD::
  8092. 
  8093. File: gfortran.info, Node: COSD, Next: COSH, Prev: COS, Up: Intrinsic Procedures
  8094. 9.74 'COSD' -- Cosine function, degrees
  8095. =======================================
  8096. _Description_:
  8097. 'COSD(X)' computes the cosine of X in degrees.
  8098. This function is for compatibility only and should be avoided in
  8099. favor of standard constructs wherever possible.
  8100. _Standard_:
  8101. GNU Extension, enabled with '-fdec-math'.
  8102. _Class_:
  8103. Elemental function
  8104. _Syntax_:
  8105. 'RESULT = COSD(X)'
  8106. _Arguments_:
  8107. X The type shall be 'REAL' or 'COMPLEX'.
  8108. _Return value_:
  8109. The return value is of the same type and kind as X. The real part
  8110. of the result is in degrees. If X is of the type 'REAL', the
  8111. return value lies in the range -1 \leq \cosd (x) \leq 1.
  8112. _Example_:
  8113. program test_cosd
  8114. real :: x = 0.0
  8115. x = cosd(x)
  8116. end program test_cosd
  8117. _Specific names_:
  8118. Name Argument Return type Standard
  8119. 'COSD(X)' 'REAL(4) X' 'REAL(4)' GNU Extension
  8120. 'DCOSD(X)' 'REAL(8) X' 'REAL(8)' GNU Extension
  8121. 'CCOSD(X)' 'COMPLEX(4) 'COMPLEX(4)' GNU Extension
  8122. X'
  8123. 'ZCOSD(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension
  8124. X'
  8125. 'CDCOSD(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension
  8126. X'
  8127. _See also_:
  8128. Inverse function: *note ACOSD:: Radians function: *note COS::
  8129. 
  8130. File: gfortran.info, Node: COSH, Next: COTAN, Prev: COSD, Up: Intrinsic Procedures
  8131. 9.75 'COSH' -- Hyperbolic cosine function
  8132. =========================================
  8133. _Description_:
  8134. 'COSH(X)' computes the hyperbolic cosine of X.
  8135. _Standard_:
  8136. Fortran 77 and later, for a complex argument Fortran 2008 or later
  8137. _Class_:
  8138. Elemental function
  8139. _Syntax_:
  8140. 'X = COSH(X)'
  8141. _Arguments_:
  8142. X The type shall be 'REAL' or 'COMPLEX'.
  8143. _Return value_:
  8144. The return value has same type and kind as X. If X is complex, the
  8145. imaginary part of the result is in radians. If X is 'REAL', the
  8146. return value has a lower bound of one, \cosh (x) \geq 1.
  8147. _Example_:
  8148. program test_cosh
  8149. real(8) :: x = 1.0_8
  8150. x = cosh(x)
  8151. end program test_cosh
  8152. _Specific names_:
  8153. Name Argument Return type Standard
  8154. 'COSH(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and
  8155. later
  8156. 'DCOSH(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and
  8157. later
  8158. _See also_:
  8159. Inverse function: *note ACOSH::
  8160. 
  8161. File: gfortran.info, Node: COTAN, Next: COTAND, Prev: COSH, Up: Intrinsic Procedures
  8162. 9.76 'COTAN' -- Cotangent function
  8163. ==================================
  8164. _Description_:
  8165. 'COTAN(X)' computes the cotangent of X. Equivalent to 'COS(x)'
  8166. divided by 'SIN(x)', or '1 / TAN(x)'.
  8167. This function is for compatibility only and should be avoided in
  8168. favor of standard constructs wherever possible.
  8169. _Standard_:
  8170. GNU Extension, enabled with '-fdec-math'.
  8171. _Class_:
  8172. Elemental function
  8173. _Syntax_:
  8174. 'RESULT = COTAN(X)'
  8175. _Arguments_:
  8176. X The type shall be 'REAL' or 'COMPLEX'.
  8177. _Return value_:
  8178. The return value has same type and kind as X, and its value is in
  8179. radians.
  8180. _Example_:
  8181. program test_cotan
  8182. real(8) :: x = 0.165_8
  8183. x = cotan(x)
  8184. end program test_cotan
  8185. _Specific names_:
  8186. Name Argument Return type Standard
  8187. 'COTAN(X)' 'REAL(4) X' 'REAL(4)' GNU Extension
  8188. 'DCOTAN(X)' 'REAL(8) X' 'REAL(8)' GNU Extension
  8189. _See also_:
  8190. Converse function: *note TAN:: Degrees function: *note COTAND::
  8191. 
  8192. File: gfortran.info, Node: COTAND, Next: COUNT, Prev: COTAN, Up: Intrinsic Procedures
  8193. 9.77 'COTAND' -- Cotangent function, degrees
  8194. ============================================
  8195. _Description_:
  8196. 'COTAND(X)' computes the cotangent of X in degrees. Equivalent to
  8197. 'COSD(x)' divided by 'SIND(x)', or '1 / TAND(x)'.
  8198. _Standard_:
  8199. GNU Extension, enabled with '-fdec-math'.
  8200. This function is for compatibility only and should be avoided in
  8201. favor of standard constructs wherever possible.
  8202. _Class_:
  8203. Elemental function
  8204. _Syntax_:
  8205. 'RESULT = COTAND(X)'
  8206. _Arguments_:
  8207. X The type shall be 'REAL' or 'COMPLEX'.
  8208. _Return value_:
  8209. The return value has same type and kind as X, and its value is in
  8210. degrees.
  8211. _Example_:
  8212. program test_cotand
  8213. real(8) :: x = 0.165_8
  8214. x = cotand(x)
  8215. end program test_cotand
  8216. _Specific names_:
  8217. Name Argument Return type Standard
  8218. 'COTAND(X)' 'REAL(4) X' 'REAL(4)' GNU Extension
  8219. 'DCOTAND(X)' 'REAL(8) X' 'REAL(8)' GNU Extension
  8220. _See also_:
  8221. Converse function: *note TAND:: Radians function: *note COTAN::
  8222. 
  8223. File: gfortran.info, Node: COUNT, Next: CPU_TIME, Prev: COTAND, Up: Intrinsic Procedures
  8224. 9.78 'COUNT' -- Count function
  8225. ==============================
  8226. _Description_:
  8227. Counts the number of '.TRUE.' elements in a logical MASK, or, if
  8228. the DIM argument is supplied, counts the number of elements along
  8229. each row of the array in the DIM direction. If the array has zero
  8230. size, or all of the elements of MASK are '.FALSE.', then the result
  8231. is '0'.
  8232. _Standard_:
  8233. Fortran 95 and later, with KIND argument Fortran 2003 and later
  8234. _Class_:
  8235. Transformational function
  8236. _Syntax_:
  8237. 'RESULT = COUNT(MASK [, DIM, KIND])'
  8238. _Arguments_:
  8239. MASK The type shall be 'LOGICAL'.
  8240. DIM (Optional) The type shall be 'INTEGER'.
  8241. KIND (Optional) An 'INTEGER' initialization
  8242. expression indicating the kind parameter of the
  8243. result.
  8244. _Return value_:
  8245. The return value is of type 'INTEGER' and of kind KIND. If KIND is
  8246. absent, the return value is of default integer kind. If DIM is
  8247. present, the result is an array with a rank one less than the rank
  8248. of ARRAY, and a size corresponding to the shape of ARRAY with the
  8249. DIM dimension removed.
  8250. _Example_:
  8251. program test_count
  8252. integer, dimension(2,3) :: a, b
  8253. logical, dimension(2,3) :: mask
  8254. a = reshape( (/ 1, 2, 3, 4, 5, 6 /), (/ 2, 3 /))
  8255. b = reshape( (/ 0, 7, 3, 4, 5, 8 /), (/ 2, 3 /))
  8256. print '(3i3)', a(1,:)
  8257. print '(3i3)', a(2,:)
  8258. print *
  8259. print '(3i3)', b(1,:)
  8260. print '(3i3)', b(2,:)
  8261. print *
  8262. mask = a.ne.b
  8263. print '(3l3)', mask(1,:)
  8264. print '(3l3)', mask(2,:)
  8265. print *
  8266. print '(3i3)', count(mask)
  8267. print *
  8268. print '(3i3)', count(mask, 1)
  8269. print *
  8270. print '(3i3)', count(mask, 2)
  8271. end program test_count
  8272. 
  8273. File: gfortran.info, Node: CPU_TIME, Next: CSHIFT, Prev: COUNT, Up: Intrinsic Procedures
  8274. 9.79 'CPU_TIME' -- CPU elapsed time in seconds
  8275. ==============================================
  8276. _Description_:
  8277. Returns a 'REAL' value representing the elapsed CPU time in
  8278. seconds. This is useful for testing segments of code to determine
  8279. execution time.
  8280. If a time source is available, time will be reported with
  8281. microsecond resolution. If no time source is available, TIME is
  8282. set to '-1.0'.
  8283. Note that TIME may contain a, system dependent, arbitrary offset
  8284. and may not start with '0.0'. For 'CPU_TIME', the absolute value
  8285. is meaningless, only differences between subsequent calls to this
  8286. subroutine, as shown in the example below, should be used.
  8287. _Standard_:
  8288. Fortran 95 and later
  8289. _Class_:
  8290. Subroutine
  8291. _Syntax_:
  8292. 'CALL CPU_TIME(TIME)'
  8293. _Arguments_:
  8294. TIME The type shall be 'REAL' with 'INTENT(OUT)'.
  8295. _Return value_:
  8296. None
  8297. _Example_:
  8298. program test_cpu_time
  8299. real :: start, finish
  8300. call cpu_time(start)
  8301. ! put code to test here
  8302. call cpu_time(finish)
  8303. print '("Time = ",f6.3," seconds.")',finish-start
  8304. end program test_cpu_time
  8305. _See also_:
  8306. *note SYSTEM_CLOCK::, *note DATE_AND_TIME::
  8307. 
  8308. File: gfortran.info, Node: CSHIFT, Next: CTIME, Prev: CPU_TIME, Up: Intrinsic Procedures
  8309. 9.80 'CSHIFT' -- Circular shift elements of an array
  8310. ====================================================
  8311. _Description_:
  8312. 'CSHIFT(ARRAY, SHIFT [, DIM])' performs a circular shift on
  8313. elements of ARRAY along the dimension of DIM. If DIM is omitted it
  8314. is taken to be '1'. DIM is a scalar of type 'INTEGER' in the range
  8315. of 1 \leq DIM \leq n) where n is the rank of ARRAY. If the rank of
  8316. ARRAY is one, then all elements of ARRAY are shifted by SHIFT
  8317. places. If rank is greater than one, then all complete rank one
  8318. sections of ARRAY along the given dimension are shifted. Elements
  8319. shifted out one end of each rank one section are shifted back in
  8320. the other end.
  8321. _Standard_:
  8322. Fortran 95 and later
  8323. _Class_:
  8324. Transformational function
  8325. _Syntax_:
  8326. 'RESULT = CSHIFT(ARRAY, SHIFT [, DIM])'
  8327. _Arguments_:
  8328. ARRAY Shall be an array of any type.
  8329. SHIFT The type shall be 'INTEGER'.
  8330. DIM The type shall be 'INTEGER'.
  8331. _Return value_:
  8332. Returns an array of same type and rank as the ARRAY argument.
  8333. _Example_:
  8334. program test_cshift
  8335. integer, dimension(3,3) :: a
  8336. a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /))
  8337. print '(3i3)', a(1,:)
  8338. print '(3i3)', a(2,:)
  8339. print '(3i3)', a(3,:)
  8340. a = cshift(a, SHIFT=(/1, 2, -1/), DIM=2)
  8341. print *
  8342. print '(3i3)', a(1,:)
  8343. print '(3i3)', a(2,:)
  8344. print '(3i3)', a(3,:)
  8345. end program test_cshift
  8346. 
  8347. File: gfortran.info, Node: CTIME, Next: DATE_AND_TIME, Prev: CSHIFT, Up: Intrinsic Procedures
  8348. 9.81 'CTIME' -- Convert a time into a string
  8349. ============================================
  8350. _Description_:
  8351. 'CTIME' converts a system time value, such as returned by *note
  8352. TIME8::, to a string. The output will be of the form 'Sat Aug 19
  8353. 18:13:14 1995'.
  8354. This intrinsic is provided in both subroutine and function forms;
  8355. however, only one form can be used in any given program unit.
  8356. _Standard_:
  8357. GNU extension
  8358. _Class_:
  8359. Subroutine, function
  8360. _Syntax_:
  8361. 'CALL CTIME(TIME, RESULT)'.
  8362. 'RESULT = CTIME(TIME)'.
  8363. _Arguments_:
  8364. TIME The type shall be of type 'INTEGER'.
  8365. RESULT The type shall be of type 'CHARACTER' and of
  8366. default kind. It is an 'INTENT(OUT)' argument.
  8367. If the length of this variable is too short for
  8368. the time and date string to fit completely, it
  8369. will be blank on procedure return.
  8370. _Return value_:
  8371. The converted date and time as a string.
  8372. _Example_:
  8373. program test_ctime
  8374. integer(8) :: i
  8375. character(len=30) :: date
  8376. i = time8()
  8377. ! Do something, main part of the program
  8378. call ctime(i,date)
  8379. print *, 'Program was started on ', date
  8380. end program test_ctime
  8381. _See Also_:
  8382. *note DATE_AND_TIME::, *note GMTIME::, *note LTIME::, *note TIME::,
  8383. *note TIME8::
  8384. 
  8385. File: gfortran.info, Node: DATE_AND_TIME, Next: DBLE, Prev: CTIME, Up: Intrinsic Procedures
  8386. 9.82 'DATE_AND_TIME' -- Date and time subroutine
  8387. ================================================
  8388. _Description_:
  8389. 'DATE_AND_TIME(DATE, TIME, ZONE, VALUES)' gets the corresponding
  8390. date and time information from the real-time system clock. DATE is
  8391. 'INTENT(OUT)' and has form ccyymmdd. TIME is 'INTENT(OUT)' and has
  8392. form hhmmss.sss. ZONE is 'INTENT(OUT)' and has form (+-)hhmm,
  8393. representing the difference with respect to Coordinated Universal
  8394. Time (UTC). Unavailable time and date parameters return blanks.
  8395. VALUES is 'INTENT(OUT)' and provides the following:
  8396. 'VALUE(1)': The year
  8397. 'VALUE(2)': The month
  8398. 'VALUE(3)': The day of the month
  8399. 'VALUE(4)': Time difference with UTC in
  8400. minutes
  8401. 'VALUE(5)': The hour of the day
  8402. 'VALUE(6)': The minutes of the hour
  8403. 'VALUE(7)': The seconds of the minute
  8404. 'VALUE(8)': The milliseconds of the
  8405. second
  8406. _Standard_:
  8407. Fortran 95 and later
  8408. _Class_:
  8409. Subroutine
  8410. _Syntax_:
  8411. 'CALL DATE_AND_TIME([DATE, TIME, ZONE, VALUES])'
  8412. _Arguments_:
  8413. DATE (Optional) The type shall be 'CHARACTER(LEN=8)'
  8414. or larger, and of default kind.
  8415. TIME (Optional) The type shall be 'CHARACTER(LEN=10)'
  8416. or larger, and of default kind.
  8417. ZONE (Optional) The type shall be 'CHARACTER(LEN=5)'
  8418. or larger, and of default kind.
  8419. VALUES (Optional) The type shall be 'INTEGER(8)'.
  8420. _Return value_:
  8421. None
  8422. _Example_:
  8423. program test_time_and_date
  8424. character(8) :: date
  8425. character(10) :: time
  8426. character(5) :: zone
  8427. integer,dimension(8) :: values
  8428. ! using keyword arguments
  8429. call date_and_time(date,time,zone,values)
  8430. call date_and_time(DATE=date,ZONE=zone)
  8431. call date_and_time(TIME=time)
  8432. call date_and_time(VALUES=values)
  8433. print '(a,2x,a,2x,a)', date, time, zone
  8434. print '(8i5)', values
  8435. end program test_time_and_date
  8436. _See also_:
  8437. *note CPU_TIME::, *note SYSTEM_CLOCK::
  8438. 
  8439. File: gfortran.info, Node: DBLE, Next: DCMPLX, Prev: DATE_AND_TIME, Up: Intrinsic Procedures
  8440. 9.83 'DBLE' -- Double conversion function
  8441. =========================================
  8442. _Description_:
  8443. 'DBLE(A)' Converts A to double precision real type.
  8444. _Standard_:
  8445. Fortran 77 and later
  8446. _Class_:
  8447. Elemental function
  8448. _Syntax_:
  8449. 'RESULT = DBLE(A)'
  8450. _Arguments_:
  8451. A The type shall be 'INTEGER', 'REAL', or
  8452. 'COMPLEX'.
  8453. _Return value_:
  8454. The return value is of type double precision real.
  8455. _Example_:
  8456. program test_dble
  8457. real :: x = 2.18
  8458. integer :: i = 5
  8459. complex :: z = (2.3,1.14)
  8460. print *, dble(x), dble(i), dble(z)
  8461. end program test_dble
  8462. _See also_:
  8463. *note REAL::
  8464. 
  8465. File: gfortran.info, Node: DCMPLX, Next: DIGITS, Prev: DBLE, Up: Intrinsic Procedures
  8466. 9.84 'DCMPLX' -- Double complex conversion function
  8467. ===================================================
  8468. _Description_:
  8469. 'DCMPLX(X [,Y])' returns a double complex number where X is
  8470. converted to the real component. If Y is present it is converted
  8471. to the imaginary component. If Y is not present then the imaginary
  8472. component is set to 0.0. If X is complex then Y must not be
  8473. present.
  8474. _Standard_:
  8475. GNU extension
  8476. _Class_:
  8477. Elemental function
  8478. _Syntax_:
  8479. 'RESULT = DCMPLX(X [, Y])'
  8480. _Arguments_:
  8481. X The type may be 'INTEGER', 'REAL', or 'COMPLEX'.
  8482. Y (Optional if X is not 'COMPLEX'.) May be
  8483. 'INTEGER' or 'REAL'.
  8484. _Return value_:
  8485. The return value is of type 'COMPLEX(8)'
  8486. _Example_:
  8487. program test_dcmplx
  8488. integer :: i = 42
  8489. real :: x = 3.14
  8490. complex :: z
  8491. z = cmplx(i, x)
  8492. print *, dcmplx(i)
  8493. print *, dcmplx(x)
  8494. print *, dcmplx(z)
  8495. print *, dcmplx(x,i)
  8496. end program test_dcmplx
  8497. 
  8498. File: gfortran.info, Node: DIGITS, Next: DIM, Prev: DCMPLX, Up: Intrinsic Procedures
  8499. 9.85 'DIGITS' -- Significant binary digits function
  8500. ===================================================
  8501. _Description_:
  8502. 'DIGITS(X)' returns the number of significant binary digits of the
  8503. internal model representation of X. For example, on a system using
  8504. a 32-bit floating point representation, a default real number would
  8505. likely return 24.
  8506. _Standard_:
  8507. Fortran 95 and later
  8508. _Class_:
  8509. Inquiry function
  8510. _Syntax_:
  8511. 'RESULT = DIGITS(X)'
  8512. _Arguments_:
  8513. X The type may be 'INTEGER' or 'REAL'.
  8514. _Return value_:
  8515. The return value is of type 'INTEGER'.
  8516. _Example_:
  8517. program test_digits
  8518. integer :: i = 12345
  8519. real :: x = 3.143
  8520. real(8) :: y = 2.33
  8521. print *, digits(i)
  8522. print *, digits(x)
  8523. print *, digits(y)
  8524. end program test_digits
  8525. 
  8526. File: gfortran.info, Node: DIM, Next: DOT_PRODUCT, Prev: DIGITS, Up: Intrinsic Procedures
  8527. 9.86 'DIM' -- Positive difference
  8528. =================================
  8529. _Description_:
  8530. 'DIM(X,Y)' returns the difference 'X-Y' if the result is positive;
  8531. otherwise returns zero.
  8532. _Standard_:
  8533. Fortran 77 and later
  8534. _Class_:
  8535. Elemental function
  8536. _Syntax_:
  8537. 'RESULT = DIM(X, Y)'
  8538. _Arguments_:
  8539. X The type shall be 'INTEGER' or 'REAL'
  8540. Y The type shall be the same type and kind as X.
  8541. _Return value_:
  8542. The return value is of type 'INTEGER' or 'REAL'.
  8543. _Example_:
  8544. program test_dim
  8545. integer :: i
  8546. real(8) :: x
  8547. i = dim(4, 15)
  8548. x = dim(4.345_8, 2.111_8)
  8549. print *, i
  8550. print *, x
  8551. end program test_dim
  8552. _Specific names_:
  8553. Name Argument Return type Standard
  8554. 'DIM(X,Y)' 'REAL(4) X, 'REAL(4)' Fortran 77 and
  8555. Y' later
  8556. 'IDIM(X,Y)' 'INTEGER(4) 'INTEGER(4)' Fortran 77 and
  8557. X, Y' later
  8558. 'DDIM(X,Y)' 'REAL(8) X, 'REAL(8)' Fortran 77 and
  8559. Y' later
  8560. 
  8561. File: gfortran.info, Node: DOT_PRODUCT, Next: DPROD, Prev: DIM, Up: Intrinsic Procedures
  8562. 9.87 'DOT_PRODUCT' -- Dot product function
  8563. ==========================================
  8564. _Description_:
  8565. 'DOT_PRODUCT(VECTOR_A, VECTOR_B)' computes the dot product
  8566. multiplication of two vectors VECTOR_A and VECTOR_B. The two
  8567. vectors may be either numeric or logical and must be arrays of rank
  8568. one and of equal size. If the vectors are 'INTEGER' or 'REAL', the
  8569. result is 'SUM(VECTOR_A*VECTOR_B)'. If the vectors are 'COMPLEX',
  8570. the result is 'SUM(CONJG(VECTOR_A)*VECTOR_B)'. If the vectors are
  8571. 'LOGICAL', the result is 'ANY(VECTOR_A .AND. VECTOR_B)'.
  8572. _Standard_:
  8573. Fortran 95 and later
  8574. _Class_:
  8575. Transformational function
  8576. _Syntax_:
  8577. 'RESULT = DOT_PRODUCT(VECTOR_A, VECTOR_B)'
  8578. _Arguments_:
  8579. VECTOR_A The type shall be numeric or 'LOGICAL', rank 1.
  8580. VECTOR_B The type shall be numeric if VECTOR_A is of
  8581. numeric type or 'LOGICAL' if VECTOR_A is of type
  8582. 'LOGICAL'. VECTOR_B shall be a rank-one array.
  8583. _Return value_:
  8584. If the arguments are numeric, the return value is a scalar of
  8585. numeric type, 'INTEGER', 'REAL', or 'COMPLEX'. If the arguments
  8586. are 'LOGICAL', the return value is '.TRUE.' or '.FALSE.'.
  8587. _Example_:
  8588. program test_dot_prod
  8589. integer, dimension(3) :: a, b
  8590. a = (/ 1, 2, 3 /)
  8591. b = (/ 4, 5, 6 /)
  8592. print '(3i3)', a
  8593. print *
  8594. print '(3i3)', b
  8595. print *
  8596. print *, dot_product(a,b)
  8597. end program test_dot_prod
  8598. 
  8599. File: gfortran.info, Node: DPROD, Next: DREAL, Prev: DOT_PRODUCT, Up: Intrinsic Procedures
  8600. 9.88 'DPROD' -- Double product function
  8601. =======================================
  8602. _Description_:
  8603. 'DPROD(X,Y)' returns the product 'X*Y'.
  8604. _Standard_:
  8605. Fortran 77 and later
  8606. _Class_:
  8607. Elemental function
  8608. _Syntax_:
  8609. 'RESULT = DPROD(X, Y)'
  8610. _Arguments_:
  8611. X The type shall be 'REAL'.
  8612. Y The type shall be 'REAL'.
  8613. _Return value_:
  8614. The return value is of type 'REAL(8)'.
  8615. _Example_:
  8616. program test_dprod
  8617. real :: x = 5.2
  8618. real :: y = 2.3
  8619. real(8) :: d
  8620. d = dprod(x,y)
  8621. print *, d
  8622. end program test_dprod
  8623. _Specific names_:
  8624. Name Argument Return type Standard
  8625. 'DPROD(X,Y)' 'REAL(4) X, 'REAL(8)' Fortran 77 and
  8626. Y' later
  8627. 
  8628. File: gfortran.info, Node: DREAL, Next: DSHIFTL, Prev: DPROD, Up: Intrinsic Procedures
  8629. 9.89 'DREAL' -- Double real part function
  8630. =========================================
  8631. _Description_:
  8632. 'DREAL(Z)' returns the real part of complex variable Z.
  8633. _Standard_:
  8634. GNU extension
  8635. _Class_:
  8636. Elemental function
  8637. _Syntax_:
  8638. 'RESULT = DREAL(A)'
  8639. _Arguments_:
  8640. A The type shall be 'COMPLEX(8)'.
  8641. _Return value_:
  8642. The return value is of type 'REAL(8)'.
  8643. _Example_:
  8644. program test_dreal
  8645. complex(8) :: z = (1.3_8,7.2_8)
  8646. print *, dreal(z)
  8647. end program test_dreal
  8648. _See also_:
  8649. *note AIMAG::
  8650. 
  8651. File: gfortran.info, Node: DSHIFTL, Next: DSHIFTR, Prev: DREAL, Up: Intrinsic Procedures
  8652. 9.90 'DSHIFTL' -- Combined left shift
  8653. =====================================
  8654. _Description_:
  8655. 'DSHIFTL(I, J, SHIFT)' combines bits of I and J. The rightmost
  8656. SHIFT bits of the result are the leftmost SHIFT bits of J, and the
  8657. remaining bits are the rightmost bits of I.
  8658. _Standard_:
  8659. Fortran 2008 and later
  8660. _Class_:
  8661. Elemental function
  8662. _Syntax_:
  8663. 'RESULT = DSHIFTL(I, J, SHIFT)'
  8664. _Arguments_:
  8665. I Shall be of type 'INTEGER' or a BOZ constant.
  8666. J Shall be of type 'INTEGER' or a BOZ constant.
  8667. If both I and J have integer type, then they
  8668. shall have the same kind type parameter. I and
  8669. J shall not both be BOZ constants.
  8670. SHIFT Shall be of type 'INTEGER'. It shall be
  8671. nonnegative. If I is not a BOZ constant, then
  8672. SHIFT shall be less than or equal to
  8673. 'BIT_SIZE(I)'; otherwise, SHIFT shall be less
  8674. than or equal to 'BIT_SIZE(J)'.
  8675. _Return value_:
  8676. If either I or J is a BOZ constant, it is first converted as if by
  8677. the intrinsic function 'INT' to an integer type with the kind type
  8678. parameter of the other.
  8679. _See also_:
  8680. *note DSHIFTR::
  8681. 
  8682. File: gfortran.info, Node: DSHIFTR, Next: DTIME, Prev: DSHIFTL, Up: Intrinsic Procedures
  8683. 9.91 'DSHIFTR' -- Combined right shift
  8684. ======================================
  8685. _Description_:
  8686. 'DSHIFTR(I, J, SHIFT)' combines bits of I and J. The leftmost
  8687. SHIFT bits of the result are the rightmost SHIFT bits of I, and the
  8688. remaining bits are the leftmost bits of J.
  8689. _Standard_:
  8690. Fortran 2008 and later
  8691. _Class_:
  8692. Elemental function
  8693. _Syntax_:
  8694. 'RESULT = DSHIFTR(I, J, SHIFT)'
  8695. _Arguments_:
  8696. I Shall be of type 'INTEGER' or a BOZ constant.
  8697. J Shall be of type 'INTEGER' or a BOZ constant.
  8698. If both I and J have integer type, then they
  8699. shall have the same kind type parameter. I and
  8700. J shall not both be BOZ constants.
  8701. SHIFT Shall be of type 'INTEGER'. It shall be
  8702. nonnegative. If I is not a BOZ constant, then
  8703. SHIFT shall be less than or equal to
  8704. 'BIT_SIZE(I)'; otherwise, SHIFT shall be less
  8705. than or equal to 'BIT_SIZE(J)'.
  8706. _Return value_:
  8707. If either I or J is a BOZ constant, it is first converted as if by
  8708. the intrinsic function 'INT' to an integer type with the kind type
  8709. parameter of the other.
  8710. _See also_:
  8711. *note DSHIFTL::
  8712. 
  8713. File: gfortran.info, Node: DTIME, Next: EOSHIFT, Prev: DSHIFTR, Up: Intrinsic Procedures
  8714. 9.92 'DTIME' -- Execution time subroutine (or function)
  8715. =======================================================
  8716. _Description_:
  8717. 'DTIME(VALUES, TIME)' initially returns the number of seconds of
  8718. runtime since the start of the process's execution in TIME. VALUES
  8719. returns the user and system components of this time in 'VALUES(1)'
  8720. and 'VALUES(2)' respectively. TIME is equal to 'VALUES(1) +
  8721. VALUES(2)'.
  8722. Subsequent invocations of 'DTIME' return values accumulated since
  8723. the previous invocation.
  8724. On some systems, the underlying timings are represented using types
  8725. with sufficiently small limits that overflows (wrap around) are
  8726. possible, such as 32-bit types. Therefore, the values returned by
  8727. this intrinsic might be, or become, negative, or numerically less
  8728. than previous values, during a single run of the compiled program.
  8729. Please note, that this implementation is thread safe if used within
  8730. OpenMP directives, i.e., its state will be consistent while called
  8731. from multiple threads. However, if 'DTIME' is called from multiple
  8732. threads, the result is still the time since the last invocation.
  8733. This may not give the intended results. If possible, use
  8734. 'CPU_TIME' instead.
  8735. This intrinsic is provided in both subroutine and function forms;
  8736. however, only one form can be used in any given program unit.
  8737. VALUES and TIME are 'INTENT(OUT)' and provide the following:
  8738. 'VALUES(1)': User time in seconds.
  8739. 'VALUES(2)': System time in seconds.
  8740. 'TIME': Run time since start in
  8741. seconds.
  8742. _Standard_:
  8743. GNU extension
  8744. _Class_:
  8745. Subroutine, function
  8746. _Syntax_:
  8747. 'CALL DTIME(VALUES, TIME)'.
  8748. 'TIME = DTIME(VALUES)', (not recommended).
  8749. _Arguments_:
  8750. VALUES The type shall be 'REAL(4), DIMENSION(2)'.
  8751. TIME The type shall be 'REAL(4)'.
  8752. _Return value_:
  8753. Elapsed time in seconds since the last invocation or since the
  8754. start of program execution if not called before.
  8755. _Example_:
  8756. program test_dtime
  8757. integer(8) :: i, j
  8758. real, dimension(2) :: tarray
  8759. real :: result
  8760. call dtime(tarray, result)
  8761. print *, result
  8762. print *, tarray(1)
  8763. print *, tarray(2)
  8764. do i=1,100000000 ! Just a delay
  8765. j = i * i - i
  8766. end do
  8767. call dtime(tarray, result)
  8768. print *, result
  8769. print *, tarray(1)
  8770. print *, tarray(2)
  8771. end program test_dtime
  8772. _See also_:
  8773. *note CPU_TIME::
  8774. 
  8775. File: gfortran.info, Node: EOSHIFT, Next: EPSILON, Prev: DTIME, Up: Intrinsic Procedures
  8776. 9.93 'EOSHIFT' -- End-off shift elements of an array
  8777. ====================================================
  8778. _Description_:
  8779. 'EOSHIFT(ARRAY, SHIFT[, BOUNDARY, DIM])' performs an end-off shift
  8780. on elements of ARRAY along the dimension of DIM. If DIM is omitted
  8781. it is taken to be '1'. DIM is a scalar of type 'INTEGER' in the
  8782. range of 1 \leq DIM \leq n) where n is the rank of ARRAY. If the
  8783. rank of ARRAY is one, then all elements of ARRAY are shifted by
  8784. SHIFT places. If rank is greater than one, then all complete rank
  8785. one sections of ARRAY along the given dimension are shifted.
  8786. Elements shifted out one end of each rank one section are dropped.
  8787. If BOUNDARY is present then the corresponding value of from
  8788. BOUNDARY is copied back in the other end. If BOUNDARY is not
  8789. present then the following are copied in depending on the type of
  8790. ARRAY.
  8791. _Array _Boundary Value_
  8792. Type_
  8793. Numeric 0 of the type and kind of ARRAY.
  8794. Logical '.FALSE.'.
  8795. Character(LEN)LEN blanks.
  8796. _Standard_:
  8797. Fortran 95 and later
  8798. _Class_:
  8799. Transformational function
  8800. _Syntax_:
  8801. 'RESULT = EOSHIFT(ARRAY, SHIFT [, BOUNDARY, DIM])'
  8802. _Arguments_:
  8803. ARRAY May be any type, not scalar.
  8804. SHIFT The type shall be 'INTEGER'.
  8805. BOUNDARY Same type as ARRAY.
  8806. DIM The type shall be 'INTEGER'.
  8807. _Return value_:
  8808. Returns an array of same type and rank as the ARRAY argument.
  8809. _Example_:
  8810. program test_eoshift
  8811. integer, dimension(3,3) :: a
  8812. a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /))
  8813. print '(3i3)', a(1,:)
  8814. print '(3i3)', a(2,:)
  8815. print '(3i3)', a(3,:)
  8816. a = EOSHIFT(a, SHIFT=(/1, 2, 1/), BOUNDARY=-5, DIM=2)
  8817. print *
  8818. print '(3i3)', a(1,:)
  8819. print '(3i3)', a(2,:)
  8820. print '(3i3)', a(3,:)
  8821. end program test_eoshift
  8822. 
  8823. File: gfortran.info, Node: EPSILON, Next: ERF, Prev: EOSHIFT, Up: Intrinsic Procedures
  8824. 9.94 'EPSILON' -- Epsilon function
  8825. ==================================
  8826. _Description_:
  8827. 'EPSILON(X)' returns the smallest number E of the same kind as X
  8828. such that 1 + E > 1.
  8829. _Standard_:
  8830. Fortran 95 and later
  8831. _Class_:
  8832. Inquiry function
  8833. _Syntax_:
  8834. 'RESULT = EPSILON(X)'
  8835. _Arguments_:
  8836. X The type shall be 'REAL'.
  8837. _Return value_:
  8838. The return value is of same type as the argument.
  8839. _Example_:
  8840. program test_epsilon
  8841. real :: x = 3.143
  8842. real(8) :: y = 2.33
  8843. print *, EPSILON(x)
  8844. print *, EPSILON(y)
  8845. end program test_epsilon
  8846. 
  8847. File: gfortran.info, Node: ERF, Next: ERFC, Prev: EPSILON, Up: Intrinsic Procedures
  8848. 9.95 'ERF' -- Error function
  8849. ============================
  8850. _Description_:
  8851. 'ERF(X)' computes the error function of X.
  8852. _Standard_:
  8853. Fortran 2008 and later
  8854. _Class_:
  8855. Elemental function
  8856. _Syntax_:
  8857. 'RESULT = ERF(X)'
  8858. _Arguments_:
  8859. X The type shall be 'REAL'.
  8860. _Return value_:
  8861. The return value is of type 'REAL', of the same kind as X and lies
  8862. in the range -1 \leq erf (x) \leq 1 .
  8863. _Example_:
  8864. program test_erf
  8865. real(8) :: x = 0.17_8
  8866. x = erf(x)
  8867. end program test_erf
  8868. _Specific names_:
  8869. Name Argument Return type Standard
  8870. 'DERF(X)' 'REAL(8) X' 'REAL(8)' GNU extension
  8871. 
  8872. File: gfortran.info, Node: ERFC, Next: ERFC_SCALED, Prev: ERF, Up: Intrinsic Procedures
  8873. 9.96 'ERFC' -- Error function
  8874. =============================
  8875. _Description_:
  8876. 'ERFC(X)' computes the complementary error function of X.
  8877. _Standard_:
  8878. Fortran 2008 and later
  8879. _Class_:
  8880. Elemental function
  8881. _Syntax_:
  8882. 'RESULT = ERFC(X)'
  8883. _Arguments_:
  8884. X The type shall be 'REAL'.
  8885. _Return value_:
  8886. The return value is of type 'REAL' and of the same kind as X. It
  8887. lies in the range 0 \leq erfc (x) \leq 2 .
  8888. _Example_:
  8889. program test_erfc
  8890. real(8) :: x = 0.17_8
  8891. x = erfc(x)
  8892. end program test_erfc
  8893. _Specific names_:
  8894. Name Argument Return type Standard
  8895. 'DERFC(X)' 'REAL(8) X' 'REAL(8)' GNU extension
  8896. 
  8897. File: gfortran.info, Node: ERFC_SCALED, Next: ETIME, Prev: ERFC, Up: Intrinsic Procedures
  8898. 9.97 'ERFC_SCALED' -- Error function
  8899. ====================================
  8900. _Description_:
  8901. 'ERFC_SCALED(X)' computes the exponentially-scaled complementary
  8902. error function of X.
  8903. _Standard_:
  8904. Fortran 2008 and later
  8905. _Class_:
  8906. Elemental function
  8907. _Syntax_:
  8908. 'RESULT = ERFC_SCALED(X)'
  8909. _Arguments_:
  8910. X The type shall be 'REAL'.
  8911. _Return value_:
  8912. The return value is of type 'REAL' and of the same kind as X.
  8913. _Example_:
  8914. program test_erfc_scaled
  8915. real(8) :: x = 0.17_8
  8916. x = erfc_scaled(x)
  8917. end program test_erfc_scaled
  8918. 
  8919. File: gfortran.info, Node: ETIME, Next: EVENT_QUERY, Prev: ERFC_SCALED, Up: Intrinsic Procedures
  8920. 9.98 'ETIME' -- Execution time subroutine (or function)
  8921. =======================================================
  8922. _Description_:
  8923. 'ETIME(VALUES, TIME)' returns the number of seconds of runtime
  8924. since the start of the process's execution in TIME. VALUES returns
  8925. the user and system components of this time in 'VALUES(1)' and
  8926. 'VALUES(2)' respectively. TIME is equal to 'VALUES(1) +
  8927. VALUES(2)'.
  8928. On some systems, the underlying timings are represented using types
  8929. with sufficiently small limits that overflows (wrap around) are
  8930. possible, such as 32-bit types. Therefore, the values returned by
  8931. this intrinsic might be, or become, negative, or numerically less
  8932. than previous values, during a single run of the compiled program.
  8933. This intrinsic is provided in both subroutine and function forms;
  8934. however, only one form can be used in any given program unit.
  8935. VALUES and TIME are 'INTENT(OUT)' and provide the following:
  8936. 'VALUES(1)': User time in seconds.
  8937. 'VALUES(2)': System time in seconds.
  8938. 'TIME': Run time since start in seconds.
  8939. _Standard_:
  8940. GNU extension
  8941. _Class_:
  8942. Subroutine, function
  8943. _Syntax_:
  8944. 'CALL ETIME(VALUES, TIME)'.
  8945. 'TIME = ETIME(VALUES)', (not recommended).
  8946. _Arguments_:
  8947. VALUES The type shall be 'REAL(4), DIMENSION(2)'.
  8948. TIME The type shall be 'REAL(4)'.
  8949. _Return value_:
  8950. Elapsed time in seconds since the start of program execution.
  8951. _Example_:
  8952. program test_etime
  8953. integer(8) :: i, j
  8954. real, dimension(2) :: tarray
  8955. real :: result
  8956. call ETIME(tarray, result)
  8957. print *, result
  8958. print *, tarray(1)
  8959. print *, tarray(2)
  8960. do i=1,100000000 ! Just a delay
  8961. j = i * i - i
  8962. end do
  8963. call ETIME(tarray, result)
  8964. print *, result
  8965. print *, tarray(1)
  8966. print *, tarray(2)
  8967. end program test_etime
  8968. _See also_:
  8969. *note CPU_TIME::
  8970. 
  8971. File: gfortran.info, Node: EVENT_QUERY, Next: EXECUTE_COMMAND_LINE, Prev: ETIME, Up: Intrinsic Procedures
  8972. 9.99 'EVENT_QUERY' -- Query whether a coarray event has occurred
  8973. ================================================================
  8974. _Description_:
  8975. 'EVENT_QUERY' assignes the number of events to COUNT which have
  8976. been posted to the EVENT variable and not yet been removed by
  8977. calling 'EVENT WAIT'. When STAT is present and the invocation was
  8978. successful, it is assigned the value 0. If it is present and the
  8979. invocation has failed, it is assigned a positive value and COUNT is
  8980. assigned the value -1.
  8981. _Standard_:
  8982. TS 18508 or later
  8983. _Class_:
  8984. subroutine
  8985. _Syntax_:
  8986. 'CALL EVENT_QUERY (EVENT, COUNT [, STAT])'
  8987. _Arguments_:
  8988. EVENT (intent(IN)) Scalar of type 'EVENT_TYPE',
  8989. defined in 'ISO_FORTRAN_ENV'; shall not be
  8990. coindexed.
  8991. COUNT (intent(out))Scalar integer with at least the
  8992. precision of default integer.
  8993. STAT (optional) Scalar default-kind integer variable.
  8994. _Example_:
  8995. program atomic
  8996. use iso_fortran_env
  8997. implicit none
  8998. type(event_type) :: event_value_has_been_set[*]
  8999. integer :: cnt
  9000. if (this_image() == 1) then
  9001. call event_query (event_value_has_been_set, cnt)
  9002. if (cnt > 0) write(*,*) "Value has been set"
  9003. elseif (this_image() == 2) then
  9004. event post (event_value_has_been_set[1])
  9005. end if
  9006. end program atomic
  9007. 
  9008. File: gfortran.info, Node: EXECUTE_COMMAND_LINE, Next: EXIT, Prev: EVENT_QUERY, Up: Intrinsic Procedures
  9009. 9.100 'EXECUTE_COMMAND_LINE' -- Execute a shell command
  9010. =======================================================
  9011. _Description_:
  9012. 'EXECUTE_COMMAND_LINE' runs a shell command, synchronously or
  9013. asynchronously.
  9014. The 'COMMAND' argument is passed to the shell and executed, using
  9015. the C library's 'system' call. (The shell is 'sh' on Unix systems,
  9016. and 'cmd.exe' on Windows.) If 'WAIT' is present and has the value
  9017. false, the execution of the command is asynchronous if the system
  9018. supports it; otherwise, the command is executed synchronously.
  9019. The three last arguments allow the user to get status information.
  9020. After synchronous execution, 'EXITSTAT' contains the integer exit
  9021. code of the command, as returned by 'system'. 'CMDSTAT' is set to
  9022. zero if the command line was executed (whatever its exit status
  9023. was). 'CMDMSG' is assigned an error message if an error has
  9024. occurred.
  9025. Note that the 'system' function need not be thread-safe. It is the
  9026. responsibility of the user to ensure that 'system' is not called
  9027. concurrently.
  9028. _Standard_:
  9029. Fortran 2008 and later
  9030. _Class_:
  9031. Subroutine
  9032. _Syntax_:
  9033. 'CALL EXECUTE_COMMAND_LINE(COMMAND [, WAIT, EXITSTAT, CMDSTAT,
  9034. CMDMSG ])'
  9035. _Arguments_:
  9036. COMMAND Shall be a default 'CHARACTER' scalar.
  9037. WAIT (Optional) Shall be a default 'LOGICAL' scalar.
  9038. EXITSTAT (Optional) Shall be an 'INTEGER' of the default
  9039. kind.
  9040. CMDSTAT (Optional) Shall be an 'INTEGER' of the default
  9041. kind.
  9042. CMDMSG (Optional) Shall be an 'CHARACTER' scalar of the
  9043. default kind.
  9044. _Example_:
  9045. program test_exec
  9046. integer :: i
  9047. call execute_command_line ("external_prog.exe", exitstat=i)
  9048. print *, "Exit status of external_prog.exe was ", i
  9049. call execute_command_line ("reindex_files.exe", wait=.false.)
  9050. print *, "Now reindexing files in the background"
  9051. end program test_exec
  9052. _Note_:
  9053. Because this intrinsic is implemented in terms of the 'system'
  9054. function call, its behavior with respect to signaling is processor
  9055. dependent. In particular, on POSIX-compliant systems, the SIGINT
  9056. and SIGQUIT signals will be ignored, and the SIGCHLD will be
  9057. blocked. As such, if the parent process is terminated, the child
  9058. process might not be terminated alongside.
  9059. _See also_:
  9060. *note SYSTEM::
  9061. 
  9062. File: gfortran.info, Node: EXIT, Next: EXP, Prev: EXECUTE_COMMAND_LINE, Up: Intrinsic Procedures
  9063. 9.101 'EXIT' -- Exit the program with status.
  9064. =============================================
  9065. _Description_:
  9066. 'EXIT' causes immediate termination of the program with status. If
  9067. status is omitted it returns the canonical _success_ for the
  9068. system. All Fortran I/O units are closed.
  9069. _Standard_:
  9070. GNU extension
  9071. _Class_:
  9072. Subroutine
  9073. _Syntax_:
  9074. 'CALL EXIT([STATUS])'
  9075. _Arguments_:
  9076. STATUS Shall be an 'INTEGER' of the default kind.
  9077. _Return value_:
  9078. 'STATUS' is passed to the parent process on exit.
  9079. _Example_:
  9080. program test_exit
  9081. integer :: STATUS = 0
  9082. print *, 'This program is going to exit.'
  9083. call EXIT(STATUS)
  9084. end program test_exit
  9085. _See also_:
  9086. *note ABORT::, *note KILL::
  9087. 
  9088. File: gfortran.info, Node: EXP, Next: EXPONENT, Prev: EXIT, Up: Intrinsic Procedures
  9089. 9.102 'EXP' -- Exponential function
  9090. ===================================
  9091. _Description_:
  9092. 'EXP(X)' computes the base e exponential of X.
  9093. _Standard_:
  9094. Fortran 77 and later, has overloads that are GNU extensions
  9095. _Class_:
  9096. Elemental function
  9097. _Syntax_:
  9098. 'RESULT = EXP(X)'
  9099. _Arguments_:
  9100. X The type shall be 'REAL' or 'COMPLEX'.
  9101. _Return value_:
  9102. The return value has same type and kind as X.
  9103. _Example_:
  9104. program test_exp
  9105. real :: x = 1.0
  9106. x = exp(x)
  9107. end program test_exp
  9108. _Specific names_:
  9109. Name Argument Return type Standard
  9110. 'EXP(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and
  9111. later
  9112. 'DEXP(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and
  9113. later
  9114. 'CEXP(X)' 'COMPLEX(4) 'COMPLEX(4)' Fortran 77 and
  9115. X' later
  9116. 'ZEXP(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension
  9117. X'
  9118. 'CDEXP(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension
  9119. X'
  9120. 
  9121. File: gfortran.info, Node: EXPONENT, Next: EXTENDS_TYPE_OF, Prev: EXP, Up: Intrinsic Procedures
  9122. 9.103 'EXPONENT' -- Exponent function
  9123. =====================================
  9124. _Description_:
  9125. 'EXPONENT(X)' returns the value of the exponent part of X. If X is
  9126. zero the value returned is zero.
  9127. _Standard_:
  9128. Fortran 95 and later
  9129. _Class_:
  9130. Elemental function
  9131. _Syntax_:
  9132. 'RESULT = EXPONENT(X)'
  9133. _Arguments_:
  9134. X The type shall be 'REAL'.
  9135. _Return value_:
  9136. The return value is of type default 'INTEGER'.
  9137. _Example_:
  9138. program test_exponent
  9139. real :: x = 1.0
  9140. integer :: i
  9141. i = exponent(x)
  9142. print *, i
  9143. print *, exponent(0.0)
  9144. end program test_exponent
  9145. 
  9146. File: gfortran.info, Node: EXTENDS_TYPE_OF, Next: FDATE, Prev: EXPONENT, Up: Intrinsic Procedures
  9147. 9.104 'EXTENDS_TYPE_OF' -- Query dynamic type for extension
  9148. ===========================================================
  9149. _Description_:
  9150. Query dynamic type for extension.
  9151. _Standard_:
  9152. Fortran 2003 and later
  9153. _Class_:
  9154. Inquiry function
  9155. _Syntax_:
  9156. 'RESULT = EXTENDS_TYPE_OF(A, MOLD)'
  9157. _Arguments_:
  9158. A Shall be an object of extensible declared type
  9159. or unlimited polymorphic.
  9160. MOLD Shall be an object of extensible declared type
  9161. or unlimited polymorphic.
  9162. _Return value_:
  9163. The return value is a scalar of type default logical. It is true
  9164. if and only if the dynamic type of A is an extension type of the
  9165. dynamic type of MOLD.
  9166. _See also_:
  9167. *note SAME_TYPE_AS::
  9168. 
  9169. File: gfortran.info, Node: FDATE, Next: FGET, Prev: EXTENDS_TYPE_OF, Up: Intrinsic Procedures
  9170. 9.105 'FDATE' -- Get the current time as a string
  9171. =================================================
  9172. _Description_:
  9173. 'FDATE(DATE)' returns the current date (using the same format as
  9174. *note CTIME::) in DATE. It is equivalent to 'CALL CTIME(DATE,
  9175. TIME())'.
  9176. This intrinsic is provided in both subroutine and function forms;
  9177. however, only one form can be used in any given program unit.
  9178. _Standard_:
  9179. GNU extension
  9180. _Class_:
  9181. Subroutine, function
  9182. _Syntax_:
  9183. 'CALL FDATE(DATE)'.
  9184. 'DATE = FDATE()'.
  9185. _Arguments_:
  9186. DATE The type shall be of type 'CHARACTER' of the
  9187. default kind. It is an 'INTENT(OUT)' argument.
  9188. If the length of this variable is too short for
  9189. the date and time string to fit completely, it
  9190. will be blank on procedure return.
  9191. _Return value_:
  9192. The current date and time as a string.
  9193. _Example_:
  9194. program test_fdate
  9195. integer(8) :: i, j
  9196. character(len=30) :: date
  9197. call fdate(date)
  9198. print *, 'Program started on ', date
  9199. do i = 1, 100000000 ! Just a delay
  9200. j = i * i - i
  9201. end do
  9202. call fdate(date)
  9203. print *, 'Program ended on ', date
  9204. end program test_fdate
  9205. _See also_:
  9206. *note DATE_AND_TIME::, *note CTIME::
  9207. 
  9208. File: gfortran.info, Node: FGET, Next: FGETC, Prev: FDATE, Up: Intrinsic Procedures
  9209. 9.106 'FGET' -- Read a single character in stream mode from stdin
  9210. =================================================================
  9211. _Description_:
  9212. Read a single character in stream mode from stdin by bypassing
  9213. normal formatted output. Stream I/O should not be mixed with
  9214. normal record-oriented (formatted or unformatted) I/O on the same
  9215. unit; the results are unpredictable.
  9216. This intrinsic is provided in both subroutine and function forms;
  9217. however, only one form can be used in any given program unit.
  9218. Note that the 'FGET' intrinsic is provided for backwards
  9219. compatibility with 'g77'. GNU Fortran provides the Fortran 2003
  9220. Stream facility. Programmers should consider the use of new stream
  9221. IO feature in new code for future portability. See also *note
  9222. Fortran 2003 status::.
  9223. _Standard_:
  9224. GNU extension
  9225. _Class_:
  9226. Subroutine, function
  9227. _Syntax_:
  9228. 'CALL FGET(C [, STATUS])'
  9229. 'STATUS = FGET(C)'
  9230. _Arguments_:
  9231. C The type shall be 'CHARACTER' and of default
  9232. kind.
  9233. STATUS (Optional) status flag of type 'INTEGER'.
  9234. Returns 0 on success, -1 on end-of-file, and a
  9235. system specific positive error code otherwise.
  9236. _Example_:
  9237. PROGRAM test_fget
  9238. INTEGER, PARAMETER :: strlen = 100
  9239. INTEGER :: status, i = 1
  9240. CHARACTER(len=strlen) :: str = ""
  9241. WRITE (*,*) 'Enter text:'
  9242. DO
  9243. CALL fget(str(i:i), status)
  9244. if (status /= 0 .OR. i > strlen) exit
  9245. i = i + 1
  9246. END DO
  9247. WRITE (*,*) TRIM(str)
  9248. END PROGRAM
  9249. _See also_:
  9250. *note FGETC::, *note FPUT::, *note FPUTC::
  9251. 
  9252. File: gfortran.info, Node: FGETC, Next: FLOOR, Prev: FGET, Up: Intrinsic Procedures
  9253. 9.107 'FGETC' -- Read a single character in stream mode
  9254. =======================================================
  9255. _Description_:
  9256. Read a single character in stream mode by bypassing normal
  9257. formatted output. Stream I/O should not be mixed with normal
  9258. record-oriented (formatted or unformatted) I/O on the same unit;
  9259. the results are unpredictable.
  9260. This intrinsic is provided in both subroutine and function forms;
  9261. however, only one form can be used in any given program unit.
  9262. Note that the 'FGET' intrinsic is provided for backwards
  9263. compatibility with 'g77'. GNU Fortran provides the Fortran 2003
  9264. Stream facility. Programmers should consider the use of new stream
  9265. IO feature in new code for future portability. See also *note
  9266. Fortran 2003 status::.
  9267. _Standard_:
  9268. GNU extension
  9269. _Class_:
  9270. Subroutine, function
  9271. _Syntax_:
  9272. 'CALL FGETC(UNIT, C [, STATUS])'
  9273. 'STATUS = FGETC(UNIT, C)'
  9274. _Arguments_:
  9275. UNIT The type shall be 'INTEGER'.
  9276. C The type shall be 'CHARACTER' and of default
  9277. kind.
  9278. STATUS (Optional) status flag of type 'INTEGER'.
  9279. Returns 0 on success, -1 on end-of-file and a
  9280. system specific positive error code otherwise.
  9281. _Example_:
  9282. PROGRAM test_fgetc
  9283. INTEGER :: fd = 42, status
  9284. CHARACTER :: c
  9285. OPEN(UNIT=fd, FILE="/etc/passwd", ACTION="READ", STATUS = "OLD")
  9286. DO
  9287. CALL fgetc(fd, c, status)
  9288. IF (status /= 0) EXIT
  9289. call fput(c)
  9290. END DO
  9291. CLOSE(UNIT=fd)
  9292. END PROGRAM
  9293. _See also_:
  9294. *note FGET::, *note FPUT::, *note FPUTC::
  9295. 
  9296. File: gfortran.info, Node: FLOOR, Next: FLUSH, Prev: FGETC, Up: Intrinsic Procedures
  9297. 9.108 'FLOOR' -- Integer floor function
  9298. =======================================
  9299. _Description_:
  9300. 'FLOOR(A)' returns the greatest integer less than or equal to X.
  9301. _Standard_:
  9302. Fortran 95 and later
  9303. _Class_:
  9304. Elemental function
  9305. _Syntax_:
  9306. 'RESULT = FLOOR(A [, KIND])'
  9307. _Arguments_:
  9308. A The type shall be 'REAL'.
  9309. KIND (Optional) An 'INTEGER' initialization
  9310. expression indicating the kind parameter of the
  9311. result.
  9312. _Return value_:
  9313. The return value is of type 'INTEGER(KIND)' if KIND is present and
  9314. of default-kind 'INTEGER' otherwise.
  9315. _Example_:
  9316. program test_floor
  9317. real :: x = 63.29
  9318. real :: y = -63.59
  9319. print *, floor(x) ! returns 63
  9320. print *, floor(y) ! returns -64
  9321. end program test_floor
  9322. _See also_:
  9323. *note CEILING::, *note NINT::
  9324. 
  9325. File: gfortran.info, Node: FLUSH, Next: FNUM, Prev: FLOOR, Up: Intrinsic Procedures
  9326. 9.109 'FLUSH' -- Flush I/O unit(s)
  9327. ==================================
  9328. _Description_:
  9329. Flushes Fortran unit(s) currently open for output. Without the
  9330. optional argument, all units are flushed, otherwise just the unit
  9331. specified.
  9332. _Standard_:
  9333. GNU extension
  9334. _Class_:
  9335. Subroutine
  9336. _Syntax_:
  9337. 'CALL FLUSH(UNIT)'
  9338. _Arguments_:
  9339. UNIT (Optional) The type shall be 'INTEGER'.
  9340. _Note_:
  9341. Beginning with the Fortran 2003 standard, there is a 'FLUSH'
  9342. statement that should be preferred over the 'FLUSH' intrinsic.
  9343. The 'FLUSH' intrinsic and the Fortran 2003 'FLUSH' statement have
  9344. identical effect: they flush the runtime library's I/O buffer so
  9345. that the data becomes visible to other processes. This does not
  9346. guarantee that the data is committed to disk.
  9347. On POSIX systems, you can request that all data is transferred to
  9348. the storage device by calling the 'fsync' function, with the POSIX
  9349. file descriptor of the I/O unit as argument (retrieved with GNU
  9350. intrinsic 'FNUM'). The following example shows how:
  9351. ! Declare the interface for POSIX fsync function
  9352. interface
  9353. function fsync (fd) bind(c,name="fsync")
  9354. use iso_c_binding, only: c_int
  9355. integer(c_int), value :: fd
  9356. integer(c_int) :: fsync
  9357. end function fsync
  9358. end interface
  9359. ! Variable declaration
  9360. integer :: ret
  9361. ! Opening unit 10
  9362. open (10,file="foo")
  9363. ! ...
  9364. ! Perform I/O on unit 10
  9365. ! ...
  9366. ! Flush and sync
  9367. flush(10)
  9368. ret = fsync(fnum(10))
  9369. ! Handle possible error
  9370. if (ret /= 0) stop "Error calling FSYNC"
  9371. 
  9372. File: gfortran.info, Node: FNUM, Next: FPUT, Prev: FLUSH, Up: Intrinsic Procedures
  9373. 9.110 'FNUM' -- File number function
  9374. ====================================
  9375. _Description_:
  9376. 'FNUM(UNIT)' returns the POSIX file descriptor number corresponding
  9377. to the open Fortran I/O unit 'UNIT'.
  9378. _Standard_:
  9379. GNU extension
  9380. _Class_:
  9381. Function
  9382. _Syntax_:
  9383. 'RESULT = FNUM(UNIT)'
  9384. _Arguments_:
  9385. UNIT The type shall be 'INTEGER'.
  9386. _Return value_:
  9387. The return value is of type 'INTEGER'
  9388. _Example_:
  9389. program test_fnum
  9390. integer :: i
  9391. open (unit=10, status = "scratch")
  9392. i = fnum(10)
  9393. print *, i
  9394. close (10)
  9395. end program test_fnum
  9396. 
  9397. File: gfortran.info, Node: FPUT, Next: FPUTC, Prev: FNUM, Up: Intrinsic Procedures
  9398. 9.111 'FPUT' -- Write a single character in stream mode to stdout
  9399. =================================================================
  9400. _Description_:
  9401. Write a single character in stream mode to stdout by bypassing
  9402. normal formatted output. Stream I/O should not be mixed with
  9403. normal record-oriented (formatted or unformatted) I/O on the same
  9404. unit; the results are unpredictable.
  9405. This intrinsic is provided in both subroutine and function forms;
  9406. however, only one form can be used in any given program unit.
  9407. Note that the 'FGET' intrinsic is provided for backwards
  9408. compatibility with 'g77'. GNU Fortran provides the Fortran 2003
  9409. Stream facility. Programmers should consider the use of new stream
  9410. IO feature in new code for future portability. See also *note
  9411. Fortran 2003 status::.
  9412. _Standard_:
  9413. GNU extension
  9414. _Class_:
  9415. Subroutine, function
  9416. _Syntax_:
  9417. 'CALL FPUT(C [, STATUS])'
  9418. 'STATUS = FPUT(C)'
  9419. _Arguments_:
  9420. C The type shall be 'CHARACTER' and of default
  9421. kind.
  9422. STATUS (Optional) status flag of type 'INTEGER'.
  9423. Returns 0 on success, -1 on end-of-file and a
  9424. system specific positive error code otherwise.
  9425. _Example_:
  9426. PROGRAM test_fput
  9427. CHARACTER(len=10) :: str = "gfortran"
  9428. INTEGER :: i
  9429. DO i = 1, len_trim(str)
  9430. CALL fput(str(i:i))
  9431. END DO
  9432. END PROGRAM
  9433. _See also_:
  9434. *note FPUTC::, *note FGET::, *note FGETC::
  9435. 
  9436. File: gfortran.info, Node: FPUTC, Next: FRACTION, Prev: FPUT, Up: Intrinsic Procedures
  9437. 9.112 'FPUTC' -- Write a single character in stream mode
  9438. ========================================================
  9439. _Description_:
  9440. Write a single character in stream mode by bypassing normal
  9441. formatted output. Stream I/O should not be mixed with normal
  9442. record-oriented (formatted or unformatted) I/O on the same unit;
  9443. the results are unpredictable.
  9444. This intrinsic is provided in both subroutine and function forms;
  9445. however, only one form can be used in any given program unit.
  9446. Note that the 'FGET' intrinsic is provided for backwards
  9447. compatibility with 'g77'. GNU Fortran provides the Fortran 2003
  9448. Stream facility. Programmers should consider the use of new stream
  9449. IO feature in new code for future portability. See also *note
  9450. Fortran 2003 status::.
  9451. _Standard_:
  9452. GNU extension
  9453. _Class_:
  9454. Subroutine, function
  9455. _Syntax_:
  9456. 'CALL FPUTC(UNIT, C [, STATUS])'
  9457. 'STATUS = FPUTC(UNIT, C)'
  9458. _Arguments_:
  9459. UNIT The type shall be 'INTEGER'.
  9460. C The type shall be 'CHARACTER' and of default
  9461. kind.
  9462. STATUS (Optional) status flag of type 'INTEGER'.
  9463. Returns 0 on success, -1 on end-of-file and a
  9464. system specific positive error code otherwise.
  9465. _Example_:
  9466. PROGRAM test_fputc
  9467. CHARACTER(len=10) :: str = "gfortran"
  9468. INTEGER :: fd = 42, i
  9469. OPEN(UNIT = fd, FILE = "out", ACTION = "WRITE", STATUS="NEW")
  9470. DO i = 1, len_trim(str)
  9471. CALL fputc(fd, str(i:i))
  9472. END DO
  9473. CLOSE(fd)
  9474. END PROGRAM
  9475. _See also_:
  9476. *note FPUT::, *note FGET::, *note FGETC::
  9477. 
  9478. File: gfortran.info, Node: FRACTION, Next: FREE, Prev: FPUTC, Up: Intrinsic Procedures
  9479. 9.113 'FRACTION' -- Fractional part of the model representation
  9480. ===============================================================
  9481. _Description_:
  9482. 'FRACTION(X)' returns the fractional part of the model
  9483. representation of 'X'.
  9484. _Standard_:
  9485. Fortran 95 and later
  9486. _Class_:
  9487. Elemental function
  9488. _Syntax_:
  9489. 'Y = FRACTION(X)'
  9490. _Arguments_:
  9491. X The type of the argument shall be a 'REAL'.
  9492. _Return value_:
  9493. The return value is of the same type and kind as the argument. The
  9494. fractional part of the model representation of 'X' is returned; it
  9495. is 'X * RADIX(X)**(-EXPONENT(X))'.
  9496. _Example_:
  9497. program test_fraction
  9498. real :: x
  9499. x = 178.1387e-4
  9500. print *, fraction(x), x * radix(x)**(-exponent(x))
  9501. end program test_fraction
  9502. 
  9503. File: gfortran.info, Node: FREE, Next: FSEEK, Prev: FRACTION, Up: Intrinsic Procedures
  9504. 9.114 'FREE' -- Frees memory
  9505. ============================
  9506. _Description_:
  9507. Frees memory previously allocated by 'MALLOC'. The 'FREE'
  9508. intrinsic is an extension intended to be used with Cray pointers,
  9509. and is provided in GNU Fortran to allow user to compile legacy
  9510. code. For new code using Fortran 95 pointers, the memory
  9511. de-allocation intrinsic is 'DEALLOCATE'.
  9512. _Standard_:
  9513. GNU extension
  9514. _Class_:
  9515. Subroutine
  9516. _Syntax_:
  9517. 'CALL FREE(PTR)'
  9518. _Arguments_:
  9519. PTR The type shall be 'INTEGER'. It represents the
  9520. location of the memory that should be
  9521. de-allocated.
  9522. _Return value_:
  9523. None
  9524. _Example_:
  9525. See 'MALLOC' for an example.
  9526. _See also_:
  9527. *note MALLOC::
  9528. 
  9529. File: gfortran.info, Node: FSEEK, Next: FSTAT, Prev: FREE, Up: Intrinsic Procedures
  9530. 9.115 'FSEEK' -- Low level file positioning subroutine
  9531. ======================================================
  9532. _Description_:
  9533. Moves UNIT to the specified OFFSET. If WHENCE is set to 0, the
  9534. OFFSET is taken as an absolute value 'SEEK_SET', if set to 1,
  9535. OFFSET is taken to be relative to the current position 'SEEK_CUR',
  9536. and if set to 2 relative to the end of the file 'SEEK_END'. On
  9537. error, STATUS is set to a nonzero value. If STATUS the seek fails
  9538. silently.
  9539. This intrinsic routine is not fully backwards compatible with
  9540. 'g77'. In 'g77', the 'FSEEK' takes a statement label instead of a
  9541. STATUS variable. If FSEEK is used in old code, change
  9542. CALL FSEEK(UNIT, OFFSET, WHENCE, *label)
  9543. to
  9544. INTEGER :: status
  9545. CALL FSEEK(UNIT, OFFSET, WHENCE, status)
  9546. IF (status /= 0) GOTO label
  9547. Please note that GNU Fortran provides the Fortran 2003 Stream
  9548. facility. Programmers should consider the use of new stream IO
  9549. feature in new code for future portability. See also *note Fortran
  9550. 2003 status::.
  9551. _Standard_:
  9552. GNU extension
  9553. _Class_:
  9554. Subroutine
  9555. _Syntax_:
  9556. 'CALL FSEEK(UNIT, OFFSET, WHENCE[, STATUS])'
  9557. _Arguments_:
  9558. UNIT Shall be a scalar of type 'INTEGER'.
  9559. OFFSET Shall be a scalar of type 'INTEGER'.
  9560. WHENCE Shall be a scalar of type 'INTEGER'. Its value
  9561. shall be either 0, 1 or 2.
  9562. STATUS (Optional) shall be a scalar of type
  9563. 'INTEGER(4)'.
  9564. _Example_:
  9565. PROGRAM test_fseek
  9566. INTEGER, PARAMETER :: SEEK_SET = 0, SEEK_CUR = 1, SEEK_END = 2
  9567. INTEGER :: fd, offset, ierr
  9568. ierr = 0
  9569. offset = 5
  9570. fd = 10
  9571. OPEN(UNIT=fd, FILE="fseek.test")
  9572. CALL FSEEK(fd, offset, SEEK_SET, ierr) ! move to OFFSET
  9573. print *, FTELL(fd), ierr
  9574. CALL FSEEK(fd, 0, SEEK_END, ierr) ! move to end
  9575. print *, FTELL(fd), ierr
  9576. CALL FSEEK(fd, 0, SEEK_SET, ierr) ! move to beginning
  9577. print *, FTELL(fd), ierr
  9578. CLOSE(UNIT=fd)
  9579. END PROGRAM
  9580. _See also_:
  9581. *note FTELL::
  9582. 
  9583. File: gfortran.info, Node: FSTAT, Next: FTELL, Prev: FSEEK, Up: Intrinsic Procedures
  9584. 9.116 'FSTAT' -- Get file status
  9585. ================================
  9586. _Description_:
  9587. 'FSTAT' is identical to *note STAT::, except that information about
  9588. an already opened file is obtained.
  9589. The elements in 'VALUES' are the same as described by *note STAT::.
  9590. This intrinsic is provided in both subroutine and function forms;
  9591. however, only one form can be used in any given program unit.
  9592. _Standard_:
  9593. GNU extension
  9594. _Class_:
  9595. Subroutine, function
  9596. _Syntax_:
  9597. 'CALL FSTAT(UNIT, VALUES [, STATUS])'
  9598. 'STATUS = FSTAT(UNIT, VALUES)'
  9599. _Arguments_:
  9600. UNIT An open I/O unit number of type 'INTEGER'.
  9601. VALUES The type shall be 'INTEGER(4), DIMENSION(13)'.
  9602. STATUS (Optional) status flag of type 'INTEGER(4)'.
  9603. Returns 0 on success and a system specific error
  9604. code otherwise.
  9605. _Example_:
  9606. See *note STAT:: for an example.
  9607. _See also_:
  9608. To stat a link: *note LSTAT::, to stat a file: *note STAT::
  9609. 
  9610. File: gfortran.info, Node: FTELL, Next: GAMMA, Prev: FSTAT, Up: Intrinsic Procedures
  9611. 9.117 'FTELL' -- Current stream position
  9612. ========================================
  9613. _Description_:
  9614. Retrieves the current position within an open file.
  9615. This intrinsic is provided in both subroutine and function forms;
  9616. however, only one form can be used in any given program unit.
  9617. _Standard_:
  9618. GNU extension
  9619. _Class_:
  9620. Subroutine, function
  9621. _Syntax_:
  9622. 'CALL FTELL(UNIT, OFFSET)'
  9623. 'OFFSET = FTELL(UNIT)'
  9624. _Arguments_:
  9625. OFFSET Shall of type 'INTEGER'.
  9626. UNIT Shall of type 'INTEGER'.
  9627. _Return value_:
  9628. In either syntax, OFFSET is set to the current offset of unit
  9629. number UNIT, or to -1 if the unit is not currently open.
  9630. _Example_:
  9631. PROGRAM test_ftell
  9632. INTEGER :: i
  9633. OPEN(10, FILE="temp.dat")
  9634. CALL ftell(10,i)
  9635. WRITE(*,*) i
  9636. END PROGRAM
  9637. _See also_:
  9638. *note FSEEK::
  9639. 
  9640. File: gfortran.info, Node: GAMMA, Next: GERROR, Prev: FTELL, Up: Intrinsic Procedures
  9641. 9.118 'GAMMA' -- Gamma function
  9642. ===============================
  9643. _Description_:
  9644. 'GAMMA(X)' computes Gamma (\Gamma) of X. For positive, integer
  9645. values of X the Gamma function simplifies to the factorial function
  9646. \Gamma(x)=(x-1)!.
  9647. _Standard_:
  9648. Fortran 2008 and later
  9649. _Class_:
  9650. Elemental function
  9651. _Syntax_:
  9652. 'X = GAMMA(X)'
  9653. _Arguments_:
  9654. X Shall be of type 'REAL' and neither zero nor a
  9655. negative integer.
  9656. _Return value_:
  9657. The return value is of type 'REAL' of the same kind as X.
  9658. _Example_:
  9659. program test_gamma
  9660. real :: x = 1.0
  9661. x = gamma(x) ! returns 1.0
  9662. end program test_gamma
  9663. _Specific names_:
  9664. Name Argument Return type Standard
  9665. 'GAMMA(X)' 'REAL(4) X' 'REAL(4)' GNU Extension
  9666. 'DGAMMA(X)' 'REAL(8) X' 'REAL(8)' GNU Extension
  9667. _See also_:
  9668. Logarithm of the Gamma function: *note LOG_GAMMA::
  9669. 
  9670. File: gfortran.info, Node: GERROR, Next: GETARG, Prev: GAMMA, Up: Intrinsic Procedures
  9671. 9.119 'GERROR' -- Get last system error message
  9672. ===============================================
  9673. _Description_:
  9674. Returns the system error message corresponding to the last system
  9675. error. This resembles the functionality of 'strerror(3)' in C.
  9676. _Standard_:
  9677. GNU extension
  9678. _Class_:
  9679. Subroutine
  9680. _Syntax_:
  9681. 'CALL GERROR(RESULT)'
  9682. _Arguments_:
  9683. RESULT Shall of type 'CHARACTER' and of default
  9684. _Example_:
  9685. PROGRAM test_gerror
  9686. CHARACTER(len=100) :: msg
  9687. CALL gerror(msg)
  9688. WRITE(*,*) msg
  9689. END PROGRAM
  9690. _See also_:
  9691. *note IERRNO::, *note PERROR::
  9692. 
  9693. File: gfortran.info, Node: GETARG, Next: GET_COMMAND, Prev: GERROR, Up: Intrinsic Procedures
  9694. 9.120 'GETARG' -- Get command line arguments
  9695. ============================================
  9696. _Description_:
  9697. Retrieve the POS-th argument that was passed on the command line
  9698. when the containing program was invoked.
  9699. This intrinsic routine is provided for backwards compatibility with
  9700. GNU Fortran 77. In new code, programmers should consider the use
  9701. of the *note GET_COMMAND_ARGUMENT:: intrinsic defined by the
  9702. Fortran 2003 standard.
  9703. _Standard_:
  9704. GNU extension
  9705. _Class_:
  9706. Subroutine
  9707. _Syntax_:
  9708. 'CALL GETARG(POS, VALUE)'
  9709. _Arguments_:
  9710. POS Shall be of type 'INTEGER' and not wider than
  9711. the default integer kind; POS \geq 0
  9712. VALUE Shall be of type 'CHARACTER' and of default
  9713. kind.
  9714. VALUE Shall be of type 'CHARACTER'.
  9715. _Return value_:
  9716. After 'GETARG' returns, the VALUE argument holds the POSth command
  9717. line argument. If VALUE can not hold the argument, it is truncated
  9718. to fit the length of VALUE. If there are less than POS arguments
  9719. specified at the command line, VALUE will be filled with blanks.
  9720. If POS = 0, VALUE is set to the name of the program (on systems
  9721. that support this feature).
  9722. _Example_:
  9723. PROGRAM test_getarg
  9724. INTEGER :: i
  9725. CHARACTER(len=32) :: arg
  9726. DO i = 1, iargc()
  9727. CALL getarg(i, arg)
  9728. WRITE (*,*) arg
  9729. END DO
  9730. END PROGRAM
  9731. _See also_:
  9732. GNU Fortran 77 compatibility function: *note IARGC::
  9733. Fortran 2003 functions and subroutines: *note GET_COMMAND::, *note
  9734. GET_COMMAND_ARGUMENT::, *note COMMAND_ARGUMENT_COUNT::
  9735. 
  9736. File: gfortran.info, Node: GET_COMMAND, Next: GET_COMMAND_ARGUMENT, Prev: GETARG, Up: Intrinsic Procedures
  9737. 9.121 'GET_COMMAND' -- Get the entire command line
  9738. ==================================================
  9739. _Description_:
  9740. Retrieve the entire command line that was used to invoke the
  9741. program.
  9742. _Standard_:
  9743. Fortran 2003 and later
  9744. _Class_:
  9745. Subroutine
  9746. _Syntax_:
  9747. 'CALL GET_COMMAND([COMMAND, LENGTH, STATUS])'
  9748. _Arguments_:
  9749. COMMAND (Optional) shall be of type 'CHARACTER' and of
  9750. default kind.
  9751. LENGTH (Optional) Shall be of type 'INTEGER' and of
  9752. default kind.
  9753. STATUS (Optional) Shall be of type 'INTEGER' and of
  9754. default kind.
  9755. _Return value_:
  9756. If COMMAND is present, stores the entire command line that was used
  9757. to invoke the program in COMMAND. If LENGTH is present, it is
  9758. assigned the length of the command line. If STATUS is present, it
  9759. is assigned 0 upon success of the command, -1 if COMMAND is too
  9760. short to store the command line, or a positive value in case of an
  9761. error.
  9762. _Example_:
  9763. PROGRAM test_get_command
  9764. CHARACTER(len=255) :: cmd
  9765. CALL get_command(cmd)
  9766. WRITE (*,*) TRIM(cmd)
  9767. END PROGRAM
  9768. _See also_:
  9769. *note GET_COMMAND_ARGUMENT::, *note COMMAND_ARGUMENT_COUNT::
  9770. 
  9771. File: gfortran.info, Node: GET_COMMAND_ARGUMENT, Next: GETCWD, Prev: GET_COMMAND, Up: Intrinsic Procedures
  9772. 9.122 'GET_COMMAND_ARGUMENT' -- Get command line arguments
  9773. ==========================================================
  9774. _Description_:
  9775. Retrieve the NUMBER-th argument that was passed on the command line
  9776. when the containing program was invoked.
  9777. _Standard_:
  9778. Fortran 2003 and later
  9779. _Class_:
  9780. Subroutine
  9781. _Syntax_:
  9782. 'CALL GET_COMMAND_ARGUMENT(NUMBER [, VALUE, LENGTH, STATUS])'
  9783. _Arguments_:
  9784. NUMBER Shall be a scalar of type 'INTEGER' and of
  9785. default kind, NUMBER \geq 0
  9786. VALUE (Optional) Shall be a scalar of type 'CHARACTER'
  9787. and of default kind.
  9788. LENGTH (Optional) Shall be a scalar of type 'INTEGER'
  9789. and of default kind.
  9790. STATUS (Optional) Shall be a scalar of type 'INTEGER'
  9791. and of default kind.
  9792. _Return value_:
  9793. After 'GET_COMMAND_ARGUMENT' returns, the VALUE argument holds the
  9794. NUMBER-th command line argument. If VALUE can not hold the
  9795. argument, it is truncated to fit the length of VALUE. If there are
  9796. less than NUMBER arguments specified at the command line, VALUE
  9797. will be filled with blanks. If NUMBER = 0, VALUE is set to the
  9798. name of the program (on systems that support this feature). The
  9799. LENGTH argument contains the length of the NUMBER-th command line
  9800. argument. If the argument retrieval fails, STATUS is a positive
  9801. number; if VALUE contains a truncated command line argument, STATUS
  9802. is -1; and otherwise the STATUS is zero.
  9803. _Example_:
  9804. PROGRAM test_get_command_argument
  9805. INTEGER :: i
  9806. CHARACTER(len=32) :: arg
  9807. i = 0
  9808. DO
  9809. CALL get_command_argument(i, arg)
  9810. IF (LEN_TRIM(arg) == 0) EXIT
  9811. WRITE (*,*) TRIM(arg)
  9812. i = i+1
  9813. END DO
  9814. END PROGRAM
  9815. _See also_:
  9816. *note GET_COMMAND::, *note COMMAND_ARGUMENT_COUNT::
  9817. 
  9818. File: gfortran.info, Node: GETCWD, Next: GETENV, Prev: GET_COMMAND_ARGUMENT, Up: Intrinsic Procedures
  9819. 9.123 'GETCWD' -- Get current working directory
  9820. ===============================================
  9821. _Description_:
  9822. Get current working directory.
  9823. This intrinsic is provided in both subroutine and function forms;
  9824. however, only one form can be used in any given program unit.
  9825. _Standard_:
  9826. GNU extension
  9827. _Class_:
  9828. Subroutine, function
  9829. _Syntax_:
  9830. 'CALL GETCWD(C [, STATUS])'
  9831. 'STATUS = GETCWD(C)'
  9832. _Arguments_:
  9833. C The type shall be 'CHARACTER' and of default
  9834. kind.
  9835. STATUS (Optional) status flag. Returns 0 on success, a
  9836. system specific and nonzero error code
  9837. otherwise.
  9838. _Example_:
  9839. PROGRAM test_getcwd
  9840. CHARACTER(len=255) :: cwd
  9841. CALL getcwd(cwd)
  9842. WRITE(*,*) TRIM(cwd)
  9843. END PROGRAM
  9844. _See also_:
  9845. *note CHDIR::
  9846. 
  9847. File: gfortran.info, Node: GETENV, Next: GET_ENVIRONMENT_VARIABLE, Prev: GETCWD, Up: Intrinsic Procedures
  9848. 9.124 'GETENV' -- Get an environmental variable
  9849. ===============================================
  9850. _Description_:
  9851. Get the VALUE of the environmental variable NAME.
  9852. This intrinsic routine is provided for backwards compatibility with
  9853. GNU Fortran 77. In new code, programmers should consider the use
  9854. of the *note GET_ENVIRONMENT_VARIABLE:: intrinsic defined by the
  9855. Fortran 2003 standard.
  9856. Note that 'GETENV' need not be thread-safe. It is the
  9857. responsibility of the user to ensure that the environment is not
  9858. being updated concurrently with a call to the 'GETENV' intrinsic.
  9859. _Standard_:
  9860. GNU extension
  9861. _Class_:
  9862. Subroutine
  9863. _Syntax_:
  9864. 'CALL GETENV(NAME, VALUE)'
  9865. _Arguments_:
  9866. NAME Shall be of type 'CHARACTER' and of default
  9867. kind.
  9868. VALUE Shall be of type 'CHARACTER' and of default
  9869. kind.
  9870. _Return value_:
  9871. Stores the value of NAME in VALUE. If VALUE is not large enough to
  9872. hold the data, it is truncated. If NAME is not set, VALUE will be
  9873. filled with blanks.
  9874. _Example_:
  9875. PROGRAM test_getenv
  9876. CHARACTER(len=255) :: homedir
  9877. CALL getenv("HOME", homedir)
  9878. WRITE (*,*) TRIM(homedir)
  9879. END PROGRAM
  9880. _See also_:
  9881. *note GET_ENVIRONMENT_VARIABLE::
  9882. 
  9883. File: gfortran.info, Node: GET_ENVIRONMENT_VARIABLE, Next: GETGID, Prev: GETENV, Up: Intrinsic Procedures
  9884. 9.125 'GET_ENVIRONMENT_VARIABLE' -- Get an environmental variable
  9885. =================================================================
  9886. _Description_:
  9887. Get the VALUE of the environmental variable NAME.
  9888. Note that 'GET_ENVIRONMENT_VARIABLE' need not be thread-safe. It
  9889. is the responsibility of the user to ensure that the environment is
  9890. not being updated concurrently with a call to the
  9891. 'GET_ENVIRONMENT_VARIABLE' intrinsic.
  9892. _Standard_:
  9893. Fortran 2003 and later
  9894. _Class_:
  9895. Subroutine
  9896. _Syntax_:
  9897. 'CALL GET_ENVIRONMENT_VARIABLE(NAME[, VALUE, LENGTH, STATUS,
  9898. TRIM_NAME)'
  9899. _Arguments_:
  9900. NAME Shall be a scalar of type 'CHARACTER' and of
  9901. default kind.
  9902. VALUE (Optional) Shall be a scalar of type 'CHARACTER'
  9903. and of default kind.
  9904. LENGTH (Optional) Shall be a scalar of type 'INTEGER'
  9905. and of default kind.
  9906. STATUS (Optional) Shall be a scalar of type 'INTEGER'
  9907. and of default kind.
  9908. TRIM_NAME (Optional) Shall be a scalar of type 'LOGICAL'
  9909. and of default kind.
  9910. _Return value_:
  9911. Stores the value of NAME in VALUE. If VALUE is not large enough to
  9912. hold the data, it is truncated. If NAME is not set, VALUE will be
  9913. filled with blanks. Argument LENGTH contains the length needed for
  9914. storing the environment variable NAME or zero if it is not present.
  9915. STATUS is -1 if VALUE is present but too short for the environment
  9916. variable; it is 1 if the environment variable does not exist and 2
  9917. if the processor does not support environment variables; in all
  9918. other cases STATUS is zero. If TRIM_NAME is present with the value
  9919. '.FALSE.', the trailing blanks in NAME are significant; otherwise
  9920. they are not part of the environment variable name.
  9921. _Example_:
  9922. PROGRAM test_getenv
  9923. CHARACTER(len=255) :: homedir
  9924. CALL get_environment_variable("HOME", homedir)
  9925. WRITE (*,*) TRIM(homedir)
  9926. END PROGRAM
  9927. 
  9928. File: gfortran.info, Node: GETGID, Next: GETLOG, Prev: GET_ENVIRONMENT_VARIABLE, Up: Intrinsic Procedures
  9929. 9.126 'GETGID' -- Group ID function
  9930. ===================================
  9931. _Description_:
  9932. Returns the numerical group ID of the current process.
  9933. _Standard_:
  9934. GNU extension
  9935. _Class_:
  9936. Function
  9937. _Syntax_:
  9938. 'RESULT = GETGID()'
  9939. _Return value_:
  9940. The return value of 'GETGID' is an 'INTEGER' of the default kind.
  9941. _Example_:
  9942. See 'GETPID' for an example.
  9943. _See also_:
  9944. *note GETPID::, *note GETUID::
  9945. 
  9946. File: gfortran.info, Node: GETLOG, Next: GETPID, Prev: GETGID, Up: Intrinsic Procedures
  9947. 9.127 'GETLOG' -- Get login name
  9948. ================================
  9949. _Description_:
  9950. Gets the username under which the program is running.
  9951. _Standard_:
  9952. GNU extension
  9953. _Class_:
  9954. Subroutine
  9955. _Syntax_:
  9956. 'CALL GETLOG(C)'
  9957. _Arguments_:
  9958. C Shall be of type 'CHARACTER' and of default
  9959. kind.
  9960. _Return value_:
  9961. Stores the current user name in LOGIN. (On systems where POSIX
  9962. functions 'geteuid' and 'getpwuid' are not available, and the
  9963. 'getlogin' function is not implemented either, this will return a
  9964. blank string.)
  9965. _Example_:
  9966. PROGRAM TEST_GETLOG
  9967. CHARACTER(32) :: login
  9968. CALL GETLOG(login)
  9969. WRITE(*,*) login
  9970. END PROGRAM
  9971. _See also_:
  9972. *note GETUID::
  9973. 
  9974. File: gfortran.info, Node: GETPID, Next: GETUID, Prev: GETLOG, Up: Intrinsic Procedures
  9975. 9.128 'GETPID' -- Process ID function
  9976. =====================================
  9977. _Description_:
  9978. Returns the numerical process identifier of the current process.
  9979. _Standard_:
  9980. GNU extension
  9981. _Class_:
  9982. Function
  9983. _Syntax_:
  9984. 'RESULT = GETPID()'
  9985. _Return value_:
  9986. The return value of 'GETPID' is an 'INTEGER' of the default kind.
  9987. _Example_:
  9988. program info
  9989. print *, "The current process ID is ", getpid()
  9990. print *, "Your numerical user ID is ", getuid()
  9991. print *, "Your numerical group ID is ", getgid()
  9992. end program info
  9993. _See also_:
  9994. *note GETGID::, *note GETUID::
  9995. 
  9996. File: gfortran.info, Node: GETUID, Next: GMTIME, Prev: GETPID, Up: Intrinsic Procedures
  9997. 9.129 'GETUID' -- User ID function
  9998. ==================================
  9999. _Description_:
  10000. Returns the numerical user ID of the current process.
  10001. _Standard_:
  10002. GNU extension
  10003. _Class_:
  10004. Function
  10005. _Syntax_:
  10006. 'RESULT = GETUID()'
  10007. _Return value_:
  10008. The return value of 'GETUID' is an 'INTEGER' of the default kind.
  10009. _Example_:
  10010. See 'GETPID' for an example.
  10011. _See also_:
  10012. *note GETPID::, *note GETLOG::
  10013. 
  10014. File: gfortran.info, Node: GMTIME, Next: HOSTNM, Prev: GETUID, Up: Intrinsic Procedures
  10015. 9.130 'GMTIME' -- Convert time to GMT info
  10016. ==========================================
  10017. _Description_:
  10018. Given a system time value TIME (as provided by the *note TIME::
  10019. intrinsic), fills VALUES with values extracted from it appropriate
  10020. to the UTC time zone (Universal Coordinated Time, also known in
  10021. some countries as GMT, Greenwich Mean Time), using 'gmtime(3)'.
  10022. This intrinsic routine is provided for backwards compatibility with
  10023. GNU Fortran 77. In new code, programmers should consider the use
  10024. of the *note DATE_AND_TIME:: intrinsic defined by the Fortran 95
  10025. standard.
  10026. _Standard_:
  10027. GNU extension
  10028. _Class_:
  10029. Subroutine
  10030. _Syntax_:
  10031. 'CALL GMTIME(TIME, VALUES)'
  10032. _Arguments_:
  10033. TIME An 'INTEGER' scalar expression corresponding to
  10034. a system time, with 'INTENT(IN)'.
  10035. VALUES A default 'INTEGER' array with 9 elements, with
  10036. 'INTENT(OUT)'.
  10037. _Return value_:
  10038. The elements of VALUES are assigned as follows:
  10039. 1. Seconds after the minute, range 0-59 or 0-61 to allow for leap
  10040. seconds
  10041. 2. Minutes after the hour, range 0-59
  10042. 3. Hours past midnight, range 0-23
  10043. 4. Day of month, range 1-31
  10044. 5. Number of months since January, range 0-11
  10045. 6. Years since 1900
  10046. 7. Number of days since Sunday, range 0-6
  10047. 8. Days since January 1, range 0-365
  10048. 9. Daylight savings indicator: positive if daylight savings is in
  10049. effect, zero if not, and negative if the information is not
  10050. available.
  10051. _See also_:
  10052. *note DATE_AND_TIME::, *note CTIME::, *note LTIME::, *note TIME::,
  10053. *note TIME8::
  10054. 
  10055. File: gfortran.info, Node: HOSTNM, Next: HUGE, Prev: GMTIME, Up: Intrinsic Procedures
  10056. 9.131 'HOSTNM' -- Get system host name
  10057. ======================================
  10058. _Description_:
  10059. Retrieves the host name of the system on which the program is
  10060. running.
  10061. This intrinsic is provided in both subroutine and function forms;
  10062. however, only one form can be used in any given program unit.
  10063. _Standard_:
  10064. GNU extension
  10065. _Class_:
  10066. Subroutine, function
  10067. _Syntax_:
  10068. 'CALL HOSTNM(C [, STATUS])'
  10069. 'STATUS = HOSTNM(NAME)'
  10070. _Arguments_:
  10071. C Shall of type 'CHARACTER' and of default kind.
  10072. STATUS (Optional) status flag of type 'INTEGER'.
  10073. Returns 0 on success, or a system specific error
  10074. code otherwise.
  10075. _Return value_:
  10076. In either syntax, NAME is set to the current hostname if it can be
  10077. obtained, or to a blank string otherwise.
  10078. 
  10079. File: gfortran.info, Node: HUGE, Next: HYPOT, Prev: HOSTNM, Up: Intrinsic Procedures
  10080. 9.132 'HUGE' -- Largest number of a kind
  10081. ========================================
  10082. _Description_:
  10083. 'HUGE(X)' returns the largest number that is not an infinity in the
  10084. model of the type of 'X'.
  10085. _Standard_:
  10086. Fortran 95 and later
  10087. _Class_:
  10088. Inquiry function
  10089. _Syntax_:
  10090. 'RESULT = HUGE(X)'
  10091. _Arguments_:
  10092. X Shall be of type 'REAL' or 'INTEGER'.
  10093. _Return value_:
  10094. The return value is of the same type and kind as X
  10095. _Example_:
  10096. program test_huge_tiny
  10097. print *, huge(0), huge(0.0), huge(0.0d0)
  10098. print *, tiny(0.0), tiny(0.0d0)
  10099. end program test_huge_tiny
  10100. 
  10101. File: gfortran.info, Node: HYPOT, Next: IACHAR, Prev: HUGE, Up: Intrinsic Procedures
  10102. 9.133 'HYPOT' -- Euclidean distance function
  10103. ============================================
  10104. _Description_:
  10105. 'HYPOT(X,Y)' is the Euclidean distance function. It is equal to
  10106. \sqrt{X^2 + Y^2}, without undue underflow or overflow.
  10107. _Standard_:
  10108. Fortran 2008 and later
  10109. _Class_:
  10110. Elemental function
  10111. _Syntax_:
  10112. 'RESULT = HYPOT(X, Y)'
  10113. _Arguments_:
  10114. X The type shall be 'REAL'.
  10115. Y The type and kind type parameter shall be the
  10116. same as X.
  10117. _Return value_:
  10118. The return value has the same type and kind type parameter as X.
  10119. _Example_:
  10120. program test_hypot
  10121. real(4) :: x = 1.e0_4, y = 0.5e0_4
  10122. x = hypot(x,y)
  10123. end program test_hypot
  10124. 
  10125. File: gfortran.info, Node: IACHAR, Next: IALL, Prev: HYPOT, Up: Intrinsic Procedures
  10126. 9.134 'IACHAR' -- Code in ASCII collating sequence
  10127. ==================================================
  10128. _Description_:
  10129. 'IACHAR(C)' returns the code for the ASCII character in the first
  10130. character position of 'C'.
  10131. _Standard_:
  10132. Fortran 95 and later, with KIND argument Fortran 2003 and later
  10133. _Class_:
  10134. Elemental function
  10135. _Syntax_:
  10136. 'RESULT = IACHAR(C [, KIND])'
  10137. _Arguments_:
  10138. C Shall be a scalar 'CHARACTER', with 'INTENT(IN)'
  10139. KIND (Optional) An 'INTEGER' initialization
  10140. expression indicating the kind parameter of the
  10141. result.
  10142. _Return value_:
  10143. The return value is of type 'INTEGER' and of kind KIND. If KIND is
  10144. absent, the return value is of default integer kind.
  10145. _Example_:
  10146. program test_iachar
  10147. integer i
  10148. i = iachar(' ')
  10149. end program test_iachar
  10150. _Note_:
  10151. See *note ICHAR:: for a discussion of converting between numerical
  10152. values and formatted string representations.
  10153. _See also_:
  10154. *note ACHAR::, *note CHAR::, *note ICHAR::
  10155. 
  10156. File: gfortran.info, Node: IALL, Next: IAND, Prev: IACHAR, Up: Intrinsic Procedures
  10157. 9.135 'IALL' -- Bitwise AND of array elements
  10158. =============================================
  10159. _Description_:
  10160. Reduces with bitwise AND the elements of ARRAY along dimension DIM
  10161. if the corresponding element in MASK is 'TRUE'.
  10162. _Standard_:
  10163. Fortran 2008 and later
  10164. _Class_:
  10165. Transformational function
  10166. _Syntax_:
  10167. 'RESULT = IALL(ARRAY[, MASK])'
  10168. 'RESULT = IALL(ARRAY, DIM[, MASK])'
  10169. _Arguments_:
  10170. ARRAY Shall be an array of type 'INTEGER'
  10171. DIM (Optional) shall be a scalar of type 'INTEGER'
  10172. with a value in the range from 1 to n, where n
  10173. equals the rank of ARRAY.
  10174. MASK (Optional) shall be of type 'LOGICAL' and either
  10175. be a scalar or an array of the same shape as
  10176. ARRAY.
  10177. _Return value_:
  10178. The result is of the same type as ARRAY.
  10179. If DIM is absent, a scalar with the bitwise ALL of all elements in
  10180. ARRAY is returned. Otherwise, an array of rank n-1, where n equals
  10181. the rank of ARRAY, and a shape similar to that of ARRAY with
  10182. dimension DIM dropped is returned.
  10183. _Example_:
  10184. PROGRAM test_iall
  10185. INTEGER(1) :: a(2)
  10186. a(1) = b'00100100'
  10187. a(2) = b'01101010'
  10188. ! prints 00100000
  10189. PRINT '(b8.8)', IALL(a)
  10190. END PROGRAM
  10191. _See also_:
  10192. *note IANY::, *note IPARITY::, *note IAND::
  10193. 
  10194. File: gfortran.info, Node: IAND, Next: IANY, Prev: IALL, Up: Intrinsic Procedures
  10195. 9.136 'IAND' -- Bitwise logical and
  10196. ===================================
  10197. _Description_:
  10198. Bitwise logical 'AND'.
  10199. _Standard_:
  10200. Fortran 95 and later, has overloads that are GNU extensions
  10201. _Class_:
  10202. Elemental function
  10203. _Syntax_:
  10204. 'RESULT = IAND(I, J)'
  10205. _Arguments_:
  10206. I The type shall be 'INTEGER'.
  10207. J The type shall be 'INTEGER', of the same kind as
  10208. I. (As a GNU extension, different kinds are
  10209. also permitted.)
  10210. _Return value_:
  10211. The return type is 'INTEGER', of the same kind as the arguments.
  10212. (If the argument kinds differ, it is of the same kind as the larger
  10213. argument.)
  10214. _Example_:
  10215. PROGRAM test_iand
  10216. INTEGER :: a, b
  10217. DATA a / Z'F' /, b / Z'3' /
  10218. WRITE (*,*) IAND(a, b)
  10219. END PROGRAM
  10220. _Specific names_:
  10221. Name Argument Return type Standard
  10222. 'IAND(A)' 'INTEGER A' 'INTEGER' Fortran 95 and
  10223. later
  10224. 'BIAND(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension
  10225. A'
  10226. 'IIAND(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension
  10227. A'
  10228. 'JIAND(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension
  10229. A'
  10230. 'KIAND(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension
  10231. A'
  10232. _See also_:
  10233. *note IOR::, *note IEOR::, *note IBITS::, *note IBSET::, *note
  10234. IBCLR::, *note NOT::
  10235. 
  10236. File: gfortran.info, Node: IANY, Next: IARGC, Prev: IAND, Up: Intrinsic Procedures
  10237. 9.137 'IANY' -- Bitwise OR of array elements
  10238. ============================================
  10239. _Description_:
  10240. Reduces with bitwise OR (inclusive or) the elements of ARRAY along
  10241. dimension DIM if the corresponding element in MASK is 'TRUE'.
  10242. _Standard_:
  10243. Fortran 2008 and later
  10244. _Class_:
  10245. Transformational function
  10246. _Syntax_:
  10247. 'RESULT = IANY(ARRAY[, MASK])'
  10248. 'RESULT = IANY(ARRAY, DIM[, MASK])'
  10249. _Arguments_:
  10250. ARRAY Shall be an array of type 'INTEGER'
  10251. DIM (Optional) shall be a scalar of type 'INTEGER'
  10252. with a value in the range from 1 to n, where n
  10253. equals the rank of ARRAY.
  10254. MASK (Optional) shall be of type 'LOGICAL' and either
  10255. be a scalar or an array of the same shape as
  10256. ARRAY.
  10257. _Return value_:
  10258. The result is of the same type as ARRAY.
  10259. If DIM is absent, a scalar with the bitwise OR of all elements in
  10260. ARRAY is returned. Otherwise, an array of rank n-1, where n equals
  10261. the rank of ARRAY, and a shape similar to that of ARRAY with
  10262. dimension DIM dropped is returned.
  10263. _Example_:
  10264. PROGRAM test_iany
  10265. INTEGER(1) :: a(2)
  10266. a(1) = b'00100100'
  10267. a(2) = b'01101010'
  10268. ! prints 01101110
  10269. PRINT '(b8.8)', IANY(a)
  10270. END PROGRAM
  10271. _See also_:
  10272. *note IPARITY::, *note IALL::, *note IOR::
  10273. 
  10274. File: gfortran.info, Node: IARGC, Next: IBCLR, Prev: IANY, Up: Intrinsic Procedures
  10275. 9.138 'IARGC' -- Get the number of command line arguments
  10276. =========================================================
  10277. _Description_:
  10278. 'IARGC' returns the number of arguments passed on the command line
  10279. when the containing program was invoked.
  10280. This intrinsic routine is provided for backwards compatibility with
  10281. GNU Fortran 77. In new code, programmers should consider the use
  10282. of the *note COMMAND_ARGUMENT_COUNT:: intrinsic defined by the
  10283. Fortran 2003 standard.
  10284. _Standard_:
  10285. GNU extension
  10286. _Class_:
  10287. Function
  10288. _Syntax_:
  10289. 'RESULT = IARGC()'
  10290. _Arguments_:
  10291. None.
  10292. _Return value_:
  10293. The number of command line arguments, type 'INTEGER(4)'.
  10294. _Example_:
  10295. See *note GETARG::
  10296. _See also_:
  10297. GNU Fortran 77 compatibility subroutine: *note GETARG::
  10298. Fortran 2003 functions and subroutines: *note GET_COMMAND::, *note
  10299. GET_COMMAND_ARGUMENT::, *note COMMAND_ARGUMENT_COUNT::
  10300. 
  10301. File: gfortran.info, Node: IBCLR, Next: IBITS, Prev: IARGC, Up: Intrinsic Procedures
  10302. 9.139 'IBCLR' -- Clear bit
  10303. ==========================
  10304. _Description_:
  10305. 'IBCLR' returns the value of I with the bit at position POS set to
  10306. zero.
  10307. _Standard_:
  10308. Fortran 95 and later, has overloads that are GNU extensions
  10309. _Class_:
  10310. Elemental function
  10311. _Syntax_:
  10312. 'RESULT = IBCLR(I, POS)'
  10313. _Arguments_:
  10314. I The type shall be 'INTEGER'.
  10315. POS The type shall be 'INTEGER'.
  10316. _Return value_:
  10317. The return value is of type 'INTEGER' and of the same kind as I.
  10318. _Specific names_:
  10319. Name Argument Return type Standard
  10320. 'IBCLR(A)' 'INTEGER A' 'INTEGER' Fortran 95 and
  10321. later
  10322. 'BBCLR(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension
  10323. A'
  10324. 'IIBCLR(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension
  10325. A'
  10326. 'JIBCLR(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension
  10327. A'
  10328. 'KIBCLR(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension
  10329. A'
  10330. _See also_:
  10331. *note IBITS::, *note IBSET::, *note IAND::, *note IOR::, *note
  10332. IEOR::, *note MVBITS::
  10333. 
  10334. File: gfortran.info, Node: IBITS, Next: IBSET, Prev: IBCLR, Up: Intrinsic Procedures
  10335. 9.140 'IBITS' -- Bit extraction
  10336. ===============================
  10337. _Description_:
  10338. 'IBITS' extracts a field of length LEN from I, starting from bit
  10339. position POS and extending left for LEN bits. The result is
  10340. right-justified and the remaining bits are zeroed. The value of
  10341. 'POS+LEN' must be less than or equal to the value 'BIT_SIZE(I)'.
  10342. _Standard_:
  10343. Fortran 95 and later, has overloads that are GNU extensions
  10344. _Class_:
  10345. Elemental function
  10346. _Syntax_:
  10347. 'RESULT = IBITS(I, POS, LEN)'
  10348. _Arguments_:
  10349. I The type shall be 'INTEGER'.
  10350. POS The type shall be 'INTEGER'.
  10351. LEN The type shall be 'INTEGER'.
  10352. _Return value_:
  10353. The return value is of type 'INTEGER' and of the same kind as I.
  10354. _Specific names_:
  10355. Name Argument Return type Standard
  10356. 'IBITS(A)' 'INTEGER A' 'INTEGER' Fortran 95 and
  10357. later
  10358. 'BBITS(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension
  10359. A'
  10360. 'IIBITS(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension
  10361. A'
  10362. 'JIBITS(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension
  10363. A'
  10364. 'KIBITS(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension
  10365. A'
  10366. _See also_:
  10367. *note BIT_SIZE::, *note IBCLR::, *note IBSET::, *note IAND::, *note
  10368. IOR::, *note IEOR::
  10369. 
  10370. File: gfortran.info, Node: IBSET, Next: ICHAR, Prev: IBITS, Up: Intrinsic Procedures
  10371. 9.141 'IBSET' -- Set bit
  10372. ========================
  10373. _Description_:
  10374. 'IBSET' returns the value of I with the bit at position POS set to
  10375. one.
  10376. _Standard_:
  10377. Fortran 95 and later, has overloads that are GNU extensions
  10378. _Class_:
  10379. Elemental function
  10380. _Syntax_:
  10381. 'RESULT = IBSET(I, POS)'
  10382. _Arguments_:
  10383. I The type shall be 'INTEGER'.
  10384. POS The type shall be 'INTEGER'.
  10385. _Return value_:
  10386. The return value is of type 'INTEGER' and of the same kind as I.
  10387. _Specific names_:
  10388. Name Argument Return type Standard
  10389. 'IBSET(A)' 'INTEGER A' 'INTEGER' Fortran 95 and
  10390. later
  10391. 'BBSET(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension
  10392. A'
  10393. 'IIBSET(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension
  10394. A'
  10395. 'JIBSET(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension
  10396. A'
  10397. 'KIBSET(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension
  10398. A'
  10399. _See also_:
  10400. *note IBCLR::, *note IBITS::, *note IAND::, *note IOR::, *note
  10401. IEOR::, *note MVBITS::
  10402. 
  10403. File: gfortran.info, Node: ICHAR, Next: IDATE, Prev: IBSET, Up: Intrinsic Procedures
  10404. 9.142 'ICHAR' -- Character-to-integer conversion function
  10405. =========================================================
  10406. _Description_:
  10407. 'ICHAR(C)' returns the code for the character in the first
  10408. character position of 'C' in the system's native character set.
  10409. The correspondence between characters and their codes is not
  10410. necessarily the same across different GNU Fortran implementations.
  10411. _Standard_:
  10412. Fortran 95 and later, with KIND argument Fortran 2003 and later
  10413. _Class_:
  10414. Elemental function
  10415. _Syntax_:
  10416. 'RESULT = ICHAR(C [, KIND])'
  10417. _Arguments_:
  10418. C Shall be a scalar 'CHARACTER', with 'INTENT(IN)'
  10419. KIND (Optional) An 'INTEGER' initialization
  10420. expression indicating the kind parameter of the
  10421. result.
  10422. _Return value_:
  10423. The return value is of type 'INTEGER' and of kind KIND. If KIND is
  10424. absent, the return value is of default integer kind.
  10425. _Example_:
  10426. program test_ichar
  10427. integer i
  10428. i = ichar(' ')
  10429. end program test_ichar
  10430. _Specific names_:
  10431. Name Argument Return type Standard
  10432. 'ICHAR(C)' 'CHARACTER 'INTEGER(4)' Fortran 77 and
  10433. C' later
  10434. _Note_:
  10435. No intrinsic exists to convert between a numeric value and a
  10436. formatted character string representation - for instance, given the
  10437. 'CHARACTER' value ''154'', obtaining an 'INTEGER' or 'REAL' value
  10438. with the value 154, or vice versa. Instead, this functionality is
  10439. provided by internal-file I/O, as in the following example:
  10440. program read_val
  10441. integer value
  10442. character(len=10) string, string2
  10443. string = '154'
  10444. ! Convert a string to a numeric value
  10445. read (string,'(I10)') value
  10446. print *, value
  10447. ! Convert a value to a formatted string
  10448. write (string2,'(I10)') value
  10449. print *, string2
  10450. end program read_val
  10451. _See also_:
  10452. *note ACHAR::, *note CHAR::, *note IACHAR::
  10453. 
  10454. File: gfortran.info, Node: IDATE, Next: IEOR, Prev: ICHAR, Up: Intrinsic Procedures
  10455. 9.143 'IDATE' -- Get current local time subroutine (day/month/year)
  10456. ===================================================================
  10457. _Description_:
  10458. 'IDATE(VALUES)' Fills VALUES with the numerical values at the
  10459. current local time. The day (in the range 1-31), month (in the
  10460. range 1-12), and year appear in elements 1, 2, and 3 of VALUES,
  10461. respectively. The year has four significant digits.
  10462. This intrinsic routine is provided for backwards compatibility with
  10463. GNU Fortran 77. In new code, programmers should consider the use
  10464. of the *note DATE_AND_TIME:: intrinsic defined by the Fortran 95
  10465. standard.
  10466. _Standard_:
  10467. GNU extension
  10468. _Class_:
  10469. Subroutine
  10470. _Syntax_:
  10471. 'CALL IDATE(VALUES)'
  10472. _Arguments_:
  10473. VALUES The type shall be 'INTEGER, DIMENSION(3)' and
  10474. the kind shall be the default integer kind.
  10475. _Return value_:
  10476. Does not return anything.
  10477. _Example_:
  10478. program test_idate
  10479. integer, dimension(3) :: tarray
  10480. call idate(tarray)
  10481. print *, tarray(1)
  10482. print *, tarray(2)
  10483. print *, tarray(3)
  10484. end program test_idate
  10485. _See also_:
  10486. *note DATE_AND_TIME::
  10487. 
  10488. File: gfortran.info, Node: IEOR, Next: IERRNO, Prev: IDATE, Up: Intrinsic Procedures
  10489. 9.144 'IEOR' -- Bitwise logical exclusive or
  10490. ============================================
  10491. _Description_:
  10492. 'IEOR' returns the bitwise Boolean exclusive-OR of I and J.
  10493. _Standard_:
  10494. Fortran 95 and later, has overloads that are GNU extensions
  10495. _Class_:
  10496. Elemental function
  10497. _Syntax_:
  10498. 'RESULT = IEOR(I, J)'
  10499. _Arguments_:
  10500. I The type shall be 'INTEGER'.
  10501. J The type shall be 'INTEGER', of the same kind as
  10502. I. (As a GNU extension, different kinds are
  10503. also permitted.)
  10504. _Return value_:
  10505. The return type is 'INTEGER', of the same kind as the arguments.
  10506. (If the argument kinds differ, it is of the same kind as the larger
  10507. argument.)
  10508. _Specific names_:
  10509. Name Argument Return type Standard
  10510. 'IEOR(A)' 'INTEGER A' 'INTEGER' Fortran 95 and
  10511. later
  10512. 'BIEOR(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension
  10513. A'
  10514. 'IIEOR(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension
  10515. A'
  10516. 'JIEOR(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension
  10517. A'
  10518. 'KIEOR(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension
  10519. A'
  10520. _See also_:
  10521. *note IOR::, *note IAND::, *note IBITS::, *note IBSET::, *note
  10522. IBCLR::, *note NOT::
  10523. 
  10524. File: gfortran.info, Node: IERRNO, Next: IMAGE_INDEX, Prev: IEOR, Up: Intrinsic Procedures
  10525. 9.145 'IERRNO' -- Get the last system error number
  10526. ==================================================
  10527. _Description_:
  10528. Returns the last system error number, as given by the C 'errno'
  10529. variable.
  10530. _Standard_:
  10531. GNU extension
  10532. _Class_:
  10533. Function
  10534. _Syntax_:
  10535. 'RESULT = IERRNO()'
  10536. _Arguments_:
  10537. None.
  10538. _Return value_:
  10539. The return value is of type 'INTEGER' and of the default integer
  10540. kind.
  10541. _See also_:
  10542. *note PERROR::
  10543. 
  10544. File: gfortran.info, Node: IMAGE_INDEX, Next: INDEX intrinsic, Prev: IERRNO, Up: Intrinsic Procedures
  10545. 9.146 'IMAGE_INDEX' -- Function that converts a cosubscript to an image index
  10546. =============================================================================
  10547. _Description_:
  10548. Returns the image index belonging to a cosubscript.
  10549. _Standard_:
  10550. Fortran 2008 and later
  10551. _Class_:
  10552. Inquiry function.
  10553. _Syntax_:
  10554. 'RESULT = IMAGE_INDEX(COARRAY, SUB)'
  10555. _Arguments_: None.
  10556. COARRAY Coarray of any type.
  10557. SUB default integer rank-1 array of a size equal to
  10558. the corank of COARRAY.
  10559. _Return value_:
  10560. Scalar default integer with the value of the image index which
  10561. corresponds to the cosubscripts. For invalid cosubscripts the
  10562. result is zero.
  10563. _Example_:
  10564. INTEGER :: array[2,-1:4,8,*]
  10565. ! Writes 28 (or 0 if there are fewer than 28 images)
  10566. WRITE (*,*) IMAGE_INDEX (array, [2,0,3,1])
  10567. _See also_:
  10568. *note THIS_IMAGE::, *note NUM_IMAGES::
  10569. 
  10570. File: gfortran.info, Node: INDEX intrinsic, Next: INT, Prev: IMAGE_INDEX, Up: Intrinsic Procedures
  10571. 9.147 'INDEX' -- Position of a substring within a string
  10572. ========================================================
  10573. _Description_:
  10574. Returns the position of the start of the first occurrence of string
  10575. SUBSTRING as a substring in STRING, counting from one. If
  10576. SUBSTRING is not present in STRING, zero is returned. If the BACK
  10577. argument is present and true, the return value is the start of the
  10578. last occurrence rather than the first.
  10579. _Standard_:
  10580. Fortran 77 and later, with KIND argument Fortran 2003 and later
  10581. _Class_:
  10582. Elemental function
  10583. _Syntax_:
  10584. 'RESULT = INDEX(STRING, SUBSTRING [, BACK [, KIND]])'
  10585. _Arguments_:
  10586. STRING Shall be a scalar 'CHARACTER', with 'INTENT(IN)'
  10587. SUBSTRING Shall be a scalar 'CHARACTER', with 'INTENT(IN)'
  10588. BACK (Optional) Shall be a scalar 'LOGICAL', with
  10589. 'INTENT(IN)'
  10590. KIND (Optional) An 'INTEGER' initialization
  10591. expression indicating the kind parameter of the
  10592. result.
  10593. _Return value_:
  10594. The return value is of type 'INTEGER' and of kind KIND. If KIND is
  10595. absent, the return value is of default integer kind.
  10596. _Specific names_:
  10597. Name Argument Return type Standard
  10598. 'INDEX(STRING, 'CHARACTER' 'INTEGER(4)' Fortran 77 and
  10599. SUBSTRING)' later
  10600. _See also_:
  10601. *note SCAN::, *note VERIFY::
  10602. 
  10603. File: gfortran.info, Node: INT, Next: INT2, Prev: INDEX intrinsic, Up: Intrinsic Procedures
  10604. 9.148 'INT' -- Convert to integer type
  10605. ======================================
  10606. _Description_:
  10607. Convert to integer type
  10608. _Standard_:
  10609. Fortran 77 and later
  10610. _Class_:
  10611. Elemental function
  10612. _Syntax_:
  10613. 'RESULT = INT(A [, KIND))'
  10614. _Arguments_:
  10615. A Shall be of type 'INTEGER', 'REAL', or
  10616. 'COMPLEX'.
  10617. KIND (Optional) An 'INTEGER' initialization
  10618. expression indicating the kind parameter of the
  10619. result.
  10620. _Return value_:
  10621. These functions return a 'INTEGER' variable or array under the
  10622. following rules:
  10623. (A)
  10624. If A is of type 'INTEGER', 'INT(A) = A'
  10625. (B)
  10626. If A is of type 'REAL' and |A| < 1, 'INT(A)' equals '0'. If
  10627. |A| \geq 1, then 'INT(A)' is the integer whose magnitude is
  10628. the largest integer that does not exceed the magnitude of A
  10629. and whose sign is the same as the sign of A.
  10630. (C)
  10631. If A is of type 'COMPLEX', rule B is applied to the real part
  10632. of A.
  10633. _Example_:
  10634. program test_int
  10635. integer :: i = 42
  10636. complex :: z = (-3.7, 1.0)
  10637. print *, int(i)
  10638. print *, int(z), int(z,8)
  10639. end program
  10640. _Specific names_:
  10641. Name Argument Return type Standard
  10642. 'INT(A)' 'REAL(4) A' 'INTEGER' Fortran 77 and
  10643. later
  10644. 'IFIX(A)' 'REAL(4) A' 'INTEGER' Fortran 77 and
  10645. later
  10646. 'IDINT(A)' 'REAL(8) A' 'INTEGER' Fortran 77 and
  10647. later
  10648. 
  10649. File: gfortran.info, Node: INT2, Next: INT8, Prev: INT, Up: Intrinsic Procedures
  10650. 9.149 'INT2' -- Convert to 16-bit integer type
  10651. ==============================================
  10652. _Description_:
  10653. Convert to a 'KIND=2' integer type. This is equivalent to the
  10654. standard 'INT' intrinsic with an optional argument of 'KIND=2', and
  10655. is only included for backwards compatibility.
  10656. The 'SHORT' intrinsic is equivalent to 'INT2'.
  10657. _Standard_:
  10658. GNU extension
  10659. _Class_:
  10660. Elemental function
  10661. _Syntax_:
  10662. 'RESULT = INT2(A)'
  10663. _Arguments_:
  10664. A Shall be of type 'INTEGER', 'REAL', or
  10665. 'COMPLEX'.
  10666. _Return value_:
  10667. The return value is a 'INTEGER(2)' variable.
  10668. _See also_:
  10669. *note INT::, *note INT8::, *note LONG::
  10670. 
  10671. File: gfortran.info, Node: INT8, Next: IOR, Prev: INT2, Up: Intrinsic Procedures
  10672. 9.150 'INT8' -- Convert to 64-bit integer type
  10673. ==============================================
  10674. _Description_:
  10675. Convert to a 'KIND=8' integer type. This is equivalent to the
  10676. standard 'INT' intrinsic with an optional argument of 'KIND=8', and
  10677. is only included for backwards compatibility.
  10678. _Standard_:
  10679. GNU extension
  10680. _Class_:
  10681. Elemental function
  10682. _Syntax_:
  10683. 'RESULT = INT8(A)'
  10684. _Arguments_:
  10685. A Shall be of type 'INTEGER', 'REAL', or
  10686. 'COMPLEX'.
  10687. _Return value_:
  10688. The return value is a 'INTEGER(8)' variable.
  10689. _See also_:
  10690. *note INT::, *note INT2::, *note LONG::
  10691. 
  10692. File: gfortran.info, Node: IOR, Next: IPARITY, Prev: INT8, Up: Intrinsic Procedures
  10693. 9.151 'IOR' -- Bitwise logical or
  10694. =================================
  10695. _Description_:
  10696. 'IOR' returns the bitwise Boolean inclusive-OR of I and J.
  10697. _Standard_:
  10698. Fortran 95 and later, has overloads that are GNU extensions
  10699. _Class_:
  10700. Elemental function
  10701. _Syntax_:
  10702. 'RESULT = IOR(I, J)'
  10703. _Arguments_:
  10704. I The type shall be 'INTEGER'.
  10705. J The type shall be 'INTEGER', of the same kind as
  10706. I. (As a GNU extension, different kinds are
  10707. also permitted.)
  10708. _Return value_:
  10709. The return type is 'INTEGER', of the same kind as the arguments.
  10710. (If the argument kinds differ, it is of the same kind as the larger
  10711. argument.)
  10712. _Specific names_:
  10713. Name Argument Return type Standard
  10714. 'IOR(A)' 'INTEGER A' 'INTEGER' Fortran 95 and
  10715. later
  10716. 'BIOR(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension
  10717. A'
  10718. 'IIOR(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension
  10719. A'
  10720. 'JIOR(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension
  10721. A'
  10722. 'KIOR(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension
  10723. A'
  10724. _See also_:
  10725. *note IEOR::, *note IAND::, *note IBITS::, *note IBSET::, *note
  10726. IBCLR::, *note NOT::
  10727. 
  10728. File: gfortran.info, Node: IPARITY, Next: IRAND, Prev: IOR, Up: Intrinsic Procedures
  10729. 9.152 'IPARITY' -- Bitwise XOR of array elements
  10730. ================================================
  10731. _Description_:
  10732. Reduces with bitwise XOR (exclusive or) the elements of ARRAY along
  10733. dimension DIM if the corresponding element in MASK is 'TRUE'.
  10734. _Standard_:
  10735. Fortran 2008 and later
  10736. _Class_:
  10737. Transformational function
  10738. _Syntax_:
  10739. 'RESULT = IPARITY(ARRAY[, MASK])'
  10740. 'RESULT = IPARITY(ARRAY, DIM[, MASK])'
  10741. _Arguments_:
  10742. ARRAY Shall be an array of type 'INTEGER'
  10743. DIM (Optional) shall be a scalar of type 'INTEGER'
  10744. with a value in the range from 1 to n, where n
  10745. equals the rank of ARRAY.
  10746. MASK (Optional) shall be of type 'LOGICAL' and either
  10747. be a scalar or an array of the same shape as
  10748. ARRAY.
  10749. _Return value_:
  10750. The result is of the same type as ARRAY.
  10751. If DIM is absent, a scalar with the bitwise XOR of all elements in
  10752. ARRAY is returned. Otherwise, an array of rank n-1, where n equals
  10753. the rank of ARRAY, and a shape similar to that of ARRAY with
  10754. dimension DIM dropped is returned.
  10755. _Example_:
  10756. PROGRAM test_iparity
  10757. INTEGER(1) :: a(2)
  10758. a(1) = b'00100100'
  10759. a(2) = b'01101010'
  10760. ! prints 01001110
  10761. PRINT '(b8.8)', IPARITY(a)
  10762. END PROGRAM
  10763. _See also_:
  10764. *note IANY::, *note IALL::, *note IEOR::, *note PARITY::
  10765. 
  10766. File: gfortran.info, Node: IRAND, Next: IS_IOSTAT_END, Prev: IPARITY, Up: Intrinsic Procedures
  10767. 9.153 'IRAND' -- Integer pseudo-random number
  10768. =============================================
  10769. _Description_:
  10770. 'IRAND(FLAG)' returns a pseudo-random number from a uniform
  10771. distribution between 0 and a system-dependent limit (which is in
  10772. most cases 2147483647). If FLAG is 0, the next number in the
  10773. current sequence is returned; if FLAG is 1, the generator is
  10774. restarted by 'CALL SRAND(0)'; if FLAG has any other value, it is
  10775. used as a new seed with 'SRAND'.
  10776. This intrinsic routine is provided for backwards compatibility with
  10777. GNU Fortran 77. It implements a simple modulo generator as
  10778. provided by 'g77'. For new code, one should consider the use of
  10779. *note RANDOM_NUMBER:: as it implements a superior algorithm.
  10780. _Standard_:
  10781. GNU extension
  10782. _Class_:
  10783. Function
  10784. _Syntax_:
  10785. 'RESULT = IRAND(I)'
  10786. _Arguments_:
  10787. I Shall be a scalar 'INTEGER' of kind 4.
  10788. _Return value_:
  10789. The return value is of 'INTEGER(kind=4)' type.
  10790. _Example_:
  10791. program test_irand
  10792. integer,parameter :: seed = 86456
  10793. call srand(seed)
  10794. print *, irand(), irand(), irand(), irand()
  10795. print *, irand(seed), irand(), irand(), irand()
  10796. end program test_irand
  10797. 
  10798. File: gfortran.info, Node: IS_IOSTAT_END, Next: IS_IOSTAT_EOR, Prev: IRAND, Up: Intrinsic Procedures
  10799. 9.154 'IS_IOSTAT_END' -- Test for end-of-file value
  10800. ===================================================
  10801. _Description_:
  10802. 'IS_IOSTAT_END' tests whether an variable has the value of the I/O
  10803. status "end of file". The function is equivalent to comparing the
  10804. variable with the 'IOSTAT_END' parameter of the intrinsic module
  10805. 'ISO_FORTRAN_ENV'.
  10806. _Standard_:
  10807. Fortran 2003 and later
  10808. _Class_:
  10809. Elemental function
  10810. _Syntax_:
  10811. 'RESULT = IS_IOSTAT_END(I)'
  10812. _Arguments_:
  10813. I Shall be of the type 'INTEGER'.
  10814. _Return value_:
  10815. Returns a 'LOGICAL' of the default kind, which '.TRUE.' if I has
  10816. the value which indicates an end of file condition for 'IOSTAT='
  10817. specifiers, and is '.FALSE.' otherwise.
  10818. _Example_:
  10819. PROGRAM iostat
  10820. IMPLICIT NONE
  10821. INTEGER :: stat, i
  10822. OPEN(88, FILE='test.dat')
  10823. READ(88, *, IOSTAT=stat) i
  10824. IF(IS_IOSTAT_END(stat)) STOP 'END OF FILE'
  10825. END PROGRAM
  10826. 
  10827. File: gfortran.info, Node: IS_IOSTAT_EOR, Next: ISATTY, Prev: IS_IOSTAT_END, Up: Intrinsic Procedures
  10828. 9.155 'IS_IOSTAT_EOR' -- Test for end-of-record value
  10829. =====================================================
  10830. _Description_:
  10831. 'IS_IOSTAT_EOR' tests whether an variable has the value of the I/O
  10832. status "end of record". The function is equivalent to comparing
  10833. the variable with the 'IOSTAT_EOR' parameter of the intrinsic
  10834. module 'ISO_FORTRAN_ENV'.
  10835. _Standard_:
  10836. Fortran 2003 and later
  10837. _Class_:
  10838. Elemental function
  10839. _Syntax_:
  10840. 'RESULT = IS_IOSTAT_EOR(I)'
  10841. _Arguments_:
  10842. I Shall be of the type 'INTEGER'.
  10843. _Return value_:
  10844. Returns a 'LOGICAL' of the default kind, which '.TRUE.' if I has
  10845. the value which indicates an end of file condition for 'IOSTAT='
  10846. specifiers, and is '.FALSE.' otherwise.
  10847. _Example_:
  10848. PROGRAM iostat
  10849. IMPLICIT NONE
  10850. INTEGER :: stat, i(50)
  10851. OPEN(88, FILE='test.dat', FORM='UNFORMATTED')
  10852. READ(88, IOSTAT=stat) i
  10853. IF(IS_IOSTAT_EOR(stat)) STOP 'END OF RECORD'
  10854. END PROGRAM
  10855. 
  10856. File: gfortran.info, Node: ISATTY, Next: ISHFT, Prev: IS_IOSTAT_EOR, Up: Intrinsic Procedures
  10857. 9.156 'ISATTY' -- Whether a unit is a terminal device.
  10858. ======================================================
  10859. _Description_:
  10860. Determine whether a unit is connected to a terminal device.
  10861. _Standard_:
  10862. GNU extension
  10863. _Class_:
  10864. Function
  10865. _Syntax_:
  10866. 'RESULT = ISATTY(UNIT)'
  10867. _Arguments_:
  10868. UNIT Shall be a scalar 'INTEGER'.
  10869. _Return value_:
  10870. Returns '.TRUE.' if the UNIT is connected to a terminal device,
  10871. '.FALSE.' otherwise.
  10872. _Example_:
  10873. PROGRAM test_isatty
  10874. INTEGER(kind=1) :: unit
  10875. DO unit = 1, 10
  10876. write(*,*) isatty(unit=unit)
  10877. END DO
  10878. END PROGRAM
  10879. _See also_:
  10880. *note TTYNAM::
  10881. 
  10882. File: gfortran.info, Node: ISHFT, Next: ISHFTC, Prev: ISATTY, Up: Intrinsic Procedures
  10883. 9.157 'ISHFT' -- Shift bits
  10884. ===========================
  10885. _Description_:
  10886. 'ISHFT' returns a value corresponding to I with all of the bits
  10887. shifted SHIFT places. A value of SHIFT greater than zero
  10888. corresponds to a left shift, a value of zero corresponds to no
  10889. shift, and a value less than zero corresponds to a right shift. If
  10890. the absolute value of SHIFT is greater than 'BIT_SIZE(I)', the
  10891. value is undefined. Bits shifted out from the left end or right
  10892. end are lost; zeros are shifted in from the opposite end.
  10893. _Standard_:
  10894. Fortran 95 and later, has overloads that are GNU extensions
  10895. _Class_:
  10896. Elemental function
  10897. _Syntax_:
  10898. 'RESULT = ISHFT(I, SHIFT)'
  10899. _Arguments_:
  10900. I The type shall be 'INTEGER'.
  10901. SHIFT The type shall be 'INTEGER'.
  10902. _Return value_:
  10903. The return value is of type 'INTEGER' and of the same kind as I.
  10904. _Specific names_:
  10905. Name Argument Return type Standard
  10906. 'ISHFT(A)' 'INTEGER A' 'INTEGER' Fortran 95 and
  10907. later
  10908. 'BSHFT(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension
  10909. A'
  10910. 'IISHFT(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension
  10911. A'
  10912. 'JISHFT(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension
  10913. A'
  10914. 'KISHFT(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension
  10915. A'
  10916. _See also_:
  10917. *note ISHFTC::
  10918. 
  10919. File: gfortran.info, Node: ISHFTC, Next: ISNAN, Prev: ISHFT, Up: Intrinsic Procedures
  10920. 9.158 'ISHFTC' -- Shift bits circularly
  10921. =======================================
  10922. _Description_:
  10923. 'ISHFTC' returns a value corresponding to I with the rightmost SIZE
  10924. bits shifted circularly SHIFT places; that is, bits shifted out one
  10925. end are shifted into the opposite end. A value of SHIFT greater
  10926. than zero corresponds to a left shift, a value of zero corresponds
  10927. to no shift, and a value less than zero corresponds to a right
  10928. shift. The absolute value of SHIFT must be less than SIZE. If the
  10929. SIZE argument is omitted, it is taken to be equivalent to
  10930. 'BIT_SIZE(I)'.
  10931. _Standard_:
  10932. Fortran 95 and later, has overloads that are GNU extensions
  10933. _Class_:
  10934. Elemental function
  10935. _Syntax_:
  10936. 'RESULT = ISHFTC(I, SHIFT [, SIZE])'
  10937. _Arguments_:
  10938. I The type shall be 'INTEGER'.
  10939. SHIFT The type shall be 'INTEGER'.
  10940. SIZE (Optional) The type shall be 'INTEGER'; the
  10941. value must be greater than zero and less than or
  10942. equal to 'BIT_SIZE(I)'.
  10943. _Return value_:
  10944. The return value is of type 'INTEGER' and of the same kind as I.
  10945. _Specific names_:
  10946. Name Argument Return type Standard
  10947. 'ISHFTC(A)' 'INTEGER A' 'INTEGER' Fortran 95 and
  10948. later
  10949. 'BSHFTC(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension
  10950. A'
  10951. 'IISHFTC(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension
  10952. A'
  10953. 'JISHFTC(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension
  10954. A'
  10955. 'KISHFTC(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension
  10956. A'
  10957. _See also_:
  10958. *note ISHFT::
  10959. 
  10960. File: gfortran.info, Node: ISNAN, Next: ITIME, Prev: ISHFTC, Up: Intrinsic Procedures
  10961. 9.159 'ISNAN' -- Test for a NaN
  10962. ===============================
  10963. _Description_:
  10964. 'ISNAN' tests whether a floating-point value is an IEEE
  10965. Not-a-Number (NaN).
  10966. _Standard_:
  10967. GNU extension
  10968. _Class_:
  10969. Elemental function
  10970. _Syntax_:
  10971. 'ISNAN(X)'
  10972. _Arguments_:
  10973. X Variable of the type 'REAL'.
  10974. _Return value_:
  10975. Returns a default-kind 'LOGICAL'. The returned value is 'TRUE' if
  10976. X is a NaN and 'FALSE' otherwise.
  10977. _Example_:
  10978. program test_nan
  10979. implicit none
  10980. real :: x
  10981. x = -1.0
  10982. x = sqrt(x)
  10983. if (isnan(x)) stop '"x" is a NaN'
  10984. end program test_nan
  10985. 
  10986. File: gfortran.info, Node: ITIME, Next: KILL, Prev: ISNAN, Up: Intrinsic Procedures
  10987. 9.160 'ITIME' -- Get current local time subroutine (hour/minutes/seconds)
  10988. =========================================================================
  10989. _Description_:
  10990. 'ITIME(VALUES)' Fills VALUES with the numerical values at the
  10991. current local time. The hour (in the range 1-24), minute (in the
  10992. range 1-60), and seconds (in the range 1-60) appear in elements 1,
  10993. 2, and 3 of VALUES, respectively.
  10994. This intrinsic routine is provided for backwards compatibility with
  10995. GNU Fortran 77. In new code, programmers should consider the use
  10996. of the *note DATE_AND_TIME:: intrinsic defined by the Fortran 95
  10997. standard.
  10998. _Standard_:
  10999. GNU extension
  11000. _Class_:
  11001. Subroutine
  11002. _Syntax_:
  11003. 'CALL ITIME(VALUES)'
  11004. _Arguments_:
  11005. VALUES The type shall be 'INTEGER, DIMENSION(3)' and
  11006. the kind shall be the default integer kind.
  11007. _Return value_:
  11008. Does not return anything.
  11009. _Example_:
  11010. program test_itime
  11011. integer, dimension(3) :: tarray
  11012. call itime(tarray)
  11013. print *, tarray(1)
  11014. print *, tarray(2)
  11015. print *, tarray(3)
  11016. end program test_itime
  11017. _See also_:
  11018. *note DATE_AND_TIME::
  11019. 
  11020. File: gfortran.info, Node: KILL, Next: KIND, Prev: ITIME, Up: Intrinsic Procedures
  11021. 9.161 'KILL' -- Send a signal to a process
  11022. ==========================================
  11023. _Description_:
  11024. _Standard_:
  11025. Sends the signal specified by SIGNAL to the process PID. See
  11026. 'kill(2)'.
  11027. This intrinsic is provided in both subroutine and function forms;
  11028. however, only one form can be used in any given program unit.
  11029. _Class_:
  11030. Subroutine, function
  11031. _Syntax_:
  11032. 'CALL KILL(C, VALUE [, STATUS])'
  11033. 'STATUS = KILL(C, VALUE)'
  11034. _Arguments_:
  11035. C Shall be a scalar 'INTEGER', with 'INTENT(IN)'
  11036. VALUE Shall be a scalar 'INTEGER', with 'INTENT(IN)'
  11037. STATUS (Optional) status flag of type 'INTEGER(4)' or
  11038. 'INTEGER(8)'. Returns 0 on success, or a
  11039. system-specific error code otherwise.
  11040. _See also_:
  11041. *note ABORT::, *note EXIT::
  11042. 
  11043. File: gfortran.info, Node: KIND, Next: LBOUND, Prev: KILL, Up: Intrinsic Procedures
  11044. 9.162 'KIND' -- Kind of an entity
  11045. =================================
  11046. _Description_:
  11047. 'KIND(X)' returns the kind value of the entity X.
  11048. _Standard_:
  11049. Fortran 95 and later
  11050. _Class_:
  11051. Inquiry function
  11052. _Syntax_:
  11053. 'K = KIND(X)'
  11054. _Arguments_:
  11055. X Shall be of type 'LOGICAL', 'INTEGER', 'REAL',
  11056. 'COMPLEX' or 'CHARACTER'.
  11057. _Return value_:
  11058. The return value is a scalar of type 'INTEGER' and of the default
  11059. integer kind.
  11060. _Example_:
  11061. program test_kind
  11062. integer,parameter :: kc = kind(' ')
  11063. integer,parameter :: kl = kind(.true.)
  11064. print *, "The default character kind is ", kc
  11065. print *, "The default logical kind is ", kl
  11066. end program test_kind
  11067. 
  11068. File: gfortran.info, Node: LBOUND, Next: LCOBOUND, Prev: KIND, Up: Intrinsic Procedures
  11069. 9.163 'LBOUND' -- Lower dimension bounds of an array
  11070. ====================================================
  11071. _Description_:
  11072. Returns the lower bounds of an array, or a single lower bound along
  11073. the DIM dimension.
  11074. _Standard_:
  11075. Fortran 95 and later, with KIND argument Fortran 2003 and later
  11076. _Class_:
  11077. Inquiry function
  11078. _Syntax_:
  11079. 'RESULT = LBOUND(ARRAY [, DIM [, KIND]])'
  11080. _Arguments_:
  11081. ARRAY Shall be an array, of any type.
  11082. DIM (Optional) Shall be a scalar 'INTEGER'.
  11083. KIND (Optional) An 'INTEGER' initialization
  11084. expression indicating the kind parameter of the
  11085. result.
  11086. _Return value_:
  11087. The return value is of type 'INTEGER' and of kind KIND. If KIND is
  11088. absent, the return value is of default integer kind. If DIM is
  11089. absent, the result is an array of the lower bounds of ARRAY. If
  11090. DIM is present, the result is a scalar corresponding to the lower
  11091. bound of the array along that dimension. If ARRAY is an expression
  11092. rather than a whole array or array structure component, or if it
  11093. has a zero extent along the relevant dimension, the lower bound is
  11094. taken to be 1.
  11095. _See also_:
  11096. *note UBOUND::, *note LCOBOUND::
  11097. 
  11098. File: gfortran.info, Node: LCOBOUND, Next: LEADZ, Prev: LBOUND, Up: Intrinsic Procedures
  11099. 9.164 'LCOBOUND' -- Lower codimension bounds of an array
  11100. ========================================================
  11101. _Description_:
  11102. Returns the lower bounds of a coarray, or a single lower cobound
  11103. along the DIM codimension.
  11104. _Standard_:
  11105. Fortran 2008 and later
  11106. _Class_:
  11107. Inquiry function
  11108. _Syntax_:
  11109. 'RESULT = LCOBOUND(COARRAY [, DIM [, KIND]])'
  11110. _Arguments_:
  11111. ARRAY Shall be an coarray, of any type.
  11112. DIM (Optional) Shall be a scalar 'INTEGER'.
  11113. KIND (Optional) An 'INTEGER' initialization
  11114. expression indicating the kind parameter of the
  11115. result.
  11116. _Return value_:
  11117. The return value is of type 'INTEGER' and of kind KIND. If KIND is
  11118. absent, the return value is of default integer kind. If DIM is
  11119. absent, the result is an array of the lower cobounds of COARRAY.
  11120. If DIM is present, the result is a scalar corresponding to the
  11121. lower cobound of the array along that codimension.
  11122. _See also_:
  11123. *note UCOBOUND::, *note LBOUND::
  11124. 
  11125. File: gfortran.info, Node: LEADZ, Next: LEN, Prev: LCOBOUND, Up: Intrinsic Procedures
  11126. 9.165 'LEADZ' -- Number of leading zero bits of an integer
  11127. ==========================================================
  11128. _Description_:
  11129. 'LEADZ' returns the number of leading zero bits of an integer.
  11130. _Standard_:
  11131. Fortran 2008 and later
  11132. _Class_:
  11133. Elemental function
  11134. _Syntax_:
  11135. 'RESULT = LEADZ(I)'
  11136. _Arguments_:
  11137. I Shall be of type 'INTEGER'.
  11138. _Return value_:
  11139. The type of the return value is the default 'INTEGER'. If all the
  11140. bits of 'I' are zero, the result value is 'BIT_SIZE(I)'.
  11141. _Example_:
  11142. PROGRAM test_leadz
  11143. WRITE (*,*) BIT_SIZE(1) ! prints 32
  11144. WRITE (*,*) LEADZ(1) ! prints 31
  11145. END PROGRAM
  11146. _See also_:
  11147. *note BIT_SIZE::, *note TRAILZ::, *note POPCNT::, *note POPPAR::
  11148. 
  11149. File: gfortran.info, Node: LEN, Next: LEN_TRIM, Prev: LEADZ, Up: Intrinsic Procedures
  11150. 9.166 'LEN' -- Length of a character entity
  11151. ===========================================
  11152. _Description_:
  11153. Returns the length of a character string. If STRING is an array,
  11154. the length of an element of STRING is returned. Note that STRING
  11155. need not be defined when this intrinsic is invoked, since only the
  11156. length, not the content, of STRING is needed.
  11157. _Standard_:
  11158. Fortran 77 and later, with KIND argument Fortran 2003 and later
  11159. _Class_:
  11160. Inquiry function
  11161. _Syntax_:
  11162. 'L = LEN(STRING [, KIND])'
  11163. _Arguments_:
  11164. STRING Shall be a scalar or array of type 'CHARACTER',
  11165. with 'INTENT(IN)'
  11166. KIND (Optional) An 'INTEGER' initialization
  11167. expression indicating the kind parameter of the
  11168. result.
  11169. _Return value_:
  11170. The return value is of type 'INTEGER' and of kind KIND. If KIND is
  11171. absent, the return value is of default integer kind.
  11172. _Specific names_:
  11173. Name Argument Return type Standard
  11174. 'LEN(STRING)' 'CHARACTER' 'INTEGER' Fortran 77 and
  11175. later
  11176. _See also_:
  11177. *note LEN_TRIM::, *note ADJUSTL::, *note ADJUSTR::
  11178. 
  11179. File: gfortran.info, Node: LEN_TRIM, Next: LGE, Prev: LEN, Up: Intrinsic Procedures
  11180. 9.167 'LEN_TRIM' -- Length of a character entity without trailing blank characters
  11181. ==================================================================================
  11182. _Description_:
  11183. Returns the length of a character string, ignoring any trailing
  11184. blanks.
  11185. _Standard_:
  11186. Fortran 95 and later, with KIND argument Fortran 2003 and later
  11187. _Class_:
  11188. Elemental function
  11189. _Syntax_:
  11190. 'RESULT = LEN_TRIM(STRING [, KIND])'
  11191. _Arguments_:
  11192. STRING Shall be a scalar of type 'CHARACTER', with
  11193. 'INTENT(IN)'
  11194. KIND (Optional) An 'INTEGER' initialization
  11195. expression indicating the kind parameter of the
  11196. result.
  11197. _Return value_:
  11198. The return value is of type 'INTEGER' and of kind KIND. If KIND is
  11199. absent, the return value is of default integer kind.
  11200. _See also_:
  11201. *note LEN::, *note ADJUSTL::, *note ADJUSTR::
  11202. 
  11203. File: gfortran.info, Node: LGE, Next: LGT, Prev: LEN_TRIM, Up: Intrinsic Procedures
  11204. 9.168 'LGE' -- Lexical greater than or equal
  11205. ============================================
  11206. _Description_:
  11207. Determines whether one string is lexically greater than or equal to
  11208. another string, where the two strings are interpreted as containing
  11209. ASCII character codes. If the String A and String B are not the
  11210. same length, the shorter is compared as if spaces were appended to
  11211. it to form a value that has the same length as the longer.
  11212. In general, the lexical comparison intrinsics 'LGE', 'LGT', 'LLE',
  11213. and 'LLT' differ from the corresponding intrinsic operators '.GE.',
  11214. '.GT.', '.LE.', and '.LT.', in that the latter use the processor's
  11215. character ordering (which is not ASCII on some targets), whereas
  11216. the former always use the ASCII ordering.
  11217. _Standard_:
  11218. Fortran 77 and later
  11219. _Class_:
  11220. Elemental function
  11221. _Syntax_:
  11222. 'RESULT = LGE(STRING_A, STRING_B)'
  11223. _Arguments_:
  11224. STRING_A Shall be of default 'CHARACTER' type.
  11225. STRING_B Shall be of default 'CHARACTER' type.
  11226. _Return value_:
  11227. Returns '.TRUE.' if 'STRING_A >= STRING_B', and '.FALSE.'
  11228. otherwise, based on the ASCII ordering.
  11229. _Specific names_:
  11230. Name Argument Return type Standard
  11231. 'LGE(STRING_A, 'CHARACTER' 'LOGICAL' Fortran 77 and
  11232. STRING_B)' later
  11233. _See also_:
  11234. *note LGT::, *note LLE::, *note LLT::
  11235. 
  11236. File: gfortran.info, Node: LGT, Next: LINK, Prev: LGE, Up: Intrinsic Procedures
  11237. 9.169 'LGT' -- Lexical greater than
  11238. ===================================
  11239. _Description_:
  11240. Determines whether one string is lexically greater than another
  11241. string, where the two strings are interpreted as containing ASCII
  11242. character codes. If the String A and String B are not the same
  11243. length, the shorter is compared as if spaces were appended to it to
  11244. form a value that has the same length as the longer.
  11245. In general, the lexical comparison intrinsics 'LGE', 'LGT', 'LLE',
  11246. and 'LLT' differ from the corresponding intrinsic operators '.GE.',
  11247. '.GT.', '.LE.', and '.LT.', in that the latter use the processor's
  11248. character ordering (which is not ASCII on some targets), whereas
  11249. the former always use the ASCII ordering.
  11250. _Standard_:
  11251. Fortran 77 and later
  11252. _Class_:
  11253. Elemental function
  11254. _Syntax_:
  11255. 'RESULT = LGT(STRING_A, STRING_B)'
  11256. _Arguments_:
  11257. STRING_A Shall be of default 'CHARACTER' type.
  11258. STRING_B Shall be of default 'CHARACTER' type.
  11259. _Return value_:
  11260. Returns '.TRUE.' if 'STRING_A > STRING_B', and '.FALSE.' otherwise,
  11261. based on the ASCII ordering.
  11262. _Specific names_:
  11263. Name Argument Return type Standard
  11264. 'LGT(STRING_A, 'CHARACTER' 'LOGICAL' Fortran 77 and
  11265. STRING_B)' later
  11266. _See also_:
  11267. *note LGE::, *note LLE::, *note LLT::
  11268. 
  11269. File: gfortran.info, Node: LINK, Next: LLE, Prev: LGT, Up: Intrinsic Procedures
  11270. 9.170 'LINK' -- Create a hard link
  11271. ==================================
  11272. _Description_:
  11273. Makes a (hard) link from file PATH1 to PATH2. A null character
  11274. ('CHAR(0)') can be used to mark the end of the names in PATH1 and
  11275. PATH2; otherwise, trailing blanks in the file names are ignored.
  11276. If the STATUS argument is supplied, it contains 0 on success or a
  11277. nonzero error code upon return; see 'link(2)'.
  11278. This intrinsic is provided in both subroutine and function forms;
  11279. however, only one form can be used in any given program unit.
  11280. _Standard_:
  11281. GNU extension
  11282. _Class_:
  11283. Subroutine, function
  11284. _Syntax_:
  11285. 'CALL LINK(PATH1, PATH2 [, STATUS])'
  11286. 'STATUS = LINK(PATH1, PATH2)'
  11287. _Arguments_:
  11288. PATH1 Shall be of default 'CHARACTER' type.
  11289. PATH2 Shall be of default 'CHARACTER' type.
  11290. STATUS (Optional) Shall be of default 'INTEGER' type.
  11291. _See also_:
  11292. *note SYMLNK::, *note UNLINK::
  11293. 
  11294. File: gfortran.info, Node: LLE, Next: LLT, Prev: LINK, Up: Intrinsic Procedures
  11295. 9.171 'LLE' -- Lexical less than or equal
  11296. =========================================
  11297. _Description_:
  11298. Determines whether one string is lexically less than or equal to
  11299. another string, where the two strings are interpreted as containing
  11300. ASCII character codes. If the String A and String B are not the
  11301. same length, the shorter is compared as if spaces were appended to
  11302. it to form a value that has the same length as the longer.
  11303. In general, the lexical comparison intrinsics 'LGE', 'LGT', 'LLE',
  11304. and 'LLT' differ from the corresponding intrinsic operators '.GE.',
  11305. '.GT.', '.LE.', and '.LT.', in that the latter use the processor's
  11306. character ordering (which is not ASCII on some targets), whereas
  11307. the former always use the ASCII ordering.
  11308. _Standard_:
  11309. Fortran 77 and later
  11310. _Class_:
  11311. Elemental function
  11312. _Syntax_:
  11313. 'RESULT = LLE(STRING_A, STRING_B)'
  11314. _Arguments_:
  11315. STRING_A Shall be of default 'CHARACTER' type.
  11316. STRING_B Shall be of default 'CHARACTER' type.
  11317. _Return value_:
  11318. Returns '.TRUE.' if 'STRING_A <= STRING_B', and '.FALSE.'
  11319. otherwise, based on the ASCII ordering.
  11320. _Specific names_:
  11321. Name Argument Return type Standard
  11322. 'LLE(STRING_A, 'CHARACTER' 'LOGICAL' Fortran 77 and
  11323. STRING_B)' later
  11324. _See also_:
  11325. *note LGE::, *note LGT::, *note LLT::
  11326. 
  11327. File: gfortran.info, Node: LLT, Next: LNBLNK, Prev: LLE, Up: Intrinsic Procedures
  11328. 9.172 'LLT' -- Lexical less than
  11329. ================================
  11330. _Description_:
  11331. Determines whether one string is lexically less than another
  11332. string, where the two strings are interpreted as containing ASCII
  11333. character codes. If the String A and String B are not the same
  11334. length, the shorter is compared as if spaces were appended to it to
  11335. form a value that has the same length as the longer.
  11336. In general, the lexical comparison intrinsics 'LGE', 'LGT', 'LLE',
  11337. and 'LLT' differ from the corresponding intrinsic operators '.GE.',
  11338. '.GT.', '.LE.', and '.LT.', in that the latter use the processor's
  11339. character ordering (which is not ASCII on some targets), whereas
  11340. the former always use the ASCII ordering.
  11341. _Standard_:
  11342. Fortran 77 and later
  11343. _Class_:
  11344. Elemental function
  11345. _Syntax_:
  11346. 'RESULT = LLT(STRING_A, STRING_B)'
  11347. _Arguments_:
  11348. STRING_A Shall be of default 'CHARACTER' type.
  11349. STRING_B Shall be of default 'CHARACTER' type.
  11350. _Return value_:
  11351. Returns '.TRUE.' if 'STRING_A < STRING_B', and '.FALSE.' otherwise,
  11352. based on the ASCII ordering.
  11353. _Specific names_:
  11354. Name Argument Return type Standard
  11355. 'LLT(STRING_A, 'CHARACTER' 'LOGICAL' Fortran 77 and
  11356. STRING_B)' later
  11357. _See also_:
  11358. *note LGE::, *note LGT::, *note LLE::
  11359. 
  11360. File: gfortran.info, Node: LNBLNK, Next: LOC, Prev: LLT, Up: Intrinsic Procedures
  11361. 9.173 'LNBLNK' -- Index of the last non-blank character in a string
  11362. ===================================================================
  11363. _Description_:
  11364. Returns the length of a character string, ignoring any trailing
  11365. blanks. This is identical to the standard 'LEN_TRIM' intrinsic,
  11366. and is only included for backwards compatibility.
  11367. _Standard_:
  11368. GNU extension
  11369. _Class_:
  11370. Elemental function
  11371. _Syntax_:
  11372. 'RESULT = LNBLNK(STRING)'
  11373. _Arguments_:
  11374. STRING Shall be a scalar of type 'CHARACTER', with
  11375. 'INTENT(IN)'
  11376. _Return value_:
  11377. The return value is of 'INTEGER(kind=4)' type.
  11378. _See also_:
  11379. *note INDEX intrinsic::, *note LEN_TRIM::
  11380. 
  11381. File: gfortran.info, Node: LOC, Next: LOG, Prev: LNBLNK, Up: Intrinsic Procedures
  11382. 9.174 'LOC' -- Returns the address of a variable
  11383. ================================================
  11384. _Description_:
  11385. 'LOC(X)' returns the address of X as an integer.
  11386. _Standard_:
  11387. GNU extension
  11388. _Class_:
  11389. Inquiry function
  11390. _Syntax_:
  11391. 'RESULT = LOC(X)'
  11392. _Arguments_:
  11393. X Variable of any type.
  11394. _Return value_:
  11395. The return value is of type 'INTEGER', with a 'KIND' corresponding
  11396. to the size (in bytes) of a memory address on the target machine.
  11397. _Example_:
  11398. program test_loc
  11399. integer :: i
  11400. real :: r
  11401. i = loc(r)
  11402. print *, i
  11403. end program test_loc
  11404. 
  11405. File: gfortran.info, Node: LOG, Next: LOG10, Prev: LOC, Up: Intrinsic Procedures
  11406. 9.175 'LOG' -- Natural logarithm function
  11407. =========================================
  11408. _Description_:
  11409. 'LOG(X)' computes the natural logarithm of X, i.e. the logarithm
  11410. to the base e.
  11411. _Standard_:
  11412. Fortran 77 and later
  11413. _Class_:
  11414. Elemental function
  11415. _Syntax_:
  11416. 'RESULT = LOG(X)'
  11417. _Arguments_:
  11418. X The type shall be 'REAL' or 'COMPLEX'.
  11419. _Return value_:
  11420. The return value is of type 'REAL' or 'COMPLEX'. The kind type
  11421. parameter is the same as X. If X is 'COMPLEX', the imaginary part
  11422. \omega is in the range -\pi < \omega \leq \pi.
  11423. _Example_:
  11424. program test_log
  11425. real(8) :: x = 2.7182818284590451_8
  11426. complex :: z = (1.0, 2.0)
  11427. x = log(x) ! will yield (approximately) 1
  11428. z = log(z)
  11429. end program test_log
  11430. _Specific names_:
  11431. Name Argument Return type Standard
  11432. 'ALOG(X)' 'REAL(4) X' 'REAL(4)' f95, gnu
  11433. 'DLOG(X)' 'REAL(8) X' 'REAL(8)' f95, gnu
  11434. 'CLOG(X)' 'COMPLEX(4) 'COMPLEX(4)' f95, gnu
  11435. X'
  11436. 'ZLOG(X)' 'COMPLEX(8) 'COMPLEX(8)' f95, gnu
  11437. X'
  11438. 'CDLOG(X)' 'COMPLEX(8) 'COMPLEX(8)' f95, gnu
  11439. X'
  11440. 
  11441. File: gfortran.info, Node: LOG10, Next: LOG_GAMMA, Prev: LOG, Up: Intrinsic Procedures
  11442. 9.176 'LOG10' -- Base 10 logarithm function
  11443. ===========================================
  11444. _Description_:
  11445. 'LOG10(X)' computes the base 10 logarithm of X.
  11446. _Standard_:
  11447. Fortran 77 and later
  11448. _Class_:
  11449. Elemental function
  11450. _Syntax_:
  11451. 'RESULT = LOG10(X)'
  11452. _Arguments_:
  11453. X The type shall be 'REAL'.
  11454. _Return value_:
  11455. The return value is of type 'REAL' or 'COMPLEX'. The kind type
  11456. parameter is the same as X.
  11457. _Example_:
  11458. program test_log10
  11459. real(8) :: x = 10.0_8
  11460. x = log10(x)
  11461. end program test_log10
  11462. _Specific names_:
  11463. Name Argument Return type Standard
  11464. 'ALOG10(X)' 'REAL(4) X' 'REAL(4)' Fortran 95 and
  11465. later
  11466. 'DLOG10(X)' 'REAL(8) X' 'REAL(8)' Fortran 95 and
  11467. later
  11468. 
  11469. File: gfortran.info, Node: LOG_GAMMA, Next: LOGICAL, Prev: LOG10, Up: Intrinsic Procedures
  11470. 9.177 'LOG_GAMMA' -- Logarithm of the Gamma function
  11471. ====================================================
  11472. _Description_:
  11473. 'LOG_GAMMA(X)' computes the natural logarithm of the absolute value
  11474. of the Gamma (\Gamma) function.
  11475. _Standard_:
  11476. Fortran 2008 and later
  11477. _Class_:
  11478. Elemental function
  11479. _Syntax_:
  11480. 'X = LOG_GAMMA(X)'
  11481. _Arguments_:
  11482. X Shall be of type 'REAL' and neither zero nor a
  11483. negative integer.
  11484. _Return value_:
  11485. The return value is of type 'REAL' of the same kind as X.
  11486. _Example_:
  11487. program test_log_gamma
  11488. real :: x = 1.0
  11489. x = lgamma(x) ! returns 0.0
  11490. end program test_log_gamma
  11491. _Specific names_:
  11492. Name Argument Return type Standard
  11493. 'LGAMMA(X)' 'REAL(4) X' 'REAL(4)' GNU Extension
  11494. 'ALGAMA(X)' 'REAL(4) X' 'REAL(4)' GNU Extension
  11495. 'DLGAMA(X)' 'REAL(8) X' 'REAL(8)' GNU Extension
  11496. _See also_:
  11497. Gamma function: *note GAMMA::
  11498. 
  11499. File: gfortran.info, Node: LOGICAL, Next: LONG, Prev: LOG_GAMMA, Up: Intrinsic Procedures
  11500. 9.178 'LOGICAL' -- Convert to logical type
  11501. ==========================================
  11502. _Description_:
  11503. Converts one kind of 'LOGICAL' variable to another.
  11504. _Standard_:
  11505. Fortran 95 and later
  11506. _Class_:
  11507. Elemental function
  11508. _Syntax_:
  11509. 'RESULT = LOGICAL(L [, KIND])'
  11510. _Arguments_:
  11511. L The type shall be 'LOGICAL'.
  11512. KIND (Optional) An 'INTEGER' initialization
  11513. expression indicating the kind parameter of the
  11514. result.
  11515. _Return value_:
  11516. The return value is a 'LOGICAL' value equal to L, with a kind
  11517. corresponding to KIND, or of the default logical kind if KIND is
  11518. not given.
  11519. _See also_:
  11520. *note INT::, *note REAL::, *note CMPLX::
  11521. 
  11522. File: gfortran.info, Node: LONG, Next: LSHIFT, Prev: LOGICAL, Up: Intrinsic Procedures
  11523. 9.179 'LONG' -- Convert to integer type
  11524. =======================================
  11525. _Description_:
  11526. Convert to a 'KIND=4' integer type, which is the same size as a C
  11527. 'long' integer. This is equivalent to the standard 'INT' intrinsic
  11528. with an optional argument of 'KIND=4', and is only included for
  11529. backwards compatibility.
  11530. _Standard_:
  11531. GNU extension
  11532. _Class_:
  11533. Elemental function
  11534. _Syntax_:
  11535. 'RESULT = LONG(A)'
  11536. _Arguments_:
  11537. A Shall be of type 'INTEGER', 'REAL', or
  11538. 'COMPLEX'.
  11539. _Return value_:
  11540. The return value is a 'INTEGER(4)' variable.
  11541. _See also_:
  11542. *note INT::, *note INT2::, *note INT8::
  11543. 
  11544. File: gfortran.info, Node: LSHIFT, Next: LSTAT, Prev: LONG, Up: Intrinsic Procedures
  11545. 9.180 'LSHIFT' -- Left shift bits
  11546. =================================
  11547. _Description_:
  11548. 'LSHIFT' returns a value corresponding to I with all of the bits
  11549. shifted left by SHIFT places. If the absolute value of SHIFT is
  11550. greater than 'BIT_SIZE(I)', the value is undefined. Bits shifted
  11551. out from the left end are lost; zeros are shifted in from the
  11552. opposite end.
  11553. This function has been superseded by the 'ISHFT' intrinsic, which
  11554. is standard in Fortran 95 and later, and the 'SHIFTL' intrinsic,
  11555. which is standard in Fortran 2008 and later.
  11556. _Standard_:
  11557. GNU extension
  11558. _Class_:
  11559. Elemental function
  11560. _Syntax_:
  11561. 'RESULT = LSHIFT(I, SHIFT)'
  11562. _Arguments_:
  11563. I The type shall be 'INTEGER'.
  11564. SHIFT The type shall be 'INTEGER'.
  11565. _Return value_:
  11566. The return value is of type 'INTEGER' and of the same kind as I.
  11567. _See also_:
  11568. *note ISHFT::, *note ISHFTC::, *note RSHIFT::, *note SHIFTA::,
  11569. *note SHIFTL::, *note SHIFTR::
  11570. 
  11571. File: gfortran.info, Node: LSTAT, Next: LTIME, Prev: LSHIFT, Up: Intrinsic Procedures
  11572. 9.181 'LSTAT' -- Get file status
  11573. ================================
  11574. _Description_:
  11575. 'LSTAT' is identical to *note STAT::, except that if path is a
  11576. symbolic link, then the link itself is statted, not the file that
  11577. it refers to.
  11578. The elements in 'VALUES' are the same as described by *note STAT::.
  11579. This intrinsic is provided in both subroutine and function forms;
  11580. however, only one form can be used in any given program unit.
  11581. _Standard_:
  11582. GNU extension
  11583. _Class_:
  11584. Subroutine, function
  11585. _Syntax_:
  11586. 'CALL LSTAT(NAME, VALUES [, STATUS])'
  11587. 'STATUS = LSTAT(NAME, VALUES)'
  11588. _Arguments_:
  11589. NAME The type shall be 'CHARACTER' of the default
  11590. kind, a valid path within the file system.
  11591. VALUES The type shall be 'INTEGER(4), DIMENSION(13)'.
  11592. STATUS (Optional) status flag of type 'INTEGER(4)'.
  11593. Returns 0 on success and a system specific error
  11594. code otherwise.
  11595. _Example_:
  11596. See *note STAT:: for an example.
  11597. _See also_:
  11598. To stat an open file: *note FSTAT::, to stat a file: *note STAT::
  11599. 
  11600. File: gfortran.info, Node: LTIME, Next: MALLOC, Prev: LSTAT, Up: Intrinsic Procedures
  11601. 9.182 'LTIME' -- Convert time to local time info
  11602. ================================================
  11603. _Description_:
  11604. Given a system time value TIME (as provided by the *note TIME::
  11605. intrinsic), fills VALUES with values extracted from it appropriate
  11606. to the local time zone using 'localtime(3)'.
  11607. This intrinsic routine is provided for backwards compatibility with
  11608. GNU Fortran 77. In new code, programmers should consider the use
  11609. of the *note DATE_AND_TIME:: intrinsic defined by the Fortran 95
  11610. standard.
  11611. _Standard_:
  11612. GNU extension
  11613. _Class_:
  11614. Subroutine
  11615. _Syntax_:
  11616. 'CALL LTIME(TIME, VALUES)'
  11617. _Arguments_:
  11618. TIME An 'INTEGER' scalar expression corresponding to
  11619. a system time, with 'INTENT(IN)'.
  11620. VALUES A default 'INTEGER' array with 9 elements, with
  11621. 'INTENT(OUT)'.
  11622. _Return value_:
  11623. The elements of VALUES are assigned as follows:
  11624. 1. Seconds after the minute, range 0-59 or 0-61 to allow for leap
  11625. seconds
  11626. 2. Minutes after the hour, range 0-59
  11627. 3. Hours past midnight, range 0-23
  11628. 4. Day of month, range 1-31
  11629. 5. Number of months since January, range 0-11
  11630. 6. Years since 1900
  11631. 7. Number of days since Sunday, range 0-6
  11632. 8. Days since January 1, range 0-365
  11633. 9. Daylight savings indicator: positive if daylight savings is in
  11634. effect, zero if not, and negative if the information is not
  11635. available.
  11636. _See also_:
  11637. *note DATE_AND_TIME::, *note CTIME::, *note GMTIME::, *note TIME::,
  11638. *note TIME8::
  11639. 
  11640. File: gfortran.info, Node: MALLOC, Next: MASKL, Prev: LTIME, Up: Intrinsic Procedures
  11641. 9.183 'MALLOC' -- Allocate dynamic memory
  11642. =========================================
  11643. _Description_:
  11644. 'MALLOC(SIZE)' allocates SIZE bytes of dynamic memory and returns
  11645. the address of the allocated memory. The 'MALLOC' intrinsic is an
  11646. extension intended to be used with Cray pointers, and is provided
  11647. in GNU Fortran to allow the user to compile legacy code. For new
  11648. code using Fortran 95 pointers, the memory allocation intrinsic is
  11649. 'ALLOCATE'.
  11650. _Standard_:
  11651. GNU extension
  11652. _Class_:
  11653. Function
  11654. _Syntax_:
  11655. 'PTR = MALLOC(SIZE)'
  11656. _Arguments_:
  11657. SIZE The type shall be 'INTEGER'.
  11658. _Return value_:
  11659. The return value is of type 'INTEGER(K)', with K such that
  11660. variables of type 'INTEGER(K)' have the same size as C pointers
  11661. ('sizeof(void *)').
  11662. _Example_:
  11663. The following example demonstrates the use of 'MALLOC' and 'FREE'
  11664. with Cray pointers.
  11665. program test_malloc
  11666. implicit none
  11667. integer i
  11668. real*8 x(*), z
  11669. pointer(ptr_x,x)
  11670. ptr_x = malloc(20*8)
  11671. do i = 1, 20
  11672. x(i) = sqrt(1.0d0 / i)
  11673. end do
  11674. z = 0
  11675. do i = 1, 20
  11676. z = z + x(i)
  11677. print *, z
  11678. end do
  11679. call free(ptr_x)
  11680. end program test_malloc
  11681. _See also_:
  11682. *note FREE::
  11683. 
  11684. File: gfortran.info, Node: MASKL, Next: MASKR, Prev: MALLOC, Up: Intrinsic Procedures
  11685. 9.184 'MASKL' -- Left justified mask
  11686. ====================================
  11687. _Description_:
  11688. 'MASKL(I[, KIND])' has its leftmost I bits set to 1, and the
  11689. remaining bits set to 0.
  11690. _Standard_:
  11691. Fortran 2008 and later
  11692. _Class_:
  11693. Elemental function
  11694. _Syntax_:
  11695. 'RESULT = MASKL(I[, KIND])'
  11696. _Arguments_:
  11697. I Shall be of type 'INTEGER'.
  11698. KIND Shall be a scalar constant expression of type
  11699. 'INTEGER'.
  11700. _Return value_:
  11701. The return value is of type 'INTEGER'. If KIND is present, it
  11702. specifies the kind value of the return type; otherwise, it is of
  11703. the default integer kind.
  11704. _See also_:
  11705. *note MASKR::
  11706. 
  11707. File: gfortran.info, Node: MASKR, Next: MATMUL, Prev: MASKL, Up: Intrinsic Procedures
  11708. 9.185 'MASKR' -- Right justified mask
  11709. =====================================
  11710. _Description_:
  11711. 'MASKL(I[, KIND])' has its rightmost I bits set to 1, and the
  11712. remaining bits set to 0.
  11713. _Standard_:
  11714. Fortran 2008 and later
  11715. _Class_:
  11716. Elemental function
  11717. _Syntax_:
  11718. 'RESULT = MASKR(I[, KIND])'
  11719. _Arguments_:
  11720. I Shall be of type 'INTEGER'.
  11721. KIND Shall be a scalar constant expression of type
  11722. 'INTEGER'.
  11723. _Return value_:
  11724. The return value is of type 'INTEGER'. If KIND is present, it
  11725. specifies the kind value of the return type; otherwise, it is of
  11726. the default integer kind.
  11727. _See also_:
  11728. *note MASKL::
  11729. 
  11730. File: gfortran.info, Node: MATMUL, Next: MAX, Prev: MASKR, Up: Intrinsic Procedures
  11731. 9.186 'MATMUL' -- matrix multiplication
  11732. =======================================
  11733. _Description_:
  11734. Performs a matrix multiplication on numeric or logical arguments.
  11735. _Standard_:
  11736. Fortran 95 and later
  11737. _Class_:
  11738. Transformational function
  11739. _Syntax_:
  11740. 'RESULT = MATMUL(MATRIX_A, MATRIX_B)'
  11741. _Arguments_:
  11742. MATRIX_A An array of 'INTEGER', 'REAL', 'COMPLEX', or
  11743. 'LOGICAL' type, with a rank of one or two.
  11744. MATRIX_B An array of 'INTEGER', 'REAL', or 'COMPLEX' type
  11745. if MATRIX_A is of a numeric type; otherwise, an
  11746. array of 'LOGICAL' type. The rank shall be one
  11747. or two, and the first (or only) dimension of
  11748. MATRIX_B shall be equal to the last (or only)
  11749. dimension of MATRIX_A.
  11750. _Return value_:
  11751. The matrix product of MATRIX_A and MATRIX_B. The type and kind of
  11752. the result follow the usual type and kind promotion rules, as for
  11753. the '*' or '.AND.' operators.
  11754. _See also_:
  11755. 
  11756. File: gfortran.info, Node: MAX, Next: MAXEXPONENT, Prev: MATMUL, Up: Intrinsic Procedures
  11757. 9.187 'MAX' -- Maximum value of an argument list
  11758. ================================================
  11759. _Description_:
  11760. Returns the argument with the largest (most positive) value.
  11761. _Standard_:
  11762. Fortran 77 and later
  11763. _Class_:
  11764. Elemental function
  11765. _Syntax_:
  11766. 'RESULT = MAX(A1, A2 [, A3 [, ...]])'
  11767. _Arguments_:
  11768. A1 The type shall be 'INTEGER' or 'REAL'.
  11769. A2, A3, An expression of the same type and kind as A1.
  11770. ... (As a GNU extension, arguments of different
  11771. kinds are permitted.)
  11772. _Return value_:
  11773. The return value corresponds to the maximum value among the
  11774. arguments, and has the same type and kind as the first argument.
  11775. _Specific names_:
  11776. Name Argument Return type Standard
  11777. 'MAX0(A1)' 'INTEGER(4) 'INTEGER(4)' Fortran 77 and
  11778. A1' later
  11779. 'AMAX0(A1)' 'INTEGER(4) 'REAL(MAX(X))' Fortran 77 and
  11780. A1' later
  11781. 'MAX1(A1)' 'REAL A1' 'INT(MAX(X))' Fortran 77 and
  11782. later
  11783. 'AMAX1(A1)' 'REAL(4) A1' 'REAL(4)' Fortran 77 and
  11784. later
  11785. 'DMAX1(A1)' 'REAL(8) A1' 'REAL(8)' Fortran 77 and
  11786. later
  11787. _See also_:
  11788. *note MAXLOC:: *note MAXVAL::, *note MIN::
  11789. 
  11790. File: gfortran.info, Node: MAXEXPONENT, Next: MAXLOC, Prev: MAX, Up: Intrinsic Procedures
  11791. 9.188 'MAXEXPONENT' -- Maximum exponent of a real kind
  11792. ======================================================
  11793. _Description_:
  11794. 'MAXEXPONENT(X)' returns the maximum exponent in the model of the
  11795. type of 'X'.
  11796. _Standard_:
  11797. Fortran 95 and later
  11798. _Class_:
  11799. Inquiry function
  11800. _Syntax_:
  11801. 'RESULT = MAXEXPONENT(X)'
  11802. _Arguments_:
  11803. X Shall be of type 'REAL'.
  11804. _Return value_:
  11805. The return value is of type 'INTEGER' and of the default integer
  11806. kind.
  11807. _Example_:
  11808. program exponents
  11809. real(kind=4) :: x
  11810. real(kind=8) :: y
  11811. print *, minexponent(x), maxexponent(x)
  11812. print *, minexponent(y), maxexponent(y)
  11813. end program exponents
  11814. 
  11815. File: gfortran.info, Node: MAXLOC, Next: MAXVAL, Prev: MAXEXPONENT, Up: Intrinsic Procedures
  11816. 9.189 'MAXLOC' -- Location of the maximum value within an array
  11817. ===============================================================
  11818. _Description_:
  11819. Determines the location of the element in the array with the
  11820. maximum value, or, if the DIM argument is supplied, determines the
  11821. locations of the maximum element along each row of the array in the
  11822. DIM direction. If MASK is present, only the elements for which
  11823. MASK is '.TRUE.' are considered. If more than one element in the
  11824. array has the maximum value, the location returned is that of the
  11825. first such element in array element order. If the array has zero
  11826. size, or all of the elements of MASK are '.FALSE.', then the result
  11827. is an array of zeroes. Similarly, if DIM is supplied and all of
  11828. the elements of MASK along a given row are zero, the result value
  11829. for that row is zero.
  11830. _Standard_:
  11831. Fortran 95 and later
  11832. _Class_:
  11833. Transformational function
  11834. _Syntax_:
  11835. 'RESULT = MAXLOC(ARRAY, DIM [, MASK])'
  11836. 'RESULT = MAXLOC(ARRAY [, MASK])'
  11837. _Arguments_:
  11838. ARRAY Shall be an array of type 'INTEGER' or 'REAL'.
  11839. DIM (Optional) Shall be a scalar of type 'INTEGER',
  11840. with a value between one and the rank of ARRAY,
  11841. inclusive. It may not be an optional dummy
  11842. argument.
  11843. MASK Shall be an array of type 'LOGICAL', and
  11844. conformable with ARRAY.
  11845. _Return value_:
  11846. If DIM is absent, the result is a rank-one array with a length
  11847. equal to the rank of ARRAY. If DIM is present, the result is an
  11848. array with a rank one less than the rank of ARRAY, and a size
  11849. corresponding to the size of ARRAY with the DIM dimension removed.
  11850. If DIM is present and ARRAY has a rank of one, the result is a
  11851. scalar. In all cases, the result is of default 'INTEGER' type.
  11852. _See also_:
  11853. *note MAX::, *note MAXVAL::
  11854. 
  11855. File: gfortran.info, Node: MAXVAL, Next: MCLOCK, Prev: MAXLOC, Up: Intrinsic Procedures
  11856. 9.190 'MAXVAL' -- Maximum value of an array
  11857. ===========================================
  11858. _Description_:
  11859. Determines the maximum value of the elements in an array value, or,
  11860. if the DIM argument is supplied, determines the maximum value along
  11861. each row of the array in the DIM direction. If MASK is present,
  11862. only the elements for which MASK is '.TRUE.' are considered. If
  11863. the array has zero size, or all of the elements of MASK are
  11864. '.FALSE.', then the result is '-HUGE(ARRAY)' if ARRAY is numeric,
  11865. or a string of nulls if ARRAY is of character type.
  11866. _Standard_:
  11867. Fortran 95 and later
  11868. _Class_:
  11869. Transformational function
  11870. _Syntax_:
  11871. 'RESULT = MAXVAL(ARRAY, DIM [, MASK])'
  11872. 'RESULT = MAXVAL(ARRAY [, MASK])'
  11873. _Arguments_:
  11874. ARRAY Shall be an array of type 'INTEGER' or 'REAL'.
  11875. DIM (Optional) Shall be a scalar of type 'INTEGER',
  11876. with a value between one and the rank of ARRAY,
  11877. inclusive. It may not be an optional dummy
  11878. argument.
  11879. MASK Shall be an array of type 'LOGICAL', and
  11880. conformable with ARRAY.
  11881. _Return value_:
  11882. If DIM is absent, or if ARRAY has a rank of one, the result is a
  11883. scalar. If DIM is present, the result is an array with a rank one
  11884. less than the rank of ARRAY, and a size corresponding to the size
  11885. of ARRAY with the DIM dimension removed. In all cases, the result
  11886. is of the same type and kind as ARRAY.
  11887. _See also_:
  11888. *note MAX::, *note MAXLOC::
  11889. 
  11890. File: gfortran.info, Node: MCLOCK, Next: MCLOCK8, Prev: MAXVAL, Up: Intrinsic Procedures
  11891. 9.191 'MCLOCK' -- Time function
  11892. ===============================
  11893. _Description_:
  11894. Returns the number of clock ticks since the start of the process,
  11895. based on the function 'clock(3)' in the C standard library.
  11896. This intrinsic is not fully portable, such as to systems with
  11897. 32-bit 'INTEGER' types but supporting times wider than 32 bits.
  11898. Therefore, the values returned by this intrinsic might be, or
  11899. become, negative, or numerically less than previous values, during
  11900. a single run of the compiled program.
  11901. _Standard_:
  11902. GNU extension
  11903. _Class_:
  11904. Function
  11905. _Syntax_:
  11906. 'RESULT = MCLOCK()'
  11907. _Return value_:
  11908. The return value is a scalar of type 'INTEGER(4)', equal to the
  11909. number of clock ticks since the start of the process, or '-1' if
  11910. the system does not support 'clock(3)'.
  11911. _See also_:
  11912. *note CTIME::, *note GMTIME::, *note LTIME::, *note MCLOCK::, *note
  11913. TIME::
  11914. 
  11915. File: gfortran.info, Node: MCLOCK8, Next: MERGE, Prev: MCLOCK, Up: Intrinsic Procedures
  11916. 9.192 'MCLOCK8' -- Time function (64-bit)
  11917. =========================================
  11918. _Description_:
  11919. Returns the number of clock ticks since the start of the process,
  11920. based on the function 'clock(3)' in the C standard library.
  11921. _Warning:_ this intrinsic does not increase the range of the timing
  11922. values over that returned by 'clock(3)'. On a system with a 32-bit
  11923. 'clock(3)', 'MCLOCK8' will return a 32-bit value, even though it is
  11924. converted to a 64-bit 'INTEGER(8)' value. That means overflows of
  11925. the 32-bit value can still occur. Therefore, the values returned
  11926. by this intrinsic might be or become negative or numerically less
  11927. than previous values during a single run of the compiled program.
  11928. _Standard_:
  11929. GNU extension
  11930. _Class_:
  11931. Function
  11932. _Syntax_:
  11933. 'RESULT = MCLOCK8()'
  11934. _Return value_:
  11935. The return value is a scalar of type 'INTEGER(8)', equal to the
  11936. number of clock ticks since the start of the process, or '-1' if
  11937. the system does not support 'clock(3)'.
  11938. _See also_:
  11939. *note CTIME::, *note GMTIME::, *note LTIME::, *note MCLOCK::, *note
  11940. TIME8::
  11941. 
  11942. File: gfortran.info, Node: MERGE, Next: MERGE_BITS, Prev: MCLOCK8, Up: Intrinsic Procedures
  11943. 9.193 'MERGE' -- Merge variables
  11944. ================================
  11945. _Description_:
  11946. Select values from two arrays according to a logical mask. The
  11947. result is equal to TSOURCE if MASK is '.TRUE.', or equal to FSOURCE
  11948. if it is '.FALSE.'.
  11949. _Standard_:
  11950. Fortran 95 and later
  11951. _Class_:
  11952. Elemental function
  11953. _Syntax_:
  11954. 'RESULT = MERGE(TSOURCE, FSOURCE, MASK)'
  11955. _Arguments_:
  11956. TSOURCE May be of any type.
  11957. FSOURCE Shall be of the same type and type parameters as
  11958. TSOURCE.
  11959. MASK Shall be of type 'LOGICAL'.
  11960. _Return value_:
  11961. The result is of the same type and type parameters as TSOURCE.
  11962. 
  11963. File: gfortran.info, Node: MERGE_BITS, Next: MIN, Prev: MERGE, Up: Intrinsic Procedures
  11964. 9.194 'MERGE_BITS' -- Merge of bits under mask
  11965. ==============================================
  11966. _Description_:
  11967. 'MERGE_BITS(I, J, MASK)' merges the bits of I and J as determined
  11968. by the mask. The i-th bit of the result is equal to the i-th bit
  11969. of I if the i-th bit of MASK is 1; it is equal to the i-th bit of J
  11970. otherwise.
  11971. _Standard_:
  11972. Fortran 2008 and later
  11973. _Class_:
  11974. Elemental function
  11975. _Syntax_:
  11976. 'RESULT = MERGE_BITS(I, J, MASK)'
  11977. _Arguments_:
  11978. I Shall be of type 'INTEGER'.
  11979. J Shall be of type 'INTEGER' and of the same kind
  11980. as I.
  11981. MASK Shall be of type 'INTEGER' and of the same kind
  11982. as I.
  11983. _Return value_:
  11984. The result is of the same type and kind as I.
  11985. 
  11986. File: gfortran.info, Node: MIN, Next: MINEXPONENT, Prev: MERGE_BITS, Up: Intrinsic Procedures
  11987. 9.195 'MIN' -- Minimum value of an argument list
  11988. ================================================
  11989. _Description_:
  11990. Returns the argument with the smallest (most negative) value.
  11991. _Standard_:
  11992. Fortran 77 and later
  11993. _Class_:
  11994. Elemental function
  11995. _Syntax_:
  11996. 'RESULT = MIN(A1, A2 [, A3, ...])'
  11997. _Arguments_:
  11998. A1 The type shall be 'INTEGER' or 'REAL'.
  11999. A2, A3, An expression of the same type and kind as A1.
  12000. ... (As a GNU extension, arguments of different
  12001. kinds are permitted.)
  12002. _Return value_:
  12003. The return value corresponds to the maximum value among the
  12004. arguments, and has the same type and kind as the first argument.
  12005. _Specific names_:
  12006. Name Argument Return type Standard
  12007. 'MIN0(A1)' 'INTEGER(4) 'INTEGER(4)' Fortran 77 and
  12008. A1' later
  12009. 'AMIN0(A1)' 'INTEGER(4) 'REAL(4)' Fortran 77 and
  12010. A1' later
  12011. 'MIN1(A1)' 'REAL A1' 'INTEGER(4)' Fortran 77 and
  12012. later
  12013. 'AMIN1(A1)' 'REAL(4) A1' 'REAL(4)' Fortran 77 and
  12014. later
  12015. 'DMIN1(A1)' 'REAL(8) A1' 'REAL(8)' Fortran 77 and
  12016. later
  12017. _See also_:
  12018. *note MAX::, *note MINLOC::, *note MINVAL::
  12019. 
  12020. File: gfortran.info, Node: MINEXPONENT, Next: MINLOC, Prev: MIN, Up: Intrinsic Procedures
  12021. 9.196 'MINEXPONENT' -- Minimum exponent of a real kind
  12022. ======================================================
  12023. _Description_:
  12024. 'MINEXPONENT(X)' returns the minimum exponent in the model of the
  12025. type of 'X'.
  12026. _Standard_:
  12027. Fortran 95 and later
  12028. _Class_:
  12029. Inquiry function
  12030. _Syntax_:
  12031. 'RESULT = MINEXPONENT(X)'
  12032. _Arguments_:
  12033. X Shall be of type 'REAL'.
  12034. _Return value_:
  12035. The return value is of type 'INTEGER' and of the default integer
  12036. kind.
  12037. _Example_:
  12038. See 'MAXEXPONENT' for an example.
  12039. 
  12040. File: gfortran.info, Node: MINLOC, Next: MINVAL, Prev: MINEXPONENT, Up: Intrinsic Procedures
  12041. 9.197 'MINLOC' -- Location of the minimum value within an array
  12042. ===============================================================
  12043. _Description_:
  12044. Determines the location of the element in the array with the
  12045. minimum value, or, if the DIM argument is supplied, determines the
  12046. locations of the minimum element along each row of the array in the
  12047. DIM direction. If MASK is present, only the elements for which
  12048. MASK is '.TRUE.' are considered. If more than one element in the
  12049. array has the minimum value, the location returned is that of the
  12050. first such element in array element order. If the array has zero
  12051. size, or all of the elements of MASK are '.FALSE.', then the result
  12052. is an array of zeroes. Similarly, if DIM is supplied and all of
  12053. the elements of MASK along a given row are zero, the result value
  12054. for that row is zero.
  12055. _Standard_:
  12056. Fortran 95 and later
  12057. _Class_:
  12058. Transformational function
  12059. _Syntax_:
  12060. 'RESULT = MINLOC(ARRAY, DIM [, MASK])'
  12061. 'RESULT = MINLOC(ARRAY [, MASK])'
  12062. _Arguments_:
  12063. ARRAY Shall be an array of type 'INTEGER' or 'REAL'.
  12064. DIM (Optional) Shall be a scalar of type 'INTEGER',
  12065. with a value between one and the rank of ARRAY,
  12066. inclusive. It may not be an optional dummy
  12067. argument.
  12068. MASK Shall be an array of type 'LOGICAL', and
  12069. conformable with ARRAY.
  12070. _Return value_:
  12071. If DIM is absent, the result is a rank-one array with a length
  12072. equal to the rank of ARRAY. If DIM is present, the result is an
  12073. array with a rank one less than the rank of ARRAY, and a size
  12074. corresponding to the size of ARRAY with the DIM dimension removed.
  12075. If DIM is present and ARRAY has a rank of one, the result is a
  12076. scalar. In all cases, the result is of default 'INTEGER' type.
  12077. _See also_:
  12078. *note MIN::, *note MINVAL::
  12079. 
  12080. File: gfortran.info, Node: MINVAL, Next: MOD, Prev: MINLOC, Up: Intrinsic Procedures
  12081. 9.198 'MINVAL' -- Minimum value of an array
  12082. ===========================================
  12083. _Description_:
  12084. Determines the minimum value of the elements in an array value, or,
  12085. if the DIM argument is supplied, determines the minimum value along
  12086. each row of the array in the DIM direction. If MASK is present,
  12087. only the elements for which MASK is '.TRUE.' are considered. If
  12088. the array has zero size, or all of the elements of MASK are
  12089. '.FALSE.', then the result is 'HUGE(ARRAY)' if ARRAY is numeric, or
  12090. a string of 'CHAR(255)' characters if ARRAY is of character type.
  12091. _Standard_:
  12092. Fortran 95 and later
  12093. _Class_:
  12094. Transformational function
  12095. _Syntax_:
  12096. 'RESULT = MINVAL(ARRAY, DIM [, MASK])'
  12097. 'RESULT = MINVAL(ARRAY [, MASK])'
  12098. _Arguments_:
  12099. ARRAY Shall be an array of type 'INTEGER' or 'REAL'.
  12100. DIM (Optional) Shall be a scalar of type 'INTEGER',
  12101. with a value between one and the rank of ARRAY,
  12102. inclusive. It may not be an optional dummy
  12103. argument.
  12104. MASK Shall be an array of type 'LOGICAL', and
  12105. conformable with ARRAY.
  12106. _Return value_:
  12107. If DIM is absent, or if ARRAY has a rank of one, the result is a
  12108. scalar. If DIM is present, the result is an array with a rank one
  12109. less than the rank of ARRAY, and a size corresponding to the size
  12110. of ARRAY with the DIM dimension removed. In all cases, the result
  12111. is of the same type and kind as ARRAY.
  12112. _See also_:
  12113. *note MIN::, *note MINLOC::
  12114. 
  12115. File: gfortran.info, Node: MOD, Next: MODULO, Prev: MINVAL, Up: Intrinsic Procedures
  12116. 9.199 'MOD' -- Remainder function
  12117. =================================
  12118. _Description_:
  12119. 'MOD(A,P)' computes the remainder of the division of A by P.
  12120. _Standard_:
  12121. Fortran 77 and later, has overloads that are GNU extensions
  12122. _Class_:
  12123. Elemental function
  12124. _Syntax_:
  12125. 'RESULT = MOD(A, P)'
  12126. _Arguments_:
  12127. A Shall be a scalar of type 'INTEGER' or 'REAL'.
  12128. P Shall be a scalar of the same type and kind as A
  12129. and not equal to zero.
  12130. _Return value_:
  12131. The return value is the result of 'A - (INT(A/P) * P)'. The type
  12132. and kind of the return value is the same as that of the arguments.
  12133. The returned value has the same sign as A and a magnitude less than
  12134. the magnitude of P.
  12135. _Example_:
  12136. program test_mod
  12137. print *, mod(17,3)
  12138. print *, mod(17.5,5.5)
  12139. print *, mod(17.5d0,5.5)
  12140. print *, mod(17.5,5.5d0)
  12141. print *, mod(-17,3)
  12142. print *, mod(-17.5,5.5)
  12143. print *, mod(-17.5d0,5.5)
  12144. print *, mod(-17.5,5.5d0)
  12145. print *, mod(17,-3)
  12146. print *, mod(17.5,-5.5)
  12147. print *, mod(17.5d0,-5.5)
  12148. print *, mod(17.5,-5.5d0)
  12149. end program test_mod
  12150. _Specific names_:
  12151. Name Arguments Return type Standard
  12152. 'MOD(A,P)' 'INTEGER 'INTEGER' Fortran 95 and
  12153. A,P' later
  12154. 'AMOD(A,P)' 'REAL(4) 'REAL(4)' Fortran 95 and
  12155. A,P' later
  12156. 'DMOD(A,P)' 'REAL(8) 'REAL(8)' Fortran 95 and
  12157. A,P' later
  12158. 'BMOD(A,P)' 'INTEGER(1) 'INTEGER(1)' GNU extension
  12159. A,P'
  12160. 'IMOD(A,P)' 'INTEGER(2) 'INTEGER(2)' GNU extension
  12161. A,P'
  12162. 'JMOD(A,P)' 'INTEGER(4) 'INTEGER(4)' GNU extension
  12163. A,P'
  12164. 'KMOD(A,P)' 'INTEGER(8) 'INTEGER(8)' GNU extension
  12165. A,P'
  12166. _See also_:
  12167. *note MODULO::
  12168. 
  12169. File: gfortran.info, Node: MODULO, Next: MOVE_ALLOC, Prev: MOD, Up: Intrinsic Procedures
  12170. 9.200 'MODULO' -- Modulo function
  12171. =================================
  12172. _Description_:
  12173. 'MODULO(A,P)' computes the A modulo P.
  12174. _Standard_:
  12175. Fortran 95 and later
  12176. _Class_:
  12177. Elemental function
  12178. _Syntax_:
  12179. 'RESULT = MODULO(A, P)'
  12180. _Arguments_:
  12181. A Shall be a scalar of type 'INTEGER' or 'REAL'.
  12182. P Shall be a scalar of the same type and kind as
  12183. A. It shall not be zero.
  12184. _Return value_:
  12185. The type and kind of the result are those of the arguments.
  12186. If A and P are of type 'INTEGER':
  12187. 'MODULO(A,P)' has the value R such that 'A=Q*P+R', where Q is
  12188. an integer and R is between 0 (inclusive) and P (exclusive).
  12189. If A and P are of type 'REAL':
  12190. 'MODULO(A,P)' has the value of 'A - FLOOR (A / P) * P'.
  12191. The returned value has the same sign as P and a magnitude less than
  12192. the magnitude of P.
  12193. _Example_:
  12194. program test_modulo
  12195. print *, modulo(17,3)
  12196. print *, modulo(17.5,5.5)
  12197. print *, modulo(-17,3)
  12198. print *, modulo(-17.5,5.5)
  12199. print *, modulo(17,-3)
  12200. print *, modulo(17.5,-5.5)
  12201. end program
  12202. _See also_:
  12203. *note MOD::
  12204. 
  12205. File: gfortran.info, Node: MOVE_ALLOC, Next: MVBITS, Prev: MODULO, Up: Intrinsic Procedures
  12206. 9.201 'MOVE_ALLOC' -- Move allocation from one object to another
  12207. ================================================================
  12208. _Description_:
  12209. 'MOVE_ALLOC(FROM, TO)' moves the allocation from FROM to TO. FROM
  12210. will become deallocated in the process.
  12211. _Standard_:
  12212. Fortran 2003 and later
  12213. _Class_:
  12214. Pure subroutine
  12215. _Syntax_:
  12216. 'CALL MOVE_ALLOC(FROM, TO)'
  12217. _Arguments_:
  12218. FROM 'ALLOCATABLE', 'INTENT(INOUT)', may be of any
  12219. type and kind.
  12220. TO 'ALLOCATABLE', 'INTENT(OUT)', shall be of the
  12221. same type, kind and rank as FROM.
  12222. _Return value_:
  12223. None
  12224. _Example_:
  12225. program test_move_alloc
  12226. integer, allocatable :: a(:), b(:)
  12227. allocate(a(3))
  12228. a = [ 1, 2, 3 ]
  12229. call move_alloc(a, b)
  12230. print *, allocated(a), allocated(b)
  12231. print *, b
  12232. end program test_move_alloc
  12233. 
  12234. File: gfortran.info, Node: MVBITS, Next: NEAREST, Prev: MOVE_ALLOC, Up: Intrinsic Procedures
  12235. 9.202 'MVBITS' -- Move bits from one integer to another
  12236. =======================================================
  12237. _Description_:
  12238. Moves LEN bits from positions FROMPOS through 'FROMPOS+LEN-1' of
  12239. FROM to positions TOPOS through 'TOPOS+LEN-1' of TO. The portion
  12240. of argument TO not affected by the movement of bits is unchanged.
  12241. The values of 'FROMPOS+LEN-1' and 'TOPOS+LEN-1' must be less than
  12242. 'BIT_SIZE(FROM)'.
  12243. _Standard_:
  12244. Fortran 95 and later, has overloads that are GNU extensions
  12245. _Class_:
  12246. Elemental subroutine
  12247. _Syntax_:
  12248. 'CALL MVBITS(FROM, FROMPOS, LEN, TO, TOPOS)'
  12249. _Arguments_:
  12250. FROM The type shall be 'INTEGER'.
  12251. FROMPOS The type shall be 'INTEGER'.
  12252. LEN The type shall be 'INTEGER'.
  12253. TO The type shall be 'INTEGER', of the same kind as
  12254. FROM.
  12255. TOPOS The type shall be 'INTEGER'.
  12256. _Specific names_:
  12257. Name Argument Return type Standard
  12258. 'MVBITS(A)' 'INTEGER A' 'INTEGER' Fortran 95 and
  12259. later
  12260. 'BMVBITS(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension
  12261. A'
  12262. 'IMVBITS(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension
  12263. A'
  12264. 'JMVBITS(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension
  12265. A'
  12266. 'KMVBITS(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension
  12267. A'
  12268. _See also_:
  12269. *note IBCLR::, *note IBSET::, *note IBITS::, *note IAND::, *note
  12270. IOR::, *note IEOR::
  12271. 
  12272. File: gfortran.info, Node: NEAREST, Next: NEW_LINE, Prev: MVBITS, Up: Intrinsic Procedures
  12273. 9.203 'NEAREST' -- Nearest representable number
  12274. ===============================================
  12275. _Description_:
  12276. 'NEAREST(X, S)' returns the processor-representable number nearest
  12277. to 'X' in the direction indicated by the sign of 'S'.
  12278. _Standard_:
  12279. Fortran 95 and later
  12280. _Class_:
  12281. Elemental function
  12282. _Syntax_:
  12283. 'RESULT = NEAREST(X, S)'
  12284. _Arguments_:
  12285. X Shall be of type 'REAL'.
  12286. S Shall be of type 'REAL' and not equal to zero.
  12287. _Return value_:
  12288. The return value is of the same type as 'X'. If 'S' is positive,
  12289. 'NEAREST' returns the processor-representable number greater than
  12290. 'X' and nearest to it. If 'S' is negative, 'NEAREST' returns the
  12291. processor-representable number smaller than 'X' and nearest to it.
  12292. _Example_:
  12293. program test_nearest
  12294. real :: x, y
  12295. x = nearest(42.0, 1.0)
  12296. y = nearest(42.0, -1.0)
  12297. write (*,"(3(G20.15))") x, y, x - y
  12298. end program test_nearest
  12299. 
  12300. File: gfortran.info, Node: NEW_LINE, Next: NINT, Prev: NEAREST, Up: Intrinsic Procedures
  12301. 9.204 'NEW_LINE' -- New line character
  12302. ======================================
  12303. _Description_:
  12304. 'NEW_LINE(C)' returns the new-line character.
  12305. _Standard_:
  12306. Fortran 2003 and later
  12307. _Class_:
  12308. Inquiry function
  12309. _Syntax_:
  12310. 'RESULT = NEW_LINE(C)'
  12311. _Arguments_:
  12312. C The argument shall be a scalar or array of the
  12313. type 'CHARACTER'.
  12314. _Return value_:
  12315. Returns a CHARACTER scalar of length one with the new-line
  12316. character of the same kind as parameter C.
  12317. _Example_:
  12318. program newline
  12319. implicit none
  12320. write(*,'(A)') 'This is record 1.'//NEW_LINE('A')//'This is record 2.'
  12321. end program newline
  12322. 
  12323. File: gfortran.info, Node: NINT, Next: NORM2, Prev: NEW_LINE, Up: Intrinsic Procedures
  12324. 9.205 'NINT' -- Nearest whole number
  12325. ====================================
  12326. _Description_:
  12327. 'NINT(A)' rounds its argument to the nearest whole number.
  12328. _Standard_:
  12329. Fortran 77 and later, with KIND argument Fortran 90 and later
  12330. _Class_:
  12331. Elemental function
  12332. _Syntax_:
  12333. 'RESULT = NINT(A [, KIND])'
  12334. _Arguments_:
  12335. A The type of the argument shall be 'REAL'.
  12336. KIND (Optional) An 'INTEGER' initialization
  12337. expression indicating the kind parameter of the
  12338. result.
  12339. _Return value_:
  12340. Returns A with the fractional portion of its magnitude eliminated
  12341. by rounding to the nearest whole number and with its sign
  12342. preserved, converted to an 'INTEGER' of the default kind.
  12343. _Example_:
  12344. program test_nint
  12345. real(4) x4
  12346. real(8) x8
  12347. x4 = 1.234E0_4
  12348. x8 = 4.321_8
  12349. print *, nint(x4), idnint(x8)
  12350. end program test_nint
  12351. _Specific names_:
  12352. Name Argument Return Type Standard
  12353. 'NINT(A)' 'REAL(4) A' 'INTEGER' Fortran 95 and
  12354. later
  12355. 'IDNINT(A)' 'REAL(8) A' 'INTEGER' Fortran 95 and
  12356. later
  12357. _See also_:
  12358. *note CEILING::, *note FLOOR::
  12359. 
  12360. File: gfortran.info, Node: NORM2, Next: NOT, Prev: NINT, Up: Intrinsic Procedures
  12361. 9.206 'NORM2' -- Euclidean vector norms
  12362. =======================================
  12363. _Description_:
  12364. Calculates the Euclidean vector norm (L_2 norm) of of ARRAY along
  12365. dimension DIM.
  12366. _Standard_:
  12367. Fortran 2008 and later
  12368. _Class_:
  12369. Transformational function
  12370. _Syntax_:
  12371. 'RESULT = NORM2(ARRAY[, DIM])'
  12372. _Arguments_:
  12373. ARRAY Shall be an array of type 'REAL'
  12374. DIM (Optional) shall be a scalar of type 'INTEGER'
  12375. with a value in the range from 1 to n, where n
  12376. equals the rank of ARRAY.
  12377. _Return value_:
  12378. The result is of the same type as ARRAY.
  12379. If DIM is absent, a scalar with the square root of the sum of all
  12380. elements in ARRAY squared is returned. Otherwise, an array of rank
  12381. n-1, where n equals the rank of ARRAY, and a shape similar to that
  12382. of ARRAY with dimension DIM dropped is returned.
  12383. _Example_:
  12384. PROGRAM test_sum
  12385. REAL :: x(5) = [ real :: 1, 2, 3, 4, 5 ]
  12386. print *, NORM2(x) ! = sqrt(55.) ~ 7.416
  12387. END PROGRAM
  12388. 
  12389. File: gfortran.info, Node: NOT, Next: NULL, Prev: NORM2, Up: Intrinsic Procedures
  12390. 9.207 'NOT' -- Logical negation
  12391. ===============================
  12392. _Description_:
  12393. 'NOT' returns the bitwise Boolean inverse of I.
  12394. _Standard_:
  12395. Fortran 95 and later, has overloads that are GNU extensions
  12396. _Class_:
  12397. Elemental function
  12398. _Syntax_:
  12399. 'RESULT = NOT(I)'
  12400. _Arguments_:
  12401. I The type shall be 'INTEGER'.
  12402. _Return value_:
  12403. The return type is 'INTEGER', of the same kind as the argument.
  12404. _Specific names_:
  12405. Name Argument Return type Standard
  12406. 'NOT(A)' 'INTEGER A' 'INTEGER' Fortran 95 and
  12407. later
  12408. 'BNOT(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension
  12409. A'
  12410. 'INOT(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension
  12411. A'
  12412. 'JNOT(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension
  12413. A'
  12414. 'KNOT(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension
  12415. A'
  12416. _See also_:
  12417. *note IAND::, *note IEOR::, *note IOR::, *note IBITS::, *note
  12418. IBSET::, *note IBCLR::
  12419. 
  12420. File: gfortran.info, Node: NULL, Next: NUM_IMAGES, Prev: NOT, Up: Intrinsic Procedures
  12421. 9.208 'NULL' -- Function that returns an disassociated pointer
  12422. ==============================================================
  12423. _Description_:
  12424. Returns a disassociated pointer.
  12425. If MOLD is present, a disassociated pointer of the same type is
  12426. returned, otherwise the type is determined by context.
  12427. In Fortran 95, MOLD is optional. Please note that Fortran 2003
  12428. includes cases where it is required.
  12429. _Standard_:
  12430. Fortran 95 and later
  12431. _Class_:
  12432. Transformational function
  12433. _Syntax_:
  12434. 'PTR => NULL([MOLD])'
  12435. _Arguments_:
  12436. MOLD (Optional) shall be a pointer of any association
  12437. status and of any type.
  12438. _Return value_:
  12439. A disassociated pointer.
  12440. _Example_:
  12441. REAL, POINTER, DIMENSION(:) :: VEC => NULL ()
  12442. _See also_:
  12443. *note ASSOCIATED::
  12444. 
  12445. File: gfortran.info, Node: NUM_IMAGES, Next: OR, Prev: NULL, Up: Intrinsic Procedures
  12446. 9.209 'NUM_IMAGES' -- Function that returns the number of images
  12447. ================================================================
  12448. _Description_:
  12449. Returns the number of images.
  12450. _Standard_:
  12451. Fortran 2008 and later. With DISTANCE or FAILED argument,
  12452. Technical Specification (TS) 18508 or later
  12453. _Class_:
  12454. Transformational function
  12455. _Syntax_:
  12456. 'RESULT = NUM_IMAGES(DISTANCE, FAILED)'
  12457. _Arguments_:
  12458. DISTANCE (optional, intent(in)) Nonnegative scalar
  12459. integer
  12460. FAILED (optional, intent(in)) Scalar logical expression
  12461. _Return value_:
  12462. Scalar default-kind integer. If DISTANCE is not present or has
  12463. value 0, the number of images in the current team is returned. For
  12464. values smaller or equal distance to the initial team, it returns
  12465. the number of images index on the ancestor team which has a
  12466. distance of DISTANCE from the invoking team. If DISTANCE is larger
  12467. than the distance to the initial team, the number of images of the
  12468. initial team is returned. If FAILED is not present the total
  12469. number of images is returned; if it has the value '.TRUE.', the
  12470. number of failed images is returned, otherwise, the number of
  12471. images which do have not the failed status.
  12472. _Example_:
  12473. INTEGER :: value[*]
  12474. INTEGER :: i
  12475. value = THIS_IMAGE()
  12476. SYNC ALL
  12477. IF (THIS_IMAGE() == 1) THEN
  12478. DO i = 1, NUM_IMAGES()
  12479. WRITE(*,'(2(a,i0))') 'value[', i, '] is ', value[i]
  12480. END DO
  12481. END IF
  12482. _See also_:
  12483. *note THIS_IMAGE::, *note IMAGE_INDEX::
  12484. 
  12485. File: gfortran.info, Node: OR, Next: PACK, Prev: NUM_IMAGES, Up: Intrinsic Procedures
  12486. 9.210 'OR' -- Bitwise logical OR
  12487. ================================
  12488. _Description_:
  12489. Bitwise logical 'OR'.
  12490. This intrinsic routine is provided for backwards compatibility with
  12491. GNU Fortran 77. For integer arguments, programmers should consider
  12492. the use of the *note IOR:: intrinsic defined by the Fortran
  12493. standard.
  12494. _Standard_:
  12495. GNU extension
  12496. _Class_:
  12497. Function
  12498. _Syntax_:
  12499. 'RESULT = OR(I, J)'
  12500. _Arguments_:
  12501. I The type shall be either a scalar 'INTEGER' type
  12502. or a scalar 'LOGICAL' type.
  12503. J The type shall be the same as the type of J.
  12504. _Return value_:
  12505. The return type is either a scalar 'INTEGER' or a scalar 'LOGICAL'.
  12506. If the kind type parameters differ, then the smaller kind type is
  12507. implicitly converted to larger kind, and the return has the larger
  12508. kind.
  12509. _Example_:
  12510. PROGRAM test_or
  12511. LOGICAL :: T = .TRUE., F = .FALSE.
  12512. INTEGER :: a, b
  12513. DATA a / Z'F' /, b / Z'3' /
  12514. WRITE (*,*) OR(T, T), OR(T, F), OR(F, T), OR(F, F)
  12515. WRITE (*,*) OR(a, b)
  12516. END PROGRAM
  12517. _See also_:
  12518. Fortran 95 elemental function: *note IOR::
  12519. 
  12520. File: gfortran.info, Node: PACK, Next: PARITY, Prev: OR, Up: Intrinsic Procedures
  12521. 9.211 'PACK' -- Pack an array into an array of rank one
  12522. =======================================================
  12523. _Description_:
  12524. Stores the elements of ARRAY in an array of rank one.
  12525. The beginning of the resulting array is made up of elements whose
  12526. MASK equals 'TRUE'. Afterwards, positions are filled with elements
  12527. taken from VECTOR.
  12528. _Standard_:
  12529. Fortran 95 and later
  12530. _Class_:
  12531. Transformational function
  12532. _Syntax_:
  12533. 'RESULT = PACK(ARRAY, MASK[,VECTOR])'
  12534. _Arguments_:
  12535. ARRAY Shall be an array of any type.
  12536. MASK Shall be an array of type 'LOGICAL' and of the
  12537. same size as ARRAY. Alternatively, it may be a
  12538. 'LOGICAL' scalar.
  12539. VECTOR (Optional) shall be an array of the same type as
  12540. ARRAY and of rank one. If present, the number
  12541. of elements in VECTOR shall be equal to or
  12542. greater than the number of true elements in
  12543. MASK. If MASK is scalar, the number of elements
  12544. in VECTOR shall be equal to or greater than the
  12545. number of elements in ARRAY.
  12546. _Return value_:
  12547. The result is an array of rank one and the same type as that of
  12548. ARRAY. If VECTOR is present, the result size is that of VECTOR,
  12549. the number of 'TRUE' values in MASK otherwise.
  12550. _Example_:
  12551. Gathering nonzero elements from an array:
  12552. PROGRAM test_pack_1
  12553. INTEGER :: m(6)
  12554. m = (/ 1, 0, 0, 0, 5, 0 /)
  12555. WRITE(*, FMT="(6(I0, ' '))") pack(m, m /= 0) ! "1 5"
  12556. END PROGRAM
  12557. Gathering nonzero elements from an array and appending elements
  12558. from VECTOR:
  12559. PROGRAM test_pack_2
  12560. INTEGER :: m(4)
  12561. m = (/ 1, 0, 0, 2 /)
  12562. WRITE(*, FMT="(4(I0, ' '))") pack(m, m /= 0, (/ 0, 0, 3, 4 /)) ! "1 2 3 4"
  12563. END PROGRAM
  12564. _See also_:
  12565. *note UNPACK::
  12566. 
  12567. File: gfortran.info, Node: PARITY, Next: PERROR, Prev: PACK, Up: Intrinsic Procedures
  12568. 9.212 'PARITY' -- Reduction with exclusive OR
  12569. =============================================
  12570. _Description_:
  12571. Calculates the parity, i.e. the reduction using '.XOR.', of MASK
  12572. along dimension DIM.
  12573. _Standard_:
  12574. Fortran 2008 and later
  12575. _Class_:
  12576. Transformational function
  12577. _Syntax_:
  12578. 'RESULT = PARITY(MASK[, DIM])'
  12579. _Arguments_:
  12580. LOGICAL Shall be an array of type 'LOGICAL'
  12581. DIM (Optional) shall be a scalar of type 'INTEGER'
  12582. with a value in the range from 1 to n, where n
  12583. equals the rank of MASK.
  12584. _Return value_:
  12585. The result is of the same type as MASK.
  12586. If DIM is absent, a scalar with the parity of all elements in MASK
  12587. is returned, i.e. true if an odd number of elements is '.true.'
  12588. and false otherwise. If DIM is present, an array of rank n-1,
  12589. where n equals the rank of ARRAY, and a shape similar to that of
  12590. MASK with dimension DIM dropped is returned.
  12591. _Example_:
  12592. PROGRAM test_sum
  12593. LOGICAL :: x(2) = [ .true., .false. ]
  12594. print *, PARITY(x) ! prints "T" (true).
  12595. END PROGRAM
  12596. 
  12597. File: gfortran.info, Node: PERROR, Next: POPCNT, Prev: PARITY, Up: Intrinsic Procedures
  12598. 9.213 'PERROR' -- Print system error message
  12599. ============================================
  12600. _Description_:
  12601. Prints (on the C 'stderr' stream) a newline-terminated error
  12602. message corresponding to the last system error. This is prefixed
  12603. by STRING, a colon and a space. See 'perror(3)'.
  12604. _Standard_:
  12605. GNU extension
  12606. _Class_:
  12607. Subroutine
  12608. _Syntax_:
  12609. 'CALL PERROR(STRING)'
  12610. _Arguments_:
  12611. STRING A scalar of type 'CHARACTER' and of the default
  12612. kind.
  12613. _See also_:
  12614. *note IERRNO::
  12615. 
  12616. File: gfortran.info, Node: POPCNT, Next: POPPAR, Prev: PERROR, Up: Intrinsic Procedures
  12617. 9.214 'POPCNT' -- Number of bits set
  12618. ====================================
  12619. _Description_:
  12620. 'POPCNT(I)' returns the number of bits set ('1' bits) in the binary
  12621. representation of 'I'.
  12622. _Standard_:
  12623. Fortran 2008 and later
  12624. _Class_:
  12625. Elemental function
  12626. _Syntax_:
  12627. 'RESULT = POPCNT(I)'
  12628. _Arguments_:
  12629. I Shall be of type 'INTEGER'.
  12630. _Return value_:
  12631. The return value is of type 'INTEGER' and of the default integer
  12632. kind.
  12633. _See also_:
  12634. *note POPPAR::, *note LEADZ::, *note TRAILZ::
  12635. _Example_:
  12636. program test_population
  12637. print *, popcnt(127), poppar(127)
  12638. print *, popcnt(huge(0_4)), poppar(huge(0_4))
  12639. print *, popcnt(huge(0_8)), poppar(huge(0_8))
  12640. end program test_population
  12641. 
  12642. File: gfortran.info, Node: POPPAR, Next: PRECISION, Prev: POPCNT, Up: Intrinsic Procedures
  12643. 9.215 'POPPAR' -- Parity of the number of bits set
  12644. ==================================================
  12645. _Description_:
  12646. 'POPPAR(I)' returns parity of the integer 'I', i.e. the parity of
  12647. the number of bits set ('1' bits) in the binary representation of
  12648. 'I'. It is equal to 0 if 'I' has an even number of bits set, and 1
  12649. for an odd number of '1' bits.
  12650. _Standard_:
  12651. Fortran 2008 and later
  12652. _Class_:
  12653. Elemental function
  12654. _Syntax_:
  12655. 'RESULT = POPPAR(I)'
  12656. _Arguments_:
  12657. I Shall be of type 'INTEGER'.
  12658. _Return value_:
  12659. The return value is of type 'INTEGER' and of the default integer
  12660. kind.
  12661. _See also_:
  12662. *note POPCNT::, *note LEADZ::, *note TRAILZ::
  12663. _Example_:
  12664. program test_population
  12665. print *, popcnt(127), poppar(127)
  12666. print *, popcnt(huge(0_4)), poppar(huge(0_4))
  12667. print *, popcnt(huge(0_8)), poppar(huge(0_8))
  12668. end program test_population
  12669. 
  12670. File: gfortran.info, Node: PRECISION, Next: PRESENT, Prev: POPPAR, Up: Intrinsic Procedures
  12671. 9.216 'PRECISION' -- Decimal precision of a real kind
  12672. =====================================================
  12673. _Description_:
  12674. 'PRECISION(X)' returns the decimal precision in the model of the
  12675. type of 'X'.
  12676. _Standard_:
  12677. Fortran 95 and later
  12678. _Class_:
  12679. Inquiry function
  12680. _Syntax_:
  12681. 'RESULT = PRECISION(X)'
  12682. _Arguments_:
  12683. X Shall be of type 'REAL' or 'COMPLEX'.
  12684. _Return value_:
  12685. The return value is of type 'INTEGER' and of the default integer
  12686. kind.
  12687. _See also_:
  12688. *note SELECTED_REAL_KIND::, *note RANGE::
  12689. _Example_:
  12690. program prec_and_range
  12691. real(kind=4) :: x(2)
  12692. complex(kind=8) :: y
  12693. print *, precision(x), range(x)
  12694. print *, precision(y), range(y)
  12695. end program prec_and_range
  12696. 
  12697. File: gfortran.info, Node: PRESENT, Next: PRODUCT, Prev: PRECISION, Up: Intrinsic Procedures
  12698. 9.217 'PRESENT' -- Determine whether an optional dummy argument is specified
  12699. ============================================================================
  12700. _Description_:
  12701. Determines whether an optional dummy argument is present.
  12702. _Standard_:
  12703. Fortran 95 and later
  12704. _Class_:
  12705. Inquiry function
  12706. _Syntax_:
  12707. 'RESULT = PRESENT(A)'
  12708. _Arguments_:
  12709. A May be of any type and may be a pointer, scalar
  12710. or array value, or a dummy procedure. It shall
  12711. be the name of an optional dummy argument
  12712. accessible within the current subroutine or
  12713. function.
  12714. _Return value_:
  12715. Returns either 'TRUE' if the optional argument A is present, or
  12716. 'FALSE' otherwise.
  12717. _Example_:
  12718. PROGRAM test_present
  12719. WRITE(*,*) f(), f(42) ! "F T"
  12720. CONTAINS
  12721. LOGICAL FUNCTION f(x)
  12722. INTEGER, INTENT(IN), OPTIONAL :: x
  12723. f = PRESENT(x)
  12724. END FUNCTION
  12725. END PROGRAM
  12726. 
  12727. File: gfortran.info, Node: PRODUCT, Next: RADIX, Prev: PRESENT, Up: Intrinsic Procedures
  12728. 9.218 'PRODUCT' -- Product of array elements
  12729. ============================================
  12730. _Description_:
  12731. Multiplies the elements of ARRAY along dimension DIM if the
  12732. corresponding element in MASK is 'TRUE'.
  12733. _Standard_:
  12734. Fortran 95 and later
  12735. _Class_:
  12736. Transformational function
  12737. _Syntax_:
  12738. 'RESULT = PRODUCT(ARRAY[, MASK])'
  12739. 'RESULT = PRODUCT(ARRAY, DIM[, MASK])'
  12740. _Arguments_:
  12741. ARRAY Shall be an array of type 'INTEGER', 'REAL' or
  12742. 'COMPLEX'.
  12743. DIM (Optional) shall be a scalar of type 'INTEGER'
  12744. with a value in the range from 1 to n, where n
  12745. equals the rank of ARRAY.
  12746. MASK (Optional) shall be of type 'LOGICAL' and either
  12747. be a scalar or an array of the same shape as
  12748. ARRAY.
  12749. _Return value_:
  12750. The result is of the same type as ARRAY.
  12751. If DIM is absent, a scalar with the product of all elements in
  12752. ARRAY is returned. Otherwise, an array of rank n-1, where n equals
  12753. the rank of ARRAY, and a shape similar to that of ARRAY with
  12754. dimension DIM dropped is returned.
  12755. _Example_:
  12756. PROGRAM test_product
  12757. INTEGER :: x(5) = (/ 1, 2, 3, 4 ,5 /)
  12758. print *, PRODUCT(x) ! all elements, product = 120
  12759. print *, PRODUCT(x, MASK=MOD(x, 2)==1) ! odd elements, product = 15
  12760. END PROGRAM
  12761. _See also_:
  12762. *note SUM::
  12763. 
  12764. File: gfortran.info, Node: RADIX, Next: RAN, Prev: PRODUCT, Up: Intrinsic Procedures
  12765. 9.219 'RADIX' -- Base of a model number
  12766. =======================================
  12767. _Description_:
  12768. 'RADIX(X)' returns the base of the model representing the entity X.
  12769. _Standard_:
  12770. Fortran 95 and later
  12771. _Class_:
  12772. Inquiry function
  12773. _Syntax_:
  12774. 'RESULT = RADIX(X)'
  12775. _Arguments_:
  12776. X Shall be of type 'INTEGER' or 'REAL'
  12777. _Return value_:
  12778. The return value is a scalar of type 'INTEGER' and of the default
  12779. integer kind.
  12780. _See also_:
  12781. *note SELECTED_REAL_KIND::
  12782. _Example_:
  12783. program test_radix
  12784. print *, "The radix for the default integer kind is", radix(0)
  12785. print *, "The radix for the default real kind is", radix(0.0)
  12786. end program test_radix
  12787. 
  12788. File: gfortran.info, Node: RAN, Next: RAND, Prev: RADIX, Up: Intrinsic Procedures
  12789. 9.220 'RAN' -- Real pseudo-random number
  12790. ========================================
  12791. _Description_:
  12792. For compatibility with HP FORTRAN 77/iX, the 'RAN' intrinsic is
  12793. provided as an alias for 'RAND'. See *note RAND:: for complete
  12794. documentation.
  12795. _Standard_:
  12796. GNU extension
  12797. _Class_:
  12798. Function
  12799. _See also_:
  12800. *note RAND::, *note RANDOM_NUMBER::
  12801. 
  12802. File: gfortran.info, Node: RAND, Next: RANDOM_NUMBER, Prev: RAN, Up: Intrinsic Procedures
  12803. 9.221 'RAND' -- Real pseudo-random number
  12804. =========================================
  12805. _Description_:
  12806. 'RAND(FLAG)' returns a pseudo-random number from a uniform
  12807. distribution between 0 and 1. If FLAG is 0, the next number in the
  12808. current sequence is returned; if FLAG is 1, the generator is
  12809. restarted by 'CALL SRAND(0)'; if FLAG has any other value, it is
  12810. used as a new seed with 'SRAND'.
  12811. This intrinsic routine is provided for backwards compatibility with
  12812. GNU Fortran 77. It implements a simple modulo generator as
  12813. provided by 'g77'. For new code, one should consider the use of
  12814. *note RANDOM_NUMBER:: as it implements a superior algorithm.
  12815. _Standard_:
  12816. GNU extension
  12817. _Class_:
  12818. Function
  12819. _Syntax_:
  12820. 'RESULT = RAND(I)'
  12821. _Arguments_:
  12822. I Shall be a scalar 'INTEGER' of kind 4.
  12823. _Return value_:
  12824. The return value is of 'REAL' type and the default kind.
  12825. _Example_:
  12826. program test_rand
  12827. integer,parameter :: seed = 86456
  12828. call srand(seed)
  12829. print *, rand(), rand(), rand(), rand()
  12830. print *, rand(seed), rand(), rand(), rand()
  12831. end program test_rand
  12832. _See also_:
  12833. *note SRAND::, *note RANDOM_NUMBER::
  12834. 
  12835. File: gfortran.info, Node: RANDOM_NUMBER, Next: RANDOM_SEED, Prev: RAND, Up: Intrinsic Procedures
  12836. 9.222 'RANDOM_NUMBER' -- Pseudo-random number
  12837. =============================================
  12838. _Description_:
  12839. Returns a single pseudorandom number or an array of pseudorandom
  12840. numbers from the uniform distribution over the range 0 \leq x < 1.
  12841. The runtime-library implements the xorshift1024* random number
  12842. generator (RNG). This generator has a period of 2^{1024} - 1, and
  12843. when using multiple threads up to 2^{512} threads can each generate
  12844. 2^{512} random numbers before any aliasing occurs.
  12845. Note that in a multi-threaded program (e.g. using OpenMP
  12846. directives), each thread will have its own random number state.
  12847. For details of the seeding procedure, see the documentation for the
  12848. 'RANDOM_SEED' intrinsic.
  12849. _Standard_:
  12850. Fortran 95 and later
  12851. _Class_:
  12852. Subroutine
  12853. _Syntax_:
  12854. 'RANDOM_NUMBER(HARVEST)'
  12855. _Arguments_:
  12856. HARVEST Shall be a scalar or an array of type 'REAL'.
  12857. _Example_:
  12858. program test_random_number
  12859. REAL :: r(5,5)
  12860. CALL RANDOM_NUMBER(r)
  12861. end program
  12862. _See also_:
  12863. *note RANDOM_SEED::
  12864. 
  12865. File: gfortran.info, Node: RANDOM_SEED, Next: RANGE, Prev: RANDOM_NUMBER, Up: Intrinsic Procedures
  12866. 9.223 'RANDOM_SEED' -- Initialize a pseudo-random number sequence
  12867. =================================================================
  12868. _Description_:
  12869. Restarts or queries the state of the pseudorandom number generator
  12870. used by 'RANDOM_NUMBER'.
  12871. If 'RANDOM_SEED' is called without arguments, it is seeded with
  12872. random data retrieved from the operating system.
  12873. As an extension to the Fortran standard, the GFortran
  12874. 'RANDOM_NUMBER' supports multiple threads. Each thread in a
  12875. multi-threaded program has its own seed. When 'RANDOM_SEED' is
  12876. called either without arguments or with the PUT argument, the given
  12877. seed is copied into a master seed as well as the seed of the
  12878. current thread. When a new thread uses 'RANDOM_NUMBER' for the
  12879. first time, the seed is copied from the master seed, and forwarded
  12880. N * 2^{512} steps to guarantee that the random stream does not
  12881. alias any other stream in the system, where N is the number of
  12882. threads that have used 'RANDOM_NUMBER' so far during the program
  12883. execution.
  12884. _Standard_:
  12885. Fortran 95 and later
  12886. _Class_:
  12887. Subroutine
  12888. _Syntax_:
  12889. 'CALL RANDOM_SEED([SIZE, PUT, GET])'
  12890. _Arguments_:
  12891. SIZE (Optional) Shall be a scalar and of type default
  12892. 'INTEGER', with 'INTENT(OUT)'. It specifies the
  12893. minimum size of the arrays used with the PUT and
  12894. GET arguments.
  12895. PUT (Optional) Shall be an array of type default
  12896. 'INTEGER' and rank one. It is 'INTENT(IN)' and
  12897. the size of the array must be larger than or
  12898. equal to the number returned by the SIZE
  12899. argument.
  12900. GET (Optional) Shall be an array of type default
  12901. 'INTEGER' and rank one. It is 'INTENT(OUT)' and
  12902. the size of the array must be larger than or
  12903. equal to the number returned by the SIZE
  12904. argument.
  12905. _Example_:
  12906. program test_random_seed
  12907. implicit none
  12908. integer, allocatable :: seed(:)
  12909. integer :: n
  12910. call random_seed(size = n)
  12911. allocate(seed(n))
  12912. call random_seed(get=seed)
  12913. write (*, *) seed
  12914. end program test_random_seed
  12915. _See also_:
  12916. *note RANDOM_NUMBER::
  12917. 
  12918. File: gfortran.info, Node: RANGE, Next: RANK, Prev: RANDOM_SEED, Up: Intrinsic Procedures
  12919. 9.224 'RANGE' -- Decimal exponent range
  12920. =======================================
  12921. _Description_:
  12922. 'RANGE(X)' returns the decimal exponent range in the model of the
  12923. type of 'X'.
  12924. _Standard_:
  12925. Fortran 95 and later
  12926. _Class_:
  12927. Inquiry function
  12928. _Syntax_:
  12929. 'RESULT = RANGE(X)'
  12930. _Arguments_:
  12931. X Shall be of type 'INTEGER', 'REAL' or 'COMPLEX'.
  12932. _Return value_:
  12933. The return value is of type 'INTEGER' and of the default integer
  12934. kind.
  12935. _See also_:
  12936. *note SELECTED_REAL_KIND::, *note PRECISION::
  12937. _Example_:
  12938. See 'PRECISION' for an example.
  12939. 
  12940. File: gfortran.info, Node: RANK, Next: REAL, Prev: RANGE, Up: Intrinsic Procedures
  12941. 9.225 'RANK' -- Rank of a data object
  12942. =====================================
  12943. _Description_:
  12944. 'RANK(A)' returns the rank of a scalar or array data object.
  12945. _Standard_:
  12946. Technical Specification (TS) 29113
  12947. _Class_:
  12948. Inquiry function
  12949. _Syntax_:
  12950. 'RESULT = RANK(A)'
  12951. _Arguments_:
  12952. A can be of any type
  12953. _Return value_:
  12954. The return value is of type 'INTEGER' and of the default integer
  12955. kind. For arrays, their rank is returned; for scalars zero is
  12956. returned.
  12957. _Example_:
  12958. program test_rank
  12959. integer :: a
  12960. real, allocatable :: b(:,:)
  12961. print *, rank(a), rank(b) ! Prints: 0 2
  12962. end program test_rank
  12963. 
  12964. File: gfortran.info, Node: REAL, Next: RENAME, Prev: RANK, Up: Intrinsic Procedures
  12965. 9.226 'REAL' -- Convert to real type
  12966. ====================================
  12967. _Description_:
  12968. 'REAL(A [, KIND])' converts its argument A to a real type. The
  12969. 'REALPART' function is provided for compatibility with 'g77', and
  12970. its use is strongly discouraged.
  12971. _Standard_:
  12972. Fortran 77 and later
  12973. _Class_:
  12974. Elemental function
  12975. _Syntax_:
  12976. 'RESULT = REAL(A [, KIND])'
  12977. 'RESULT = REALPART(Z)'
  12978. _Arguments_:
  12979. A Shall be 'INTEGER', 'REAL', or 'COMPLEX'.
  12980. KIND (Optional) An 'INTEGER' initialization
  12981. expression indicating the kind parameter of the
  12982. result.
  12983. _Return value_:
  12984. These functions return a 'REAL' variable or array under the
  12985. following rules:
  12986. (A)
  12987. 'REAL(A)' is converted to a default real type if A is an
  12988. integer or real variable.
  12989. (B)
  12990. 'REAL(A)' is converted to a real type with the kind type
  12991. parameter of A if A is a complex variable.
  12992. (C)
  12993. 'REAL(A, KIND)' is converted to a real type with kind type
  12994. parameter KIND if A is a complex, integer, or real variable.
  12995. _Example_:
  12996. program test_real
  12997. complex :: x = (1.0, 2.0)
  12998. print *, real(x), real(x,8), realpart(x)
  12999. end program test_real
  13000. _Specific names_:
  13001. Name Argument Return type Standard
  13002. 'FLOAT(A)' 'INTEGER(4)' 'REAL(4)' Fortran 77 and
  13003. later
  13004. 'DFLOAT(A)' 'INTEGER(4)' 'REAL(8)' GNU extension
  13005. 'FLOATI(A)' 'INTEGER(2)' 'REAL(4)' GNU extension
  13006. 'FLOATJ(A)' 'INTEGER(4)' 'REAL(4)' GNU extension
  13007. 'FLOATK(A)' 'INTEGER(8)' 'REAL(4)' GNU extension
  13008. 'SNGL(A)' 'INTEGER(8)' 'REAL(4)' Fortran 77 and
  13009. later
  13010. _See also_:
  13011. *note DBLE::
  13012. 
  13013. File: gfortran.info, Node: RENAME, Next: REPEAT, Prev: REAL, Up: Intrinsic Procedures
  13014. 9.227 'RENAME' -- Rename a file
  13015. ===============================
  13016. _Description_:
  13017. Renames a file from file PATH1 to PATH2. A null character
  13018. ('CHAR(0)') can be used to mark the end of the names in PATH1 and
  13019. PATH2; otherwise, trailing blanks in the file names are ignored.
  13020. If the STATUS argument is supplied, it contains 0 on success or a
  13021. nonzero error code upon return; see 'rename(2)'.
  13022. This intrinsic is provided in both subroutine and function forms;
  13023. however, only one form can be used in any given program unit.
  13024. _Standard_:
  13025. GNU extension
  13026. _Class_:
  13027. Subroutine, function
  13028. _Syntax_:
  13029. 'CALL RENAME(PATH1, PATH2 [, STATUS])'
  13030. 'STATUS = RENAME(PATH1, PATH2)'
  13031. _Arguments_:
  13032. PATH1 Shall be of default 'CHARACTER' type.
  13033. PATH2 Shall be of default 'CHARACTER' type.
  13034. STATUS (Optional) Shall be of default 'INTEGER' type.
  13035. _See also_:
  13036. *note LINK::
  13037. 
  13038. File: gfortran.info, Node: REPEAT, Next: RESHAPE, Prev: RENAME, Up: Intrinsic Procedures
  13039. 9.228 'REPEAT' -- Repeated string concatenation
  13040. ===============================================
  13041. _Description_:
  13042. Concatenates NCOPIES copies of a string.
  13043. _Standard_:
  13044. Fortran 95 and later
  13045. _Class_:
  13046. Transformational function
  13047. _Syntax_:
  13048. 'RESULT = REPEAT(STRING, NCOPIES)'
  13049. _Arguments_:
  13050. STRING Shall be scalar and of type 'CHARACTER'.
  13051. NCOPIES Shall be scalar and of type 'INTEGER'.
  13052. _Return value_:
  13053. A new scalar of type 'CHARACTER' built up from NCOPIES copies of
  13054. STRING.
  13055. _Example_:
  13056. program test_repeat
  13057. write(*,*) repeat("x", 5) ! "xxxxx"
  13058. end program
  13059. 
  13060. File: gfortran.info, Node: RESHAPE, Next: RRSPACING, Prev: REPEAT, Up: Intrinsic Procedures
  13061. 9.229 'RESHAPE' -- Function to reshape an array
  13062. ===============================================
  13063. _Description_:
  13064. Reshapes SOURCE to correspond to SHAPE. If necessary, the new
  13065. array may be padded with elements from PAD or permuted as defined
  13066. by ORDER.
  13067. _Standard_:
  13068. Fortran 95 and later
  13069. _Class_:
  13070. Transformational function
  13071. _Syntax_:
  13072. 'RESULT = RESHAPE(SOURCE, SHAPE[, PAD, ORDER])'
  13073. _Arguments_:
  13074. SOURCE Shall be an array of any type.
  13075. SHAPE Shall be of type 'INTEGER' and an array of rank
  13076. one. Its values must be positive or zero.
  13077. PAD (Optional) shall be an array of the same type as
  13078. SOURCE.
  13079. ORDER (Optional) shall be of type 'INTEGER' and an
  13080. array of the same shape as SHAPE. Its values
  13081. shall be a permutation of the numbers from 1 to
  13082. n, where n is the size of SHAPE. If ORDER is
  13083. absent, the natural ordering shall be assumed.
  13084. _Return value_:
  13085. The result is an array of shape SHAPE with the same type as SOURCE.
  13086. _Example_:
  13087. PROGRAM test_reshape
  13088. INTEGER, DIMENSION(4) :: x
  13089. WRITE(*,*) SHAPE(x) ! prints "4"
  13090. WRITE(*,*) SHAPE(RESHAPE(x, (/2, 2/))) ! prints "2 2"
  13091. END PROGRAM
  13092. _See also_:
  13093. *note SHAPE::
  13094. 
  13095. File: gfortran.info, Node: RRSPACING, Next: RSHIFT, Prev: RESHAPE, Up: Intrinsic Procedures
  13096. 9.230 'RRSPACING' -- Reciprocal of the relative spacing
  13097. =======================================================
  13098. _Description_:
  13099. 'RRSPACING(X)' returns the reciprocal of the relative spacing of
  13100. model numbers near X.
  13101. _Standard_:
  13102. Fortran 95 and later
  13103. _Class_:
  13104. Elemental function
  13105. _Syntax_:
  13106. 'RESULT = RRSPACING(X)'
  13107. _Arguments_:
  13108. X Shall be of type 'REAL'.
  13109. _Return value_:
  13110. The return value is of the same type and kind as X. The value
  13111. returned is equal to 'ABS(FRACTION(X)) *
  13112. FLOAT(RADIX(X))**DIGITS(X)'.
  13113. _See also_:
  13114. *note SPACING::
  13115. 
  13116. File: gfortran.info, Node: RSHIFT, Next: SAME_TYPE_AS, Prev: RRSPACING, Up: Intrinsic Procedures
  13117. 9.231 'RSHIFT' -- Right shift bits
  13118. ==================================
  13119. _Description_:
  13120. 'RSHIFT' returns a value corresponding to I with all of the bits
  13121. shifted right by SHIFT places. If the absolute value of SHIFT is
  13122. greater than 'BIT_SIZE(I)', the value is undefined. Bits shifted
  13123. out from the right end are lost. The fill is arithmetic: the bits
  13124. shifted in from the left end are equal to the leftmost bit, which
  13125. in two's complement representation is the sign bit.
  13126. This function has been superseded by the 'SHIFTA' intrinsic, which
  13127. is standard in Fortran 2008 and later.
  13128. _Standard_:
  13129. GNU extension
  13130. _Class_:
  13131. Elemental function
  13132. _Syntax_:
  13133. 'RESULT = RSHIFT(I, SHIFT)'
  13134. _Arguments_:
  13135. I The type shall be 'INTEGER'.
  13136. SHIFT The type shall be 'INTEGER'.
  13137. _Return value_:
  13138. The return value is of type 'INTEGER' and of the same kind as I.
  13139. _See also_:
  13140. *note ISHFT::, *note ISHFTC::, *note LSHIFT::, *note SHIFTA::,
  13141. *note SHIFTR::, *note SHIFTL::
  13142. 
  13143. File: gfortran.info, Node: SAME_TYPE_AS, Next: SCALE, Prev: RSHIFT, Up: Intrinsic Procedures
  13144. 9.232 'SAME_TYPE_AS' -- Query dynamic types for equality
  13145. ========================================================
  13146. _Description_:
  13147. Query dynamic types for equality.
  13148. _Standard_:
  13149. Fortran 2003 and later
  13150. _Class_:
  13151. Inquiry function
  13152. _Syntax_:
  13153. 'RESULT = SAME_TYPE_AS(A, B)'
  13154. _Arguments_:
  13155. A Shall be an object of extensible declared type
  13156. or unlimited polymorphic.
  13157. B Shall be an object of extensible declared type
  13158. or unlimited polymorphic.
  13159. _Return value_:
  13160. The return value is a scalar of type default logical. It is true
  13161. if and only if the dynamic type of A is the same as the dynamic
  13162. type of B.
  13163. _See also_:
  13164. *note EXTENDS_TYPE_OF::
  13165. 
  13166. File: gfortran.info, Node: SCALE, Next: SCAN, Prev: SAME_TYPE_AS, Up: Intrinsic Procedures
  13167. 9.233 'SCALE' -- Scale a real value
  13168. ===================================
  13169. _Description_:
  13170. 'SCALE(X,I)' returns 'X * RADIX(X)**I'.
  13171. _Standard_:
  13172. Fortran 95 and later
  13173. _Class_:
  13174. Elemental function
  13175. _Syntax_:
  13176. 'RESULT = SCALE(X, I)'
  13177. _Arguments_:
  13178. X The type of the argument shall be a 'REAL'.
  13179. I The type of the argument shall be a 'INTEGER'.
  13180. _Return value_:
  13181. The return value is of the same type and kind as X. Its value is
  13182. 'X * RADIX(X)**I'.
  13183. _Example_:
  13184. program test_scale
  13185. real :: x = 178.1387e-4
  13186. integer :: i = 5
  13187. print *, scale(x,i), x*radix(x)**i
  13188. end program test_scale
  13189. 
  13190. File: gfortran.info, Node: SCAN, Next: SECNDS, Prev: SCALE, Up: Intrinsic Procedures
  13191. 9.234 'SCAN' -- Scan a string for the presence of a set of characters
  13192. =====================================================================
  13193. _Description_:
  13194. Scans a STRING for any of the characters in a SET of characters.
  13195. If BACK is either absent or equals 'FALSE', this function returns
  13196. the position of the leftmost character of STRING that is in SET.
  13197. If BACK equals 'TRUE', the rightmost position is returned. If no
  13198. character of SET is found in STRING, the result is zero.
  13199. _Standard_:
  13200. Fortran 95 and later, with KIND argument Fortran 2003 and later
  13201. _Class_:
  13202. Elemental function
  13203. _Syntax_:
  13204. 'RESULT = SCAN(STRING, SET[, BACK [, KIND]])'
  13205. _Arguments_:
  13206. STRING Shall be of type 'CHARACTER'.
  13207. SET Shall be of type 'CHARACTER'.
  13208. BACK (Optional) shall be of type 'LOGICAL'.
  13209. KIND (Optional) An 'INTEGER' initialization
  13210. expression indicating the kind parameter of the
  13211. result.
  13212. _Return value_:
  13213. The return value is of type 'INTEGER' and of kind KIND. If KIND is
  13214. absent, the return value is of default integer kind.
  13215. _Example_:
  13216. PROGRAM test_scan
  13217. WRITE(*,*) SCAN("FORTRAN", "AO") ! 2, found 'O'
  13218. WRITE(*,*) SCAN("FORTRAN", "AO", .TRUE.) ! 6, found 'A'
  13219. WRITE(*,*) SCAN("FORTRAN", "C++") ! 0, found none
  13220. END PROGRAM
  13221. _See also_:
  13222. *note INDEX intrinsic::, *note VERIFY::
  13223. 
  13224. File: gfortran.info, Node: SECNDS, Next: SECOND, Prev: SCAN, Up: Intrinsic Procedures
  13225. 9.235 'SECNDS' -- Time function
  13226. ===============================
  13227. _Description_:
  13228. 'SECNDS(X)' gets the time in seconds from the real-time system
  13229. clock. X is a reference time, also in seconds. If this is zero,
  13230. the time in seconds from midnight is returned. This function is
  13231. non-standard and its use is discouraged.
  13232. _Standard_:
  13233. GNU extension
  13234. _Class_:
  13235. Function
  13236. _Syntax_:
  13237. 'RESULT = SECNDS (X)'
  13238. _Arguments_:
  13239. T Shall be of type 'REAL(4)'.
  13240. X Shall be of type 'REAL(4)'.
  13241. _Return value_:
  13242. None
  13243. _Example_:
  13244. program test_secnds
  13245. integer :: i
  13246. real(4) :: t1, t2
  13247. print *, secnds (0.0) ! seconds since midnight
  13248. t1 = secnds (0.0) ! reference time
  13249. do i = 1, 10000000 ! do something
  13250. end do
  13251. t2 = secnds (t1) ! elapsed time
  13252. print *, "Something took ", t2, " seconds."
  13253. end program test_secnds
  13254. 
  13255. File: gfortran.info, Node: SECOND, Next: SELECTED_CHAR_KIND, Prev: SECNDS, Up: Intrinsic Procedures
  13256. 9.236 'SECOND' -- CPU time function
  13257. ===================================
  13258. _Description_:
  13259. Returns a 'REAL(4)' value representing the elapsed CPU time in
  13260. seconds. This provides the same functionality as the standard
  13261. 'CPU_TIME' intrinsic, and is only included for backwards
  13262. compatibility.
  13263. This intrinsic is provided in both subroutine and function forms;
  13264. however, only one form can be used in any given program unit.
  13265. _Standard_:
  13266. GNU extension
  13267. _Class_:
  13268. Subroutine, function
  13269. _Syntax_:
  13270. 'CALL SECOND(TIME)'
  13271. 'TIME = SECOND()'
  13272. _Arguments_:
  13273. TIME Shall be of type 'REAL(4)'.
  13274. _Return value_:
  13275. In either syntax, TIME is set to the process's current runtime in
  13276. seconds.
  13277. _See also_:
  13278. *note CPU_TIME::
  13279. 
  13280. File: gfortran.info, Node: SELECTED_CHAR_KIND, Next: SELECTED_INT_KIND, Prev: SECOND, Up: Intrinsic Procedures
  13281. 9.237 'SELECTED_CHAR_KIND' -- Choose character kind
  13282. ===================================================
  13283. _Description_:
  13284. 'SELECTED_CHAR_KIND(NAME)' returns the kind value for the character
  13285. set named NAME, if a character set with such a name is supported,
  13286. or -1 otherwise. Currently, supported character sets include
  13287. "ASCII" and "DEFAULT", which are equivalent, and "ISO_10646"
  13288. (Universal Character Set, UCS-4) which is commonly known as
  13289. Unicode.
  13290. _Standard_:
  13291. Fortran 2003 and later
  13292. _Class_:
  13293. Transformational function
  13294. _Syntax_:
  13295. 'RESULT = SELECTED_CHAR_KIND(NAME)'
  13296. _Arguments_:
  13297. NAME Shall be a scalar and of the default character
  13298. type.
  13299. _Example_:
  13300. program character_kind
  13301. use iso_fortran_env
  13302. implicit none
  13303. integer, parameter :: ascii = selected_char_kind ("ascii")
  13304. integer, parameter :: ucs4 = selected_char_kind ('ISO_10646')
  13305. character(kind=ascii, len=26) :: alphabet
  13306. character(kind=ucs4, len=30) :: hello_world
  13307. alphabet = ascii_"abcdefghijklmnopqrstuvwxyz"
  13308. hello_world = ucs4_'Hello World and Ni Hao -- ' &
  13309. // char (int (z'4F60'), ucs4) &
  13310. // char (int (z'597D'), ucs4)
  13311. write (*,*) alphabet
  13312. open (output_unit, encoding='UTF-8')
  13313. write (*,*) trim (hello_world)
  13314. end program character_kind
  13315. 
  13316. File: gfortran.info, Node: SELECTED_INT_KIND, Next: SELECTED_REAL_KIND, Prev: SELECTED_CHAR_KIND, Up: Intrinsic Procedures
  13317. 9.238 'SELECTED_INT_KIND' -- Choose integer kind
  13318. ================================================
  13319. _Description_:
  13320. 'SELECTED_INT_KIND(R)' return the kind value of the smallest
  13321. integer type that can represent all values ranging from -10^R
  13322. (exclusive) to 10^R (exclusive). If there is no integer kind that
  13323. accommodates this range, 'SELECTED_INT_KIND' returns -1.
  13324. _Standard_:
  13325. Fortran 95 and later
  13326. _Class_:
  13327. Transformational function
  13328. _Syntax_:
  13329. 'RESULT = SELECTED_INT_KIND(R)'
  13330. _Arguments_:
  13331. R Shall be a scalar and of type 'INTEGER'.
  13332. _Example_:
  13333. program large_integers
  13334. integer,parameter :: k5 = selected_int_kind(5)
  13335. integer,parameter :: k15 = selected_int_kind(15)
  13336. integer(kind=k5) :: i5
  13337. integer(kind=k15) :: i15
  13338. print *, huge(i5), huge(i15)
  13339. ! The following inequalities are always true
  13340. print *, huge(i5) >= 10_k5**5-1
  13341. print *, huge(i15) >= 10_k15**15-1
  13342. end program large_integers
  13343. 
  13344. File: gfortran.info, Node: SELECTED_REAL_KIND, Next: SET_EXPONENT, Prev: SELECTED_INT_KIND, Up: Intrinsic Procedures
  13345. 9.239 'SELECTED_REAL_KIND' -- Choose real kind
  13346. ==============================================
  13347. _Description_:
  13348. 'SELECTED_REAL_KIND(P,R)' returns the kind value of a real data
  13349. type with decimal precision of at least 'P' digits, exponent range
  13350. of at least 'R', and with a radix of 'RADIX'.
  13351. _Standard_:
  13352. Fortran 95 and later, with 'RADIX' Fortran 2008 or later
  13353. _Class_:
  13354. Transformational function
  13355. _Syntax_:
  13356. 'RESULT = SELECTED_REAL_KIND([P, R, RADIX])'
  13357. _Arguments_:
  13358. P (Optional) shall be a scalar and of type
  13359. 'INTEGER'.
  13360. R (Optional) shall be a scalar and of type
  13361. 'INTEGER'.
  13362. RADIX (Optional) shall be a scalar and of type
  13363. 'INTEGER'.
  13364. Before Fortran 2008, at least one of the arguments R or P shall be
  13365. present; since Fortran 2008, they are assumed to be zero if absent.
  13366. _Return value_:
  13367. 'SELECTED_REAL_KIND' returns the value of the kind type parameter
  13368. of a real data type with decimal precision of at least 'P' digits,
  13369. a decimal exponent range of at least 'R', and with the requested
  13370. 'RADIX'. If the 'RADIX' parameter is absent, real kinds with any
  13371. radix can be returned. If more than one real data type meet the
  13372. criteria, the kind of the data type with the smallest decimal
  13373. precision is returned. If no real data type matches the criteria,
  13374. the result is
  13375. -1 if the processor does not support a real data type with a
  13376. precision greater than or equal to 'P', but the 'R' and
  13377. 'RADIX' requirements can be fulfilled
  13378. -2 if the processor does not support a real type with an exponent
  13379. range greater than or equal to 'R', but 'P' and 'RADIX' are
  13380. fulfillable
  13381. -3 if 'RADIX' but not 'P' and 'R' requirements
  13382. are fulfillable
  13383. -4 if 'RADIX' and either 'P' or 'R' requirements
  13384. are fulfillable
  13385. -5 if there is no real type with the given 'RADIX'
  13386. _See also_:
  13387. *note PRECISION::, *note RANGE::, *note RADIX::
  13388. _Example_:
  13389. program real_kinds
  13390. integer,parameter :: p6 = selected_real_kind(6)
  13391. integer,parameter :: p10r100 = selected_real_kind(10,100)
  13392. integer,parameter :: r400 = selected_real_kind(r=400)
  13393. real(kind=p6) :: x
  13394. real(kind=p10r100) :: y
  13395. real(kind=r400) :: z
  13396. print *, precision(x), range(x)
  13397. print *, precision(y), range(y)
  13398. print *, precision(z), range(z)
  13399. end program real_kinds
  13400. 
  13401. File: gfortran.info, Node: SET_EXPONENT, Next: SHAPE, Prev: SELECTED_REAL_KIND, Up: Intrinsic Procedures
  13402. 9.240 'SET_EXPONENT' -- Set the exponent of the model
  13403. =====================================================
  13404. _Description_:
  13405. 'SET_EXPONENT(X, I)' returns the real number whose fractional part
  13406. is that that of X and whose exponent part is I.
  13407. _Standard_:
  13408. Fortran 95 and later
  13409. _Class_:
  13410. Elemental function
  13411. _Syntax_:
  13412. 'RESULT = SET_EXPONENT(X, I)'
  13413. _Arguments_:
  13414. X Shall be of type 'REAL'.
  13415. I Shall be of type 'INTEGER'.
  13416. _Return value_:
  13417. The return value is of the same type and kind as X. The real
  13418. number whose fractional part is that that of X and whose exponent
  13419. part if I is returned; it is 'FRACTION(X) * RADIX(X)**I'.
  13420. _Example_:
  13421. PROGRAM test_setexp
  13422. REAL :: x = 178.1387e-4
  13423. INTEGER :: i = 17
  13424. PRINT *, SET_EXPONENT(x, i), FRACTION(x) * RADIX(x)**i
  13425. END PROGRAM
  13426. 
  13427. File: gfortran.info, Node: SHAPE, Next: SHIFTA, Prev: SET_EXPONENT, Up: Intrinsic Procedures
  13428. 9.241 'SHAPE' -- Determine the shape of an array
  13429. ================================================
  13430. _Description_:
  13431. Determines the shape of an array.
  13432. _Standard_:
  13433. Fortran 95 and later, with KIND argument Fortran 2003 and later
  13434. _Class_:
  13435. Inquiry function
  13436. _Syntax_:
  13437. 'RESULT = SHAPE(SOURCE [, KIND])'
  13438. _Arguments_:
  13439. SOURCE Shall be an array or scalar of any type. If
  13440. SOURCE is a pointer it must be associated and
  13441. allocatable arrays must be allocated.
  13442. KIND (Optional) An 'INTEGER' initialization
  13443. expression indicating the kind parameter of the
  13444. result.
  13445. _Return value_:
  13446. An 'INTEGER' array of rank one with as many elements as SOURCE has
  13447. dimensions. The elements of the resulting array correspond to the
  13448. extend of SOURCE along the respective dimensions. If SOURCE is a
  13449. scalar, the result is the rank one array of size zero. If KIND is
  13450. absent, the return value has the default integer kind otherwise the
  13451. specified kind.
  13452. _Example_:
  13453. PROGRAM test_shape
  13454. INTEGER, DIMENSION(-1:1, -1:2) :: A
  13455. WRITE(*,*) SHAPE(A) ! (/ 3, 4 /)
  13456. WRITE(*,*) SIZE(SHAPE(42)) ! (/ /)
  13457. END PROGRAM
  13458. _See also_:
  13459. *note RESHAPE::, *note SIZE::
  13460. 
  13461. File: gfortran.info, Node: SHIFTA, Next: SHIFTL, Prev: SHAPE, Up: Intrinsic Procedures
  13462. 9.242 'SHIFTA' -- Right shift with fill
  13463. =======================================
  13464. _Description_:
  13465. 'SHIFTA' returns a value corresponding to I with all of the bits
  13466. shifted right by SHIFT places. If the absolute value of SHIFT is
  13467. greater than 'BIT_SIZE(I)', the value is undefined. Bits shifted
  13468. out from the right end are lost. The fill is arithmetic: the bits
  13469. shifted in from the left end are equal to the leftmost bit, which
  13470. in two's complement representation is the sign bit.
  13471. _Standard_:
  13472. Fortran 2008 and later
  13473. _Class_:
  13474. Elemental function
  13475. _Syntax_:
  13476. 'RESULT = SHIFTA(I, SHIFT)'
  13477. _Arguments_:
  13478. I The type shall be 'INTEGER'.
  13479. SHIFT The type shall be 'INTEGER'.
  13480. _Return value_:
  13481. The return value is of type 'INTEGER' and of the same kind as I.
  13482. _See also_:
  13483. *note SHIFTL::, *note SHIFTR::
  13484. 
  13485. File: gfortran.info, Node: SHIFTL, Next: SHIFTR, Prev: SHIFTA, Up: Intrinsic Procedures
  13486. 9.243 'SHIFTL' -- Left shift
  13487. ============================
  13488. _Description_:
  13489. 'SHIFTL' returns a value corresponding to I with all of the bits
  13490. shifted left by SHIFT places. If the absolute value of SHIFT is
  13491. greater than 'BIT_SIZE(I)', the value is undefined. Bits shifted
  13492. out from the left end are lost, and bits shifted in from the right
  13493. end are set to 0.
  13494. _Standard_:
  13495. Fortran 2008 and later
  13496. _Class_:
  13497. Elemental function
  13498. _Syntax_:
  13499. 'RESULT = SHIFTL(I, SHIFT)'
  13500. _Arguments_:
  13501. I The type shall be 'INTEGER'.
  13502. SHIFT The type shall be 'INTEGER'.
  13503. _Return value_:
  13504. The return value is of type 'INTEGER' and of the same kind as I.
  13505. _See also_:
  13506. *note SHIFTA::, *note SHIFTR::
  13507. 
  13508. File: gfortran.info, Node: SHIFTR, Next: SIGN, Prev: SHIFTL, Up: Intrinsic Procedures
  13509. 9.244 'SHIFTR' -- Right shift
  13510. =============================
  13511. _Description_:
  13512. 'SHIFTR' returns a value corresponding to I with all of the bits
  13513. shifted right by SHIFT places. If the absolute value of SHIFT is
  13514. greater than 'BIT_SIZE(I)', the value is undefined. Bits shifted
  13515. out from the right end are lost, and bits shifted in from the left
  13516. end are set to 0.
  13517. _Standard_:
  13518. Fortran 2008 and later
  13519. _Class_:
  13520. Elemental function
  13521. _Syntax_:
  13522. 'RESULT = SHIFTR(I, SHIFT)'
  13523. _Arguments_:
  13524. I The type shall be 'INTEGER'.
  13525. SHIFT The type shall be 'INTEGER'.
  13526. _Return value_:
  13527. The return value is of type 'INTEGER' and of the same kind as I.
  13528. _See also_:
  13529. *note SHIFTA::, *note SHIFTL::
  13530. 
  13531. File: gfortran.info, Node: SIGN, Next: SIGNAL, Prev: SHIFTR, Up: Intrinsic Procedures
  13532. 9.245 'SIGN' -- Sign copying function
  13533. =====================================
  13534. _Description_:
  13535. 'SIGN(A,B)' returns the value of A with the sign of B.
  13536. _Standard_:
  13537. Fortran 77 and later
  13538. _Class_:
  13539. Elemental function
  13540. _Syntax_:
  13541. 'RESULT = SIGN(A, B)'
  13542. _Arguments_:
  13543. A Shall be of type 'INTEGER' or 'REAL'
  13544. B Shall be of the same type and kind as A
  13545. _Return value_:
  13546. The kind of the return value is that of A and B. If B\ge 0 then
  13547. the result is 'ABS(A)', else it is '-ABS(A)'.
  13548. _Example_:
  13549. program test_sign
  13550. print *, sign(-12,1)
  13551. print *, sign(-12,0)
  13552. print *, sign(-12,-1)
  13553. print *, sign(-12.,1.)
  13554. print *, sign(-12.,0.)
  13555. print *, sign(-12.,-1.)
  13556. end program test_sign
  13557. _Specific names_:
  13558. Name Arguments Return type Standard
  13559. 'SIGN(A,B)' 'REAL(4) A, 'REAL(4)' f77, gnu
  13560. B'
  13561. 'ISIGN(A,B)' 'INTEGER(4) 'INTEGER(4)' f77, gnu
  13562. A, B'
  13563. 'DSIGN(A,B)' 'REAL(8) A, 'REAL(8)' f77, gnu
  13564. B'
  13565. 
  13566. File: gfortran.info, Node: SIGNAL, Next: SIN, Prev: SIGN, Up: Intrinsic Procedures
  13567. 9.246 'SIGNAL' -- Signal handling subroutine (or function)
  13568. ==========================================================
  13569. _Description_:
  13570. 'SIGNAL(NUMBER, HANDLER [, STATUS])' causes external subroutine
  13571. HANDLER to be executed with a single integer argument when signal
  13572. NUMBER occurs. If HANDLER is an integer, it can be used to turn
  13573. off handling of signal NUMBER or revert to its default action. See
  13574. 'signal(2)'.
  13575. If 'SIGNAL' is called as a subroutine and the STATUS argument is
  13576. supplied, it is set to the value returned by 'signal(2)'.
  13577. _Standard_:
  13578. GNU extension
  13579. _Class_:
  13580. Subroutine, function
  13581. _Syntax_:
  13582. 'CALL SIGNAL(NUMBER, HANDLER [, STATUS])'
  13583. 'STATUS = SIGNAL(NUMBER, HANDLER)'
  13584. _Arguments_:
  13585. NUMBER Shall be a scalar integer, with 'INTENT(IN)'
  13586. HANDLER Signal handler ('INTEGER FUNCTION' or
  13587. 'SUBROUTINE') or dummy/global 'INTEGER' scalar.
  13588. 'INTEGER'. It is 'INTENT(IN)'.
  13589. STATUS (Optional) STATUS shall be a scalar integer. It
  13590. has 'INTENT(OUT)'.
  13591. _Return value_:
  13592. The 'SIGNAL' function returns the value returned by 'signal(2)'.
  13593. _Example_:
  13594. program test_signal
  13595. intrinsic signal
  13596. external handler_print
  13597. call signal (12, handler_print)
  13598. call signal (10, 1)
  13599. call sleep (30)
  13600. end program test_signal
  13601. 
  13602. File: gfortran.info, Node: SIN, Next: SIND, Prev: SIGNAL, Up: Intrinsic Procedures
  13603. 9.247 'SIN' -- Sine function
  13604. ============================
  13605. _Description_:
  13606. 'SIN(X)' computes the sine of X.
  13607. _Standard_:
  13608. Fortran 77 and later
  13609. _Class_:
  13610. Elemental function
  13611. _Syntax_:
  13612. 'RESULT = SIN(X)'
  13613. _Arguments_:
  13614. X The type shall be 'REAL' or 'COMPLEX'.
  13615. _Return value_:
  13616. The return value has same type and kind as X.
  13617. _Example_:
  13618. program test_sin
  13619. real :: x = 0.0
  13620. x = sin(x)
  13621. end program test_sin
  13622. _Specific names_:
  13623. Name Argument Return type Standard
  13624. 'SIN(X)' 'REAL(4) X' 'REAL(4)' f77, gnu
  13625. 'DSIN(X)' 'REAL(8) X' 'REAL(8)' f95, gnu
  13626. 'CSIN(X)' 'COMPLEX(4) 'COMPLEX(4)' f95, gnu
  13627. X'
  13628. 'ZSIN(X)' 'COMPLEX(8) 'COMPLEX(8)' f95, gnu
  13629. X'
  13630. 'CDSIN(X)' 'COMPLEX(8) 'COMPLEX(8)' f95, gnu
  13631. X'
  13632. _See also_:
  13633. Inverse function: *note ASIN:: Degrees function: *note SIND::
  13634. 
  13635. File: gfortran.info, Node: SIND, Next: SINH, Prev: SIN, Up: Intrinsic Procedures
  13636. 9.248 'SIND' -- Sine function, degrees
  13637. ======================================
  13638. _Description_:
  13639. 'SIND(X)' computes the sine of X in degrees.
  13640. This function is for compatibility only and should be avoided in
  13641. favor of standard constructs wherever possible.
  13642. _Standard_:
  13643. GNU Extension, enabled with '-fdec-math'.
  13644. _Class_:
  13645. Elemental function
  13646. _Syntax_:
  13647. 'RESULT = SIND(X)'
  13648. _Arguments_:
  13649. X The type shall be 'REAL' or 'COMPLEX'.
  13650. _Return value_:
  13651. The return value has same type and kind as X, and its value is in
  13652. degrees.
  13653. _Example_:
  13654. program test_sind
  13655. real :: x = 0.0
  13656. x = sind(x)
  13657. end program test_sind
  13658. _Specific names_:
  13659. Name Argument Return type Standard
  13660. 'SIND(X)' 'REAL(4) X' 'REAL(4)' GNU Extension
  13661. 'DSIND(X)' 'REAL(8) X' 'REAL(8)' GNU Extension
  13662. 'CSIND(X)' 'COMPLEX(4) 'COMPLEX(4)' GNU Extension
  13663. X'
  13664. 'ZSIND(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU Extension
  13665. X'
  13666. 'CDSIND(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU Extension
  13667. X'
  13668. _See also_:
  13669. Inverse function: *note ASIND:: Radians function: *note SIN::
  13670. 
  13671. File: gfortran.info, Node: SINH, Next: SIZE, Prev: SIND, Up: Intrinsic Procedures
  13672. 9.249 'SINH' -- Hyperbolic sine function
  13673. ========================================
  13674. _Description_:
  13675. 'SINH(X)' computes the hyperbolic sine of X.
  13676. _Standard_:
  13677. Fortran 95 and later, for a complex argument Fortran 2008 or later
  13678. _Class_:
  13679. Elemental function
  13680. _Syntax_:
  13681. 'RESULT = SINH(X)'
  13682. _Arguments_:
  13683. X The type shall be 'REAL' or 'COMPLEX'.
  13684. _Return value_:
  13685. The return value has same type and kind as X.
  13686. _Example_:
  13687. program test_sinh
  13688. real(8) :: x = - 1.0_8
  13689. x = sinh(x)
  13690. end program test_sinh
  13691. _Specific names_:
  13692. Name Argument Return type Standard
  13693. 'SINH(X)' 'REAL(4) X' 'REAL(4)' Fortran 95 and
  13694. later
  13695. 'DSINH(X)' 'REAL(8) X' 'REAL(8)' Fortran 95 and
  13696. later
  13697. _See also_:
  13698. *note ASINH::
  13699. 
  13700. File: gfortran.info, Node: SIZE, Next: SIZEOF, Prev: SINH, Up: Intrinsic Procedures
  13701. 9.250 'SIZE' -- Determine the size of an array
  13702. ==============================================
  13703. _Description_:
  13704. Determine the extent of ARRAY along a specified dimension DIM, or
  13705. the total number of elements in ARRAY if DIM is absent.
  13706. _Standard_:
  13707. Fortran 95 and later, with KIND argument Fortran 2003 and later
  13708. _Class_:
  13709. Inquiry function
  13710. _Syntax_:
  13711. 'RESULT = SIZE(ARRAY[, DIM [, KIND]])'
  13712. _Arguments_:
  13713. ARRAY Shall be an array of any type. If ARRAY is a
  13714. pointer it must be associated and allocatable
  13715. arrays must be allocated.
  13716. DIM (Optional) shall be a scalar of type 'INTEGER'
  13717. and its value shall be in the range from 1 to n,
  13718. where n equals the rank of ARRAY.
  13719. KIND (Optional) An 'INTEGER' initialization
  13720. expression indicating the kind parameter of the
  13721. result.
  13722. _Return value_:
  13723. The return value is of type 'INTEGER' and of kind KIND. If KIND is
  13724. absent, the return value is of default integer kind.
  13725. _Example_:
  13726. PROGRAM test_size
  13727. WRITE(*,*) SIZE((/ 1, 2 /)) ! 2
  13728. END PROGRAM
  13729. _See also_:
  13730. *note SHAPE::, *note RESHAPE::
  13731. 
  13732. File: gfortran.info, Node: SIZEOF, Next: SLEEP, Prev: SIZE, Up: Intrinsic Procedures
  13733. 9.251 'SIZEOF' -- Size in bytes of an expression
  13734. ================================================
  13735. _Description_:
  13736. 'SIZEOF(X)' calculates the number of bytes of storage the
  13737. expression 'X' occupies.
  13738. _Standard_:
  13739. GNU extension
  13740. _Class_:
  13741. Inquiry function
  13742. _Syntax_:
  13743. 'N = SIZEOF(X)'
  13744. _Arguments_:
  13745. X The argument shall be of any type, rank or
  13746. shape.
  13747. _Return value_:
  13748. The return value is of type integer and of the system-dependent
  13749. kind C_SIZE_T (from the ISO_C_BINDING module). Its value is the
  13750. number of bytes occupied by the argument. If the argument has the
  13751. 'POINTER' attribute, the number of bytes of the storage area
  13752. pointed to is returned. If the argument is of a derived type with
  13753. 'POINTER' or 'ALLOCATABLE' components, the return value does not
  13754. account for the sizes of the data pointed to by these components.
  13755. If the argument is polymorphic, the size according to the dynamic
  13756. type is returned. The argument may not be a procedure or procedure
  13757. pointer. Note that the code assumes for arrays that those are
  13758. contiguous; for contiguous arrays, it returns the storage or an
  13759. array element multiplied by the size of the array.
  13760. _Example_:
  13761. integer :: i
  13762. real :: r, s(5)
  13763. print *, (sizeof(s)/sizeof(r) == 5)
  13764. end
  13765. The example will print '.TRUE.' unless you are using a platform
  13766. where default 'REAL' variables are unusually padded.
  13767. _See also_:
  13768. *note C_SIZEOF::, *note STORAGE_SIZE::
  13769. 
  13770. File: gfortran.info, Node: SLEEP, Next: SPACING, Prev: SIZEOF, Up: Intrinsic Procedures
  13771. 9.252 'SLEEP' -- Sleep for the specified number of seconds
  13772. ==========================================================
  13773. _Description_:
  13774. Calling this subroutine causes the process to pause for SECONDS
  13775. seconds.
  13776. _Standard_:
  13777. GNU extension
  13778. _Class_:
  13779. Subroutine
  13780. _Syntax_:
  13781. 'CALL SLEEP(SECONDS)'
  13782. _Arguments_:
  13783. SECONDS The type shall be of default 'INTEGER'.
  13784. _Example_:
  13785. program test_sleep
  13786. call sleep(5)
  13787. end
  13788. 
  13789. File: gfortran.info, Node: SPACING, Next: SPREAD, Prev: SLEEP, Up: Intrinsic Procedures
  13790. 9.253 'SPACING' -- Smallest distance between two numbers of a given type
  13791. ========================================================================
  13792. _Description_:
  13793. Determines the distance between the argument X and the nearest
  13794. adjacent number of the same type.
  13795. _Standard_:
  13796. Fortran 95 and later
  13797. _Class_:
  13798. Elemental function
  13799. _Syntax_:
  13800. 'RESULT = SPACING(X)'
  13801. _Arguments_:
  13802. X Shall be of type 'REAL'.
  13803. _Return value_:
  13804. The result is of the same type as the input argument X.
  13805. _Example_:
  13806. PROGRAM test_spacing
  13807. INTEGER, PARAMETER :: SGL = SELECTED_REAL_KIND(p=6, r=37)
  13808. INTEGER, PARAMETER :: DBL = SELECTED_REAL_KIND(p=13, r=200)
  13809. WRITE(*,*) spacing(1.0_SGL) ! "1.1920929E-07" on i686
  13810. WRITE(*,*) spacing(1.0_DBL) ! "2.220446049250313E-016" on i686
  13811. END PROGRAM
  13812. _See also_:
  13813. *note RRSPACING::
  13814. 
  13815. File: gfortran.info, Node: SPREAD, Next: SQRT, Prev: SPACING, Up: Intrinsic Procedures
  13816. 9.254 'SPREAD' -- Add a dimension to an array
  13817. =============================================
  13818. _Description_:
  13819. Replicates a SOURCE array NCOPIES times along a specified dimension
  13820. DIM.
  13821. _Standard_:
  13822. Fortran 95 and later
  13823. _Class_:
  13824. Transformational function
  13825. _Syntax_:
  13826. 'RESULT = SPREAD(SOURCE, DIM, NCOPIES)'
  13827. _Arguments_:
  13828. SOURCE Shall be a scalar or an array of any type and a
  13829. rank less than seven.
  13830. DIM Shall be a scalar of type 'INTEGER' with a value
  13831. in the range from 1 to n+1, where n equals the
  13832. rank of SOURCE.
  13833. NCOPIES Shall be a scalar of type 'INTEGER'.
  13834. _Return value_:
  13835. The result is an array of the same type as SOURCE and has rank n+1
  13836. where n equals the rank of SOURCE.
  13837. _Example_:
  13838. PROGRAM test_spread
  13839. INTEGER :: a = 1, b(2) = (/ 1, 2 /)
  13840. WRITE(*,*) SPREAD(A, 1, 2) ! "1 1"
  13841. WRITE(*,*) SPREAD(B, 1, 2) ! "1 1 2 2"
  13842. END PROGRAM
  13843. _See also_:
  13844. *note UNPACK::
  13845. 
  13846. File: gfortran.info, Node: SQRT, Next: SRAND, Prev: SPREAD, Up: Intrinsic Procedures
  13847. 9.255 'SQRT' -- Square-root function
  13848. ====================================
  13849. _Description_:
  13850. 'SQRT(X)' computes the square root of X.
  13851. _Standard_:
  13852. Fortran 77 and later
  13853. _Class_:
  13854. Elemental function
  13855. _Syntax_:
  13856. 'RESULT = SQRT(X)'
  13857. _Arguments_:
  13858. X The type shall be 'REAL' or 'COMPLEX'.
  13859. _Return value_:
  13860. The return value is of type 'REAL' or 'COMPLEX'. The kind type
  13861. parameter is the same as X.
  13862. _Example_:
  13863. program test_sqrt
  13864. real(8) :: x = 2.0_8
  13865. complex :: z = (1.0, 2.0)
  13866. x = sqrt(x)
  13867. z = sqrt(z)
  13868. end program test_sqrt
  13869. _Specific names_:
  13870. Name Argument Return type Standard
  13871. 'SQRT(X)' 'REAL(4) X' 'REAL(4)' Fortran 95 and
  13872. later
  13873. 'DSQRT(X)' 'REAL(8) X' 'REAL(8)' Fortran 95 and
  13874. later
  13875. 'CSQRT(X)' 'COMPLEX(4) 'COMPLEX(4)' Fortran 95 and
  13876. X' later
  13877. 'ZSQRT(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension
  13878. X'
  13879. 'CDSQRT(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension
  13880. X'
  13881. 
  13882. File: gfortran.info, Node: SRAND, Next: STAT, Prev: SQRT, Up: Intrinsic Procedures
  13883. 9.256 'SRAND' -- Reinitialize the random number generator
  13884. =========================================================
  13885. _Description_:
  13886. 'SRAND' reinitializes the pseudo-random number generator called by
  13887. 'RAND' and 'IRAND'. The new seed used by the generator is
  13888. specified by the required argument SEED.
  13889. _Standard_:
  13890. GNU extension
  13891. _Class_:
  13892. Subroutine
  13893. _Syntax_:
  13894. 'CALL SRAND(SEED)'
  13895. _Arguments_:
  13896. SEED Shall be a scalar 'INTEGER(kind=4)'.
  13897. _Return value_:
  13898. Does not return anything.
  13899. _Example_:
  13900. See 'RAND' and 'IRAND' for examples.
  13901. _Notes_:
  13902. The Fortran standard specifies the intrinsic subroutines
  13903. 'RANDOM_SEED' to initialize the pseudo-random number generator and
  13904. 'RANDOM_NUMBER' to generate pseudo-random numbers. These
  13905. subroutines should be used in new codes.
  13906. Please note that in GNU Fortran, these two sets of intrinsics
  13907. ('RAND', 'IRAND' and 'SRAND' on the one hand, 'RANDOM_NUMBER' and
  13908. 'RANDOM_SEED' on the other hand) access two independent
  13909. pseudo-random number generators.
  13910. _See also_:
  13911. *note RAND::, *note RANDOM_SEED::, *note RANDOM_NUMBER::
  13912. 
  13913. File: gfortran.info, Node: STAT, Next: STORAGE_SIZE, Prev: SRAND, Up: Intrinsic Procedures
  13914. 9.257 'STAT' -- Get file status
  13915. ===============================
  13916. _Description_:
  13917. This function returns information about a file. No permissions are
  13918. required on the file itself, but execute (search) permission is
  13919. required on all of the directories in path that lead to the file.
  13920. The elements that are obtained and stored in the array 'VALUES':
  13921. 'VALUES(1)' Device ID
  13922. 'VALUES(2)' Inode number
  13923. 'VALUES(3)' File mode
  13924. 'VALUES(4)' Number of links
  13925. 'VALUES(5)' Owner's uid
  13926. 'VALUES(6)' Owner's gid
  13927. 'VALUES(7)' ID of device containing directory entry for file
  13928. (0 if not available)
  13929. 'VALUES(8)' File size (bytes)
  13930. 'VALUES(9)' Last access time
  13931. 'VALUES(10)'Last modification time
  13932. 'VALUES(11)'Last file status change time
  13933. 'VALUES(12)'Preferred I/O block size (-1 if not available)
  13934. 'VALUES(13)'Number of blocks allocated (-1 if not available)
  13935. Not all these elements are relevant on all systems. If an element
  13936. is not relevant, it is returned as 0.
  13937. This intrinsic is provided in both subroutine and function forms;
  13938. however, only one form can be used in any given program unit.
  13939. _Standard_:
  13940. GNU extension
  13941. _Class_:
  13942. Subroutine, function
  13943. _Syntax_:
  13944. 'CALL STAT(NAME, VALUES [, STATUS])'
  13945. 'STATUS = STAT(NAME, VALUES)'
  13946. _Arguments_:
  13947. NAME The type shall be 'CHARACTER', of the default
  13948. kind and a valid path within the file system.
  13949. VALUES The type shall be 'INTEGER(4), DIMENSION(13)'.
  13950. STATUS (Optional) status flag of type 'INTEGER(4)'.
  13951. Returns 0 on success and a system specific error
  13952. code otherwise.
  13953. _Example_:
  13954. PROGRAM test_stat
  13955. INTEGER, DIMENSION(13) :: buff
  13956. INTEGER :: status
  13957. CALL STAT("/etc/passwd", buff, status)
  13958. IF (status == 0) THEN
  13959. WRITE (*, FMT="('Device ID:', T30, I19)") buff(1)
  13960. WRITE (*, FMT="('Inode number:', T30, I19)") buff(2)
  13961. WRITE (*, FMT="('File mode (octal):', T30, O19)") buff(3)
  13962. WRITE (*, FMT="('Number of links:', T30, I19)") buff(4)
  13963. WRITE (*, FMT="('Owner''s uid:', T30, I19)") buff(5)
  13964. WRITE (*, FMT="('Owner''s gid:', T30, I19)") buff(6)
  13965. WRITE (*, FMT="('Device where located:', T30, I19)") buff(7)
  13966. WRITE (*, FMT="('File size:', T30, I19)") buff(8)
  13967. WRITE (*, FMT="('Last access time:', T30, A19)") CTIME(buff(9))
  13968. WRITE (*, FMT="('Last modification time', T30, A19)") CTIME(buff(10))
  13969. WRITE (*, FMT="('Last status change time:', T30, A19)") CTIME(buff(11))
  13970. WRITE (*, FMT="('Preferred block size:', T30, I19)") buff(12)
  13971. WRITE (*, FMT="('No. of blocks allocated:', T30, I19)") buff(13)
  13972. END IF
  13973. END PROGRAM
  13974. _See also_:
  13975. To stat an open file: *note FSTAT::, to stat a link: *note LSTAT::
  13976. 
  13977. File: gfortran.info, Node: STORAGE_SIZE, Next: SUM, Prev: STAT, Up: Intrinsic Procedures
  13978. 9.258 'STORAGE_SIZE' -- Storage size in bits
  13979. ============================================
  13980. _Description_:
  13981. Returns the storage size of argument A in bits.
  13982. _Standard_:
  13983. Fortran 2008 and later
  13984. _Class_:
  13985. Inquiry function
  13986. _Syntax_:
  13987. 'RESULT = STORAGE_SIZE(A [, KIND])'
  13988. _Arguments_:
  13989. A Shall be a scalar or array of any type.
  13990. KIND (Optional) shall be a scalar integer constant
  13991. expression.
  13992. _Return Value_:
  13993. The result is a scalar integer with the kind type parameter
  13994. specified by KIND (or default integer type if KIND is missing).
  13995. The result value is the size expressed in bits for an element of an
  13996. array that has the dynamic type and type parameters of A.
  13997. _See also_:
  13998. *note C_SIZEOF::, *note SIZEOF::
  13999. 
  14000. File: gfortran.info, Node: SUM, Next: SYMLNK, Prev: STORAGE_SIZE, Up: Intrinsic Procedures
  14001. 9.259 'SUM' -- Sum of array elements
  14002. ====================================
  14003. _Description_:
  14004. Adds the elements of ARRAY along dimension DIM if the corresponding
  14005. element in MASK is 'TRUE'.
  14006. _Standard_:
  14007. Fortran 95 and later
  14008. _Class_:
  14009. Transformational function
  14010. _Syntax_:
  14011. 'RESULT = SUM(ARRAY[, MASK])'
  14012. 'RESULT = SUM(ARRAY, DIM[, MASK])'
  14013. _Arguments_:
  14014. ARRAY Shall be an array of type 'INTEGER', 'REAL' or
  14015. 'COMPLEX'.
  14016. DIM (Optional) shall be a scalar of type 'INTEGER'
  14017. with a value in the range from 1 to n, where n
  14018. equals the rank of ARRAY.
  14019. MASK (Optional) shall be of type 'LOGICAL' and either
  14020. be a scalar or an array of the same shape as
  14021. ARRAY.
  14022. _Return value_:
  14023. The result is of the same type as ARRAY.
  14024. If DIM is absent, a scalar with the sum of all elements in ARRAY is
  14025. returned. Otherwise, an array of rank n-1, where n equals the rank
  14026. of ARRAY, and a shape similar to that of ARRAY with dimension DIM
  14027. dropped is returned.
  14028. _Example_:
  14029. PROGRAM test_sum
  14030. INTEGER :: x(5) = (/ 1, 2, 3, 4 ,5 /)
  14031. print *, SUM(x) ! all elements, sum = 15
  14032. print *, SUM(x, MASK=MOD(x, 2)==1) ! odd elements, sum = 9
  14033. END PROGRAM
  14034. _See also_:
  14035. *note PRODUCT::
  14036. 
  14037. File: gfortran.info, Node: SYMLNK, Next: SYSTEM, Prev: SUM, Up: Intrinsic Procedures
  14038. 9.260 'SYMLNK' -- Create a symbolic link
  14039. ========================================
  14040. _Description_:
  14041. Makes a symbolic link from file PATH1 to PATH2. A null character
  14042. ('CHAR(0)') can be used to mark the end of the names in PATH1 and
  14043. PATH2; otherwise, trailing blanks in the file names are ignored.
  14044. If the STATUS argument is supplied, it contains 0 on success or a
  14045. nonzero error code upon return; see 'symlink(2)'. If the system
  14046. does not supply 'symlink(2)', 'ENOSYS' is returned.
  14047. This intrinsic is provided in both subroutine and function forms;
  14048. however, only one form can be used in any given program unit.
  14049. _Standard_:
  14050. GNU extension
  14051. _Class_:
  14052. Subroutine, function
  14053. _Syntax_:
  14054. 'CALL SYMLNK(PATH1, PATH2 [, STATUS])'
  14055. 'STATUS = SYMLNK(PATH1, PATH2)'
  14056. _Arguments_:
  14057. PATH1 Shall be of default 'CHARACTER' type.
  14058. PATH2 Shall be of default 'CHARACTER' type.
  14059. STATUS (Optional) Shall be of default 'INTEGER' type.
  14060. _See also_:
  14061. *note LINK::, *note UNLINK::
  14062. 
  14063. File: gfortran.info, Node: SYSTEM, Next: SYSTEM_CLOCK, Prev: SYMLNK, Up: Intrinsic Procedures
  14064. 9.261 'SYSTEM' -- Execute a shell command
  14065. =========================================
  14066. _Description_:
  14067. Passes the command COMMAND to a shell (see 'system(3)'). If
  14068. argument STATUS is present, it contains the value returned by
  14069. 'system(3)', which is presumably 0 if the shell command succeeded.
  14070. Note that which shell is used to invoke the command is
  14071. system-dependent and environment-dependent.
  14072. This intrinsic is provided in both subroutine and function forms;
  14073. however, only one form can be used in any given program unit.
  14074. Note that the 'system' function need not be thread-safe. It is the
  14075. responsibility of the user to ensure that 'system' is not called
  14076. concurrently.
  14077. _Standard_:
  14078. GNU extension
  14079. _Class_:
  14080. Subroutine, function
  14081. _Syntax_:
  14082. 'CALL SYSTEM(COMMAND [, STATUS])'
  14083. 'STATUS = SYSTEM(COMMAND)'
  14084. _Arguments_:
  14085. COMMAND Shall be of default 'CHARACTER' type.
  14086. STATUS (Optional) Shall be of default 'INTEGER' type.
  14087. _See also_:
  14088. *note EXECUTE_COMMAND_LINE::, which is part of the Fortran 2008
  14089. standard and should considered in new code for future portability.
  14090. 
  14091. File: gfortran.info, Node: SYSTEM_CLOCK, Next: TAN, Prev: SYSTEM, Up: Intrinsic Procedures
  14092. 9.262 'SYSTEM_CLOCK' -- Time function
  14093. =====================================
  14094. _Description_:
  14095. Determines the COUNT of a processor clock since an unspecified time
  14096. in the past modulo COUNT_MAX, COUNT_RATE determines the number of
  14097. clock ticks per second. If the platform supports a monotonic
  14098. clock, that clock is used and can, depending on the platform clock
  14099. implementation, provide up to nanosecond resolution. If a
  14100. monotonic clock is not available, the implementation falls back to
  14101. a realtime clock.
  14102. COUNT_RATE is system dependent and can vary depending on the kind
  14103. of the arguments. For KIND=4 arguments (and smaller integer
  14104. kinds), COUNT represents milliseconds, while for KIND=8 arguments
  14105. (and larger integer kinds), COUNT typically represents micro- or
  14106. nanoseconds depending on resolution of the underlying platform
  14107. clock. COUNT_MAX usually equals 'HUGE(COUNT_MAX)'. Note that the
  14108. millisecond resolution of the KIND=4 version implies that the COUNT
  14109. will wrap around in roughly 25 days. In order to avoid issues with
  14110. the wrap around and for more precise timing, please use the KIND=8
  14111. version.
  14112. If there is no clock, or querying the clock fails, COUNT is set to
  14113. '-HUGE(COUNT)', and COUNT_RATE and COUNT_MAX are set to zero.
  14114. When running on a platform using the GNU C library (glibc) version
  14115. 2.16 or older, or a derivative thereof, the high resolution
  14116. monotonic clock is available only when linking with the RT library.
  14117. This can be done explicitly by adding the '-lrt' flag when linking
  14118. the application, but is also done implicitly when using OpenMP.
  14119. On the Windows platform, the version with KIND=4 arguments uses the
  14120. 'GetTickCount' function, whereas the KIND=8 version uses
  14121. 'QueryPerformanceCounter' and 'QueryPerformanceCounterFrequency'.
  14122. For more information, and potential caveats, please see the
  14123. platform documentation.
  14124. _Standard_:
  14125. Fortran 95 and later
  14126. _Class_:
  14127. Subroutine
  14128. _Syntax_:
  14129. 'CALL SYSTEM_CLOCK([COUNT, COUNT_RATE, COUNT_MAX])'
  14130. _Arguments_:
  14131. COUNT (Optional) shall be a scalar of type 'INTEGER'
  14132. with 'INTENT(OUT)'.
  14133. COUNT_RATE (Optional) shall be a scalar of type 'INTEGER'
  14134. or 'REAL', with 'INTENT(OUT)'.
  14135. COUNT_MAX (Optional) shall be a scalar of type 'INTEGER'
  14136. with 'INTENT(OUT)'.
  14137. _Example_:
  14138. PROGRAM test_system_clock
  14139. INTEGER :: count, count_rate, count_max
  14140. CALL SYSTEM_CLOCK(count, count_rate, count_max)
  14141. WRITE(*,*) count, count_rate, count_max
  14142. END PROGRAM
  14143. _See also_:
  14144. *note DATE_AND_TIME::, *note CPU_TIME::
  14145. 
  14146. File: gfortran.info, Node: TAN, Next: TAND, Prev: SYSTEM_CLOCK, Up: Intrinsic Procedures
  14147. 9.263 'TAN' -- Tangent function
  14148. ===============================
  14149. _Description_:
  14150. 'TAN(X)' computes the tangent of X.
  14151. _Standard_:
  14152. Fortran 77 and later, for a complex argument Fortran 2008 or later
  14153. _Class_:
  14154. Elemental function
  14155. _Syntax_:
  14156. 'RESULT = TAN(X)'
  14157. _Arguments_:
  14158. X The type shall be 'REAL' or 'COMPLEX'.
  14159. _Return value_:
  14160. The return value has same type and kind as X, and its value is in
  14161. radians.
  14162. _Example_:
  14163. program test_tan
  14164. real(8) :: x = 0.165_8
  14165. x = tan(x)
  14166. end program test_tan
  14167. _Specific names_:
  14168. Name Argument Return type Standard
  14169. 'TAN(X)' 'REAL(4) X' 'REAL(4)' Fortran 95 and
  14170. later
  14171. 'DTAN(X)' 'REAL(8) X' 'REAL(8)' Fortran 95 and
  14172. later
  14173. _See also_:
  14174. Inverse function: *note ATAN:: Degrees function: *note TAND::
  14175. 
  14176. File: gfortran.info, Node: TAND, Next: TANH, Prev: TAN, Up: Intrinsic Procedures
  14177. 9.264 'TAND' -- Tangent function, degrees
  14178. =========================================
  14179. _Description_:
  14180. 'TAND(X)' computes the tangent of X in degrees.
  14181. This function is for compatibility only and should be avoided in
  14182. favor of standard constructs wherever possible.
  14183. _Standard_:
  14184. GNU Extension, enabled with '-fdec-math'.
  14185. _Class_:
  14186. Elemental function
  14187. _Syntax_:
  14188. 'RESULT = TAND(X)'
  14189. _Arguments_:
  14190. X The type shall be 'REAL' or 'COMPLEX'.
  14191. _Return value_:
  14192. The return value has same type and kind as X, and its value is in
  14193. degrees.
  14194. _Example_:
  14195. program test_tand
  14196. real(8) :: x = 0.165_8
  14197. x = tand(x)
  14198. end program test_tand
  14199. _Specific names_:
  14200. Name Argument Return type Standard
  14201. 'TAND(X)' 'REAL(4) X' 'REAL(4)' GNU Extension
  14202. 'DTAND(X)' 'REAL(8) X' 'REAL(8)' GNU Extension
  14203. _See also_:
  14204. Inverse function: *note ATAND:: Radians function: *note TAN::
  14205. 
  14206. File: gfortran.info, Node: TANH, Next: THIS_IMAGE, Prev: TAND, Up: Intrinsic Procedures
  14207. 9.265 'TANH' -- Hyperbolic tangent function
  14208. ===========================================
  14209. _Description_:
  14210. 'TANH(X)' computes the hyperbolic tangent of X.
  14211. _Standard_:
  14212. Fortran 77 and later, for a complex argument Fortran 2008 or later
  14213. _Class_:
  14214. Elemental function
  14215. _Syntax_:
  14216. 'X = TANH(X)'
  14217. _Arguments_:
  14218. X The type shall be 'REAL' or 'COMPLEX'.
  14219. _Return value_:
  14220. The return value has same type and kind as X. If X is complex, the
  14221. imaginary part of the result is in radians. If X is 'REAL', the
  14222. return value lies in the range - 1 \leq tanh(x) \leq 1 .
  14223. _Example_:
  14224. program test_tanh
  14225. real(8) :: x = 2.1_8
  14226. x = tanh(x)
  14227. end program test_tanh
  14228. _Specific names_:
  14229. Name Argument Return type Standard
  14230. 'TANH(X)' 'REAL(4) X' 'REAL(4)' Fortran 95 and
  14231. later
  14232. 'DTANH(X)' 'REAL(8) X' 'REAL(8)' Fortran 95 and
  14233. later
  14234. _See also_:
  14235. *note ATANH::
  14236. 
  14237. File: gfortran.info, Node: THIS_IMAGE, Next: TIME, Prev: TANH, Up: Intrinsic Procedures
  14238. 9.266 'THIS_IMAGE' -- Function that returns the cosubscript index of this image
  14239. ===============================================================================
  14240. _Description_:
  14241. Returns the cosubscript for this image.
  14242. _Standard_:
  14243. Fortran 2008 and later. With DISTANCE argument, Technical
  14244. Specification (TS) 18508 or later
  14245. _Class_:
  14246. Transformational function
  14247. _Syntax_:
  14248. 'RESULT = THIS_IMAGE()'
  14249. 'RESULT = THIS_IMAGE(DISTANCE)'
  14250. 'RESULT = THIS_IMAGE(COARRAY [, DIM])'
  14251. _Arguments_:
  14252. DISTANCE (optional, intent(in)) Nonnegative scalar
  14253. integer (not permitted together with COARRAY).
  14254. COARRAY Coarray of any type (optional; if DIM present,
  14255. required).
  14256. DIM default integer scalar (optional). If present,
  14257. DIM shall be between one and the corank of
  14258. COARRAY.
  14259. _Return value_:
  14260. Default integer. If COARRAY is not present, it is scalar; if
  14261. DISTANCE is not present or has value 0, its value is the image
  14262. index on the invoking image for the current team, for values
  14263. smaller or equal distance to the initial team, it returns the image
  14264. index on the ancestor team which has a distance of DISTANCE from
  14265. the invoking team. If DISTANCE is larger than the distance to the
  14266. initial team, the image index of the initial team is returned.
  14267. Otherwise when the COARRAY is present, if DIM is not present, a
  14268. rank-1 array with corank elements is returned, containing the
  14269. cosubscripts for COARRAY specifying the invoking image. If DIM is
  14270. present, a scalar is returned, with the value of the DIM element of
  14271. 'THIS_IMAGE(COARRAY)'.
  14272. _Example_:
  14273. INTEGER :: value[*]
  14274. INTEGER :: i
  14275. value = THIS_IMAGE()
  14276. SYNC ALL
  14277. IF (THIS_IMAGE() == 1) THEN
  14278. DO i = 1, NUM_IMAGES()
  14279. WRITE(*,'(2(a,i0))') 'value[', i, '] is ', value[i]
  14280. END DO
  14281. END IF
  14282. ! Check whether the current image is the initial image
  14283. IF (THIS_IMAGE(HUGE(1)) /= THIS_IMAGE())
  14284. error stop "something is rotten here"
  14285. _See also_:
  14286. *note NUM_IMAGES::, *note IMAGE_INDEX::
  14287. 
  14288. File: gfortran.info, Node: TIME, Next: TIME8, Prev: THIS_IMAGE, Up: Intrinsic Procedures
  14289. 9.267 'TIME' -- Time function
  14290. =============================
  14291. _Description_:
  14292. Returns the current time encoded as an integer (in the manner of
  14293. the function 'time(3)' in the C standard library). This value is
  14294. suitable for passing to *note CTIME::, *note GMTIME::, and *note
  14295. LTIME::.
  14296. This intrinsic is not fully portable, such as to systems with
  14297. 32-bit 'INTEGER' types but supporting times wider than 32 bits.
  14298. Therefore, the values returned by this intrinsic might be, or
  14299. become, negative, or numerically less than previous values, during
  14300. a single run of the compiled program.
  14301. See *note TIME8::, for information on a similar intrinsic that
  14302. might be portable to more GNU Fortran implementations, though to
  14303. fewer Fortran compilers.
  14304. _Standard_:
  14305. GNU extension
  14306. _Class_:
  14307. Function
  14308. _Syntax_:
  14309. 'RESULT = TIME()'
  14310. _Return value_:
  14311. The return value is a scalar of type 'INTEGER(4)'.
  14312. _See also_:
  14313. *note DATE_AND_TIME::, *note CTIME::, *note GMTIME::, *note
  14314. LTIME::, *note MCLOCK::, *note TIME8::
  14315. 
  14316. File: gfortran.info, Node: TIME8, Next: TINY, Prev: TIME, Up: Intrinsic Procedures
  14317. 9.268 'TIME8' -- Time function (64-bit)
  14318. =======================================
  14319. _Description_:
  14320. Returns the current time encoded as an integer (in the manner of
  14321. the function 'time(3)' in the C standard library). This value is
  14322. suitable for passing to *note CTIME::, *note GMTIME::, and *note
  14323. LTIME::.
  14324. _Warning:_ this intrinsic does not increase the range of the timing
  14325. values over that returned by 'time(3)'. On a system with a 32-bit
  14326. 'time(3)', 'TIME8' will return a 32-bit value, even though it is
  14327. converted to a 64-bit 'INTEGER(8)' value. That means overflows of
  14328. the 32-bit value can still occur. Therefore, the values returned
  14329. by this intrinsic might be or become negative or numerically less
  14330. than previous values during a single run of the compiled program.
  14331. _Standard_:
  14332. GNU extension
  14333. _Class_:
  14334. Function
  14335. _Syntax_:
  14336. 'RESULT = TIME8()'
  14337. _Return value_:
  14338. The return value is a scalar of type 'INTEGER(8)'.
  14339. _See also_:
  14340. *note DATE_AND_TIME::, *note CTIME::, *note GMTIME::, *note
  14341. LTIME::, *note MCLOCK8::, *note TIME::
  14342. 
  14343. File: gfortran.info, Node: TINY, Next: TRAILZ, Prev: TIME8, Up: Intrinsic Procedures
  14344. 9.269 'TINY' -- Smallest positive number of a real kind
  14345. =======================================================
  14346. _Description_:
  14347. 'TINY(X)' returns the smallest positive (non zero) number in the
  14348. model of the type of 'X'.
  14349. _Standard_:
  14350. Fortran 95 and later
  14351. _Class_:
  14352. Inquiry function
  14353. _Syntax_:
  14354. 'RESULT = TINY(X)'
  14355. _Arguments_:
  14356. X Shall be of type 'REAL'.
  14357. _Return value_:
  14358. The return value is of the same type and kind as X
  14359. _Example_:
  14360. See 'HUGE' for an example.
  14361. 
  14362. File: gfortran.info, Node: TRAILZ, Next: TRANSFER, Prev: TINY, Up: Intrinsic Procedures
  14363. 9.270 'TRAILZ' -- Number of trailing zero bits of an integer
  14364. ============================================================
  14365. _Description_:
  14366. 'TRAILZ' returns the number of trailing zero bits of an integer.
  14367. _Standard_:
  14368. Fortran 2008 and later
  14369. _Class_:
  14370. Elemental function
  14371. _Syntax_:
  14372. 'RESULT = TRAILZ(I)'
  14373. _Arguments_:
  14374. I Shall be of type 'INTEGER'.
  14375. _Return value_:
  14376. The type of the return value is the default 'INTEGER'. If all the
  14377. bits of 'I' are zero, the result value is 'BIT_SIZE(I)'.
  14378. _Example_:
  14379. PROGRAM test_trailz
  14380. WRITE (*,*) TRAILZ(8) ! prints 3
  14381. END PROGRAM
  14382. _See also_:
  14383. *note BIT_SIZE::, *note LEADZ::, *note POPPAR::, *note POPCNT::
  14384. 
  14385. File: gfortran.info, Node: TRANSFER, Next: TRANSPOSE, Prev: TRAILZ, Up: Intrinsic Procedures
  14386. 9.271 'TRANSFER' -- Transfer bit patterns
  14387. =========================================
  14388. _Description_:
  14389. Interprets the bitwise representation of SOURCE in memory as if it
  14390. is the representation of a variable or array of the same type and
  14391. type parameters as MOLD.
  14392. This is approximately equivalent to the C concept of _casting_ one
  14393. type to another.
  14394. _Standard_:
  14395. Fortran 95 and later
  14396. _Class_:
  14397. Transformational function
  14398. _Syntax_:
  14399. 'RESULT = TRANSFER(SOURCE, MOLD[, SIZE])'
  14400. _Arguments_:
  14401. SOURCE Shall be a scalar or an array of any type.
  14402. MOLD Shall be a scalar or an array of any type.
  14403. SIZE (Optional) shall be a scalar of type 'INTEGER'.
  14404. _Return value_:
  14405. The result has the same type as MOLD, with the bit level
  14406. representation of SOURCE. If SIZE is present, the result is a
  14407. one-dimensional array of length SIZE. If SIZE is absent but MOLD
  14408. is an array (of any size or shape), the result is a one-
  14409. dimensional array of the minimum length needed to contain the
  14410. entirety of the bitwise representation of SOURCE. If SIZE is
  14411. absent and MOLD is a scalar, the result is a scalar.
  14412. If the bitwise representation of the result is longer than that of
  14413. SOURCE, then the leading bits of the result correspond to those of
  14414. SOURCE and any trailing bits are filled arbitrarily.
  14415. When the resulting bit representation does not correspond to a
  14416. valid representation of a variable of the same type as MOLD, the
  14417. results are undefined, and subsequent operations on the result
  14418. cannot be guaranteed to produce sensible behavior. For example, it
  14419. is possible to create 'LOGICAL' variables for which 'VAR' and
  14420. '.NOT.VAR' both appear to be true.
  14421. _Example_:
  14422. PROGRAM test_transfer
  14423. integer :: x = 2143289344
  14424. print *, transfer(x, 1.0) ! prints "NaN" on i686
  14425. END PROGRAM
  14426. 
  14427. File: gfortran.info, Node: TRANSPOSE, Next: TRIM, Prev: TRANSFER, Up: Intrinsic Procedures
  14428. 9.272 'TRANSPOSE' -- Transpose an array of rank two
  14429. ===================================================
  14430. _Description_:
  14431. Transpose an array of rank two. Element (i, j) of the result has
  14432. the value 'MATRIX(j, i)', for all i, j.
  14433. _Standard_:
  14434. Fortran 95 and later
  14435. _Class_:
  14436. Transformational function
  14437. _Syntax_:
  14438. 'RESULT = TRANSPOSE(MATRIX)'
  14439. _Arguments_:
  14440. MATRIX Shall be an array of any type and have a rank of
  14441. two.
  14442. _Return value_:
  14443. The result has the same type as MATRIX, and has shape '(/ m, n /)'
  14444. if MATRIX has shape '(/ n, m /)'.
  14445. 
  14446. File: gfortran.info, Node: TRIM, Next: TTYNAM, Prev: TRANSPOSE, Up: Intrinsic Procedures
  14447. 9.273 'TRIM' -- Remove trailing blank characters of a string
  14448. ============================================================
  14449. _Description_:
  14450. Removes trailing blank characters of a string.
  14451. _Standard_:
  14452. Fortran 95 and later
  14453. _Class_:
  14454. Transformational function
  14455. _Syntax_:
  14456. 'RESULT = TRIM(STRING)'
  14457. _Arguments_:
  14458. STRING Shall be a scalar of type 'CHARACTER'.
  14459. _Return value_:
  14460. A scalar of type 'CHARACTER' which length is that of STRING less
  14461. the number of trailing blanks.
  14462. _Example_:
  14463. PROGRAM test_trim
  14464. CHARACTER(len=10), PARAMETER :: s = "GFORTRAN "
  14465. WRITE(*,*) LEN(s), LEN(TRIM(s)) ! "10 8", with/without trailing blanks
  14466. END PROGRAM
  14467. _See also_:
  14468. *note ADJUSTL::, *note ADJUSTR::
  14469. 
  14470. File: gfortran.info, Node: TTYNAM, Next: UBOUND, Prev: TRIM, Up: Intrinsic Procedures
  14471. 9.274 'TTYNAM' -- Get the name of a terminal device.
  14472. ====================================================
  14473. _Description_:
  14474. Get the name of a terminal device. For more information, see
  14475. 'ttyname(3)'.
  14476. This intrinsic is provided in both subroutine and function forms;
  14477. however, only one form can be used in any given program unit.
  14478. _Standard_:
  14479. GNU extension
  14480. _Class_:
  14481. Subroutine, function
  14482. _Syntax_:
  14483. 'CALL TTYNAM(UNIT, NAME)'
  14484. 'NAME = TTYNAM(UNIT)'
  14485. _Arguments_:
  14486. UNIT Shall be a scalar 'INTEGER'.
  14487. NAME Shall be of type 'CHARACTER'.
  14488. _Example_:
  14489. PROGRAM test_ttynam
  14490. INTEGER :: unit
  14491. DO unit = 1, 10
  14492. IF (isatty(unit=unit)) write(*,*) ttynam(unit)
  14493. END DO
  14494. END PROGRAM
  14495. _See also_:
  14496. *note ISATTY::
  14497. 
  14498. File: gfortran.info, Node: UBOUND, Next: UCOBOUND, Prev: TTYNAM, Up: Intrinsic Procedures
  14499. 9.275 'UBOUND' -- Upper dimension bounds of an array
  14500. ====================================================
  14501. _Description_:
  14502. Returns the upper bounds of an array, or a single upper bound along
  14503. the DIM dimension.
  14504. _Standard_:
  14505. Fortran 95 and later, with KIND argument Fortran 2003 and later
  14506. _Class_:
  14507. Inquiry function
  14508. _Syntax_:
  14509. 'RESULT = UBOUND(ARRAY [, DIM [, KIND]])'
  14510. _Arguments_:
  14511. ARRAY Shall be an array, of any type.
  14512. DIM (Optional) Shall be a scalar 'INTEGER'.
  14513. KIND (Optional) An 'INTEGER' initialization
  14514. expression indicating the kind parameter of the
  14515. result.
  14516. _Return value_:
  14517. The return value is of type 'INTEGER' and of kind KIND. If KIND is
  14518. absent, the return value is of default integer kind. If DIM is
  14519. absent, the result is an array of the upper bounds of ARRAY. If
  14520. DIM is present, the result is a scalar corresponding to the upper
  14521. bound of the array along that dimension. If ARRAY is an expression
  14522. rather than a whole array or array structure component, or if it
  14523. has a zero extent along the relevant dimension, the upper bound is
  14524. taken to be the number of elements along the relevant dimension.
  14525. _See also_:
  14526. *note LBOUND::, *note LCOBOUND::
  14527. 
  14528. File: gfortran.info, Node: UCOBOUND, Next: UMASK, Prev: UBOUND, Up: Intrinsic Procedures
  14529. 9.276 'UCOBOUND' -- Upper codimension bounds of an array
  14530. ========================================================
  14531. _Description_:
  14532. Returns the upper cobounds of a coarray, or a single upper cobound
  14533. along the DIM codimension.
  14534. _Standard_:
  14535. Fortran 2008 and later
  14536. _Class_:
  14537. Inquiry function
  14538. _Syntax_:
  14539. 'RESULT = UCOBOUND(COARRAY [, DIM [, KIND]])'
  14540. _Arguments_:
  14541. ARRAY Shall be an coarray, of any type.
  14542. DIM (Optional) Shall be a scalar 'INTEGER'.
  14543. KIND (Optional) An 'INTEGER' initialization
  14544. expression indicating the kind parameter of the
  14545. result.
  14546. _Return value_:
  14547. The return value is of type 'INTEGER' and of kind KIND. If KIND is
  14548. absent, the return value is of default integer kind. If DIM is
  14549. absent, the result is an array of the lower cobounds of COARRAY.
  14550. If DIM is present, the result is a scalar corresponding to the
  14551. lower cobound of the array along that codimension.
  14552. _See also_:
  14553. *note LCOBOUND::, *note LBOUND::
  14554. 
  14555. File: gfortran.info, Node: UMASK, Next: UNLINK, Prev: UCOBOUND, Up: Intrinsic Procedures
  14556. 9.277 'UMASK' -- Set the file creation mask
  14557. ===========================================
  14558. _Description_:
  14559. Sets the file creation mask to MASK. If called as a function, it
  14560. returns the old value. If called as a subroutine and argument OLD
  14561. if it is supplied, it is set to the old value. See 'umask(2)'.
  14562. _Standard_:
  14563. GNU extension
  14564. _Class_:
  14565. Subroutine, function
  14566. _Syntax_:
  14567. 'CALL UMASK(MASK [, OLD])'
  14568. 'OLD = UMASK(MASK)'
  14569. _Arguments_:
  14570. MASK Shall be a scalar of type 'INTEGER'.
  14571. OLD (Optional) Shall be a scalar of type 'INTEGER'.
  14572. 
  14573. File: gfortran.info, Node: UNLINK, Next: UNPACK, Prev: UMASK, Up: Intrinsic Procedures
  14574. 9.278 'UNLINK' -- Remove a file from the file system
  14575. ====================================================
  14576. _Description_:
  14577. Unlinks the file PATH. A null character ('CHAR(0)') can be used to
  14578. mark the end of the name in PATH; otherwise, trailing blanks in the
  14579. file name are ignored. If the STATUS argument is supplied, it
  14580. contains 0 on success or a nonzero error code upon return; see
  14581. 'unlink(2)'.
  14582. This intrinsic is provided in both subroutine and function forms;
  14583. however, only one form can be used in any given program unit.
  14584. _Standard_:
  14585. GNU extension
  14586. _Class_:
  14587. Subroutine, function
  14588. _Syntax_:
  14589. 'CALL UNLINK(PATH [, STATUS])'
  14590. 'STATUS = UNLINK(PATH)'
  14591. _Arguments_:
  14592. PATH Shall be of default 'CHARACTER' type.
  14593. STATUS (Optional) Shall be of default 'INTEGER' type.
  14594. _See also_:
  14595. *note LINK::, *note SYMLNK::
  14596. 
  14597. File: gfortran.info, Node: UNPACK, Next: VERIFY, Prev: UNLINK, Up: Intrinsic Procedures
  14598. 9.279 'UNPACK' -- Unpack an array of rank one into an array
  14599. ===========================================================
  14600. _Description_:
  14601. Store the elements of VECTOR in an array of higher rank.
  14602. _Standard_:
  14603. Fortran 95 and later
  14604. _Class_:
  14605. Transformational function
  14606. _Syntax_:
  14607. 'RESULT = UNPACK(VECTOR, MASK, FIELD)'
  14608. _Arguments_:
  14609. VECTOR Shall be an array of any type and rank one. It
  14610. shall have at least as many elements as MASK has
  14611. 'TRUE' values.
  14612. MASK Shall be an array of type 'LOGICAL'.
  14613. FIELD Shall be of the same type as VECTOR and have the
  14614. same shape as MASK.
  14615. _Return value_:
  14616. The resulting array corresponds to FIELD with 'TRUE' elements of
  14617. MASK replaced by values from VECTOR in array element order.
  14618. _Example_:
  14619. PROGRAM test_unpack
  14620. integer :: vector(2) = (/1,1/)
  14621. logical :: mask(4) = (/ .TRUE., .FALSE., .FALSE., .TRUE. /)
  14622. integer :: field(2,2) = 0, unity(2,2)
  14623. ! result: unity matrix
  14624. unity = unpack(vector, reshape(mask, (/2,2/)), field)
  14625. END PROGRAM
  14626. _See also_:
  14627. *note PACK::, *note SPREAD::
  14628. 
  14629. File: gfortran.info, Node: VERIFY, Next: XOR, Prev: UNPACK, Up: Intrinsic Procedures
  14630. 9.280 'VERIFY' -- Scan a string for characters not a given set
  14631. ==============================================================
  14632. _Description_:
  14633. Verifies that all the characters in STRING belong to the set of
  14634. characters in SET.
  14635. If BACK is either absent or equals 'FALSE', this function returns
  14636. the position of the leftmost character of STRING that is not in
  14637. SET. If BACK equals 'TRUE', the rightmost position is returned.
  14638. If all characters of STRING are found in SET, the result is zero.
  14639. _Standard_:
  14640. Fortran 95 and later, with KIND argument Fortran 2003 and later
  14641. _Class_:
  14642. Elemental function
  14643. _Syntax_:
  14644. 'RESULT = VERIFY(STRING, SET[, BACK [, KIND]])'
  14645. _Arguments_:
  14646. STRING Shall be of type 'CHARACTER'.
  14647. SET Shall be of type 'CHARACTER'.
  14648. BACK (Optional) shall be of type 'LOGICAL'.
  14649. KIND (Optional) An 'INTEGER' initialization
  14650. expression indicating the kind parameter of the
  14651. result.
  14652. _Return value_:
  14653. The return value is of type 'INTEGER' and of kind KIND. If KIND is
  14654. absent, the return value is of default integer kind.
  14655. _Example_:
  14656. PROGRAM test_verify
  14657. WRITE(*,*) VERIFY("FORTRAN", "AO") ! 1, found 'F'
  14658. WRITE(*,*) VERIFY("FORTRAN", "FOO") ! 3, found 'R'
  14659. WRITE(*,*) VERIFY("FORTRAN", "C++") ! 1, found 'F'
  14660. WRITE(*,*) VERIFY("FORTRAN", "C++", .TRUE.) ! 7, found 'N'
  14661. WRITE(*,*) VERIFY("FORTRAN", "FORTRAN") ! 0' found none
  14662. END PROGRAM
  14663. _See also_:
  14664. *note SCAN::, *note INDEX intrinsic::
  14665. 
  14666. File: gfortran.info, Node: XOR, Prev: VERIFY, Up: Intrinsic Procedures
  14667. 9.281 'XOR' -- Bitwise logical exclusive OR
  14668. ===========================================
  14669. _Description_:
  14670. Bitwise logical exclusive or.
  14671. This intrinsic routine is provided for backwards compatibility with
  14672. GNU Fortran 77. For integer arguments, programmers should consider
  14673. the use of the *note IEOR:: intrinsic and for logical arguments the
  14674. '.NEQV.' operator, which are both defined by the Fortran standard.
  14675. _Standard_:
  14676. GNU extension
  14677. _Class_:
  14678. Function
  14679. _Syntax_:
  14680. 'RESULT = XOR(I, J)'
  14681. _Arguments_:
  14682. I The type shall be either a scalar 'INTEGER' type
  14683. or a scalar 'LOGICAL' type.
  14684. J The type shall be the same as the type of I.
  14685. _Return value_:
  14686. The return type is either a scalar 'INTEGER' or a scalar 'LOGICAL'.
  14687. If the kind type parameters differ, then the smaller kind type is
  14688. implicitly converted to larger kind, and the return has the larger
  14689. kind.
  14690. _Example_:
  14691. PROGRAM test_xor
  14692. LOGICAL :: T = .TRUE., F = .FALSE.
  14693. INTEGER :: a, b
  14694. DATA a / Z'F' /, b / Z'3' /
  14695. WRITE (*,*) XOR(T, T), XOR(T, F), XOR(F, T), XOR(F, F)
  14696. WRITE (*,*) XOR(a, b)
  14697. END PROGRAM
  14698. _See also_:
  14699. Fortran 95 elemental function: *note IEOR::
  14700. 
  14701. File: gfortran.info, Node: Intrinsic Modules, Next: Contributing, Prev: Intrinsic Procedures, Up: Top
  14702. 10 Intrinsic Modules
  14703. ********************
  14704. * Menu:
  14705. * ISO_FORTRAN_ENV::
  14706. * ISO_C_BINDING::
  14707. * IEEE modules::
  14708. * OpenMP Modules OMP_LIB and OMP_LIB_KINDS::
  14709. * OpenACC Module OPENACC::
  14710. 
  14711. File: gfortran.info, Node: ISO_FORTRAN_ENV, Next: ISO_C_BINDING, Up: Intrinsic Modules
  14712. 10.1 'ISO_FORTRAN_ENV'
  14713. ======================
  14714. _Standard_:
  14715. Fortran 2003 and later, except when otherwise noted
  14716. The 'ISO_FORTRAN_ENV' module provides the following scalar
  14717. default-integer named constants:
  14718. 'ATOMIC_INT_KIND':
  14719. Default-kind integer constant to be used as kind parameter when
  14720. defining integer variables used in atomic operations. (Fortran
  14721. 2008 or later.)
  14722. 'ATOMIC_LOGICAL_KIND':
  14723. Default-kind integer constant to be used as kind parameter when
  14724. defining logical variables used in atomic operations. (Fortran
  14725. 2008 or later.)
  14726. 'CHARACTER_KINDS':
  14727. Default-kind integer constant array of rank one containing the
  14728. supported kind parameters of the 'CHARACTER' type. (Fortran 2008
  14729. or later.)
  14730. 'CHARACTER_STORAGE_SIZE':
  14731. Size in bits of the character storage unit.
  14732. 'ERROR_UNIT':
  14733. Identifies the preconnected unit used for error reporting.
  14734. 'FILE_STORAGE_SIZE':
  14735. Size in bits of the file-storage unit.
  14736. 'INPUT_UNIT':
  14737. Identifies the preconnected unit identified by the asterisk ('*')
  14738. in 'READ' statement.
  14739. 'INT8', 'INT16', 'INT32', 'INT64':
  14740. Kind type parameters to specify an INTEGER type with a storage size
  14741. of 16, 32, and 64 bits. It is negative if a target platform does
  14742. not support the particular kind. (Fortran 2008 or later.)
  14743. 'INTEGER_KINDS':
  14744. Default-kind integer constant array of rank one containing the
  14745. supported kind parameters of the 'INTEGER' type. (Fortran 2008 or
  14746. later.)
  14747. 'IOSTAT_END':
  14748. The value assigned to the variable passed to the 'IOSTAT='
  14749. specifier of an input/output statement if an end-of-file condition
  14750. occurred.
  14751. 'IOSTAT_EOR':
  14752. The value assigned to the variable passed to the 'IOSTAT='
  14753. specifier of an input/output statement if an end-of-record
  14754. condition occurred.
  14755. 'IOSTAT_INQUIRE_INTERNAL_UNIT':
  14756. Scalar default-integer constant, used by 'INQUIRE' for the
  14757. 'IOSTAT=' specifier to denote an that a unit number identifies an
  14758. internal unit. (Fortran 2008 or later.)
  14759. 'NUMERIC_STORAGE_SIZE':
  14760. The size in bits of the numeric storage unit.
  14761. 'LOGICAL_KINDS':
  14762. Default-kind integer constant array of rank one containing the
  14763. supported kind parameters of the 'LOGICAL' type. (Fortran 2008 or
  14764. later.)
  14765. 'OUTPUT_UNIT':
  14766. Identifies the preconnected unit identified by the asterisk ('*')
  14767. in 'WRITE' statement.
  14768. 'REAL32', 'REAL64', 'REAL128':
  14769. Kind type parameters to specify a REAL type with a storage size of
  14770. 32, 64, and 128 bits. It is negative if a target platform does not
  14771. support the particular kind. (Fortran 2008 or later.)
  14772. 'REAL_KINDS':
  14773. Default-kind integer constant array of rank one containing the
  14774. supported kind parameters of the 'REAL' type. (Fortran 2008 or
  14775. later.)
  14776. 'STAT_LOCKED':
  14777. Scalar default-integer constant used as STAT= return value by
  14778. 'LOCK' to denote that the lock variable is locked by the executing
  14779. image. (Fortran 2008 or later.)
  14780. 'STAT_LOCKED_OTHER_IMAGE':
  14781. Scalar default-integer constant used as STAT= return value by
  14782. 'UNLOCK' to denote that the lock variable is locked by another
  14783. image. (Fortran 2008 or later.)
  14784. 'STAT_STOPPED_IMAGE':
  14785. Positive, scalar default-integer constant used as STAT= return
  14786. value if the argument in the statement requires synchronisation
  14787. with an image, which has initiated the termination of the
  14788. execution. (Fortran 2008 or later.)
  14789. 'STAT_FAILED_IMAGE':
  14790. Positive, scalar default-integer constant used as STAT= return
  14791. value if the argument in the statement requires communication with
  14792. an image, which has is in the failed state. (TS 18508 or later.)
  14793. 'STAT_UNLOCKED':
  14794. Scalar default-integer constant used as STAT= return value by
  14795. 'UNLOCK' to denote that the lock variable is unlocked. (Fortran
  14796. 2008 or later.)
  14797. The module provides the following derived type:
  14798. 'LOCK_TYPE':
  14799. Derived type with private components to be use with the 'LOCK' and
  14800. 'UNLOCK' statement. A variable of its type has to be always
  14801. declared as coarray and may not appear in a variable-definition
  14802. context. (Fortran 2008 or later.)
  14803. The module also provides the following intrinsic procedures: *note
  14804. COMPILER_OPTIONS:: and *note COMPILER_VERSION::.
  14805. 
  14806. File: gfortran.info, Node: ISO_C_BINDING, Next: IEEE modules, Prev: ISO_FORTRAN_ENV, Up: Intrinsic Modules
  14807. 10.2 'ISO_C_BINDING'
  14808. ====================
  14809. _Standard_:
  14810. Fortran 2003 and later, GNU extensions
  14811. The following intrinsic procedures are provided by the module; their
  14812. definition can be found in the section Intrinsic Procedures of this
  14813. manual.
  14814. 'C_ASSOCIATED'
  14815. 'C_F_POINTER'
  14816. 'C_F_PROCPOINTER'
  14817. 'C_FUNLOC'
  14818. 'C_LOC'
  14819. 'C_SIZEOF'
  14820. The 'ISO_C_BINDING' module provides the following named constants of
  14821. type default integer, which can be used as KIND type parameters.
  14822. In addition to the integer named constants required by the Fortran
  14823. 2003 standard and 'C_PTRDIFF_T' of TS 29113, GNU Fortran provides as an
  14824. extension named constants for the 128-bit integer types supported by the
  14825. C compiler: 'C_INT128_T, C_INT_LEAST128_T, C_INT_FAST128_T'.
  14826. Furthermore, if '__float128' is supported in C, the named constants
  14827. 'C_FLOAT128, C_FLOAT128_COMPLEX' are defined.
  14828. Fortran Named constant C type Extension
  14829. Type
  14830. 'INTEGER' 'C_INT' 'int'
  14831. 'INTEGER' 'C_SHORT' 'short int'
  14832. 'INTEGER' 'C_LONG' 'long int'
  14833. 'INTEGER' 'C_LONG_LONG' 'long long int'
  14834. 'INTEGER' 'C_SIGNED_CHAR' 'signed char'/'unsigned
  14835. char'
  14836. 'INTEGER' 'C_SIZE_T' 'size_t'
  14837. 'INTEGER' 'C_INT8_T' 'int8_t'
  14838. 'INTEGER' 'C_INT16_T' 'int16_t'
  14839. 'INTEGER' 'C_INT32_T' 'int32_t'
  14840. 'INTEGER' 'C_INT64_T' 'int64_t'
  14841. 'INTEGER' 'C_INT128_T' 'int128_t' Ext.
  14842. 'INTEGER' 'C_INT_LEAST8_T' 'int_least8_t'
  14843. 'INTEGER' 'C_INT_LEAST16_T' 'int_least16_t'
  14844. 'INTEGER' 'C_INT_LEAST32_T' 'int_least32_t'
  14845. 'INTEGER' 'C_INT_LEAST64_T' 'int_least64_t'
  14846. 'INTEGER' 'C_INT_LEAST128_T' 'int_least128_t' Ext.
  14847. 'INTEGER' 'C_INT_FAST8_T' 'int_fast8_t'
  14848. 'INTEGER' 'C_INT_FAST16_T' 'int_fast16_t'
  14849. 'INTEGER' 'C_INT_FAST32_T' 'int_fast32_t'
  14850. 'INTEGER' 'C_INT_FAST64_T' 'int_fast64_t'
  14851. 'INTEGER' 'C_INT_FAST128_T' 'int_fast128_t' Ext.
  14852. 'INTEGER' 'C_INTMAX_T' 'intmax_t'
  14853. 'INTEGER' 'C_INTPTR_T' 'intptr_t'
  14854. 'INTEGER' 'C_PTRDIFF_T' 'ptrdiff_t' TS 29113
  14855. 'REAL' 'C_FLOAT' 'float'
  14856. 'REAL' 'C_DOUBLE' 'double'
  14857. 'REAL' 'C_LONG_DOUBLE' 'long double'
  14858. 'REAL' 'C_FLOAT128' '__float128' Ext.
  14859. 'COMPLEX' 'C_FLOAT_COMPLEX' 'float _Complex'
  14860. 'COMPLEX' 'C_DOUBLE_COMPLEX' 'double _Complex'
  14861. 'COMPLEX' 'C_LONG_DOUBLE_COMPLEX' 'long double _Complex'
  14862. 'REAL' 'C_FLOAT128_COMPLEX' '__float128 _Complex' Ext.
  14863. 'LOGICAL' 'C_BOOL' '_Bool'
  14864. 'CHARACTER' 'C_CHAR' 'char'
  14865. Additionally, the following parameters of type
  14866. 'CHARACTER(KIND=C_CHAR)' are defined.
  14867. Name C definition Value
  14868. 'C_NULL_CHAR' null character ''\0''
  14869. 'C_ALERT' alert ''\a''
  14870. 'C_BACKSPACE' backspace ''\b''
  14871. 'C_FORM_FEED' form feed ''\f''
  14872. 'C_NEW_LINE' new line ''\n''
  14873. 'C_CARRIAGE_RETURN'carriage return ''\r''
  14874. 'C_HORIZONTAL_TAB'horizontal tab ''\t''
  14875. 'C_VERTICAL_TAB'vertical tab ''\v''
  14876. Moreover, the following two named constants are defined:
  14877. Name Type
  14878. 'C_NULL_PTR' 'C_PTR'
  14879. 'C_NULL_FUNPTR''C_FUNPTR'
  14880. Both are equivalent to the value 'NULL' in C.
  14881. 
  14882. File: gfortran.info, Node: IEEE modules, Next: OpenMP Modules OMP_LIB and OMP_LIB_KINDS, Prev: ISO_C_BINDING, Up: Intrinsic Modules
  14883. 10.3 IEEE modules: 'IEEE_EXCEPTIONS', 'IEEE_ARITHMETIC', and 'IEEE_FEATURES'
  14884. ============================================================================
  14885. _Standard_:
  14886. Fortran 2003 and later
  14887. The 'IEEE_EXCEPTIONS', 'IEEE_ARITHMETIC', and 'IEEE_FEATURES'
  14888. intrinsic modules provide support for exceptions and IEEE arithmetic, as
  14889. defined in Fortran 2003 and later standards, and the IEC 60559:1989
  14890. standard (_Binary floating-point arithmetic for microprocessor
  14891. systems_). These modules are only provided on the following supported
  14892. platforms:
  14893. * i386 and x86_64 processors
  14894. * platforms which use the GNU C Library (glibc)
  14895. * platforms with support for SysV/386 routines for floating point
  14896. interface (including Solaris and BSDs)
  14897. * platforms with the AIX OS
  14898. For full compliance with the Fortran standards, code using the
  14899. 'IEEE_EXCEPTIONS' or 'IEEE_ARITHMETIC' modules should be compiled with
  14900. the following options: '-fno-unsafe-math-optimizations -frounding-math
  14901. -fsignaling-nans'.
  14902. 
  14903. File: gfortran.info, Node: OpenMP Modules OMP_LIB and OMP_LIB_KINDS, Next: OpenACC Module OPENACC, Prev: IEEE modules, Up: Intrinsic Modules
  14904. 10.4 OpenMP Modules 'OMP_LIB' and 'OMP_LIB_KINDS'
  14905. =================================================
  14906. _Standard_:
  14907. OpenMP Application Program Interface v4.5
  14908. The OpenMP Fortran runtime library routines are provided both in a
  14909. form of two Fortran 90 modules, named 'OMP_LIB' and 'OMP_LIB_KINDS', and
  14910. in a form of a Fortran 'include' file named 'omp_lib.h'. The procedures
  14911. provided by 'OMP_LIB' can be found in the *note Introduction:
  14912. (libgomp)Top. manual, the named constants defined in the modules are
  14913. listed below.
  14914. For details refer to the actual OpenMP Application Program Interface
  14915. v4.5 (http://www.openmp.org/wp-content/uploads/openmp-4.5.pdf).
  14916. 'OMP_LIB_KINDS' provides the following scalar default-integer named
  14917. constants:
  14918. 'omp_lock_kind'
  14919. 'omp_nest_lock_kind'
  14920. 'omp_proc_bind_kind'
  14921. 'omp_sched_kind'
  14922. 'OMP_LIB' provides the scalar default-integer named constant
  14923. 'openmp_version' with a value of the form YYYYMM, where 'yyyy' is the
  14924. year and MM the month of the OpenMP version; for OpenMP v4.5 the value
  14925. is '201511'.
  14926. The following scalar integer named constants of the kind
  14927. 'omp_sched_kind':
  14928. 'omp_sched_static'
  14929. 'omp_sched_dynamic'
  14930. 'omp_sched_guided'
  14931. 'omp_sched_auto'
  14932. And the following scalar integer named constants of the kind
  14933. 'omp_proc_bind_kind':
  14934. 'omp_proc_bind_false'
  14935. 'omp_proc_bind_true'
  14936. 'omp_proc_bind_master'
  14937. 'omp_proc_bind_close'
  14938. 'omp_proc_bind_spread'
  14939. 
  14940. File: gfortran.info, Node: OpenACC Module OPENACC, Prev: OpenMP Modules OMP_LIB and OMP_LIB_KINDS, Up: Intrinsic Modules
  14941. 10.5 OpenACC Module 'OPENACC'
  14942. =============================
  14943. _Standard_:
  14944. OpenACC Application Programming Interface v2.0
  14945. The OpenACC Fortran runtime library routines are provided both in a
  14946. form of a Fortran 90 module, named 'OPENACC', and in form of a Fortran
  14947. 'include' file named 'openacc_lib.h'. The procedures provided by
  14948. 'OPENACC' can be found in the *note Introduction: (libgomp)Top. manual,
  14949. the named constants defined in the modules are listed below.
  14950. For details refer to the actual OpenACC Application Programming
  14951. Interface v2.0 (http://www.openacc.org/).
  14952. 'OPENACC' provides the scalar default-integer named constant
  14953. 'openacc_version' with a value of the form YYYYMM, where 'yyyy' is the
  14954. year and MM the month of the OpenACC version; for OpenACC v2.0 the value
  14955. is '201306'.
  14956. 
  14957. File: gfortran.info, Node: Contributing, Next: Copying, Prev: Intrinsic Modules, Up: Top
  14958. Contributing
  14959. ************
  14960. Free software is only possible if people contribute to efforts to create
  14961. it. We're always in need of more people helping out with ideas and
  14962. comments, writing documentation and contributing code.
  14963. If you want to contribute to GNU Fortran, have a look at the long
  14964. lists of projects you can take on. Some of these projects are small,
  14965. some of them are large; some are completely orthogonal to the rest of
  14966. what is happening on GNU Fortran, but others are "mainstream" projects
  14967. in need of enthusiastic hackers. All of these projects are important!
  14968. We will eventually get around to the things here, but they are also
  14969. things doable by someone who is willing and able.
  14970. * Menu:
  14971. * Contributors::
  14972. * Projects::
  14973. * Proposed Extensions::
  14974. 
  14975. File: gfortran.info, Node: Contributors, Next: Projects, Up: Contributing
  14976. Contributors to GNU Fortran
  14977. ===========================
  14978. Most of the parser was hand-crafted by _Andy Vaught_, who is also the
  14979. initiator of the whole project. Thanks Andy! Most of the interface
  14980. with GCC was written by _Paul Brook_.
  14981. The following individuals have contributed code and/or ideas and
  14982. significant help to the GNU Fortran project (in alphabetical order):
  14983. - Janne Blomqvist
  14984. - Steven Bosscher
  14985. - Paul Brook
  14986. - Tobias Burnus
  14987. - Franc,ois-Xavier Coudert
  14988. - Bud Davis
  14989. - Jerry DeLisle
  14990. - Erik Edelmann
  14991. - Bernhard Fischer
  14992. - Daniel Franke
  14993. - Richard Guenther
  14994. - Richard Henderson
  14995. - Katherine Holcomb
  14996. - Jakub Jelinek
  14997. - Niels Kristian Bech Jensen
  14998. - Steven Johnson
  14999. - Steven G. Kargl
  15000. - Thomas Koenig
  15001. - Asher Langton
  15002. - H. J. Lu
  15003. - Toon Moene
  15004. - Brooks Moses
  15005. - Andrew Pinski
  15006. - Tim Prince
  15007. - Christopher D. Rickett
  15008. - Richard Sandiford
  15009. - Tobias Schlu"ter
  15010. - Roger Sayle
  15011. - Paul Thomas
  15012. - Andy Vaught
  15013. - Feng Wang
  15014. - Janus Weil
  15015. - Daniel Kraft
  15016. The following people have contributed bug reports, smaller or larger
  15017. patches, and much needed feedback and encouragement for the GNU Fortran
  15018. project:
  15019. - Bill Clodius
  15020. - Dominique d'Humie`res
  15021. - Kate Hedstrom
  15022. - Erik Schnetter
  15023. - Joost VandeVondele
  15024. Many other individuals have helped debug, test and improve the GNU
  15025. Fortran compiler over the past few years, and we welcome you to do the
  15026. same! If you already have done so, and you would like to see your name
  15027. listed in the list above, please contact us.
  15028. 
  15029. File: gfortran.info, Node: Projects, Next: Proposed Extensions, Prev: Contributors, Up: Contributing
  15030. Projects
  15031. ========
  15032. _Help build the test suite_
  15033. Solicit more code for donation to the test suite: the more
  15034. extensive the testsuite, the smaller the risk of breaking things in
  15035. the future! We can keep code private on request.
  15036. _Bug hunting/squishing_
  15037. Find bugs and write more test cases! Test cases are especially
  15038. very welcome, because it allows us to concentrate on fixing bugs
  15039. instead of isolating them. Going through the bugzilla database at
  15040. <https://gcc.gnu.org/bugzilla/> to reduce testcases posted there
  15041. and add more information (for example, for which version does the
  15042. testcase work, for which versions does it fail?) is also very
  15043. helpful.
  15044. 
  15045. File: gfortran.info, Node: Proposed Extensions, Prev: Projects, Up: Contributing
  15046. Proposed Extensions
  15047. ===================
  15048. Here's a list of proposed extensions for the GNU Fortran compiler, in no
  15049. particular order. Most of these are necessary to be fully compatible
  15050. with existing Fortran compilers, but they are not part of the official
  15051. J3 Fortran 95 standard.
  15052. Compiler extensions:
  15053. --------------------
  15054. * User-specified alignment rules for structures.
  15055. * Automatically extend single precision constants to double.
  15056. * Compile code that conserves memory by dynamically allocating common
  15057. and module storage either on stack or heap.
  15058. * Compile flag to generate code for array conformance checking
  15059. (suggest -CC).
  15060. * User control of symbol names (underscores, etc).
  15061. * Compile setting for maximum size of stack frame size before
  15062. spilling parts to static or heap.
  15063. * Flag to force local variables into static space.
  15064. * Flag to force local variables onto stack.
  15065. Environment Options
  15066. -------------------
  15067. * Pluggable library modules for random numbers, linear algebra. LA
  15068. should use BLAS calling conventions.
  15069. * Environment variables controlling actions on arithmetic exceptions
  15070. like overflow, underflow, precision loss--Generate NaN, abort,
  15071. default. action.
  15072. * Set precision for fp units that support it (i387).
  15073. * Variable for setting fp rounding mode.
  15074. * Variable to fill uninitialized variables with a user-defined bit
  15075. pattern.
  15076. * Environment variable controlling filename that is opened for that
  15077. unit number.
  15078. * Environment variable to clear/trash memory being freed.
  15079. * Environment variable to control tracing of allocations and frees.
  15080. * Environment variable to display allocated memory at normal program
  15081. end.
  15082. * Environment variable for filename for * IO-unit.
  15083. * Environment variable for temporary file directory.
  15084. * Environment variable forcing standard output to be line buffered
  15085. (Unix).
  15086. 
  15087. File: gfortran.info, Node: Copying, Next: GNU Free Documentation License, Prev: Contributing, Up: Top
  15088. GNU General Public License
  15089. **************************
  15090. Version 3, 29 June 2007
  15091. Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
  15092. Everyone is permitted to copy and distribute verbatim copies of this
  15093. license document, but changing it is not allowed.
  15094. Preamble
  15095. ========
  15096. The GNU General Public License is a free, copyleft license for software
  15097. and other kinds of works.
  15098. The licenses for most software and other practical works are designed
  15099. to take away your freedom to share and change the works. By contrast,
  15100. the GNU General Public License is intended to guarantee your freedom to
  15101. share and change all versions of a program-to make sure it remains free
  15102. software for all its users. We, the Free Software Foundation, use the
  15103. GNU General Public License for most of our software; it applies also to
  15104. any other work released this way by its authors. You can apply it to
  15105. your programs, too.
  15106. When we speak of free software, we are referring to freedom, not
  15107. price. Our General Public Licenses are designed to make sure that you
  15108. have the freedom to distribute copies of free software (and charge for
  15109. them if you wish), that you receive source code or can get it if you
  15110. want it, that you can change the software or use pieces of it in new
  15111. free programs, and that you know you can do these things.
  15112. To protect your rights, we need to prevent others from denying you
  15113. these rights or asking you to surrender the rights. Therefore, you have
  15114. certain responsibilities if you distribute copies of the software, or if
  15115. you modify it: responsibilities to respect the freedom of others.
  15116. For example, if you distribute copies of such a program, whether
  15117. gratis or for a fee, you must pass on to the recipients the same
  15118. freedoms that you received. You must make sure that they, too, receive
  15119. or can get the source code. And you must show them these terms so they
  15120. know their rights.
  15121. Developers that use the GNU GPL protect your rights with two steps:
  15122. (1) assert copyright on the software, and (2) offer you this License
  15123. giving you legal permission to copy, distribute and/or modify it.
  15124. For the developers' and authors' protection, the GPL clearly explains
  15125. that there is no warranty for this free software. For both users' and
  15126. authors' sake, the GPL requires that modified versions be marked as
  15127. changed, so that their problems will not be attributed erroneously to
  15128. authors of previous versions.
  15129. Some devices are designed to deny users access to install or run
  15130. modified versions of the software inside them, although the manufacturer
  15131. can do so. This is fundamentally incompatible with the aim of
  15132. protecting users' freedom to change the software. The systematic
  15133. pattern of such abuse occurs in the area of products for individuals to
  15134. use, which is precisely where it is most unacceptable. Therefore, we
  15135. have designed this version of the GPL to prohibit the practice for those
  15136. products. If such problems arise substantially in other domains, we
  15137. stand ready to extend this provision to those domains in future versions
  15138. of the GPL, as needed to protect the freedom of users.
  15139. Finally, every program is threatened constantly by software patents.
  15140. States should not allow patents to restrict development and use of
  15141. software on general-purpose computers, but in those that do, we wish to
  15142. avoid the special danger that patents applied to a free program could
  15143. make it effectively proprietary. To prevent this, the GPL assures that
  15144. patents cannot be used to render the program non-free.
  15145. The precise terms and conditions for copying, distribution and
  15146. modification follow.
  15147. TERMS AND CONDITIONS
  15148. ====================
  15149. 0. Definitions.
  15150. "This License" refers to version 3 of the GNU General Public
  15151. License.
  15152. "Copyright" also means copyright-like laws that apply to other
  15153. kinds of works, such as semiconductor masks.
  15154. "The Program" refers to any copyrightable work licensed under this
  15155. License. Each licensee is addressed as "you". "Licensees" and
  15156. "recipients" may be individuals or organizations.
  15157. To "modify" a work means to copy from or adapt all or part of the
  15158. work in a fashion requiring copyright permission, other than the
  15159. making of an exact copy. The resulting work is called a "modified
  15160. version" of the earlier work or a work "based on" the earlier work.
  15161. A "covered work" means either the unmodified Program or a work
  15162. based on the Program.
  15163. To "propagate" a work means to do anything with it that, without
  15164. permission, would make you directly or secondarily liable for
  15165. infringement under applicable copyright law, except executing it on
  15166. a computer or modifying a private copy. Propagation includes
  15167. copying, distribution (with or without modification), making
  15168. available to the public, and in some countries other activities as
  15169. well.
  15170. To "convey" a work means any kind of propagation that enables other
  15171. parties to make or receive copies. Mere interaction with a user
  15172. through a computer network, with no transfer of a copy, is not
  15173. conveying.
  15174. An interactive user interface displays "Appropriate Legal Notices"
  15175. to the extent that it includes a convenient and prominently visible
  15176. feature that (1) displays an appropriate copyright notice, and (2)
  15177. tells the user that there is no warranty for the work (except to
  15178. the extent that warranties are provided), that licensees may convey
  15179. the work under this License, and how to view a copy of this
  15180. License. If the interface presents a list of user commands or
  15181. options, such as a menu, a prominent item in the list meets this
  15182. criterion.
  15183. 1. Source Code.
  15184. The "source code" for a work means the preferred form of the work
  15185. for making modifications to it. "Object code" means any non-source
  15186. form of a work.
  15187. A "Standard Interface" means an interface that either is an
  15188. official standard defined by a recognized standards body, or, in
  15189. the case of interfaces specified for a particular programming
  15190. language, one that is widely used among developers working in that
  15191. language.
  15192. The "System Libraries" of an executable work include anything,
  15193. other than the work as a whole, that (a) is included in the normal
  15194. form of packaging a Major Component, but which is not part of that
  15195. Major Component, and (b) serves only to enable use of the work with
  15196. that Major Component, or to implement a Standard Interface for
  15197. which an implementation is available to the public in source code
  15198. form. A "Major Component", in this context, means a major
  15199. essential component (kernel, window system, and so on) of the
  15200. specific operating system (if any) on which the executable work
  15201. runs, or a compiler used to produce the work, or an object code
  15202. interpreter used to run it.
  15203. The "Corresponding Source" for a work in object code form means all
  15204. the source code needed to generate, install, and (for an executable
  15205. work) run the object code and to modify the work, including scripts
  15206. to control those activities. However, it does not include the
  15207. work's System Libraries, or general-purpose tools or generally
  15208. available free programs which are used unmodified in performing
  15209. those activities but which are not part of the work. For example,
  15210. Corresponding Source includes interface definition files associated
  15211. with source files for the work, and the source code for shared
  15212. libraries and dynamically linked subprograms that the work is
  15213. specifically designed to require, such as by intimate data
  15214. communication or control flow between those subprograms and other
  15215. parts of the work.
  15216. The Corresponding Source need not include anything that users can
  15217. regenerate automatically from other parts of the Corresponding
  15218. Source.
  15219. The Corresponding Source for a work in source code form is that
  15220. same work.
  15221. 2. Basic Permissions.
  15222. All rights granted under this License are granted for the term of
  15223. copyright on the Program, and are irrevocable provided the stated
  15224. conditions are met. This License explicitly affirms your unlimited
  15225. permission to run the unmodified Program. The output from running
  15226. a covered work is covered by this License only if the output, given
  15227. its content, constitutes a covered work. This License acknowledges
  15228. your rights of fair use or other equivalent, as provided by
  15229. copyright law.
  15230. You may make, run and propagate covered works that you do not
  15231. convey, without conditions so long as your license otherwise
  15232. remains in force. You may convey covered works to others for the
  15233. sole purpose of having them make modifications exclusively for you,
  15234. or provide you with facilities for running those works, provided
  15235. that you comply with the terms of this License in conveying all
  15236. material for which you do not control copyright. Those thus making
  15237. or running the covered works for you must do so exclusively on your
  15238. behalf, under your direction and control, on terms that prohibit
  15239. them from making any copies of your copyrighted material outside
  15240. their relationship with you.
  15241. Conveying under any other circumstances is permitted solely under
  15242. the conditions stated below. Sublicensing is not allowed; section
  15243. 10 makes it unnecessary.
  15244. 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
  15245. No covered work shall be deemed part of an effective technological
  15246. measure under any applicable law fulfilling obligations under
  15247. article 11 of the WIPO copyright treaty adopted on 20 December
  15248. 1996, or similar laws prohibiting or restricting circumvention of
  15249. such measures.
  15250. When you convey a covered work, you waive any legal power to forbid
  15251. circumvention of technological measures to the extent such
  15252. circumvention is effected by exercising rights under this License
  15253. with respect to the covered work, and you disclaim any intention to
  15254. limit operation or modification of the work as a means of
  15255. enforcing, against the work's users, your or third parties' legal
  15256. rights to forbid circumvention of technological measures.
  15257. 4. Conveying Verbatim Copies.
  15258. You may convey verbatim copies of the Program's source code as you
  15259. receive it, in any medium, provided that you conspicuously and
  15260. appropriately publish on each copy an appropriate copyright notice;
  15261. keep intact all notices stating that this License and any
  15262. non-permissive terms added in accord with section 7 apply to the
  15263. code; keep intact all notices of the absence of any warranty; and
  15264. give all recipients a copy of this License along with the Program.
  15265. You may charge any price or no price for each copy that you convey,
  15266. and you may offer support or warranty protection for a fee.
  15267. 5. Conveying Modified Source Versions.
  15268. You may convey a work based on the Program, or the modifications to
  15269. produce it from the Program, in the form of source code under the
  15270. terms of section 4, provided that you also meet all of these
  15271. conditions:
  15272. a. The work must carry prominent notices stating that you
  15273. modified it, and giving a relevant date.
  15274. b. The work must carry prominent notices stating that it is
  15275. released under this License and any conditions added under
  15276. section 7. This requirement modifies the requirement in
  15277. section 4 to "keep intact all notices".
  15278. c. You must license the entire work, as a whole, under this
  15279. License to anyone who comes into possession of a copy. This
  15280. License will therefore apply, along with any applicable
  15281. section 7 additional terms, to the whole of the work, and all
  15282. its parts, regardless of how they are packaged. This License
  15283. gives no permission to license the work in any other way, but
  15284. it does not invalidate such permission if you have separately
  15285. received it.
  15286. d. If the work has interactive user interfaces, each must display
  15287. Appropriate Legal Notices; however, if the Program has
  15288. interactive interfaces that do not display Appropriate Legal
  15289. Notices, your work need not make them do so.
  15290. A compilation of a covered work with other separate and independent
  15291. works, which are not by their nature extensions of the covered
  15292. work, and which are not combined with it such as to form a larger
  15293. program, in or on a volume of a storage or distribution medium, is
  15294. called an "aggregate" if the compilation and its resulting
  15295. copyright are not used to limit the access or legal rights of the
  15296. compilation's users beyond what the individual works permit.
  15297. Inclusion of a covered work in an aggregate does not cause this
  15298. License to apply to the other parts of the aggregate.
  15299. 6. Conveying Non-Source Forms.
  15300. You may convey a covered work in object code form under the terms
  15301. of sections 4 and 5, provided that you also convey the
  15302. machine-readable Corresponding Source under the terms of this
  15303. License, in one of these ways:
  15304. a. Convey the object code in, or embodied in, a physical product
  15305. (including a physical distribution medium), accompanied by the
  15306. Corresponding Source fixed on a durable physical medium
  15307. customarily used for software interchange.
  15308. b. Convey the object code in, or embodied in, a physical product
  15309. (including a physical distribution medium), accompanied by a
  15310. written offer, valid for at least three years and valid for as
  15311. long as you offer spare parts or customer support for that
  15312. product model, to give anyone who possesses the object code
  15313. either (1) a copy of the Corresponding Source for all the
  15314. software in the product that is covered by this License, on a
  15315. durable physical medium customarily used for software
  15316. interchange, for a price no more than your reasonable cost of
  15317. physically performing this conveying of source, or (2) access
  15318. to copy the Corresponding Source from a network server at no
  15319. charge.
  15320. c. Convey individual copies of the object code with a copy of the
  15321. written offer to provide the Corresponding Source. This
  15322. alternative is allowed only occasionally and noncommercially,
  15323. and only if you received the object code with such an offer,
  15324. in accord with subsection 6b.
  15325. d. Convey the object code by offering access from a designated
  15326. place (gratis or for a charge), and offer equivalent access to
  15327. the Corresponding Source in the same way through the same
  15328. place at no further charge. You need not require recipients
  15329. to copy the Corresponding Source along with the object code.
  15330. If the place to copy the object code is a network server, the
  15331. Corresponding Source may be on a different server (operated by
  15332. you or a third party) that supports equivalent copying
  15333. facilities, provided you maintain clear directions next to the
  15334. object code saying where to find the Corresponding Source.
  15335. Regardless of what server hosts the Corresponding Source, you
  15336. remain obligated to ensure that it is available for as long as
  15337. needed to satisfy these requirements.
  15338. e. Convey the object code using peer-to-peer transmission,
  15339. provided you inform other peers where the object code and
  15340. Corresponding Source of the work are being offered to the
  15341. general public at no charge under subsection 6d.
  15342. A separable portion of the object code, whose source code is
  15343. excluded from the Corresponding Source as a System Library, need
  15344. not be included in conveying the object code work.
  15345. A "User Product" is either (1) a "consumer product", which means
  15346. any tangible personal property which is normally used for personal,
  15347. family, or household purposes, or (2) anything designed or sold for
  15348. incorporation into a dwelling. In determining whether a product is
  15349. a consumer product, doubtful cases shall be resolved in favor of
  15350. coverage. For a particular product received by a particular user,
  15351. "normally used" refers to a typical or common use of that class of
  15352. product, regardless of the status of the particular user or of the
  15353. way in which the particular user actually uses, or expects or is
  15354. expected to use, the product. A product is a consumer product
  15355. regardless of whether the product has substantial commercial,
  15356. industrial or non-consumer uses, unless such uses represent the
  15357. only significant mode of use of the product.
  15358. "Installation Information" for a User Product means any methods,
  15359. procedures, authorization keys, or other information required to
  15360. install and execute modified versions of a covered work in that
  15361. User Product from a modified version of its Corresponding Source.
  15362. The information must suffice to ensure that the continued
  15363. functioning of the modified object code is in no case prevented or
  15364. interfered with solely because modification has been made.
  15365. If you convey an object code work under this section in, or with,
  15366. or specifically for use in, a User Product, and the conveying
  15367. occurs as part of a transaction in which the right of possession
  15368. and use of the User Product is transferred to the recipient in
  15369. perpetuity or for a fixed term (regardless of how the transaction
  15370. is characterized), the Corresponding Source conveyed under this
  15371. section must be accompanied by the Installation Information. But
  15372. this requirement does not apply if neither you nor any third party
  15373. retains the ability to install modified object code on the User
  15374. Product (for example, the work has been installed in ROM).
  15375. The requirement to provide Installation Information does not
  15376. include a requirement to continue to provide support service,
  15377. warranty, or updates for a work that has been modified or installed
  15378. by the recipient, or for the User Product in which it has been
  15379. modified or installed. Access to a network may be denied when the
  15380. modification itself materially and adversely affects the operation
  15381. of the network or violates the rules and protocols for
  15382. communication across the network.
  15383. Corresponding Source conveyed, and Installation Information
  15384. provided, in accord with this section must be in a format that is
  15385. publicly documented (and with an implementation available to the
  15386. public in source code form), and must require no special password
  15387. or key for unpacking, reading or copying.
  15388. 7. Additional Terms.
  15389. "Additional permissions" are terms that supplement the terms of
  15390. this License by making exceptions from one or more of its
  15391. conditions. Additional permissions that are applicable to the
  15392. entire Program shall be treated as though they were included in
  15393. this License, to the extent that they are valid under applicable
  15394. law. If additional permissions apply only to part of the Program,
  15395. that part may be used separately under those permissions, but the
  15396. entire Program remains governed by this License without regard to
  15397. the additional permissions.
  15398. When you convey a copy of a covered work, you may at your option
  15399. remove any additional permissions from that copy, or from any part
  15400. of it. (Additional permissions may be written to require their own
  15401. removal in certain cases when you modify the work.) You may place
  15402. additional permissions on material, added by you to a covered work,
  15403. for which you have or can give appropriate copyright permission.
  15404. Notwithstanding any other provision of this License, for material
  15405. you add to a covered work, you may (if authorized by the copyright
  15406. holders of that material) supplement the terms of this License with
  15407. terms:
  15408. a. Disclaiming warranty or limiting liability differently from
  15409. the terms of sections 15 and 16 of this License; or
  15410. b. Requiring preservation of specified reasonable legal notices
  15411. or author attributions in that material or in the Appropriate
  15412. Legal Notices displayed by works containing it; or
  15413. c. Prohibiting misrepresentation of the origin of that material,
  15414. or requiring that modified versions of such material be marked
  15415. in reasonable ways as different from the original version; or
  15416. d. Limiting the use for publicity purposes of names of licensors
  15417. or authors of the material; or
  15418. e. Declining to grant rights under trademark law for use of some
  15419. trade names, trademarks, or service marks; or
  15420. f. Requiring indemnification of licensors and authors of that
  15421. material by anyone who conveys the material (or modified
  15422. versions of it) with contractual assumptions of liability to
  15423. the recipient, for any liability that these contractual
  15424. assumptions directly impose on those licensors and authors.
  15425. All other non-permissive additional terms are considered "further
  15426. restrictions" within the meaning of section 10. If the Program as
  15427. you received it, or any part of it, contains a notice stating that
  15428. it is governed by this License along with a term that is a further
  15429. restriction, you may remove that term. If a license document
  15430. contains a further restriction but permits relicensing or conveying
  15431. under this License, you may add to a covered work material governed
  15432. by the terms of that license document, provided that the further
  15433. restriction does not survive such relicensing or conveying.
  15434. If you add terms to a covered work in accord with this section, you
  15435. must place, in the relevant source files, a statement of the
  15436. additional terms that apply to those files, or a notice indicating
  15437. where to find the applicable terms.
  15438. Additional terms, permissive or non-permissive, may be stated in
  15439. the form of a separately written license, or stated as exceptions;
  15440. the above requirements apply either way.
  15441. 8. Termination.
  15442. You may not propagate or modify a covered work except as expressly
  15443. provided under this License. Any attempt otherwise to propagate or
  15444. modify it is void, and will automatically terminate your rights
  15445. under this License (including any patent licenses granted under the
  15446. third paragraph of section 11).
  15447. However, if you cease all violation of this License, then your
  15448. license from a particular copyright holder is reinstated (a)
  15449. provisionally, unless and until the copyright holder explicitly and
  15450. finally terminates your license, and (b) permanently, if the
  15451. copyright holder fails to notify you of the violation by some
  15452. reasonable means prior to 60 days after the cessation.
  15453. Moreover, your license from a particular copyright holder is
  15454. reinstated permanently if the copyright holder notifies you of the
  15455. violation by some reasonable means, this is the first time you have
  15456. received notice of violation of this License (for any work) from
  15457. that copyright holder, and you cure the violation prior to 30 days
  15458. after your receipt of the notice.
  15459. Termination of your rights under this section does not terminate
  15460. the licenses of parties who have received copies or rights from you
  15461. under this License. If your rights have been terminated and not
  15462. permanently reinstated, you do not qualify to receive new licenses
  15463. for the same material under section 10.
  15464. 9. Acceptance Not Required for Having Copies.
  15465. You are not required to accept this License in order to receive or
  15466. run a copy of the Program. Ancillary propagation of a covered work
  15467. occurring solely as a consequence of using peer-to-peer
  15468. transmission to receive a copy likewise does not require
  15469. acceptance. However, nothing other than this License grants you
  15470. permission to propagate or modify any covered work. These actions
  15471. infringe copyright if you do not accept this License. Therefore,
  15472. by modifying or propagating a covered work, you indicate your
  15473. acceptance of this License to do so.
  15474. 10. Automatic Licensing of Downstream Recipients.
  15475. Each time you convey a covered work, the recipient automatically
  15476. receives a license from the original licensors, to run, modify and
  15477. propagate that work, subject to this License. You are not
  15478. responsible for enforcing compliance by third parties with this
  15479. License.
  15480. An "entity transaction" is a transaction transferring control of an
  15481. organization, or substantially all assets of one, or subdividing an
  15482. organization, or merging organizations. If propagation of a
  15483. covered work results from an entity transaction, each party to that
  15484. transaction who receives a copy of the work also receives whatever
  15485. licenses to the work the party's predecessor in interest had or
  15486. could give under the previous paragraph, plus a right to possession
  15487. of the Corresponding Source of the work from the predecessor in
  15488. interest, if the predecessor has it or can get it with reasonable
  15489. efforts.
  15490. You may not impose any further restrictions on the exercise of the
  15491. rights granted or affirmed under this License. For example, you
  15492. may not impose a license fee, royalty, or other charge for exercise
  15493. of rights granted under this License, and you may not initiate
  15494. litigation (including a cross-claim or counterclaim in a lawsuit)
  15495. alleging that any patent claim is infringed by making, using,
  15496. selling, offering for sale, or importing the Program or any portion
  15497. of it.
  15498. 11. Patents.
  15499. A "contributor" is a copyright holder who authorizes use under this
  15500. License of the Program or a work on which the Program is based.
  15501. The work thus licensed is called the contributor's "contributor
  15502. version".
  15503. A contributor's "essential patent claims" are all patent claims
  15504. owned or controlled by the contributor, whether already acquired or
  15505. hereafter acquired, that would be infringed by some manner,
  15506. permitted by this License, of making, using, or selling its
  15507. contributor version, but do not include claims that would be
  15508. infringed only as a consequence of further modification of the
  15509. contributor version. For purposes of this definition, "control"
  15510. includes the right to grant patent sublicenses in a manner
  15511. consistent with the requirements of this License.
  15512. Each contributor grants you a non-exclusive, worldwide,
  15513. royalty-free patent license under the contributor's essential
  15514. patent claims, to make, use, sell, offer for sale, import and
  15515. otherwise run, modify and propagate the contents of its contributor
  15516. version.
  15517. In the following three paragraphs, a "patent license" is any
  15518. express agreement or commitment, however denominated, not to
  15519. enforce a patent (such as an express permission to practice a
  15520. patent or covenant not to sue for patent infringement). To "grant"
  15521. such a patent license to a party means to make such an agreement or
  15522. commitment not to enforce a patent against the party.
  15523. If you convey a covered work, knowingly relying on a patent
  15524. license, and the Corresponding Source of the work is not available
  15525. for anyone to copy, free of charge and under the terms of this
  15526. License, through a publicly available network server or other
  15527. readily accessible means, then you must either (1) cause the
  15528. Corresponding Source to be so available, or (2) arrange to deprive
  15529. yourself of the benefit of the patent license for this particular
  15530. work, or (3) arrange, in a manner consistent with the requirements
  15531. of this License, to extend the patent license to downstream
  15532. recipients. "Knowingly relying" means you have actual knowledge
  15533. that, but for the patent license, your conveying the covered work
  15534. in a country, or your recipient's use of the covered work in a
  15535. country, would infringe one or more identifiable patents in that
  15536. country that you have reason to believe are valid.
  15537. If, pursuant to or in connection with a single transaction or
  15538. arrangement, you convey, or propagate by procuring conveyance of, a
  15539. covered work, and grant a patent license to some of the parties
  15540. receiving the covered work authorizing them to use, propagate,
  15541. modify or convey a specific copy of the covered work, then the
  15542. patent license you grant is automatically extended to all
  15543. recipients of the covered work and works based on it.
  15544. A patent license is "discriminatory" if it does not include within
  15545. the scope of its coverage, prohibits the exercise of, or is
  15546. conditioned on the non-exercise of one or more of the rights that
  15547. are specifically granted under this License. You may not convey a
  15548. covered work if you are a party to an arrangement with a third
  15549. party that is in the business of distributing software, under which
  15550. you make payment to the third party based on the extent of your
  15551. activity of conveying the work, and under which the third party
  15552. grants, to any of the parties who would receive the covered work
  15553. from you, a discriminatory patent license (a) in connection with
  15554. copies of the covered work conveyed by you (or copies made from
  15555. those copies), or (b) primarily for and in connection with specific
  15556. products or compilations that contain the covered work, unless you
  15557. entered into that arrangement, or that patent license was granted,
  15558. prior to 28 March 2007.
  15559. Nothing in this License shall be construed as excluding or limiting
  15560. any implied license or other defenses to infringement that may
  15561. otherwise be available to you under applicable patent law.
  15562. 12. No Surrender of Others' Freedom.
  15563. If conditions are imposed on you (whether by court order, agreement
  15564. or otherwise) that contradict the conditions of this License, they
  15565. do not excuse you from the conditions of this License. If you
  15566. cannot convey a covered work so as to satisfy simultaneously your
  15567. obligations under this License and any other pertinent obligations,
  15568. then as a consequence you may not convey it at all. For example,
  15569. if you agree to terms that obligate you to collect a royalty for
  15570. further conveying from those to whom you convey the Program, the
  15571. only way you could satisfy both those terms and this License would
  15572. be to refrain entirely from conveying the Program.
  15573. 13. Use with the GNU Affero General Public License.
  15574. Notwithstanding any other provision of this License, you have
  15575. permission to link or combine any covered work with a work licensed
  15576. under version 3 of the GNU Affero General Public License into a
  15577. single combined work, and to convey the resulting work. The terms
  15578. of this License will continue to apply to the part which is the
  15579. covered work, but the special requirements of the GNU Affero
  15580. General Public License, section 13, concerning interaction through
  15581. a network will apply to the combination as such.
  15582. 14. Revised Versions of this License.
  15583. The Free Software Foundation may publish revised and/or new
  15584. versions of the GNU General Public License from time to time. Such
  15585. new versions will be similar in spirit to the present version, but
  15586. may differ in detail to address new problems or concerns.
  15587. Each version is given a distinguishing version number. If the
  15588. Program specifies that a certain numbered version of the GNU
  15589. General Public License "or any later version" applies to it, you
  15590. have the option of following the terms and conditions either of
  15591. that numbered version or of any later version published by the Free
  15592. Software Foundation. If the Program does not specify a version
  15593. number of the GNU General Public License, you may choose any
  15594. version ever published by the Free Software Foundation.
  15595. If the Program specifies that a proxy can decide which future
  15596. versions of the GNU General Public License can be used, that
  15597. proxy's public statement of acceptance of a version permanently
  15598. authorizes you to choose that version for the Program.
  15599. Later license versions may give you additional or different
  15600. permissions. However, no additional obligations are imposed on any
  15601. author or copyright holder as a result of your choosing to follow a
  15602. later version.
  15603. 15. Disclaimer of Warranty.
  15604. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
  15605. APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE
  15606. COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS"
  15607. WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
  15608. INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  15609. MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE
  15610. RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.
  15611. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
  15612. NECESSARY SERVICING, REPAIR OR CORRECTION.
  15613. 16. Limitation of Liability.
  15614. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
  15615. WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES
  15616. AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR
  15617. DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
  15618. CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
  15619. THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA
  15620. BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
  15621. PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
  15622. PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF
  15623. THE POSSIBILITY OF SUCH DAMAGES.
  15624. 17. Interpretation of Sections 15 and 16.
  15625. If the disclaimer of warranty and limitation of liability provided
  15626. above cannot be given local legal effect according to their terms,
  15627. reviewing courts shall apply local law that most closely
  15628. approximates an absolute waiver of all civil liability in
  15629. connection with the Program, unless a warranty or assumption of
  15630. liability accompanies a copy of the Program in return for a fee.
  15631. END OF TERMS AND CONDITIONS
  15632. ===========================
  15633. How to Apply These Terms to Your New Programs
  15634. =============================================
  15635. If you develop a new program, and you want it to be of the greatest
  15636. possible use to the public, the best way to achieve this is to make it
  15637. free software which everyone can redistribute and change under these
  15638. terms.
  15639. To do so, attach the following notices to the program. It is safest
  15640. to attach them to the start of each source file to most effectively
  15641. state the exclusion of warranty; and each file should have at least the
  15642. "copyright" line and a pointer to where the full notice is found.
  15643. ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES.
  15644. Copyright (C) YEAR NAME OF AUTHOR
  15645. This program is free software: you can redistribute it and/or modify
  15646. it under the terms of the GNU General Public License as published by
  15647. the Free Software Foundation, either version 3 of the License, or (at
  15648. your option) any later version.
  15649. This program is distributed in the hope that it will be useful, but
  15650. WITHOUT ANY WARRANTY; without even the implied warranty of
  15651. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15652. General Public License for more details.
  15653. You should have received a copy of the GNU General Public License
  15654. along with this program. If not, see <http://www.gnu.org/licenses/>.
  15655. Also add information on how to contact you by electronic and paper
  15656. mail.
  15657. If the program does terminal interaction, make it output a short
  15658. notice like this when it starts in an interactive mode:
  15659. PROGRAM Copyright (C) YEAR NAME OF AUTHOR
  15660. This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'.
  15661. This is free software, and you are welcome to redistribute it
  15662. under certain conditions; type 'show c' for details.
  15663. The hypothetical commands 'show w' and 'show c' should show the
  15664. appropriate parts of the General Public License. Of course, your
  15665. program's commands might be different; for a GUI interface, you would
  15666. use an "about box".
  15667. You should also get your employer (if you work as a programmer) or
  15668. school, if any, to sign a "copyright disclaimer" for the program, if
  15669. necessary. For more information on this, and how to apply and follow
  15670. the GNU GPL, see <http://www.gnu.org/licenses/>.
  15671. The GNU General Public License does not permit incorporating your
  15672. program into proprietary programs. If your program is a subroutine
  15673. library, you may consider it more useful to permit linking proprietary
  15674. applications with the library. If this is what you want to do, use the
  15675. GNU Lesser General Public License instead of this License. But first,
  15676. please read <http://www.gnu.org/philosophy/why-not-lgpl.html>.
  15677. 
  15678. File: gfortran.info, Node: GNU Free Documentation License, Next: Funding, Prev: Copying, Up: Top
  15679. GNU Free Documentation License
  15680. ******************************
  15681. Version 1.3, 3 November 2008
  15682. Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
  15683. <http://fsf.org/>
  15684. Everyone is permitted to copy and distribute verbatim copies
  15685. of this license document, but changing it is not allowed.
  15686. 0. PREAMBLE
  15687. The purpose of this License is to make a manual, textbook, or other
  15688. functional and useful document "free" in the sense of freedom: to
  15689. assure everyone the effective freedom to copy and redistribute it,
  15690. with or without modifying it, either commercially or
  15691. noncommercially. Secondarily, this License preserves for the
  15692. author and publisher a way to get credit for their work, while not
  15693. being considered responsible for modifications made by others.
  15694. This License is a kind of "copyleft", which means that derivative
  15695. works of the document must themselves be free in the same sense.
  15696. It complements the GNU General Public License, which is a copyleft
  15697. license designed for free software.
  15698. We have designed this License in order to use it for manuals for
  15699. free software, because free software needs free documentation: a
  15700. free program should come with manuals providing the same freedoms
  15701. that the software does. But this License is not limited to
  15702. software manuals; it can be used for any textual work, regardless
  15703. of subject matter or whether it is published as a printed book. We
  15704. recommend this License principally for works whose purpose is
  15705. instruction or reference.
  15706. 1. APPLICABILITY AND DEFINITIONS
  15707. This License applies to any manual or other work, in any medium,
  15708. that contains a notice placed by the copyright holder saying it can
  15709. be distributed under the terms of this License. Such a notice
  15710. grants a world-wide, royalty-free license, unlimited in duration,
  15711. to use that work under the conditions stated herein. The
  15712. "Document", below, refers to any such manual or work. Any member
  15713. of the public is a licensee, and is addressed as "you". You accept
  15714. the license if you copy, modify or distribute the work in a way
  15715. requiring permission under copyright law.
  15716. A "Modified Version" of the Document means any work containing the
  15717. Document or a portion of it, either copied verbatim, or with
  15718. modifications and/or translated into another language.
  15719. A "Secondary Section" is a named appendix or a front-matter section
  15720. of the Document that deals exclusively with the relationship of the
  15721. publishers or authors of the Document to the Document's overall
  15722. subject (or to related matters) and contains nothing that could
  15723. fall directly within that overall subject. (Thus, if the Document
  15724. is in part a textbook of mathematics, a Secondary Section may not
  15725. explain any mathematics.) The relationship could be a matter of
  15726. historical connection with the subject or with related matters, or
  15727. of legal, commercial, philosophical, ethical or political position
  15728. regarding them.
  15729. The "Invariant Sections" are certain Secondary Sections whose
  15730. titles are designated, as being those of Invariant Sections, in the
  15731. notice that says that the Document is released under this License.
  15732. If a section does not fit the above definition of Secondary then it
  15733. is not allowed to be designated as Invariant. The Document may
  15734. contain zero Invariant Sections. If the Document does not identify
  15735. any Invariant Sections then there are none.
  15736. The "Cover Texts" are certain short passages of text that are
  15737. listed, as Front-Cover Texts or Back-Cover Texts, in the notice
  15738. that says that the Document is released under this License. A
  15739. Front-Cover Text may be at most 5 words, and a Back-Cover Text may
  15740. be at most 25 words.
  15741. A "Transparent" copy of the Document means a machine-readable copy,
  15742. represented in a format whose specification is available to the
  15743. general public, that is suitable for revising the document
  15744. straightforwardly with generic text editors or (for images composed
  15745. of pixels) generic paint programs or (for drawings) some widely
  15746. available drawing editor, and that is suitable for input to text
  15747. formatters or for automatic translation to a variety of formats
  15748. suitable for input to text formatters. A copy made in an otherwise
  15749. Transparent file format whose markup, or absence of markup, has
  15750. been arranged to thwart or discourage subsequent modification by
  15751. readers is not Transparent. An image format is not Transparent if
  15752. used for any substantial amount of text. A copy that is not
  15753. "Transparent" is called "Opaque".
  15754. Examples of suitable formats for Transparent copies include plain
  15755. ASCII without markup, Texinfo input format, LaTeX input format,
  15756. SGML or XML using a publicly available DTD, and standard-conforming
  15757. simple HTML, PostScript or PDF designed for human modification.
  15758. Examples of transparent image formats include PNG, XCF and JPG.
  15759. Opaque formats include proprietary formats that can be read and
  15760. edited only by proprietary word processors, SGML or XML for which
  15761. the DTD and/or processing tools are not generally available, and
  15762. the machine-generated HTML, PostScript or PDF produced by some word
  15763. processors for output purposes only.
  15764. The "Title Page" means, for a printed book, the title page itself,
  15765. plus such following pages as are needed to hold, legibly, the
  15766. material this License requires to appear in the title page. For
  15767. works in formats which do not have any title page as such, "Title
  15768. Page" means the text near the most prominent appearance of the
  15769. work's title, preceding the beginning of the body of the text.
  15770. The "publisher" means any person or entity that distributes copies
  15771. of the Document to the public.
  15772. A section "Entitled XYZ" means a named subunit of the Document
  15773. whose title either is precisely XYZ or contains XYZ in parentheses
  15774. following text that translates XYZ in another language. (Here XYZ
  15775. stands for a specific section name mentioned below, such as
  15776. "Acknowledgements", "Dedications", "Endorsements", or "History".)
  15777. To "Preserve the Title" of such a section when you modify the
  15778. Document means that it remains a section "Entitled XYZ" according
  15779. to this definition.
  15780. The Document may include Warranty Disclaimers next to the notice
  15781. which states that this License applies to the Document. These
  15782. Warranty Disclaimers are considered to be included by reference in
  15783. this License, but only as regards disclaiming warranties: any other
  15784. implication that these Warranty Disclaimers may have is void and
  15785. has no effect on the meaning of this License.
  15786. 2. VERBATIM COPYING
  15787. You may copy and distribute the Document in any medium, either
  15788. commercially or noncommercially, provided that this License, the
  15789. copyright notices, and the license notice saying this License
  15790. applies to the Document are reproduced in all copies, and that you
  15791. add no other conditions whatsoever to those of this License. You
  15792. may not use technical measures to obstruct or control the reading
  15793. or further copying of the copies you make or distribute. However,
  15794. you may accept compensation in exchange for copies. If you
  15795. distribute a large enough number of copies you must also follow the
  15796. conditions in section 3.
  15797. You may also lend copies, under the same conditions stated above,
  15798. and you may publicly display copies.
  15799. 3. COPYING IN QUANTITY
  15800. If you publish printed copies (or copies in media that commonly
  15801. have printed covers) of the Document, numbering more than 100, and
  15802. the Document's license notice requires Cover Texts, you must
  15803. enclose the copies in covers that carry, clearly and legibly, all
  15804. these Cover Texts: Front-Cover Texts on the front cover, and
  15805. Back-Cover Texts on the back cover. Both covers must also clearly
  15806. and legibly identify you as the publisher of these copies. The
  15807. front cover must present the full title with all words of the title
  15808. equally prominent and visible. You may add other material on the
  15809. covers in addition. Copying with changes limited to the covers, as
  15810. long as they preserve the title of the Document and satisfy these
  15811. conditions, can be treated as verbatim copying in other respects.
  15812. If the required texts for either cover are too voluminous to fit
  15813. legibly, you should put the first ones listed (as many as fit
  15814. reasonably) on the actual cover, and continue the rest onto
  15815. adjacent pages.
  15816. If you publish or distribute Opaque copies of the Document
  15817. numbering more than 100, you must either include a machine-readable
  15818. Transparent copy along with each Opaque copy, or state in or with
  15819. each Opaque copy a computer-network location from which the general
  15820. network-using public has access to download using public-standard
  15821. network protocols a complete Transparent copy of the Document, free
  15822. of added material. If you use the latter option, you must take
  15823. reasonably prudent steps, when you begin distribution of Opaque
  15824. copies in quantity, to ensure that this Transparent copy will
  15825. remain thus accessible at the stated location until at least one
  15826. year after the last time you distribute an Opaque copy (directly or
  15827. through your agents or retailers) of that edition to the public.
  15828. It is requested, but not required, that you contact the authors of
  15829. the Document well before redistributing any large number of copies,
  15830. to give them a chance to provide you with an updated version of the
  15831. Document.
  15832. 4. MODIFICATIONS
  15833. You may copy and distribute a Modified Version of the Document
  15834. under the conditions of sections 2 and 3 above, provided that you
  15835. release the Modified Version under precisely this License, with the
  15836. Modified Version filling the role of the Document, thus licensing
  15837. distribution and modification of the Modified Version to whoever
  15838. possesses a copy of it. In addition, you must do these things in
  15839. the Modified Version:
  15840. A. Use in the Title Page (and on the covers, if any) a title
  15841. distinct from that of the Document, and from those of previous
  15842. versions (which should, if there were any, be listed in the
  15843. History section of the Document). You may use the same title
  15844. as a previous version if the original publisher of that
  15845. version gives permission.
  15846. B. List on the Title Page, as authors, one or more persons or
  15847. entities responsible for authorship of the modifications in
  15848. the Modified Version, together with at least five of the
  15849. principal authors of the Document (all of its principal
  15850. authors, if it has fewer than five), unless they release you
  15851. from this requirement.
  15852. C. State on the Title page the name of the publisher of the
  15853. Modified Version, as the publisher.
  15854. D. Preserve all the copyright notices of the Document.
  15855. E. Add an appropriate copyright notice for your modifications
  15856. adjacent to the other copyright notices.
  15857. F. Include, immediately after the copyright notices, a license
  15858. notice giving the public permission to use the Modified
  15859. Version under the terms of this License, in the form shown in
  15860. the Addendum below.
  15861. G. Preserve in that license notice the full lists of Invariant
  15862. Sections and required Cover Texts given in the Document's
  15863. license notice.
  15864. H. Include an unaltered copy of this License.
  15865. I. Preserve the section Entitled "History", Preserve its Title,
  15866. and add to it an item stating at least the title, year, new
  15867. authors, and publisher of the Modified Version as given on the
  15868. Title Page. If there is no section Entitled "History" in the
  15869. Document, create one stating the title, year, authors, and
  15870. publisher of the Document as given on its Title Page, then add
  15871. an item describing the Modified Version as stated in the
  15872. previous sentence.
  15873. J. Preserve the network location, if any, given in the Document
  15874. for public access to a Transparent copy of the Document, and
  15875. likewise the network locations given in the Document for
  15876. previous versions it was based on. These may be placed in the
  15877. "History" section. You may omit a network location for a work
  15878. that was published at least four years before the Document
  15879. itself, or if the original publisher of the version it refers
  15880. to gives permission.
  15881. K. For any section Entitled "Acknowledgements" or "Dedications",
  15882. Preserve the Title of the section, and preserve in the section
  15883. all the substance and tone of each of the contributor
  15884. acknowledgements and/or dedications given therein.
  15885. L. Preserve all the Invariant Sections of the Document, unaltered
  15886. in their text and in their titles. Section numbers or the
  15887. equivalent are not considered part of the section titles.
  15888. M. Delete any section Entitled "Endorsements". Such a section
  15889. may not be included in the Modified Version.
  15890. N. Do not retitle any existing section to be Entitled
  15891. "Endorsements" or to conflict in title with any Invariant
  15892. Section.
  15893. O. Preserve any Warranty Disclaimers.
  15894. If the Modified Version includes new front-matter sections or
  15895. appendices that qualify as Secondary Sections and contain no
  15896. material copied from the Document, you may at your option designate
  15897. some or all of these sections as invariant. To do this, add their
  15898. titles to the list of Invariant Sections in the Modified Version's
  15899. license notice. These titles must be distinct from any other
  15900. section titles.
  15901. You may add a section Entitled "Endorsements", provided it contains
  15902. nothing but endorsements of your Modified Version by various
  15903. parties--for example, statements of peer review or that the text
  15904. has been approved by an organization as the authoritative
  15905. definition of a standard.
  15906. You may add a passage of up to five words as a Front-Cover Text,
  15907. and a passage of up to 25 words as a Back-Cover Text, to the end of
  15908. the list of Cover Texts in the Modified Version. Only one passage
  15909. of Front-Cover Text and one of Back-Cover Text may be added by (or
  15910. through arrangements made by) any one entity. If the Document
  15911. already includes a cover text for the same cover, previously added
  15912. by you or by arrangement made by the same entity you are acting on
  15913. behalf of, you may not add another; but you may replace the old
  15914. one, on explicit permission from the previous publisher that added
  15915. the old one.
  15916. The author(s) and publisher(s) of the Document do not by this
  15917. License give permission to use their names for publicity for or to
  15918. assert or imply endorsement of any Modified Version.
  15919. 5. COMBINING DOCUMENTS
  15920. You may combine the Document with other documents released under
  15921. this License, under the terms defined in section 4 above for
  15922. modified versions, provided that you include in the combination all
  15923. of the Invariant Sections of all of the original documents,
  15924. unmodified, and list them all as Invariant Sections of your
  15925. combined work in its license notice, and that you preserve all
  15926. their Warranty Disclaimers.
  15927. The combined work need only contain one copy of this License, and
  15928. multiple identical Invariant Sections may be replaced with a single
  15929. copy. If there are multiple Invariant Sections with the same name
  15930. but different contents, make the title of each such section unique
  15931. by adding at the end of it, in parentheses, the name of the
  15932. original author or publisher of that section if known, or else a
  15933. unique number. Make the same adjustment to the section titles in
  15934. the list of Invariant Sections in the license notice of the
  15935. combined work.
  15936. In the combination, you must combine any sections Entitled
  15937. "History" in the various original documents, forming one section
  15938. Entitled "History"; likewise combine any sections Entitled
  15939. "Acknowledgements", and any sections Entitled "Dedications". You
  15940. must delete all sections Entitled "Endorsements."
  15941. 6. COLLECTIONS OF DOCUMENTS
  15942. You may make a collection consisting of the Document and other
  15943. documents released under this License, and replace the individual
  15944. copies of this License in the various documents with a single copy
  15945. that is included in the collection, provided that you follow the
  15946. rules of this License for verbatim copying of each of the documents
  15947. in all other respects.
  15948. You may extract a single document from such a collection, and
  15949. distribute it individually under this License, provided you insert
  15950. a copy of this License into the extracted document, and follow this
  15951. License in all other respects regarding verbatim copying of that
  15952. document.
  15953. 7. AGGREGATION WITH INDEPENDENT WORKS
  15954. A compilation of the Document or its derivatives with other
  15955. separate and independent documents or works, in or on a volume of a
  15956. storage or distribution medium, is called an "aggregate" if the
  15957. copyright resulting from the compilation is not used to limit the
  15958. legal rights of the compilation's users beyond what the individual
  15959. works permit. When the Document is included in an aggregate, this
  15960. License does not apply to the other works in the aggregate which
  15961. are not themselves derivative works of the Document.
  15962. If the Cover Text requirement of section 3 is applicable to these
  15963. copies of the Document, then if the Document is less than one half
  15964. of the entire aggregate, the Document's Cover Texts may be placed
  15965. on covers that bracket the Document within the aggregate, or the
  15966. electronic equivalent of covers if the Document is in electronic
  15967. form. Otherwise they must appear on printed covers that bracket
  15968. the whole aggregate.
  15969. 8. TRANSLATION
  15970. Translation is considered a kind of modification, so you may
  15971. distribute translations of the Document under the terms of section
  15972. 4. Replacing Invariant Sections with translations requires special
  15973. permission from their copyright holders, but you may include
  15974. translations of some or all Invariant Sections in addition to the
  15975. original versions of these Invariant Sections. You may include a
  15976. translation of this License, and all the license notices in the
  15977. Document, and any Warranty Disclaimers, provided that you also
  15978. include the original English version of this License and the
  15979. original versions of those notices and disclaimers. In case of a
  15980. disagreement between the translation and the original version of
  15981. this License or a notice or disclaimer, the original version will
  15982. prevail.
  15983. If a section in the Document is Entitled "Acknowledgements",
  15984. "Dedications", or "History", the requirement (section 4) to
  15985. Preserve its Title (section 1) will typically require changing the
  15986. actual title.
  15987. 9. TERMINATION
  15988. You may not copy, modify, sublicense, or distribute the Document
  15989. except as expressly provided under this License. Any attempt
  15990. otherwise to copy, modify, sublicense, or distribute it is void,
  15991. and will automatically terminate your rights under this License.
  15992. However, if you cease all violation of this License, then your
  15993. license from a particular copyright holder is reinstated (a)
  15994. provisionally, unless and until the copyright holder explicitly and
  15995. finally terminates your license, and (b) permanently, if the
  15996. copyright holder fails to notify you of the violation by some
  15997. reasonable means prior to 60 days after the cessation.
  15998. Moreover, your license from a particular copyright holder is
  15999. reinstated permanently if the copyright holder notifies you of the
  16000. violation by some reasonable means, this is the first time you have
  16001. received notice of violation of this License (for any work) from
  16002. that copyright holder, and you cure the violation prior to 30 days
  16003. after your receipt of the notice.
  16004. Termination of your rights under this section does not terminate
  16005. the licenses of parties who have received copies or rights from you
  16006. under this License. If your rights have been terminated and not
  16007. permanently reinstated, receipt of a copy of some or all of the
  16008. same material does not give you any rights to use it.
  16009. 10. FUTURE REVISIONS OF THIS LICENSE
  16010. The Free Software Foundation may publish new, revised versions of
  16011. the GNU Free Documentation License from time to time. Such new
  16012. versions will be similar in spirit to the present version, but may
  16013. differ in detail to address new problems or concerns. See
  16014. <http://www.gnu.org/copyleft/>.
  16015. Each version of the License is given a distinguishing version
  16016. number. If the Document specifies that a particular numbered
  16017. version of this License "or any later version" applies to it, you
  16018. have the option of following the terms and conditions either of
  16019. that specified version or of any later version that has been
  16020. published (not as a draft) by the Free Software Foundation. If the
  16021. Document does not specify a version number of this License, you may
  16022. choose any version ever published (not as a draft) by the Free
  16023. Software Foundation. If the Document specifies that a proxy can
  16024. decide which future versions of this License can be used, that
  16025. proxy's public statement of acceptance of a version permanently
  16026. authorizes you to choose that version for the Document.
  16027. 11. RELICENSING
  16028. "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
  16029. World Wide Web server that publishes copyrightable works and also
  16030. provides prominent facilities for anybody to edit those works. A
  16031. public wiki that anybody can edit is an example of such a server.
  16032. A "Massive Multiauthor Collaboration" (or "MMC") contained in the
  16033. site means any set of copyrightable works thus published on the MMC
  16034. site.
  16035. "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
  16036. license published by Creative Commons Corporation, a not-for-profit
  16037. corporation with a principal place of business in San Francisco,
  16038. California, as well as future copyleft versions of that license
  16039. published by that same organization.
  16040. "Incorporate" means to publish or republish a Document, in whole or
  16041. in part, as part of another Document.
  16042. An MMC is "eligible for relicensing" if it is licensed under this
  16043. License, and if all works that were first published under this
  16044. License somewhere other than this MMC, and subsequently
  16045. incorporated in whole or in part into the MMC, (1) had no cover
  16046. texts or invariant sections, and (2) were thus incorporated prior
  16047. to November 1, 2008.
  16048. The operator of an MMC Site may republish an MMC contained in the
  16049. site under CC-BY-SA on the same site at any time before August 1,
  16050. 2009, provided the MMC is eligible for relicensing.
  16051. ADDENDUM: How to use this License for your documents
  16052. ====================================================
  16053. To use this License in a document you have written, include a copy of
  16054. the License in the document and put the following copyright and license
  16055. notices just after the title page:
  16056. Copyright (C) YEAR YOUR NAME.
  16057. Permission is granted to copy, distribute and/or modify this document
  16058. under the terms of the GNU Free Documentation License, Version 1.3
  16059. or any later version published by the Free Software Foundation;
  16060. with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
  16061. Texts. A copy of the license is included in the section entitled ``GNU
  16062. Free Documentation License''.
  16063. If you have Invariant Sections, Front-Cover Texts and Back-Cover
  16064. Texts, replace the "with...Texts." line with this:
  16065. with the Invariant Sections being LIST THEIR TITLES, with
  16066. the Front-Cover Texts being LIST, and with the Back-Cover Texts
  16067. being LIST.
  16068. If you have Invariant Sections without Cover Texts, or some other
  16069. combination of the three, merge those two alternatives to suit the
  16070. situation.
  16071. If your document contains nontrivial examples of program code, we
  16072. recommend releasing these examples in parallel under your choice of free
  16073. software license, such as the GNU General Public License, to permit
  16074. their use in free software.
  16075. 
  16076. File: gfortran.info, Node: Funding, Next: Option Index, Prev: GNU Free Documentation License, Up: Top
  16077. Funding Free Software
  16078. *********************
  16079. If you want to have more free software a few years from now, it makes
  16080. sense for you to help encourage people to contribute funds for its
  16081. development. The most effective approach known is to encourage
  16082. commercial redistributors to donate.
  16083. Users of free software systems can boost the pace of development by
  16084. encouraging for-a-fee distributors to donate part of their selling price
  16085. to free software developers--the Free Software Foundation, and others.
  16086. The way to convince distributors to do this is to demand it and
  16087. expect it from them. So when you compare distributors, judge them
  16088. partly by how much they give to free software development. Show
  16089. distributors they must compete to be the one who gives the most.
  16090. To make this approach work, you must insist on numbers that you can
  16091. compare, such as, "We will donate ten dollars to the Frobnitz project
  16092. for each disk sold." Don't be satisfied with a vague promise, such as
  16093. "A portion of the profits are donated," since it doesn't give a basis
  16094. for comparison.
  16095. Even a precise fraction "of the profits from this disk" is not very
  16096. meaningful, since creative accounting and unrelated business decisions
  16097. can greatly alter what fraction of the sales price counts as profit. If
  16098. the price you pay is $50, ten percent of the profit is probably less
  16099. than a dollar; it might be a few cents, or nothing at all.
  16100. Some redistributors do development work themselves. This is useful
  16101. too; but to keep everyone honest, you need to inquire how much they do,
  16102. and what kind. Some kinds of development make much more long-term
  16103. difference than others. For example, maintaining a separate version of
  16104. a program contributes very little; maintaining the standard version of a
  16105. program for the whole community contributes much. Easy new ports
  16106. contribute little, since someone else would surely do them; difficult
  16107. ports such as adding a new CPU to the GNU Compiler Collection contribute
  16108. more; major new features or packages contribute the most.
  16109. By establishing the idea that supporting further development is "the
  16110. proper thing to do" when distributing free software for a fee, we can
  16111. assure a steady flow of resources into making more free software.
  16112. Copyright (C) 1994 Free Software Foundation, Inc.
  16113. Verbatim copying and redistribution of this section is permitted
  16114. without royalty; alteration is not permitted.
  16115. 
  16116. File: gfortran.info, Node: Option Index, Next: Keyword Index, Prev: Funding, Up: Top
  16117. Option Index
  16118. ************
  16119. 'gfortran''s command line options are indexed here without any initial
  16120. '-' or '--'. Where an option has both positive and negative forms (such
  16121. as -foption and -fno-option), relevant entries in the manual are indexed
  16122. under the most appropriate form; it may sometimes be useful to look up
  16123. both forms.
  16124. �[index�]
  16125. * Menu:
  16126. * 'A-PREDICATE=ANSWER': Preprocessing Options.
  16127. (line 119)
  16128. * 'APREDICATE=ANSWER': Preprocessing Options.
  16129. (line 113)
  16130. * 'backslash': Fortran Dialect Options.
  16131. (line 74)
  16132. * 'C': Preprocessing Options.
  16133. (line 122)
  16134. * 'CC': Preprocessing Options.
  16135. (line 137)
  16136. * 'cpp': Preprocessing Options.
  16137. (line 12)
  16138. * 'dD': Preprocessing Options.
  16139. (line 35)
  16140. * 'dI': Preprocessing Options.
  16141. (line 51)
  16142. * 'dM': Preprocessing Options.
  16143. (line 26)
  16144. * 'dN': Preprocessing Options.
  16145. (line 41)
  16146. * 'DNAME': Preprocessing Options.
  16147. (line 151)
  16148. * 'DNAME=DEFINITION': Preprocessing Options.
  16149. (line 154)
  16150. * 'dU': Preprocessing Options.
  16151. (line 44)
  16152. * 'faggressive-function-elimination': Code Gen Options. (line 392)
  16153. * 'falign-commons': Code Gen Options. (line 365)
  16154. * 'fall-intrinsics': Fortran Dialect Options.
  16155. (line 17)
  16156. * 'fblas-matmul-limit': Code Gen Options. (line 305)
  16157. * 'fbounds-check': Code Gen Options. (line 198)
  16158. * 'fcheck': Code Gen Options. (line 141)
  16159. * 'fcheck-array-temporaries': Code Gen Options. (line 232)
  16160. * 'fcoarray': Code Gen Options. (line 127)
  16161. * 'fconvert='CONVERSION: Runtime Options. (line 10)
  16162. * 'fcray-pointer': Fortran Dialect Options.
  16163. (line 120)
  16164. * 'fd-lines-as-code': Fortran Dialect Options.
  16165. (line 27)
  16166. * 'fd-lines-as-comments': Fortran Dialect Options.
  16167. (line 27)
  16168. * 'fdec': Fortran Dialect Options.
  16169. (line 34)
  16170. * 'fdec-intrinsic-ints': Fortran Dialect Options.
  16171. (line 54)
  16172. * 'fdec-math': Fortran Dialect Options.
  16173. (line 59)
  16174. * 'fdec-static': Fortran Dialect Options.
  16175. (line 64)
  16176. * 'fdec-structure': Fortran Dialect Options.
  16177. (line 48)
  16178. * 'fdefault-double-8': Fortran Dialect Options.
  16179. (line 169)
  16180. * 'fdefault-integer-8': Fortran Dialect Options.
  16181. (line 155)
  16182. * 'fdefault-real-8': Fortran Dialect Options.
  16183. (line 161)
  16184. * 'fdollar-ok': Fortran Dialect Options.
  16185. (line 68)
  16186. * 'fdump-fortran-optimized': Debugging Options. (line 15)
  16187. * 'fdump-fortran-original': Debugging Options. (line 10)
  16188. * 'fdump-parse-tree': Debugging Options. (line 19)
  16189. * 'fexternal-blas': Code Gen Options. (line 297)
  16190. * ff2c: Code Gen Options. (line 25)
  16191. * 'ffixed-form': Fortran Dialect Options.
  16192. (line 11)
  16193. * 'ffixed-line-length-'N: Fortran Dialect Options.
  16194. (line 91)
  16195. * 'ffpe-summary='LIST: Debugging Options. (line 51)
  16196. * 'ffpe-trap='LIST: Debugging Options. (line 25)
  16197. * 'ffree-form': Fortran Dialect Options.
  16198. (line 11)
  16199. * 'ffree-line-length-'N: Fortran Dialect Options.
  16200. (line 104)
  16201. * 'fimplicit-none': Fortran Dialect Options.
  16202. (line 115)
  16203. * 'finit-character': Code Gen Options. (line 340)
  16204. * 'finit-derived': Code Gen Options. (line 340)
  16205. * 'finit-integer': Code Gen Options. (line 340)
  16206. * 'finit-local-zero': Code Gen Options. (line 340)
  16207. * 'finit-logical': Code Gen Options. (line 340)
  16208. * 'finit-real': Code Gen Options. (line 340)
  16209. * 'finline-matmul-limit': Code Gen Options. (line 316)
  16210. * 'finteger-4-integer-8': Fortran Dialect Options.
  16211. (line 178)
  16212. * 'fintrinsic-modules-path' DIR: Directory Options. (line 36)
  16213. * 'fmax-array-constructor': Code Gen Options. (line 235)
  16214. * 'fmax-errors='N: Error and Warning Options.
  16215. (line 27)
  16216. * 'fmax-identifier-length='N: Fortran Dialect Options.
  16217. (line 111)
  16218. * 'fmax-stack-var-size': Code Gen Options. (line 253)
  16219. * 'fmax-subrecord-length='LENGTH: Runtime Options. (line 29)
  16220. * 'fmodule-private': Fortran Dialect Options.
  16221. (line 86)
  16222. * 'fno-automatic': Code Gen Options. (line 15)
  16223. * 'fno-backtrace': Debugging Options. (line 61)
  16224. * 'fno-protect-parens': Code Gen Options. (line 377)
  16225. * 'fno-underscoring': Code Gen Options. (line 54)
  16226. * 'fopenacc': Fortran Dialect Options.
  16227. (line 124)
  16228. * 'fopenmp': Fortran Dialect Options.
  16229. (line 135)
  16230. * 'fpack-derived': Code Gen Options. (line 275)
  16231. * 'fpp': Preprocessing Options.
  16232. (line 12)
  16233. * 'frange-check': Fortran Dialect Options.
  16234. (line 143)
  16235. * 'freal-4-real-10': Fortran Dialect Options.
  16236. (line 193)
  16237. * 'freal-4-real-16': Fortran Dialect Options.
  16238. (line 193)
  16239. * 'freal-4-real-8': Fortran Dialect Options.
  16240. (line 193)
  16241. * 'freal-8-real-10': Fortran Dialect Options.
  16242. (line 193)
  16243. * 'freal-8-real-16': Fortran Dialect Options.
  16244. (line 193)
  16245. * 'freal-8-real-4': Fortran Dialect Options.
  16246. (line 193)
  16247. * 'frealloc-lhs': Code Gen Options. (line 386)
  16248. * 'frecord-marker='LENGTH: Runtime Options. (line 21)
  16249. * 'frecursive': Code Gen Options. (line 330)
  16250. * 'frepack-arrays': Code Gen Options. (line 281)
  16251. * 'frontend-optimize': Code Gen Options. (line 400)
  16252. * 'fsecond-underscore': Code Gen Options. (line 110)
  16253. * 'fshort-enums': Code Gen Options. (line 291)
  16254. * 'fshort-enums' <1>: Fortran 2003 status. (line 93)
  16255. * 'fsign-zero': Runtime Options. (line 34)
  16256. * 'fstack-arrays': Code Gen Options. (line 267)
  16257. * 'fsyntax-only': Error and Warning Options.
  16258. (line 33)
  16259. * 'ftest-forall-temp': Fortran Dialect Options.
  16260. (line 223)
  16261. * 'fworking-directory': Preprocessing Options.
  16262. (line 55)
  16263. * 'H': Preprocessing Options.
  16264. (line 174)
  16265. * 'I'DIR: Directory Options. (line 14)
  16266. * 'idirafter DIR': Preprocessing Options.
  16267. (line 69)
  16268. * 'imultilib DIR': Preprocessing Options.
  16269. (line 76)
  16270. * 'iprefix PREFIX': Preprocessing Options.
  16271. (line 80)
  16272. * 'iquote DIR': Preprocessing Options.
  16273. (line 89)
  16274. * 'isysroot DIR': Preprocessing Options.
  16275. (line 85)
  16276. * 'isystem DIR': Preprocessing Options.
  16277. (line 96)
  16278. * 'J'DIR: Directory Options. (line 29)
  16279. * 'M'DIR: Directory Options. (line 29)
  16280. * 'nostdinc': Preprocessing Options.
  16281. (line 104)
  16282. * 'P': Preprocessing Options.
  16283. (line 179)
  16284. * 'pedantic': Error and Warning Options.
  16285. (line 39)
  16286. * 'pedantic-errors': Error and Warning Options.
  16287. (line 58)
  16288. * 'static-libgfortran': Link Options. (line 11)
  16289. * 'std='STD option: Fortran Dialect Options.
  16290. (line 204)
  16291. * 'tail-call-workaround': Code Gen Options. (line 202)
  16292. * 'UNAME': Preprocessing Options.
  16293. (line 185)
  16294. * 'undef': Preprocessing Options.
  16295. (line 109)
  16296. * 'Waliasing': Error and Warning Options.
  16297. (line 71)
  16298. * 'Walign-commons': Error and Warning Options.
  16299. (line 222)
  16300. * 'Wall': Error and Warning Options.
  16301. (line 62)
  16302. * 'Wampersand': Error and Warning Options.
  16303. (line 88)
  16304. * 'Wargument-mismatch': Error and Warning Options.
  16305. (line 96)
  16306. * 'Warray-temporaries': Error and Warning Options.
  16307. (line 101)
  16308. * 'Wc-binding-type': Error and Warning Options.
  16309. (line 106)
  16310. * 'Wcharacter-truncation': Error and Warning Options.
  16311. (line 113)
  16312. * 'Wcompare-reals': Error and Warning Options.
  16313. (line 249)
  16314. * 'Wconversion': Error and Warning Options.
  16315. (line 122)
  16316. * 'Wconversion-extra': Error and Warning Options.
  16317. (line 126)
  16318. * 'Werror': Error and Warning Options.
  16319. (line 261)
  16320. * 'Wextra': Error and Warning Options.
  16321. (line 130)
  16322. * 'Wfunction-elimination': Error and Warning Options.
  16323. (line 228)
  16324. * 'Wimplicit-interface': Error and Warning Options.
  16325. (line 135)
  16326. * 'Wimplicit-procedure': Error and Warning Options.
  16327. (line 141)
  16328. * 'Winteger-division': Error and Warning Options.
  16329. (line 145)
  16330. * 'Wintrinsic-shadow': Error and Warning Options.
  16331. (line 200)
  16332. * 'Wintrinsics-std': Error and Warning Options.
  16333. (line 149)
  16334. * 'Wline-truncation': Error and Warning Options.
  16335. (line 116)
  16336. * 'Wpedantic': Error and Warning Options.
  16337. (line 39)
  16338. * 'Wreal-q-constant': Error and Warning Options.
  16339. (line 156)
  16340. * 'Wrealloc-lhs': Error and Warning Options.
  16341. (line 232)
  16342. * 'Wrealloc-lhs-all': Error and Warning Options.
  16343. (line 244)
  16344. * 'Wsurprising': Error and Warning Options.
  16345. (line 160)
  16346. * 'Wtabs': Error and Warning Options.
  16347. (line 182)
  16348. * 'Wtargt-lifetime': Error and Warning Options.
  16349. (line 253)
  16350. * 'Wundefined-do-loop': Error and Warning Options.
  16351. (line 190)
  16352. * 'Wunderflow': Error and Warning Options.
  16353. (line 195)
  16354. * 'Wunused-dummy-argument': Error and Warning Options.
  16355. (line 211)
  16356. * 'Wunused-parameter': Error and Warning Options.
  16357. (line 215)
  16358. * 'Wuse-without-only': Error and Warning Options.
  16359. (line 207)
  16360. * 'Wzerotrip': Error and Warning Options.
  16361. (line 257)
  16362. 
  16363. File: gfortran.info, Node: Keyword Index, Prev: Option Index, Up: Top
  16364. Keyword Index
  16365. *************
  16366. �[index�]
  16367. * Menu:
  16368. * '$': Fortran Dialect Options.
  16369. (line 68)
  16370. * '%LOC': Argument list functions.
  16371. (line 6)
  16372. * '%REF': Argument list functions.
  16373. (line 6)
  16374. * '%VAL': Argument list functions.
  16375. (line 6)
  16376. * '&': Error and Warning Options.
  16377. (line 88)
  16378. * '[...]': Fortran 2003 status. (line 78)
  16379. * _gfortran_set_args: _gfortran_set_args. (line 6)
  16380. * _gfortran_set_convert: _gfortran_set_convert.
  16381. (line 6)
  16382. * _gfortran_set_fpe: _gfortran_set_fpe. (line 6)
  16383. * _gfortran_set_max_subrecord_length: _gfortran_set_max_subrecord_length.
  16384. (line 6)
  16385. * _gfortran_set_options: _gfortran_set_options.
  16386. (line 6)
  16387. * _gfortran_set_record_marker: _gfortran_set_record_marker.
  16388. (line 6)
  16389. * ABORT: ABORT. (line 6)
  16390. * ABS: ABS. (line 6)
  16391. * absolute value: ABS. (line 6)
  16392. * ACCESS: ACCESS. (line 6)
  16393. * 'ACCESS='STREAM'' I/O: Fortran 2003 status. (line 103)
  16394. * ACHAR: ACHAR. (line 6)
  16395. * ACOS: ACOS. (line 6)
  16396. * ACOSD: ACOSD. (line 6)
  16397. * ACOSH: ACOSH. (line 6)
  16398. * adjust string: ADJUSTL. (line 6)
  16399. * adjust string <1>: ADJUSTR. (line 6)
  16400. * ADJUSTL: ADJUSTL. (line 6)
  16401. * ADJUSTR: ADJUSTR. (line 6)
  16402. * AIMAG: AIMAG. (line 6)
  16403. * AINT: AINT. (line 6)
  16404. * ALARM: ALARM. (line 6)
  16405. * ALGAMA: LOG_GAMMA. (line 6)
  16406. * aliasing: Error and Warning Options.
  16407. (line 71)
  16408. * alignment of 'COMMON' blocks: Error and Warning Options.
  16409. (line 222)
  16410. * alignment of 'COMMON' blocks <1>: Code Gen Options. (line 365)
  16411. * ALL: ALL. (line 6)
  16412. * all warnings: Error and Warning Options.
  16413. (line 62)
  16414. * 'ALLOCATABLE' components of derived types: Fortran 2003 status.
  16415. (line 101)
  16416. * 'ALLOCATABLE' dummy arguments: Fortran 2003 status. (line 99)
  16417. * 'ALLOCATABLE' function results: Fortran 2003 status. (line 100)
  16418. * ALLOCATED: ALLOCATED. (line 6)
  16419. * allocation, moving: MOVE_ALLOC. (line 6)
  16420. * allocation, status: ALLOCATED. (line 6)
  16421. * ALOG: LOG. (line 6)
  16422. * ALOG10: LOG10. (line 6)
  16423. * AMAX0: MAX. (line 6)
  16424. * AMAX1: MAX. (line 6)
  16425. * AMIN0: MIN. (line 6)
  16426. * AMIN1: MIN. (line 6)
  16427. * AMOD: MOD. (line 6)
  16428. * AND: AND. (line 6)
  16429. * ANINT: ANINT. (line 6)
  16430. * ANY: ANY. (line 6)
  16431. * area hyperbolic cosine: ACOSH. (line 6)
  16432. * area hyperbolic sine: ASINH. (line 6)
  16433. * area hyperbolic tangent: ATANH. (line 6)
  16434. * argument list functions: Argument list functions.
  16435. (line 6)
  16436. * arguments, to program: COMMAND_ARGUMENT_COUNT.
  16437. (line 6)
  16438. * arguments, to program <1>: GETARG. (line 6)
  16439. * arguments, to program <2>: GET_COMMAND. (line 6)
  16440. * arguments, to program <3>: GET_COMMAND_ARGUMENT.
  16441. (line 6)
  16442. * arguments, to program <4>: IARGC. (line 6)
  16443. * array, add elements: SUM. (line 6)
  16444. * array, AND: IALL. (line 6)
  16445. * array, apply condition: ALL. (line 6)
  16446. * array, apply condition <1>: ANY. (line 6)
  16447. * array, bounds checking: Code Gen Options. (line 141)
  16448. * array, change dimensions: RESHAPE. (line 6)
  16449. * array, combine arrays: MERGE. (line 6)
  16450. * array, condition testing: ALL. (line 6)
  16451. * array, condition testing <1>: ANY. (line 6)
  16452. * array, conditionally add elements: SUM. (line 6)
  16453. * array, conditionally count elements: COUNT. (line 6)
  16454. * array, conditionally multiply elements: PRODUCT. (line 6)
  16455. * array, constructors: Fortran 2003 status. (line 78)
  16456. * array, count elements: SIZE. (line 6)
  16457. * array, duplicate dimensions: SPREAD. (line 6)
  16458. * array, duplicate elements: SPREAD. (line 6)
  16459. * array, element counting: COUNT. (line 6)
  16460. * array, gather elements: PACK. (line 6)
  16461. * array, increase dimension: SPREAD. (line 6)
  16462. * array, increase dimension <1>: UNPACK. (line 6)
  16463. * array, indices of type real: Real array indices. (line 6)
  16464. * array, location of maximum element: MAXLOC. (line 6)
  16465. * array, location of minimum element: MINLOC. (line 6)
  16466. * array, lower bound: LBOUND. (line 6)
  16467. * array, maximum value: MAXVAL. (line 6)
  16468. * array, merge arrays: MERGE. (line 6)
  16469. * array, minimum value: MINVAL. (line 6)
  16470. * array, multiply elements: PRODUCT. (line 6)
  16471. * array, number of elements: COUNT. (line 6)
  16472. * array, number of elements <1>: SIZE. (line 6)
  16473. * array, OR: IANY. (line 6)
  16474. * array, packing: PACK. (line 6)
  16475. * array, parity: IPARITY. (line 6)
  16476. * array, permutation: CSHIFT. (line 6)
  16477. * array, product: PRODUCT. (line 6)
  16478. * array, reduce dimension: PACK. (line 6)
  16479. * array, rotate: CSHIFT. (line 6)
  16480. * array, scatter elements: UNPACK. (line 6)
  16481. * array, shape: SHAPE. (line 6)
  16482. * array, shift: EOSHIFT. (line 6)
  16483. * array, shift circularly: CSHIFT. (line 6)
  16484. * array, size: SIZE. (line 6)
  16485. * array, sum: SUM. (line 6)
  16486. * array, transmogrify: RESHAPE. (line 6)
  16487. * array, transpose: TRANSPOSE. (line 6)
  16488. * array, unpacking: UNPACK. (line 6)
  16489. * array, upper bound: UBOUND. (line 6)
  16490. * array, XOR: IPARITY. (line 6)
  16491. * ASCII collating sequence: ACHAR. (line 6)
  16492. * ASCII collating sequence <1>: IACHAR. (line 6)
  16493. * ASIN: ASIN. (line 6)
  16494. * ASIND: ASIND. (line 6)
  16495. * ASINH: ASINH. (line 6)
  16496. * ASSOCIATED: ASSOCIATED. (line 6)
  16497. * association status: ASSOCIATED. (line 6)
  16498. * association status, C pointer: C_ASSOCIATED. (line 6)
  16499. * ATAN: ATAN. (line 6)
  16500. * ATAN2: ATAN2. (line 6)
  16501. * ATAN2D: ATAN2D. (line 6)
  16502. * ATAND: ATAND. (line 6)
  16503. * ATANH: ATANH. (line 6)
  16504. * Atomic subroutine, add: ATOMIC_ADD. (line 6)
  16505. * Atomic subroutine, ADD with fetch: ATOMIC_FETCH_ADD. (line 6)
  16506. * Atomic subroutine, AND: ATOMIC_AND. (line 6)
  16507. * Atomic subroutine, AND with fetch: ATOMIC_FETCH_AND. (line 6)
  16508. * Atomic subroutine, compare and swap: ATOMIC_CAS. (line 6)
  16509. * Atomic subroutine, define: ATOMIC_DEFINE. (line 6)
  16510. * Atomic subroutine, OR: ATOMIC_OR. (line 6)
  16511. * Atomic subroutine, OR with fetch: ATOMIC_FETCH_OR. (line 6)
  16512. * Atomic subroutine, reference: ATOMIC_REF. (line 6)
  16513. * Atomic subroutine, XOR: ATOMIC_XOR. (line 6)
  16514. * Atomic subroutine, XOR with fetch: ATOMIC_FETCH_XOR. (line 6)
  16515. * ATOMIC_ADD: ATOMIC_ADD. (line 6)
  16516. * ATOMIC_AND: ATOMIC_AND. (line 6)
  16517. * ATOMIC_DEFINE: ATOMIC_CAS. (line 6)
  16518. * ATOMIC_DEFINE <1>: ATOMIC_DEFINE. (line 6)
  16519. * ATOMIC_FETCH_ADD: ATOMIC_FETCH_ADD. (line 6)
  16520. * ATOMIC_FETCH_AND: ATOMIC_FETCH_AND. (line 6)
  16521. * ATOMIC_FETCH_OR: ATOMIC_FETCH_OR. (line 6)
  16522. * ATOMIC_FETCH_XOR: ATOMIC_FETCH_XOR. (line 6)
  16523. * ATOMIC_OR: ATOMIC_OR. (line 6)
  16524. * ATOMIC_REF: ATOMIC_REF. (line 6)
  16525. * ATOMIC_XOR: ATOMIC_XOR. (line 6)
  16526. * Authors: Contributors. (line 6)
  16527. * 'AUTOMATIC': AUTOMATIC and STATIC attributes.
  16528. (line 6)
  16529. * BABS: ABS. (line 6)
  16530. * backslash: Fortran Dialect Options.
  16531. (line 74)
  16532. * 'BACKSPACE': Read/Write after EOF marker.
  16533. (line 6)
  16534. * BACKTRACE: BACKTRACE. (line 6)
  16535. * backtrace: Debugging Options. (line 61)
  16536. * backtrace <1>: BACKTRACE. (line 6)
  16537. * base 10 logarithm function: LOG10. (line 6)
  16538. * BBCLR: IBCLR. (line 6)
  16539. * BBITS: IBITS. (line 6)
  16540. * BBSET: IBSET. (line 6)
  16541. * BBTEST: BTEST. (line 6)
  16542. * BESJ0: BESSEL_J0. (line 6)
  16543. * BESJ1: BESSEL_J1. (line 6)
  16544. * BESJN: BESSEL_JN. (line 6)
  16545. * Bessel function, first kind: BESSEL_J0. (line 6)
  16546. * Bessel function, first kind <1>: BESSEL_J1. (line 6)
  16547. * Bessel function, first kind <2>: BESSEL_JN. (line 6)
  16548. * Bessel function, second kind: BESSEL_Y0. (line 6)
  16549. * Bessel function, second kind <1>: BESSEL_Y1. (line 6)
  16550. * Bessel function, second kind <2>: BESSEL_YN. (line 6)
  16551. * BESSEL_J0: BESSEL_J0. (line 6)
  16552. * BESSEL_J1: BESSEL_J1. (line 6)
  16553. * BESSEL_JN: BESSEL_JN. (line 6)
  16554. * BESSEL_Y0: BESSEL_Y0. (line 6)
  16555. * BESSEL_Y1: BESSEL_Y1. (line 6)
  16556. * BESSEL_YN: BESSEL_YN. (line 6)
  16557. * BESY0: BESSEL_Y0. (line 6)
  16558. * BESY1: BESSEL_Y1. (line 6)
  16559. * BESYN: BESSEL_YN. (line 6)
  16560. * BGE: BGE. (line 6)
  16561. * BGT: BGT. (line 6)
  16562. * BIAND: IAND. (line 6)
  16563. * BIEOR: IEOR. (line 6)
  16564. * binary representation: POPCNT. (line 6)
  16565. * binary representation <1>: POPPAR. (line 6)
  16566. * BIOR: IOR. (line 6)
  16567. * BITEST: BTEST. (line 6)
  16568. * bits set: POPCNT. (line 6)
  16569. * bits, AND of array elements: IALL. (line 6)
  16570. * bits, clear: IBCLR. (line 6)
  16571. * bits, extract: IBITS. (line 6)
  16572. * bits, get: IBITS. (line 6)
  16573. * bits, merge: MERGE_BITS. (line 6)
  16574. * bits, move: MVBITS. (line 6)
  16575. * bits, move <1>: TRANSFER. (line 6)
  16576. * bits, negate: NOT. (line 6)
  16577. * bits, number of: BIT_SIZE. (line 6)
  16578. * bits, OR of array elements: IANY. (line 6)
  16579. * bits, set: IBSET. (line 6)
  16580. * bits, shift: ISHFT. (line 6)
  16581. * bits, shift circular: ISHFTC. (line 6)
  16582. * bits, shift left: LSHIFT. (line 6)
  16583. * bits, shift left <1>: SHIFTL. (line 6)
  16584. * bits, shift right: RSHIFT. (line 6)
  16585. * bits, shift right <1>: SHIFTA. (line 6)
  16586. * bits, shift right <2>: SHIFTR. (line 6)
  16587. * bits, testing: BTEST. (line 6)
  16588. * bits, unset: IBCLR. (line 6)
  16589. * bits, XOR of array elements: IPARITY. (line 6)
  16590. * bitwise comparison: BGE. (line 6)
  16591. * bitwise comparison <1>: BGT. (line 6)
  16592. * bitwise comparison <2>: BLE. (line 6)
  16593. * bitwise comparison <3>: BLT. (line 6)
  16594. * bitwise logical and: AND. (line 6)
  16595. * bitwise logical and <1>: IAND. (line 6)
  16596. * bitwise logical exclusive or: IEOR. (line 6)
  16597. * bitwise logical exclusive or <1>: XOR. (line 6)
  16598. * bitwise logical not: NOT. (line 6)
  16599. * bitwise logical or: IOR. (line 6)
  16600. * bitwise logical or <1>: OR. (line 6)
  16601. * BIT_SIZE: BIT_SIZE. (line 6)
  16602. * BJTEST: BTEST. (line 6)
  16603. * BKTEST: BTEST. (line 6)
  16604. * BLE: BLE. (line 6)
  16605. * BLT: BLT. (line 6)
  16606. * BMOD: MOD. (line 6)
  16607. * BMVBITS: MVBITS. (line 6)
  16608. * BNOT: NOT. (line 6)
  16609. * bounds checking: Code Gen Options. (line 141)
  16610. * BOZ literal constants: BOZ literal constants.
  16611. (line 6)
  16612. * BSHFT: ISHFT. (line 6)
  16613. * BSHFTC: ISHFTC. (line 6)
  16614. * BTEST: BTEST. (line 6)
  16615. * CABS: ABS. (line 6)
  16616. * calling convention: Code Gen Options. (line 25)
  16617. * 'CARRIAGECONTROL': Extended I/O specifiers.
  16618. (line 6)
  16619. * CCOS: COS. (line 6)
  16620. * CCOSD: COSD. (line 6)
  16621. * CDABS: ABS. (line 6)
  16622. * CDCOS: COS. (line 6)
  16623. * CDCOSD: COSD. (line 6)
  16624. * CDEXP: EXP. (line 6)
  16625. * CDLOG: LOG. (line 6)
  16626. * CDSIN: SIN. (line 6)
  16627. * CDSIND: SIND. (line 6)
  16628. * CDSQRT: SQRT. (line 6)
  16629. * CEILING: CEILING. (line 6)
  16630. * ceiling: ANINT. (line 6)
  16631. * ceiling <1>: CEILING. (line 6)
  16632. * CEXP: EXP. (line 6)
  16633. * CHAR: CHAR. (line 6)
  16634. * character kind: SELECTED_CHAR_KIND. (line 6)
  16635. * character set: Fortran Dialect Options.
  16636. (line 68)
  16637. * CHDIR: CHDIR. (line 6)
  16638. * checking array temporaries: Code Gen Options. (line 141)
  16639. * checking subscripts: Code Gen Options. (line 141)
  16640. * CHMOD: CHMOD. (line 6)
  16641. * clock ticks: MCLOCK. (line 6)
  16642. * clock ticks <1>: MCLOCK8. (line 6)
  16643. * clock ticks <2>: SYSTEM_CLOCK. (line 6)
  16644. * CLOG: LOG. (line 6)
  16645. * CMPLX: CMPLX. (line 6)
  16646. * coarray, 'IMAGE_INDEX': IMAGE_INDEX. (line 6)
  16647. * coarray, lower bound: LCOBOUND. (line 6)
  16648. * coarray, 'NUM_IMAGES': NUM_IMAGES. (line 6)
  16649. * coarray, 'THIS_IMAGE': THIS_IMAGE. (line 6)
  16650. * coarray, upper bound: UCOBOUND. (line 6)
  16651. * Coarray, _gfortran_caf_atomic_cas: _gfortran_caf_atomic_cas.
  16652. (line 6)
  16653. * Coarray, _gfortran_caf_atomic_define: _gfortran_caf_atomic_define.
  16654. (line 6)
  16655. * Coarray, _gfortran_caf_atomic_op: _gfortran_caf_atomic_op.
  16656. (line 6)
  16657. * Coarray, _gfortran_caf_atomic_ref: _gfortran_caf_atomic_ref.
  16658. (line 6)
  16659. * Coarray, _gfortran_caf_co_broadcast: _gfortran_caf_co_broadcast.
  16660. (line 6)
  16661. * Coarray, _gfortran_caf_co_max: _gfortran_caf_co_max.
  16662. (line 6)
  16663. * Coarray, _gfortran_caf_co_min: _gfortran_caf_co_min.
  16664. (line 6)
  16665. * Coarray, _gfortran_caf_co_reduce: _gfortran_caf_co_reduce.
  16666. (line 6)
  16667. * Coarray, _gfortran_caf_co_sum: _gfortran_caf_co_sum.
  16668. (line 6)
  16669. * Coarray, _gfortran_caf_deregister: _gfortran_caf_deregister.
  16670. (line 6)
  16671. * Coarray, _gfortran_caf_error_stop: _gfortran_caf_error_stop.
  16672. (line 6)
  16673. * Coarray, _gfortran_caf_error_stop_str: _gfortran_caf_error_stop_str.
  16674. (line 6)
  16675. * Coarray, _gfortran_caf_event_post: _gfortran_caf_event_post.
  16676. (line 6)
  16677. * Coarray, _gfortran_caf_event_query: _gfortran_caf_event_query.
  16678. (line 6)
  16679. * Coarray, _gfortran_caf_event_wait: _gfortran_caf_event_wait.
  16680. (line 6)
  16681. * Coarray, _gfortran_caf_failed_images: _gfortran_caf_failed_images.
  16682. (line 6)
  16683. * Coarray, _gfortran_caf_fail_image: _gfortran_caf_fail_image.
  16684. (line 6)
  16685. * Coarray, _gfortran_caf_finish: _gfortran_caf_finish.
  16686. (line 6)
  16687. * Coarray, _gfortran_caf_get: _gfortran_caf_get. (line 6)
  16688. * Coarray, _gfortran_caf_get_by_ref: _gfortran_caf_get_by_ref.
  16689. (line 6)
  16690. * Coarray, _gfortran_caf_image_status: _gfortran_caf_image_status.
  16691. (line 6)
  16692. * Coarray, _gfortran_caf_init: _gfortran_caf_init. (line 6)
  16693. * Coarray, _gfortran_caf_is_present: _gfortran_caf_is_present.
  16694. (line 6)
  16695. * Coarray, _gfortran_caf_lock: _gfortran_caf_lock. (line 6)
  16696. * Coarray, _gfortran_caf_num_images: _gfortran_caf_num_images.
  16697. (line 6)
  16698. * Coarray, _gfortran_caf_register: _gfortran_caf_register.
  16699. (line 6)
  16700. * Coarray, _gfortran_caf_send: _gfortran_caf_send. (line 6)
  16701. * Coarray, _gfortran_caf_sendget: _gfortran_caf_sendget.
  16702. (line 6)
  16703. * Coarray, _gfortran_caf_sendget_by_ref: _gfortran_caf_sendget_by_ref.
  16704. (line 6)
  16705. * Coarray, _gfortran_caf_send_by_ref: _gfortran_caf_send_by_ref.
  16706. (line 6)
  16707. * Coarray, _gfortran_caf_stopped_images: _gfortran_caf_stopped_images.
  16708. (line 6)
  16709. * Coarray, _gfortran_caf_sync_all: _gfortran_caf_sync_all.
  16710. (line 6)
  16711. * Coarray, _gfortran_caf_sync_images: _gfortran_caf_sync_images.
  16712. (line 6)
  16713. * Coarray, _gfortran_caf_sync_memory: _gfortran_caf_sync_memory.
  16714. (line 6)
  16715. * Coarray, _gfortran_caf_this_image: _gfortran_caf_this_image.
  16716. (line 6)
  16717. * Coarray, _gfortran_caf_unlock: _gfortran_caf_unlock.
  16718. (line 6)
  16719. * coarrays: Code Gen Options. (line 127)
  16720. * Coarrays: Coarray Programming. (line 6)
  16721. * code generation, conventions: Code Gen Options. (line 6)
  16722. * collating sequence, ASCII: ACHAR. (line 6)
  16723. * collating sequence, ASCII <1>: IACHAR. (line 6)
  16724. * Collectives, generic reduction: CO_REDUCE. (line 6)
  16725. * Collectives, maximal value: CO_MAX. (line 6)
  16726. * Collectives, minimal value: CO_MIN. (line 6)
  16727. * Collectives, sum of values: CO_SUM. (line 6)
  16728. * Collectives, value broadcasting: CO_BROADCAST. (line 6)
  16729. * command line: EXECUTE_COMMAND_LINE.
  16730. (line 6)
  16731. * command options: Invoking GNU Fortran.
  16732. (line 6)
  16733. * command-line arguments: COMMAND_ARGUMENT_COUNT.
  16734. (line 6)
  16735. * command-line arguments <1>: GETARG. (line 6)
  16736. * command-line arguments <2>: GET_COMMAND. (line 6)
  16737. * command-line arguments <3>: GET_COMMAND_ARGUMENT.
  16738. (line 6)
  16739. * command-line arguments <4>: IARGC. (line 6)
  16740. * command-line arguments, number of: COMMAND_ARGUMENT_COUNT.
  16741. (line 6)
  16742. * command-line arguments, number of <1>: IARGC. (line 6)
  16743. * COMMAND_ARGUMENT_COUNT: COMMAND_ARGUMENT_COUNT.
  16744. (line 6)
  16745. * 'COMMON': Volatile COMMON blocks.
  16746. (line 6)
  16747. * compiler flags inquiry function: COMPILER_OPTIONS. (line 6)
  16748. * compiler, name and version: COMPILER_VERSION. (line 6)
  16749. * COMPILER_OPTIONS: COMPILER_OPTIONS. (line 6)
  16750. * COMPILER_VERSION: COMPILER_VERSION. (line 6)
  16751. * COMPLEX: COMPLEX. (line 6)
  16752. * complex conjugate: CONJG. (line 6)
  16753. * Complex function: Alternate complex function syntax.
  16754. (line 6)
  16755. * complex numbers, conversion to: CMPLX. (line 6)
  16756. * complex numbers, conversion to <1>: COMPLEX. (line 6)
  16757. * complex numbers, conversion to <2>: DCMPLX. (line 6)
  16758. * complex numbers, imaginary part: AIMAG. (line 6)
  16759. * complex numbers, real part: DREAL. (line 6)
  16760. * complex numbers, real part <1>: REAL. (line 6)
  16761. * Conditional compilation: Preprocessing and conditional compilation.
  16762. (line 6)
  16763. * CONJG: CONJG. (line 6)
  16764. * consistency, durability: Data consistency and durability.
  16765. (line 6)
  16766. * Contributing: Contributing. (line 6)
  16767. * Contributors: Contributors. (line 6)
  16768. * conversion: Error and Warning Options.
  16769. (line 122)
  16770. * conversion <1>: Error and Warning Options.
  16771. (line 126)
  16772. * conversion, to character: CHAR. (line 6)
  16773. * conversion, to complex: CMPLX. (line 6)
  16774. * conversion, to complex <1>: COMPLEX. (line 6)
  16775. * conversion, to complex <2>: DCMPLX. (line 6)
  16776. * conversion, to integer: Implicitly convert LOGICAL and INTEGER values.
  16777. (line 6)
  16778. * conversion, to integer <1>: IACHAR. (line 6)
  16779. * conversion, to integer <2>: ICHAR. (line 6)
  16780. * conversion, to integer <3>: INT. (line 6)
  16781. * conversion, to integer <4>: INT2. (line 6)
  16782. * conversion, to integer <5>: INT8. (line 6)
  16783. * conversion, to integer <6>: LONG. (line 6)
  16784. * conversion, to logical: Implicitly convert LOGICAL and INTEGER values.
  16785. (line 6)
  16786. * conversion, to logical <1>: LOGICAL. (line 6)
  16787. * conversion, to real: DBLE. (line 6)
  16788. * conversion, to real <1>: REAL. (line 6)
  16789. * conversion, to string: CTIME. (line 6)
  16790. * 'CONVERT' specifier: CONVERT specifier. (line 6)
  16791. * core, dump: ABORT. (line 6)
  16792. * COS: COS. (line 6)
  16793. * COSD: COSD. (line 6)
  16794. * COSH: COSH. (line 6)
  16795. * cosine: COS. (line 6)
  16796. * cosine, degrees: COSD. (line 6)
  16797. * cosine, hyperbolic: COSH. (line 6)
  16798. * cosine, hyperbolic, inverse: ACOSH. (line 6)
  16799. * cosine, inverse: ACOS. (line 6)
  16800. * cosine, inverse, degrees: ACOSD. (line 6)
  16801. * COTAN: COTAN. (line 6)
  16802. * COTAND: COTAND. (line 6)
  16803. * cotangent: COTAN. (line 6)
  16804. * cotangent, degrees: COTAND. (line 6)
  16805. * COUNT: COUNT. (line 6)
  16806. * CO_BROADCAST: CO_BROADCAST. (line 6)
  16807. * CO_MAX: CO_MAX. (line 6)
  16808. * CO_MIN: CO_MIN. (line 6)
  16809. * CO_REDUCE: CO_REDUCE. (line 6)
  16810. * CO_SUM: CO_SUM. (line 6)
  16811. * CPP: Preprocessing and conditional compilation.
  16812. (line 6)
  16813. * CPP <1>: Preprocessing Options.
  16814. (line 6)
  16815. * CPU_TIME: CPU_TIME. (line 6)
  16816. * Credits: Contributors. (line 6)
  16817. * CSHIFT: CSHIFT. (line 6)
  16818. * CSIN: SIN. (line 6)
  16819. * CSIND: SIND. (line 6)
  16820. * CSQRT: SQRT. (line 6)
  16821. * CTIME: CTIME. (line 6)
  16822. * current date: DATE_AND_TIME. (line 6)
  16823. * current date <1>: FDATE. (line 6)
  16824. * current date <2>: IDATE. (line 6)
  16825. * current time: DATE_AND_TIME. (line 6)
  16826. * current time <1>: FDATE. (line 6)
  16827. * current time <2>: ITIME. (line 6)
  16828. * current time <3>: TIME. (line 6)
  16829. * current time <4>: TIME8. (line 6)
  16830. * C_ASSOCIATED: C_ASSOCIATED. (line 6)
  16831. * C_FUNLOC: C_FUNLOC. (line 6)
  16832. * C_F_POINTER: C_F_POINTER. (line 6)
  16833. * C_F_PROCPOINTER: C_F_PROCPOINTER. (line 6)
  16834. * C_LOC: C_LOC. (line 6)
  16835. * C_SIZEOF: C_SIZEOF. (line 6)
  16836. * DABS: ABS. (line 6)
  16837. * DACOS: ACOS. (line 6)
  16838. * DACOSD: ACOSD. (line 6)
  16839. * DACOSH: ACOSH. (line 6)
  16840. * DASIN: ASIN. (line 6)
  16841. * DASIND: ASIND. (line 6)
  16842. * DASINH: ASINH. (line 6)
  16843. * DATAN: ATAN. (line 6)
  16844. * DATAN2: ATAN2. (line 6)
  16845. * DATAN2D: ATAN2D. (line 6)
  16846. * DATAND: ATAND. (line 6)
  16847. * DATANH: ATANH. (line 6)
  16848. * date, current: DATE_AND_TIME. (line 6)
  16849. * date, current <1>: FDATE. (line 6)
  16850. * date, current <2>: IDATE. (line 6)
  16851. * DATE_AND_TIME: DATE_AND_TIME. (line 6)
  16852. * DBESJ0: BESSEL_J0. (line 6)
  16853. * DBESJ1: BESSEL_J1. (line 6)
  16854. * DBESJN: BESSEL_JN. (line 6)
  16855. * DBESY0: BESSEL_Y0. (line 6)
  16856. * DBESY1: BESSEL_Y1. (line 6)
  16857. * DBESYN: BESSEL_YN. (line 6)
  16858. * DBLE: DBLE. (line 6)
  16859. * DCMPLX: DCMPLX. (line 6)
  16860. * DCONJG: CONJG. (line 6)
  16861. * DCOS: COS. (line 6)
  16862. * DCOSD: COSD. (line 6)
  16863. * DCOSH: COSH. (line 6)
  16864. * DCOTAN: COTAN. (line 6)
  16865. * DCOTAND: COTAND. (line 6)
  16866. * DDIM: DIM. (line 6)
  16867. * debugging information options: Debugging Options. (line 6)
  16868. * debugging, preprocessor: Preprocessing Options.
  16869. (line 26)
  16870. * debugging, preprocessor <1>: Preprocessing Options.
  16871. (line 35)
  16872. * debugging, preprocessor <2>: Preprocessing Options.
  16873. (line 41)
  16874. * debugging, preprocessor <3>: Preprocessing Options.
  16875. (line 44)
  16876. * debugging, preprocessor <4>: Preprocessing Options.
  16877. (line 51)
  16878. * 'DECODE': ENCODE and DECODE statements.
  16879. (line 6)
  16880. * delayed execution: ALARM. (line 6)
  16881. * delayed execution <1>: SLEEP. (line 6)
  16882. * DEXP: EXP. (line 6)
  16883. * DFLOAT: REAL. (line 6)
  16884. * DGAMMA: GAMMA. (line 6)
  16885. * dialect options: Fortran Dialect Options.
  16886. (line 6)
  16887. * DIGITS: DIGITS. (line 6)
  16888. * DIM: DIM. (line 6)
  16889. * DIMAG: AIMAG. (line 6)
  16890. * DINT: AINT. (line 6)
  16891. * directive, 'INCLUDE': Directory Options. (line 6)
  16892. * directory, options: Directory Options. (line 6)
  16893. * directory, search paths for inclusion: Directory Options. (line 14)
  16894. * division, modulo: MODULO. (line 6)
  16895. * division, remainder: MOD. (line 6)
  16896. * DLGAMA: LOG_GAMMA. (line 6)
  16897. * DLOG: LOG. (line 6)
  16898. * DLOG10: LOG10. (line 6)
  16899. * DMAX1: MAX. (line 6)
  16900. * DMIN1: MIN. (line 6)
  16901. * DMOD: MOD. (line 6)
  16902. * DNINT: ANINT. (line 6)
  16903. * dot product: DOT_PRODUCT. (line 6)
  16904. * DOT_PRODUCT: DOT_PRODUCT. (line 6)
  16905. * DPROD: DPROD. (line 6)
  16906. * DREAL: DREAL. (line 6)
  16907. * DSHIFTL: DSHIFTL. (line 6)
  16908. * DSHIFTR: DSHIFTR. (line 6)
  16909. * DSIGN: SIGN. (line 6)
  16910. * DSIN: SIN. (line 6)
  16911. * DSIND: SIND. (line 6)
  16912. * DSINH: SINH. (line 6)
  16913. * DSQRT: SQRT. (line 6)
  16914. * DTAN: TAN. (line 6)
  16915. * DTAND: TAND. (line 6)
  16916. * DTANH: TANH. (line 6)
  16917. * DTIME: DTIME. (line 6)
  16918. * dummy argument, unused: Error and Warning Options.
  16919. (line 211)
  16920. * elapsed time: DTIME. (line 6)
  16921. * elapsed time <1>: SECNDS. (line 6)
  16922. * elapsed time <2>: SECOND. (line 6)
  16923. * Elimination of functions with identical argument lists: Code Gen Options.
  16924. (line 392)
  16925. * 'ENCODE': ENCODE and DECODE statements.
  16926. (line 6)
  16927. * 'ENUM' statement: Fortran 2003 status. (line 93)
  16928. * 'ENUMERATOR' statement: Fortran 2003 status. (line 93)
  16929. * environment variable: Environment Variables.
  16930. (line 6)
  16931. * environment variable <1>: Runtime. (line 6)
  16932. * environment variable <2>: GETENV. (line 6)
  16933. * environment variable <3>: GET_ENVIRONMENT_VARIABLE.
  16934. (line 6)
  16935. * 'EOF': Read/Write after EOF marker.
  16936. (line 6)
  16937. * EOSHIFT: EOSHIFT. (line 6)
  16938. * EPSILON: EPSILON. (line 6)
  16939. * ERF: ERF. (line 6)
  16940. * ERFC: ERFC. (line 6)
  16941. * ERFC_SCALED: ERFC_SCALED. (line 6)
  16942. * error function: ERF. (line 6)
  16943. * error function, complementary: ERFC. (line 6)
  16944. * error function, complementary, exponentially-scaled: ERFC_SCALED.
  16945. (line 6)
  16946. * errors, limiting: Error and Warning Options.
  16947. (line 27)
  16948. * escape characters: Fortran Dialect Options.
  16949. (line 74)
  16950. * ETIME: ETIME. (line 6)
  16951. * Euclidean distance: HYPOT. (line 6)
  16952. * Euclidean vector norm: NORM2. (line 6)
  16953. * Events, EVENT_QUERY: EVENT_QUERY. (line 6)
  16954. * EVENT_QUERY: EVENT_QUERY. (line 6)
  16955. * EXECUTE_COMMAND_LINE: EXECUTE_COMMAND_LINE.
  16956. (line 6)
  16957. * EXIT: EXIT. (line 6)
  16958. * EXP: EXP. (line 6)
  16959. * EXPONENT: EXPONENT. (line 6)
  16960. * exponent: Default exponents. (line 6)
  16961. * exponential function: EXP. (line 6)
  16962. * exponential function, inverse: LOG. (line 6)
  16963. * exponential function, inverse <1>: LOG10. (line 6)
  16964. * expression size: C_SIZEOF. (line 6)
  16965. * expression size <1>: SIZEOF. (line 6)
  16966. * EXTENDS_TYPE_OF: EXTENDS_TYPE_OF. (line 6)
  16967. * extensions: Extensions. (line 6)
  16968. * extensions, implemented: Extensions implemented in GNU Fortran.
  16969. (line 6)
  16970. * extensions, not implemented: Extensions not implemented in GNU Fortran.
  16971. (line 6)
  16972. * extra warnings: Error and Warning Options.
  16973. (line 130)
  16974. * 'f2c' calling convention: Code Gen Options. (line 25)
  16975. * 'f2c' calling convention <1>: Code Gen Options. (line 110)
  16976. * Factorial function: GAMMA. (line 6)
  16977. * FDATE: FDATE. (line 6)
  16978. * FDL, GNU Free Documentation License: GNU Free Documentation License.
  16979. (line 6)
  16980. * FGET: FGET. (line 6)
  16981. * FGETC: FGETC. (line 6)
  16982. * file format, fixed: Fortran Dialect Options.
  16983. (line 11)
  16984. * file format, fixed <1>: Fortran Dialect Options.
  16985. (line 91)
  16986. * file format, free: Fortran Dialect Options.
  16987. (line 11)
  16988. * file format, free <1>: Fortran Dialect Options.
  16989. (line 104)
  16990. * file operation, file number: FNUM. (line 6)
  16991. * file operation, flush: FLUSH. (line 6)
  16992. * file operation, position: FSEEK. (line 6)
  16993. * file operation, position <1>: FTELL. (line 6)
  16994. * file operation, read character: FGET. (line 6)
  16995. * file operation, read character <1>: FGETC. (line 6)
  16996. * file operation, seek: FSEEK. (line 6)
  16997. * file operation, write character: FPUT. (line 6)
  16998. * file operation, write character <1>: FPUTC. (line 6)
  16999. * file system, access mode: ACCESS. (line 6)
  17000. * file system, change access mode: CHMOD. (line 6)
  17001. * file system, create link: LINK. (line 6)
  17002. * file system, create link <1>: SYMLNK. (line 6)
  17003. * file system, file creation mask: UMASK. (line 6)
  17004. * file system, file status: FSTAT. (line 6)
  17005. * file system, file status <1>: LSTAT. (line 6)
  17006. * file system, file status <2>: STAT. (line 6)
  17007. * file system, hard link: LINK. (line 6)
  17008. * file system, remove file: UNLINK. (line 6)
  17009. * file system, rename file: RENAME. (line 6)
  17010. * file system, soft link: SYMLNK. (line 6)
  17011. * file, symbolic link: File operations on symbolic links.
  17012. (line 6)
  17013. * flags inquiry function: COMPILER_OPTIONS. (line 6)
  17014. * FLOAT: REAL. (line 6)
  17015. * FLOATI: REAL. (line 6)
  17016. * floating point, exponent: EXPONENT. (line 6)
  17017. * floating point, fraction: FRACTION. (line 6)
  17018. * floating point, nearest different: NEAREST. (line 6)
  17019. * floating point, relative spacing: RRSPACING. (line 6)
  17020. * floating point, relative spacing <1>: SPACING. (line 6)
  17021. * floating point, scale: SCALE. (line 6)
  17022. * floating point, set exponent: SET_EXPONENT. (line 6)
  17023. * FLOATJ: REAL. (line 6)
  17024. * FLOATK: REAL. (line 6)
  17025. * FLOOR: FLOOR. (line 6)
  17026. * floor: AINT. (line 6)
  17027. * floor <1>: FLOOR. (line 6)
  17028. * FLUSH: FLUSH. (line 6)
  17029. * 'FLUSH' statement: Fortran 2003 status. (line 89)
  17030. * FNUM: FNUM. (line 6)
  17031. * form feed whitespace: Form feed as whitespace.
  17032. (line 6)
  17033. * 'FORMAT': Variable FORMAT expressions.
  17034. (line 6)
  17035. * Fortran 77: GNU Fortran and G77. (line 6)
  17036. * FPP: Preprocessing and conditional compilation.
  17037. (line 6)
  17038. * FPUT: FPUT. (line 6)
  17039. * FPUTC: FPUTC. (line 6)
  17040. * FRACTION: FRACTION. (line 6)
  17041. * FREE: FREE. (line 6)
  17042. * Front-end optimization: Code Gen Options. (line 400)
  17043. * FSEEK: FSEEK. (line 6)
  17044. * FSTAT: FSTAT. (line 6)
  17045. * FTELL: FTELL. (line 6)
  17046. * function elimination: Error and Warning Options.
  17047. (line 228)
  17048. * 'g77': GNU Fortran and G77. (line 6)
  17049. * 'g77' calling convention: Code Gen Options. (line 25)
  17050. * 'g77' calling convention <1>: Code Gen Options. (line 110)
  17051. * GAMMA: GAMMA. (line 6)
  17052. * Gamma function: GAMMA. (line 6)
  17053. * Gamma function, logarithm of: LOG_GAMMA. (line 6)
  17054. * GCC: GNU Fortran and GCC. (line 6)
  17055. * GERROR: GERROR. (line 6)
  17056. * GETARG: GETARG. (line 6)
  17057. * GETCWD: GETCWD. (line 6)
  17058. * GETENV: GETENV. (line 6)
  17059. * GETGID: GETGID. (line 6)
  17060. * GETLOG: GETLOG. (line 6)
  17061. * GETPID: GETPID. (line 6)
  17062. * GETUID: GETUID. (line 6)
  17063. * GET_COMMAND: GET_COMMAND. (line 6)
  17064. * GET_COMMAND_ARGUMENT: GET_COMMAND_ARGUMENT.
  17065. (line 6)
  17066. * GET_ENVIRONMENT_VARIABLE: GET_ENVIRONMENT_VARIABLE.
  17067. (line 6)
  17068. * GMTIME: GMTIME. (line 6)
  17069. * GNU Compiler Collection: GNU Fortran and GCC. (line 6)
  17070. * GNU Fortran command options: Invoking GNU Fortran.
  17071. (line 6)
  17072. * Hollerith constants: Hollerith constants support.
  17073. (line 6)
  17074. * HOSTNM: HOSTNM. (line 6)
  17075. * HUGE: HUGE. (line 6)
  17076. * hyperbolic cosine: COSH. (line 6)
  17077. * hyperbolic function, cosine: COSH. (line 6)
  17078. * hyperbolic function, cosine, inverse: ACOSH. (line 6)
  17079. * hyperbolic function, sine: SINH. (line 6)
  17080. * hyperbolic function, sine, inverse: ASINH. (line 6)
  17081. * hyperbolic function, tangent: TANH. (line 6)
  17082. * hyperbolic function, tangent, inverse: ATANH. (line 6)
  17083. * hyperbolic sine: SINH. (line 6)
  17084. * hyperbolic tangent: TANH. (line 6)
  17085. * HYPOT: HYPOT. (line 6)
  17086. * I/O item lists: I/O item lists. (line 6)
  17087. * I/O specifiers: Extended I/O specifiers.
  17088. (line 6)
  17089. * IABS: ABS. (line 6)
  17090. * IACHAR: IACHAR. (line 6)
  17091. * IALL: IALL. (line 6)
  17092. * IAND: IAND. (line 6)
  17093. * IANY: IANY. (line 6)
  17094. * IARGC: IARGC. (line 6)
  17095. * IBCLR: IBCLR. (line 6)
  17096. * IBITS: IBITS. (line 6)
  17097. * IBSET: IBSET. (line 6)
  17098. * ICHAR: ICHAR. (line 6)
  17099. * IDATE: IDATE. (line 6)
  17100. * IDIM: DIM. (line 6)
  17101. * IDINT: INT. (line 6)
  17102. * IDNINT: NINT. (line 6)
  17103. * IEEE, ISNAN: ISNAN. (line 6)
  17104. * IEOR: IEOR. (line 6)
  17105. * IERRNO: IERRNO. (line 6)
  17106. * IFIX: INT. (line 6)
  17107. * IIABS: ABS. (line 6)
  17108. * IIAND: IAND. (line 6)
  17109. * IIBCLR: IBCLR. (line 6)
  17110. * IIBITS: IBITS. (line 6)
  17111. * IIBSET: IBSET. (line 6)
  17112. * IIEOR: IEOR. (line 6)
  17113. * IIOR: IOR. (line 6)
  17114. * IISHFT: ISHFT. (line 6)
  17115. * IISHFTC: ISHFTC. (line 6)
  17116. * IMAG: AIMAG. (line 6)
  17117. * images, cosubscript to image index conversion: IMAGE_INDEX. (line 6)
  17118. * images, index of this image: THIS_IMAGE. (line 6)
  17119. * images, number of: NUM_IMAGES. (line 6)
  17120. * IMAGE_INDEX: IMAGE_INDEX. (line 6)
  17121. * IMAGPART: AIMAG. (line 6)
  17122. * IMOD: MOD. (line 6)
  17123. * 'IMPORT' statement: Fortran 2003 status. (line 120)
  17124. * IMVBITS: MVBITS. (line 6)
  17125. * 'INCLUDE' directive: Directory Options. (line 6)
  17126. * inclusion, directory search paths for: Directory Options. (line 14)
  17127. * INDEX: INDEX intrinsic. (line 6)
  17128. * INOT: NOT. (line 6)
  17129. * INT: INT. (line 6)
  17130. * INT2: INT2. (line 6)
  17131. * INT8: INT8. (line 6)
  17132. * integer kind: SELECTED_INT_KIND. (line 6)
  17133. * Interoperability: Mixed-Language Programming.
  17134. (line 6)
  17135. * intrinsic: Error and Warning Options.
  17136. (line 200)
  17137. * intrinsic <1>: Error and Warning Options.
  17138. (line 207)
  17139. * intrinsic Modules: Intrinsic Modules. (line 6)
  17140. * intrinsic procedures: Intrinsic Procedures.
  17141. (line 6)
  17142. * intrinsics, integer: Type variants for integer intrinsics.
  17143. (line 6)
  17144. * intrinsics, math: Extended math intrinsics.
  17145. (line 6)
  17146. * intrinsics, trigonometric functions: Extended math intrinsics.
  17147. (line 6)
  17148. * Introduction: Top. (line 6)
  17149. * inverse hyperbolic cosine: ACOSH. (line 6)
  17150. * inverse hyperbolic sine: ASINH. (line 6)
  17151. * inverse hyperbolic tangent: ATANH. (line 6)
  17152. * 'IOMSG=' specifier: Fortran 2003 status. (line 91)
  17153. * IOR: IOR. (line 6)
  17154. * 'IOSTAT', end of file: IS_IOSTAT_END. (line 6)
  17155. * 'IOSTAT', end of record: IS_IOSTAT_EOR. (line 6)
  17156. * IPARITY: IPARITY. (line 6)
  17157. * IRAND: IRAND. (line 6)
  17158. * ISATTY: ISATTY. (line 6)
  17159. * ISHFT: ISHFT. (line 6)
  17160. * ISHFTC: ISHFTC. (line 6)
  17161. * ISIGN: SIGN. (line 6)
  17162. * ISNAN: ISNAN. (line 6)
  17163. * 'ISO_FORTRAN_ENV' statement: Fortran 2003 status. (line 128)
  17164. * IS_IOSTAT_END: IS_IOSTAT_END. (line 6)
  17165. * IS_IOSTAT_EOR: IS_IOSTAT_EOR. (line 6)
  17166. * ITIME: ITIME. (line 6)
  17167. * JIABS: ABS. (line 6)
  17168. * JIAND: IAND. (line 6)
  17169. * JIBCLR: IBCLR. (line 6)
  17170. * JIBITS: IBITS. (line 6)
  17171. * JIBSET: IBSET. (line 6)
  17172. * JIEOR: IEOR. (line 6)
  17173. * JIOR: IOR. (line 6)
  17174. * JISHFT: ISHFT. (line 6)
  17175. * JISHFTC: ISHFTC. (line 6)
  17176. * JMOD: MOD. (line 6)
  17177. * JMVBITS: MVBITS. (line 6)
  17178. * JNOT: NOT. (line 6)
  17179. * KIABS: ABS. (line 6)
  17180. * KIAND: IAND. (line 6)
  17181. * KIBCLR: IBCLR. (line 6)
  17182. * KIBITS: IBITS. (line 6)
  17183. * KIBSET: IBSET. (line 6)
  17184. * KIEOR: IEOR. (line 6)
  17185. * KILL: KILL. (line 6)
  17186. * kind: KIND Type Parameters.
  17187. (line 6)
  17188. * KIND: KIND. (line 6)
  17189. * kind <1>: KIND. (line 6)
  17190. * kind, character: SELECTED_CHAR_KIND. (line 6)
  17191. * kind, integer: SELECTED_INT_KIND. (line 6)
  17192. * kind, old-style: Old-style kind specifications.
  17193. (line 6)
  17194. * kind, real: SELECTED_REAL_KIND. (line 6)
  17195. * KIOR: IOR. (line 6)
  17196. * KISHFT: ISHFT. (line 6)
  17197. * KISHFTC: ISHFTC. (line 6)
  17198. * KMOD: MOD. (line 6)
  17199. * KMVBITS: MVBITS. (line 6)
  17200. * KNOT: NOT. (line 6)
  17201. * L2 vector norm: NORM2. (line 6)
  17202. * language, dialect options: Fortran Dialect Options.
  17203. (line 6)
  17204. * LBOUND: LBOUND. (line 6)
  17205. * LCOBOUND: LCOBOUND. (line 6)
  17206. * LEADZ: LEADZ. (line 6)
  17207. * left shift, combined: DSHIFTL. (line 6)
  17208. * LEN: LEN. (line 6)
  17209. * LEN_TRIM: LEN_TRIM. (line 6)
  17210. * lexical comparison of strings: LGE. (line 6)
  17211. * lexical comparison of strings <1>: LGT. (line 6)
  17212. * lexical comparison of strings <2>: LLE. (line 6)
  17213. * lexical comparison of strings <3>: LLT. (line 6)
  17214. * LGAMMA: LOG_GAMMA. (line 6)
  17215. * LGE: LGE. (line 6)
  17216. * LGT: LGT. (line 6)
  17217. * libf2c calling convention: Code Gen Options. (line 25)
  17218. * libf2c calling convention <1>: Code Gen Options. (line 110)
  17219. * libgfortran initialization, set_args: _gfortran_set_args. (line 6)
  17220. * libgfortran initialization, set_convert: _gfortran_set_convert.
  17221. (line 6)
  17222. * libgfortran initialization, set_fpe: _gfortran_set_fpe. (line 6)
  17223. * libgfortran initialization, set_max_subrecord_length: _gfortran_set_max_subrecord_length.
  17224. (line 6)
  17225. * libgfortran initialization, set_options: _gfortran_set_options.
  17226. (line 6)
  17227. * libgfortran initialization, set_record_marker: _gfortran_set_record_marker.
  17228. (line 6)
  17229. * limits, largest number: HUGE. (line 6)
  17230. * limits, smallest number: TINY. (line 6)
  17231. * LINK: LINK. (line 6)
  17232. * linking, static: Link Options. (line 6)
  17233. * LLE: LLE. (line 6)
  17234. * LLT: LLT. (line 6)
  17235. * LNBLNK: LNBLNK. (line 6)
  17236. * LOC: %LOC as an rvalue. (line 6)
  17237. * LOC <1>: LOC. (line 6)
  17238. * location of a variable in memory: LOC. (line 6)
  17239. * LOG: LOG. (line 6)
  17240. * LOG10: LOG10. (line 6)
  17241. * logarithm function: LOG. (line 6)
  17242. * logarithm function with base 10: LOG10. (line 6)
  17243. * logarithm function, inverse: EXP. (line 6)
  17244. * LOGICAL: LOGICAL. (line 6)
  17245. * logical and, bitwise: AND. (line 6)
  17246. * logical and, bitwise <1>: IAND. (line 6)
  17247. * logical exclusive or, bitwise: IEOR. (line 6)
  17248. * logical exclusive or, bitwise <1>: XOR. (line 6)
  17249. * logical not, bitwise: NOT. (line 6)
  17250. * logical or, bitwise: IOR. (line 6)
  17251. * logical or, bitwise <1>: OR. (line 6)
  17252. * logical, bitwise: Bitwise logical operators.
  17253. (line 6)
  17254. * logical, variable representation: Internal representation of LOGICAL variables.
  17255. (line 6)
  17256. * login name: GETLOG. (line 6)
  17257. * LOG_GAMMA: LOG_GAMMA. (line 6)
  17258. * LONG: LONG. (line 6)
  17259. * LSHIFT: LSHIFT. (line 6)
  17260. * LSTAT: LSTAT. (line 6)
  17261. * LTIME: LTIME. (line 6)
  17262. * MALLOC: MALLOC. (line 6)
  17263. * 'MAP': UNION and MAP. (line 6)
  17264. * mask, left justified: MASKL. (line 6)
  17265. * mask, right justified: MASKR. (line 6)
  17266. * MASKL: MASKL. (line 6)
  17267. * MASKR: MASKR. (line 6)
  17268. * MATMUL: MATMUL. (line 6)
  17269. * matrix multiplication: MATMUL. (line 6)
  17270. * matrix, transpose: TRANSPOSE. (line 6)
  17271. * MAX: MAX. (line 6)
  17272. * MAX0: MAX. (line 6)
  17273. * MAX1: MAX. (line 6)
  17274. * MAXEXPONENT: MAXEXPONENT. (line 6)
  17275. * maximum value: MAX. (line 6)
  17276. * maximum value <1>: MAXVAL. (line 6)
  17277. * MAXLOC: MAXLOC. (line 6)
  17278. * MAXVAL: MAXVAL. (line 6)
  17279. * MCLOCK: MCLOCK. (line 6)
  17280. * MCLOCK8: MCLOCK8. (line 6)
  17281. * memory checking: Code Gen Options. (line 141)
  17282. * MERGE: MERGE. (line 6)
  17283. * MERGE_BITS: MERGE_BITS. (line 6)
  17284. * messages, error: Error and Warning Options.
  17285. (line 6)
  17286. * messages, warning: Error and Warning Options.
  17287. (line 6)
  17288. * MIN: MIN. (line 6)
  17289. * MIN0: MIN. (line 6)
  17290. * MIN1: MIN. (line 6)
  17291. * MINEXPONENT: MINEXPONENT. (line 6)
  17292. * minimum value: MIN. (line 6)
  17293. * minimum value <1>: MINVAL. (line 6)
  17294. * MINLOC: MINLOC. (line 6)
  17295. * MINVAL: MINVAL. (line 6)
  17296. * Mixed-language programming: Mixed-Language Programming.
  17297. (line 6)
  17298. * MOD: MOD. (line 6)
  17299. * model representation, base: RADIX. (line 6)
  17300. * model representation, epsilon: EPSILON. (line 6)
  17301. * model representation, largest number: HUGE. (line 6)
  17302. * model representation, maximum exponent: MAXEXPONENT. (line 6)
  17303. * model representation, minimum exponent: MINEXPONENT. (line 6)
  17304. * model representation, precision: PRECISION. (line 6)
  17305. * model representation, radix: RADIX. (line 6)
  17306. * model representation, range: RANGE. (line 6)
  17307. * model representation, significant digits: DIGITS. (line 6)
  17308. * model representation, smallest number: TINY. (line 6)
  17309. * module entities: Fortran Dialect Options.
  17310. (line 86)
  17311. * module search path: Directory Options. (line 14)
  17312. * module search path <1>: Directory Options. (line 29)
  17313. * module search path <2>: Directory Options. (line 36)
  17314. * MODULO: MODULO. (line 6)
  17315. * modulo: MODULO. (line 6)
  17316. * MOVE_ALLOC: MOVE_ALLOC. (line 6)
  17317. * moving allocation: MOVE_ALLOC. (line 6)
  17318. * multiply array elements: PRODUCT. (line 6)
  17319. * MVBITS: MVBITS. (line 6)
  17320. * 'NAM': OPEN( ... NAME=). (line 6)
  17321. * Namelist: Extensions to namelist.
  17322. (line 6)
  17323. * natural logarithm function: LOG. (line 6)
  17324. * NEAREST: NEAREST. (line 6)
  17325. * newline: NEW_LINE. (line 6)
  17326. * NEW_LINE: NEW_LINE. (line 6)
  17327. * NINT: NINT. (line 6)
  17328. * norm, Euclidean: NORM2. (line 6)
  17329. * NORM2: NORM2. (line 6)
  17330. * 'NOSHARED': Extended I/O specifiers.
  17331. (line 6)
  17332. * NOT: NOT. (line 6)
  17333. * NULL: NULL. (line 6)
  17334. * NUM_IMAGES: NUM_IMAGES. (line 6)
  17335. * open, action: Files opened without an explicit ACTION= specifier.
  17336. (line 6)
  17337. * OpenACC: Fortran Dialect Options.
  17338. (line 124)
  17339. * OpenACC <1>: OpenACC. (line 6)
  17340. * OpenMP: Fortran Dialect Options.
  17341. (line 135)
  17342. * OpenMP <1>: OpenMP. (line 6)
  17343. * operators, unary: Unary operators. (line 6)
  17344. * operators, xor: .XOR. operator. (line 6)
  17345. * options inquiry function: COMPILER_OPTIONS. (line 6)
  17346. * options, code generation: Code Gen Options. (line 6)
  17347. * options, debugging: Debugging Options. (line 6)
  17348. * options, dialect: Fortran Dialect Options.
  17349. (line 6)
  17350. * options, directory search: Directory Options. (line 6)
  17351. * options, errors: Error and Warning Options.
  17352. (line 6)
  17353. * options, Fortran dialect: Fortran Dialect Options.
  17354. (line 11)
  17355. * options, 'gfortran' command: Invoking GNU Fortran.
  17356. (line 6)
  17357. * options, linking: Link Options. (line 6)
  17358. * options, negative forms: Invoking GNU Fortran.
  17359. (line 13)
  17360. * options, preprocessor: Preprocessing Options.
  17361. (line 6)
  17362. * options, real kind type promotion: Fortran Dialect Options.
  17363. (line 193)
  17364. * options, run-time: Code Gen Options. (line 6)
  17365. * options, runtime: Runtime Options. (line 6)
  17366. * options, warnings: Error and Warning Options.
  17367. (line 6)
  17368. * OR: OR. (line 6)
  17369. * output, newline: NEW_LINE. (line 6)
  17370. * PACK: PACK. (line 6)
  17371. * PARAMETER: Legacy PARAMETER statements.
  17372. (line 6)
  17373. * PARITY: PARITY. (line 6)
  17374. * Parity: PARITY. (line 6)
  17375. * parity: POPPAR. (line 6)
  17376. * paths, search: Directory Options. (line 14)
  17377. * paths, search <1>: Directory Options. (line 29)
  17378. * paths, search <2>: Directory Options. (line 36)
  17379. * PERROR: PERROR. (line 6)
  17380. * pointer checking: Code Gen Options. (line 141)
  17381. * pointer, C address of pointers: C_F_PROCPOINTER. (line 6)
  17382. * pointer, C address of procedures: C_FUNLOC. (line 6)
  17383. * pointer, C association status: C_ASSOCIATED. (line 6)
  17384. * pointer, convert C to Fortran: C_F_POINTER. (line 6)
  17385. * pointer, Cray: Cray pointers. (line 6)
  17386. * pointer, cray: FREE. (line 6)
  17387. * pointer, cray <1>: MALLOC. (line 6)
  17388. * pointer, disassociated: NULL. (line 6)
  17389. * pointer, status: ASSOCIATED. (line 6)
  17390. * pointer, status <1>: NULL. (line 6)
  17391. * POPCNT: POPCNT. (line 6)
  17392. * POPPAR: POPPAR. (line 6)
  17393. * positive difference: DIM. (line 6)
  17394. * PRECISION: PRECISION. (line 6)
  17395. * Preprocessing: Preprocessing and conditional compilation.
  17396. (line 6)
  17397. * preprocessing, assertion: Preprocessing Options.
  17398. (line 113)
  17399. * preprocessing, assertion <1>: Preprocessing Options.
  17400. (line 119)
  17401. * preprocessing, define macros: Preprocessing Options.
  17402. (line 151)
  17403. * preprocessing, define macros <1>: Preprocessing Options.
  17404. (line 154)
  17405. * preprocessing, include path: Preprocessing Options.
  17406. (line 69)
  17407. * preprocessing, include path <1>: Preprocessing Options.
  17408. (line 76)
  17409. * preprocessing, include path <2>: Preprocessing Options.
  17410. (line 80)
  17411. * preprocessing, include path <3>: Preprocessing Options.
  17412. (line 85)
  17413. * preprocessing, include path <4>: Preprocessing Options.
  17414. (line 89)
  17415. * preprocessing, include path <5>: Preprocessing Options.
  17416. (line 96)
  17417. * preprocessing, keep comments: Preprocessing Options.
  17418. (line 122)
  17419. * preprocessing, keep comments <1>: Preprocessing Options.
  17420. (line 137)
  17421. * preprocessing, no linemarkers: Preprocessing Options.
  17422. (line 179)
  17423. * preprocessing, undefine macros: Preprocessing Options.
  17424. (line 185)
  17425. * preprocessor: Preprocessing Options.
  17426. (line 6)
  17427. * preprocessor, debugging: Preprocessing Options.
  17428. (line 26)
  17429. * preprocessor, debugging <1>: Preprocessing Options.
  17430. (line 35)
  17431. * preprocessor, debugging <2>: Preprocessing Options.
  17432. (line 41)
  17433. * preprocessor, debugging <3>: Preprocessing Options.
  17434. (line 44)
  17435. * preprocessor, debugging <4>: Preprocessing Options.
  17436. (line 51)
  17437. * preprocessor, disable: Preprocessing Options.
  17438. (line 12)
  17439. * preprocessor, enable: Preprocessing Options.
  17440. (line 12)
  17441. * preprocessor, include file handling: Preprocessing and conditional compilation.
  17442. (line 6)
  17443. * preprocessor, working directory: Preprocessing Options.
  17444. (line 55)
  17445. * PRESENT: PRESENT. (line 6)
  17446. * private: Fortran Dialect Options.
  17447. (line 86)
  17448. * procedure pointer, convert C to Fortran: C_LOC. (line 6)
  17449. * process ID: GETPID. (line 6)
  17450. * PRODUCT: PRODUCT. (line 6)
  17451. * product, double-precision: DPROD. (line 6)
  17452. * product, matrix: MATMUL. (line 6)
  17453. * product, vector: DOT_PRODUCT. (line 6)
  17454. * program termination: EXIT. (line 6)
  17455. * program termination, with core dump: ABORT. (line 6)
  17456. * 'PROTECTED' statement: Fortran 2003 status. (line 114)
  17457. * 'Q' exponent-letter: 'Q' exponent-letter. (line 6)
  17458. * RADIX: RADIX. (line 6)
  17459. * radix, real: SELECTED_REAL_KIND. (line 6)
  17460. * RAN: RAN. (line 6)
  17461. * RAND: RAND. (line 6)
  17462. * random number generation: IRAND. (line 6)
  17463. * random number generation <1>: RAN. (line 6)
  17464. * random number generation <2>: RAND. (line 6)
  17465. * random number generation <3>: RANDOM_NUMBER. (line 6)
  17466. * random number generation, seeding: RANDOM_SEED. (line 6)
  17467. * random number generation, seeding <1>: SRAND. (line 6)
  17468. * RANDOM_NUMBER: RANDOM_NUMBER. (line 6)
  17469. * RANDOM_SEED: RANDOM_SEED. (line 6)
  17470. * RANGE: RANGE. (line 6)
  17471. * range checking: Code Gen Options. (line 141)
  17472. * RANK: RANK. (line 6)
  17473. * rank: RANK. (line 6)
  17474. * re-association of parenthesized expressions: Code Gen Options.
  17475. (line 377)
  17476. * read character, stream mode: FGET. (line 6)
  17477. * read character, stream mode <1>: FGETC. (line 6)
  17478. * 'READONLY': Extended I/O specifiers.
  17479. (line 6)
  17480. * REAL: REAL. (line 6)
  17481. * real kind: SELECTED_REAL_KIND. (line 6)
  17482. * real number, exponent: EXPONENT. (line 6)
  17483. * real number, fraction: FRACTION. (line 6)
  17484. * real number, nearest different: NEAREST. (line 6)
  17485. * real number, relative spacing: RRSPACING. (line 6)
  17486. * real number, relative spacing <1>: SPACING. (line 6)
  17487. * real number, scale: SCALE. (line 6)
  17488. * real number, set exponent: SET_EXPONENT. (line 6)
  17489. * Reallocate the LHS in assignments: Code Gen Options. (line 386)
  17490. * Reallocate the LHS in assignments, notification: Error and Warning Options.
  17491. (line 232)
  17492. * REALPART: REAL. (line 6)
  17493. * 'RECORD': STRUCTURE and RECORD.
  17494. (line 6)
  17495. * Reduction, XOR: PARITY. (line 6)
  17496. * remainder: MOD. (line 6)
  17497. * RENAME: RENAME. (line 6)
  17498. * repacking arrays: Code Gen Options. (line 281)
  17499. * REPEAT: REPEAT. (line 6)
  17500. * RESHAPE: RESHAPE. (line 6)
  17501. * 'REWIND': Read/Write after EOF marker.
  17502. (line 6)
  17503. * right shift, combined: DSHIFTR. (line 6)
  17504. * root: SQRT. (line 6)
  17505. * rounding, ceiling: ANINT. (line 6)
  17506. * rounding, ceiling <1>: CEILING. (line 6)
  17507. * rounding, floor: AINT. (line 6)
  17508. * rounding, floor <1>: FLOOR. (line 6)
  17509. * rounding, nearest whole number: NINT. (line 6)
  17510. * RRSPACING: RRSPACING. (line 6)
  17511. * RSHIFT: RSHIFT. (line 6)
  17512. * run-time checking: Code Gen Options. (line 141)
  17513. * SAME_TYPE_AS: SAME_TYPE_AS. (line 6)
  17514. * 'SAVE' statement: Code Gen Options. (line 15)
  17515. * SCALE: SCALE. (line 6)
  17516. * SCAN: SCAN. (line 6)
  17517. * search path: Directory Options. (line 6)
  17518. * search paths, for included files: Directory Options. (line 14)
  17519. * SECNDS: SECNDS. (line 6)
  17520. * SECOND: SECOND. (line 6)
  17521. * seeding a random number generator: RANDOM_SEED. (line 6)
  17522. * seeding a random number generator <1>: SRAND. (line 6)
  17523. * SELECTED_CHAR_KIND: SELECTED_CHAR_KIND. (line 6)
  17524. * SELECTED_INT_KIND: SELECTED_INT_KIND. (line 6)
  17525. * SELECTED_REAL_KIND: SELECTED_REAL_KIND. (line 6)
  17526. * SET_EXPONENT: SET_EXPONENT. (line 6)
  17527. * SHAPE: SHAPE. (line 6)
  17528. * 'SHARE': Extended I/O specifiers.
  17529. (line 6)
  17530. * 'SHARED': Extended I/O specifiers.
  17531. (line 6)
  17532. * shift, left: DSHIFTL. (line 6)
  17533. * shift, left <1>: SHIFTL. (line 6)
  17534. * shift, right: DSHIFTR. (line 6)
  17535. * shift, right <1>: SHIFTR. (line 6)
  17536. * shift, right with fill: SHIFTA. (line 6)
  17537. * SHIFTA: SHIFTA. (line 6)
  17538. * SHIFTL: SHIFTL. (line 6)
  17539. * SHIFTR: SHIFTR. (line 6)
  17540. * SHORT: INT2. (line 6)
  17541. * SIGN: SIGN. (line 6)
  17542. * sign copying: SIGN. (line 6)
  17543. * SIGNAL: SIGNAL. (line 6)
  17544. * SIN: SIN. (line 6)
  17545. * SIND: SIND. (line 6)
  17546. * sine: SIN. (line 6)
  17547. * sine, degrees: SIND. (line 6)
  17548. * sine, hyperbolic: SINH. (line 6)
  17549. * sine, hyperbolic, inverse: ASINH. (line 6)
  17550. * sine, inverse: ASIN. (line 6)
  17551. * sine, inverse, degrees: ASIND. (line 6)
  17552. * SINH: SINH. (line 6)
  17553. * SIZE: SIZE. (line 6)
  17554. * size of a variable, in bits: BIT_SIZE. (line 6)
  17555. * size of an expression: C_SIZEOF. (line 6)
  17556. * size of an expression <1>: SIZEOF. (line 6)
  17557. * SIZEOF: SIZEOF. (line 6)
  17558. * SLEEP: SLEEP. (line 6)
  17559. * SNGL: REAL. (line 6)
  17560. * SPACING: SPACING. (line 6)
  17561. * SPREAD: SPREAD. (line 6)
  17562. * SQRT: SQRT. (line 6)
  17563. * square-root: SQRT. (line 6)
  17564. * SRAND: SRAND. (line 6)
  17565. * Standards: Standards. (line 6)
  17566. * STAT: STAT. (line 6)
  17567. * statement, 'ENUM': Fortran 2003 status. (line 93)
  17568. * statement, 'ENUMERATOR': Fortran 2003 status. (line 93)
  17569. * statement, 'FLUSH': Fortran 2003 status. (line 89)
  17570. * statement, 'IMPORT': Fortran 2003 status. (line 120)
  17571. * statement, 'ISO_FORTRAN_ENV': Fortran 2003 status. (line 128)
  17572. * statement, 'PROTECTED': Fortran 2003 status. (line 114)
  17573. * statement, 'SAVE': Code Gen Options. (line 15)
  17574. * statement, 'USE, INTRINSIC': Fortran 2003 status. (line 128)
  17575. * statement, 'VALUE': Fortran 2003 status. (line 116)
  17576. * statement, 'VOLATILE': Fortran 2003 status. (line 118)
  17577. * 'STATIC': AUTOMATIC and STATIC attributes.
  17578. (line 6)
  17579. * storage size: STORAGE_SIZE. (line 6)
  17580. * STORAGE_SIZE: STORAGE_SIZE. (line 6)
  17581. * 'STREAM' I/O: Fortran 2003 status. (line 103)
  17582. * stream mode, read character: FGET. (line 6)
  17583. * stream mode, read character <1>: FGETC. (line 6)
  17584. * stream mode, write character: FPUT. (line 6)
  17585. * stream mode, write character <1>: FPUTC. (line 6)
  17586. * string, adjust left: ADJUSTL. (line 6)
  17587. * string, adjust right: ADJUSTR. (line 6)
  17588. * string, comparison: LGE. (line 6)
  17589. * string, comparison <1>: LGT. (line 6)
  17590. * string, comparison <2>: LLE. (line 6)
  17591. * string, comparison <3>: LLT. (line 6)
  17592. * string, concatenate: REPEAT. (line 6)
  17593. * string, find missing set: VERIFY. (line 6)
  17594. * string, find non-blank character: LNBLNK. (line 6)
  17595. * string, find subset: SCAN. (line 6)
  17596. * string, find substring: INDEX intrinsic. (line 6)
  17597. * string, length: LEN. (line 6)
  17598. * string, length, without trailing whitespace: LEN_TRIM. (line 6)
  17599. * string, remove trailing whitespace: TRIM. (line 6)
  17600. * string, repeat: REPEAT. (line 6)
  17601. * strings, varying length: Varying Length Character Strings.
  17602. (line 6)
  17603. * 'STRUCTURE': STRUCTURE and RECORD.
  17604. (line 6)
  17605. * structure packing: Code Gen Options. (line 275)
  17606. * subscript checking: Code Gen Options. (line 141)
  17607. * substring position: INDEX intrinsic. (line 6)
  17608. * SUM: SUM. (line 6)
  17609. * sum array elements: SUM. (line 6)
  17610. * suppressing warnings: Error and Warning Options.
  17611. (line 6)
  17612. * symbol names: Fortran Dialect Options.
  17613. (line 68)
  17614. * symbol names, transforming: Code Gen Options. (line 54)
  17615. * symbol names, transforming <1>: Code Gen Options. (line 110)
  17616. * symbol names, underscores: Code Gen Options. (line 54)
  17617. * symbol names, underscores <1>: Code Gen Options. (line 110)
  17618. * SYMLNK: SYMLNK. (line 6)
  17619. * syntax checking: Error and Warning Options.
  17620. (line 33)
  17621. * SYSTEM: SYSTEM. (line 6)
  17622. * system, error handling: GERROR. (line 6)
  17623. * system, error handling <1>: IERRNO. (line 6)
  17624. * system, error handling <2>: PERROR. (line 6)
  17625. * system, group ID: GETGID. (line 6)
  17626. * system, host name: HOSTNM. (line 6)
  17627. * system, login name: GETLOG. (line 6)
  17628. * system, process ID: GETPID. (line 6)
  17629. * system, signal handling: SIGNAL. (line 6)
  17630. * system, system call: EXECUTE_COMMAND_LINE.
  17631. (line 6)
  17632. * system, system call <1>: SYSTEM. (line 6)
  17633. * system, terminal: ISATTY. (line 6)
  17634. * system, terminal <1>: TTYNAM. (line 6)
  17635. * system, user ID: GETUID. (line 6)
  17636. * system, working directory: CHDIR. (line 6)
  17637. * system, working directory <1>: GETCWD. (line 6)
  17638. * SYSTEM_CLOCK: SYSTEM_CLOCK. (line 6)
  17639. * tabulators: Error and Warning Options.
  17640. (line 182)
  17641. * TAN: TAN. (line 6)
  17642. * TAND: TAND. (line 6)
  17643. * tangent: TAN. (line 6)
  17644. * tangent, degrees: TAND. (line 6)
  17645. * tangent, hyperbolic: TANH. (line 6)
  17646. * tangent, hyperbolic, inverse: ATANH. (line 6)
  17647. * tangent, inverse: ATAN. (line 6)
  17648. * tangent, inverse <1>: ATAN2. (line 6)
  17649. * tangent, inverse, degrees: ATAND. (line 6)
  17650. * tangent, inverse, degrees <1>: ATAN2D. (line 6)
  17651. * TANH: TANH. (line 6)
  17652. * terminate program: EXIT. (line 6)
  17653. * terminate program, with core dump: ABORT. (line 6)
  17654. * THIS_IMAGE: THIS_IMAGE. (line 6)
  17655. * thread-safety, threads: Thread-safety of the runtime library.
  17656. (line 6)
  17657. * TIME: TIME. (line 6)
  17658. * time, clock ticks: MCLOCK. (line 6)
  17659. * time, clock ticks <1>: MCLOCK8. (line 6)
  17660. * time, clock ticks <2>: SYSTEM_CLOCK. (line 6)
  17661. * time, conversion to GMT info: GMTIME. (line 6)
  17662. * time, conversion to local time info: LTIME. (line 6)
  17663. * time, conversion to string: CTIME. (line 6)
  17664. * time, current: DATE_AND_TIME. (line 6)
  17665. * time, current <1>: FDATE. (line 6)
  17666. * time, current <2>: ITIME. (line 6)
  17667. * time, current <3>: TIME. (line 6)
  17668. * time, current <4>: TIME8. (line 6)
  17669. * time, elapsed: CPU_TIME. (line 6)
  17670. * time, elapsed <1>: DTIME. (line 6)
  17671. * time, elapsed <2>: ETIME. (line 6)
  17672. * time, elapsed <3>: SECNDS. (line 6)
  17673. * time, elapsed <4>: SECOND. (line 6)
  17674. * TIME8: TIME8. (line 6)
  17675. * TINY: TINY. (line 6)
  17676. * TR 15581: Fortran 2003 status. (line 98)
  17677. * trace: Debugging Options. (line 61)
  17678. * TRAILZ: TRAILZ. (line 6)
  17679. * TRANSFER: TRANSFER. (line 6)
  17680. * transforming symbol names: Code Gen Options. (line 54)
  17681. * transforming symbol names <1>: Code Gen Options. (line 110)
  17682. * TRANSPOSE: TRANSPOSE. (line 6)
  17683. * transpose: TRANSPOSE. (line 6)
  17684. * trigonometric function, cosine: COS. (line 6)
  17685. * trigonometric function, cosine, degrees: COSD. (line 6)
  17686. * trigonometric function, cosine, inverse: ACOS. (line 6)
  17687. * trigonometric function, cosine, inverse, degrees: ACOSD. (line 6)
  17688. * trigonometric function, cotangent: COTAN. (line 6)
  17689. * trigonometric function, cotangent, degrees: COTAND. (line 6)
  17690. * trigonometric function, sine: SIN. (line 6)
  17691. * trigonometric function, sine, degrees: SIND. (line 6)
  17692. * trigonometric function, sine, inverse: ASIN. (line 6)
  17693. * trigonometric function, sine, inverse, degrees: ASIND. (line 6)
  17694. * trigonometric function, tangent: TAN. (line 6)
  17695. * trigonometric function, tangent, degrees: TAND. (line 6)
  17696. * trigonometric function, tangent, inverse: ATAN. (line 6)
  17697. * trigonometric function, tangent, inverse <1>: ATAN2. (line 6)
  17698. * trigonometric function, tangent, inverse, degrees: ATAND. (line 6)
  17699. * trigonometric function, tangent, inverse, degrees <1>: ATAN2D.
  17700. (line 6)
  17701. * TRIM: TRIM. (line 6)
  17702. * TTYNAM: TTYNAM. (line 6)
  17703. * type alias print: TYPE as an alias for PRINT.
  17704. (line 6)
  17705. * type cast: TRANSFER. (line 6)
  17706. * UBOUND: UBOUND. (line 6)
  17707. * UCOBOUND: UCOBOUND. (line 6)
  17708. * UMASK: UMASK. (line 6)
  17709. * underflow: Error and Warning Options.
  17710. (line 195)
  17711. * underscore: Code Gen Options. (line 54)
  17712. * underscore <1>: Code Gen Options. (line 110)
  17713. * 'UNION': UNION and MAP. (line 6)
  17714. * UNLINK: UNLINK. (line 6)
  17715. * UNPACK: UNPACK. (line 6)
  17716. * unused dummy argument: Error and Warning Options.
  17717. (line 211)
  17718. * unused parameter: Error and Warning Options.
  17719. (line 215)
  17720. * 'USE, INTRINSIC' statement: Fortran 2003 status. (line 128)
  17721. * user id: GETUID. (line 6)
  17722. * 'VALUE' statement: Fortran 2003 status. (line 116)
  17723. * variable attributes: AUTOMATIC and STATIC attributes.
  17724. (line 6)
  17725. * Varying length character strings: Varying Length Character Strings.
  17726. (line 6)
  17727. * Varying length strings: Varying Length Character Strings.
  17728. (line 6)
  17729. * vector product: DOT_PRODUCT. (line 6)
  17730. * VERIFY: VERIFY. (line 6)
  17731. * version of the compiler: COMPILER_VERSION. (line 6)
  17732. * 'VOLATILE': Volatile COMMON blocks.
  17733. (line 6)
  17734. * 'VOLATILE' statement: Fortran 2003 status. (line 118)
  17735. * warning, C binding type: Error and Warning Options.
  17736. (line 106)
  17737. * warnings, aliasing: Error and Warning Options.
  17738. (line 71)
  17739. * warnings, alignment of 'COMMON' blocks: Error and Warning Options.
  17740. (line 222)
  17741. * warnings, all: Error and Warning Options.
  17742. (line 62)
  17743. * warnings, ampersand: Error and Warning Options.
  17744. (line 88)
  17745. * warnings, argument mismatch: Error and Warning Options.
  17746. (line 96)
  17747. * warnings, array temporaries: Error and Warning Options.
  17748. (line 101)
  17749. * warnings, character truncation: Error and Warning Options.
  17750. (line 113)
  17751. * warnings, conversion: Error and Warning Options.
  17752. (line 122)
  17753. * warnings, conversion <1>: Error and Warning Options.
  17754. (line 126)
  17755. * warnings, division of integers: Error and Warning Options.
  17756. (line 145)
  17757. * warnings, extra: Error and Warning Options.
  17758. (line 130)
  17759. * warnings, function elimination: Error and Warning Options.
  17760. (line 228)
  17761. * warnings, implicit interface: Error and Warning Options.
  17762. (line 135)
  17763. * warnings, implicit procedure: Error and Warning Options.
  17764. (line 141)
  17765. * warnings, integer division: Error and Warning Options.
  17766. (line 145)
  17767. * warnings, interface mismatch: Error and Warning Options.
  17768. (line 96)
  17769. * warnings, intrinsic: Error and Warning Options.
  17770. (line 200)
  17771. * warnings, intrinsics of other standards: Error and Warning Options.
  17772. (line 149)
  17773. * warnings, line truncation: Error and Warning Options.
  17774. (line 116)
  17775. * warnings, non-standard intrinsics: Error and Warning Options.
  17776. (line 149)
  17777. * warnings, parameter mismatch: Error and Warning Options.
  17778. (line 96)
  17779. * warnings, 'q' exponent-letter: Error and Warning Options.
  17780. (line 156)
  17781. * warnings, suppressing: Error and Warning Options.
  17782. (line 6)
  17783. * warnings, suspicious code: Error and Warning Options.
  17784. (line 160)
  17785. * warnings, tabs: Error and Warning Options.
  17786. (line 182)
  17787. * warnings, to errors: Error and Warning Options.
  17788. (line 261)
  17789. * warnings, undefined do loop: Error and Warning Options.
  17790. (line 190)
  17791. * warnings, underflow: Error and Warning Options.
  17792. (line 195)
  17793. * warnings, unused dummy argument: Error and Warning Options.
  17794. (line 211)
  17795. * warnings, unused parameter: Error and Warning Options.
  17796. (line 215)
  17797. * warnings, use statements: Error and Warning Options.
  17798. (line 207)
  17799. * write character, stream mode: FPUT. (line 6)
  17800. * write character, stream mode <1>: FPUTC. (line 6)
  17801. * XOR: XOR. (line 6)
  17802. * XOR reduction: PARITY. (line 6)
  17803. * ZABS: ABS. (line 6)
  17804. * ZCOS: COS. (line 6)
  17805. * ZCOSD: COSD. (line 6)
  17806. * zero bits: LEADZ. (line 6)
  17807. * zero bits <1>: TRAILZ. (line 6)
  17808. * ZEXP: EXP. (line 6)
  17809. * ZLOG: LOG. (line 6)
  17810. * ZSIN: SIN. (line 6)
  17811. * ZSIND: SIND. (line 6)
  17812. * ZSQRT: SQRT. (line 6)
  17813. 
  17814. Tag Table:
  17815. Node: Top1950
  17816. Node: Introduction3361
  17817. Node: About GNU Fortran4110
  17818. Node: GNU Fortran and GCC8099
  17819. Node: Preprocessing and conditional compilation10213
  17820. Node: GNU Fortran and G7711858
  17821. Node: Project Status12431
  17822. Node: Standards15159
  17823. Node: Varying Length Character Strings16517
  17824. Node: Invoking GNU Fortran17269
  17825. Node: Option Summary18992
  17826. Node: Fortran Dialect Options22683
  17827. Node: Preprocessing Options33438
  17828. Node: Error and Warning Options41679
  17829. Node: Debugging Options52847
  17830. Node: Directory Options56315
  17831. Node: Link Options57750
  17832. Node: Runtime Options58376
  17833. Node: Code Gen Options60283
  17834. Node: Environment Variables79085
  17835. Node: Runtime79690
  17836. Node: TMPDIR80790
  17837. Node: GFORTRAN_STDIN_UNIT81460
  17838. Node: GFORTRAN_STDOUT_UNIT81842
  17839. Node: GFORTRAN_STDERR_UNIT82243
  17840. Node: GFORTRAN_UNBUFFERED_ALL82645
  17841. Node: GFORTRAN_UNBUFFERED_PRECONNECTED83176
  17842. Node: GFORTRAN_SHOW_LOCUS83820
  17843. Node: GFORTRAN_OPTIONAL_PLUS84316
  17844. Node: GFORTRAN_DEFAULT_RECL84792
  17845. Node: GFORTRAN_LIST_SEPARATOR85280
  17846. Node: GFORTRAN_CONVERT_UNIT85889
  17847. Node: GFORTRAN_ERROR_BACKTRACE88744
  17848. Node: Fortran 2003 and 2008 status89301
  17849. Node: Fortran 2003 status89581
  17850. Node: Fortran 2008 status94824
  17851. Node: TS 29113 status100202
  17852. Node: TS 18508 status101205
  17853. Node: Compiler Characteristics101996
  17854. Node: KIND Type Parameters102625
  17855. Node: Internal representation of LOGICAL variables104053
  17856. Node: Thread-safety of the runtime library104913
  17857. Node: Data consistency and durability107316
  17858. Node: Files opened without an explicit ACTION= specifier110429
  17859. Node: File operations on symbolic links111120
  17860. Node: Extensions112188
  17861. Node: Extensions implemented in GNU Fortran112793
  17862. Node: Old-style kind specifications114676
  17863. Node: Old-style variable initialization115778
  17864. Node: Extensions to namelist117090
  17865. Node: X format descriptor without count field119393
  17866. Node: Commas in FORMAT specifications119920
  17867. Node: Missing period in FORMAT specifications120437
  17868. Node: I/O item lists120999
  17869. Node: 'Q' exponent-letter121386
  17870. Node: BOZ literal constants121986
  17871. Node: Real array indices124567
  17872. Node: Unary operators124866
  17873. Node: Implicitly convert LOGICAL and INTEGER values125280
  17874. Node: Hollerith constants support126239
  17875. Node: Cray pointers128011
  17876. Node: CONVERT specifier133458
  17877. Node: OpenMP135453
  17878. Node: OpenACC137711
  17879. Node: Argument list functions139020
  17880. Node: Read/Write after EOF marker140663
  17881. Node: STRUCTURE and RECORD141266
  17882. Node: UNION and MAP145857
  17883. Node: Type variants for integer intrinsics148825
  17884. Node: AUTOMATIC and STATIC attributes150827
  17885. Node: Extended math intrinsics152361
  17886. Node: Form feed as whitespace154157
  17887. Node: TYPE as an alias for PRINT154703
  17888. Node: %LOC as an rvalue155168
  17889. Node: .XOR. operator155815
  17890. Node: Bitwise logical operators156215
  17891. Node: Extended I/O specifiers157767
  17892. Node: Legacy PARAMETER statements161487
  17893. Node: Default exponents162092
  17894. Node: Extensions not implemented in GNU Fortran162444
  17895. Node: ENCODE and DECODE statements163389
  17896. Node: Variable FORMAT expressions164720
  17897. Node: Alternate complex function syntax165825
  17898. Node: Volatile COMMON blocks166375
  17899. Node: OPEN( ... NAME=)166877
  17900. Node: Mixed-Language Programming167279
  17901. Node: Interoperability with C167859
  17902. Node: Intrinsic Types169193
  17903. Node: Derived Types and struct170189
  17904. Node: Interoperable Global Variables171547
  17905. Node: Interoperable Subroutines and Functions172822
  17906. Node: Working with Pointers176616
  17907. Node: Further Interoperability of Fortran with C181092
  17908. Node: GNU Fortran Compiler Directives184446
  17909. Node: Non-Fortran Main Program187698
  17910. Node: _gfortran_set_args189886
  17911. Node: _gfortran_set_options190824
  17912. Node: _gfortran_set_convert194224
  17913. Node: _gfortran_set_record_marker195092
  17914. Node: _gfortran_set_fpe195902
  17915. Node: _gfortran_set_max_subrecord_length197100
  17916. Node: Naming and argument-passing conventions198023
  17917. Node: Naming conventions198742
  17918. Node: Argument passing conventions200214
  17919. Node: Coarray Programming204708
  17920. Node: Type and enum ABI Documentation204955
  17921. Node: caf_token_t205253
  17922. Node: caf_register_t205489
  17923. Node: caf_deregister_t206700
  17924. Node: caf_reference_t207202
  17925. Node: caf_team_t211526
  17926. Node: Function ABI Documentation211825
  17927. Node: _gfortran_caf_init214275
  17928. Node: _gfortran_caf_finish215701
  17929. Node: _gfortran_caf_this_image216640
  17930. Node: _gfortran_caf_num_images217395
  17931. Node: _gfortran_caf_image_status218506
  17932. Node: _gfortran_caf_failed_images219626
  17933. Node: _gfortran_caf_stopped_images220796
  17934. Node: _gfortran_caf_register221969
  17935. Node: _gfortran_caf_deregister226134
  17936. Node: _gfortran_caf_is_present227737
  17937. Node: _gfortran_caf_send228816
  17938. Node: _gfortran_caf_get232006
  17939. Node: _gfortran_caf_sendget235087
  17940. Node: _gfortran_caf_send_by_ref238998
  17941. Node: _gfortran_caf_get_by_ref242346
  17942. Node: _gfortran_caf_sendget_by_ref245608
  17943. Node: _gfortran_caf_lock249386
  17944. Node: _gfortran_caf_unlock251169
  17945. Node: _gfortran_caf_event_post252647
  17946. Node: _gfortran_caf_event_wait254093
  17947. Node: _gfortran_caf_event_query256197
  17948. Node: _gfortran_caf_sync_all257528
  17949. Node: _gfortran_caf_sync_images258453
  17950. Node: _gfortran_caf_sync_memory259985
  17951. Node: _gfortran_caf_error_stop260974
  17952. Node: _gfortran_caf_error_stop_str261582
  17953. Node: _gfortran_caf_fail_image262288
  17954. Node: _gfortran_caf_atomic_define262824
  17955. Node: _gfortran_caf_atomic_ref264139
  17956. Node: _gfortran_caf_atomic_cas265443
  17957. Node: _gfortran_caf_atomic_op267204
  17958. Node: _gfortran_caf_co_broadcast269306
  17959. Node: _gfortran_caf_co_max270408
  17960. Node: _gfortran_caf_co_min272031
  17961. Node: _gfortran_caf_co_sum273648
  17962. Node: _gfortran_caf_co_reduce275185
  17963. Node: Intrinsic Procedures277826
  17964. Node: Introduction to Intrinsics294882
  17965. Node: ABORT297232
  17966. Node: ABS297977
  17967. Node: ACCESS299927
  17968. Node: ACHAR301857
  17969. Node: ACOS303061
  17970. Node: ACOSD304347
  17971. Node: ACOSH305659
  17972. Node: ADJUSTL306655
  17973. Node: ADJUSTR307597
  17974. Node: AIMAG308547
  17975. Node: AINT309919
  17976. Node: ALARM311525
  17977. Node: ALL313157
  17978. Node: ALLOCATED315081
  17979. Node: AND316220
  17980. Node: ANINT317519
  17981. Node: ANY319016
  17982. Node: ASIN320942
  17983. Node: ASIND322217
  17984. Node: ASINH323515
  17985. Node: ASSOCIATED324521
  17986. Node: ATAN327532
  17987. Node: ATAND328982
  17988. Node: ATAN2330452
  17989. Node: ATAN2D332317
  17990. Node: ATANH334292
  17991. Node: ATOMIC_ADD335298
  17992. Node: ATOMIC_AND336830
  17993. Node: ATOMIC_CAS338418
  17994. Node: ATOMIC_DEFINE340277
  17995. Node: ATOMIC_FETCH_ADD341996
  17996. Node: ATOMIC_FETCH_AND343796
  17997. Node: ATOMIC_FETCH_OR345586
  17998. Node: ATOMIC_FETCH_XOR347363
  17999. Node: ATOMIC_OR349146
  18000. Node: ATOMIC_REF350731
  18001. Node: ATOMIC_XOR352627
  18002. Node: BACKTRACE354212
  18003. Node: BESSEL_J0354792
  18004. Node: BESSEL_J1355808
  18005. Node: BESSEL_JN356825
  18006. Node: BESSEL_Y0358650
  18007. Node: BESSEL_Y1359605
  18008. Node: BESSEL_YN360560
  18009. Node: BGE362391
  18010. Node: BGT363083
  18011. Node: BIT_SIZE363733
  18012. Node: BLE364555
  18013. Node: BLT365237
  18014. Node: BTEST365875
  18015. Node: C_ASSOCIATED367332
  18016. Node: C_F_POINTER368543
  18017. Node: C_F_PROCPOINTER369978
  18018. Node: C_FUNLOC371485
  18019. Node: C_LOC372856
  18020. Node: C_SIZEOF374135
  18021. Node: CEILING375548
  18022. Node: CHAR376556
  18023. Node: CHDIR377768
  18024. Node: CHMOD378942
  18025. Node: CMPLX380857
  18026. Node: CO_BROADCAST382300
  18027. Node: CO_MAX384073
  18028. Node: CO_MIN385953
  18029. Node: CO_REDUCE387819
  18030. Node: CO_SUM391322
  18031. Node: COMMAND_ARGUMENT_COUNT393229
  18032. Node: COMPILER_OPTIONS394146
  18033. Node: COMPILER_VERSION395172
  18034. Node: COMPLEX396136
  18035. Node: CONJG397275
  18036. Node: COS398331
  18037. Node: COSD399786
  18038. Node: COSH401235
  18039. Node: COTAN402418
  18040. Node: COTAND403557
  18041. Node: COUNT404736
  18042. Node: CPU_TIME406761
  18043. Node: CSHIFT408118
  18044. Node: CTIME409778
  18045. Node: DATE_AND_TIME411286
  18046. Node: DBLE413766
  18047. Node: DCMPLX414561
  18048. Node: DIGITS415743
  18049. Node: DIM416710
  18050. Node: DOT_PRODUCT417991
  18051. Node: DPROD419634
  18052. Node: DREAL420561
  18053. Node: DSHIFTL421227
  18054. Node: DSHIFTR422560
  18055. Node: DTIME423894
  18056. Node: EOSHIFT426709
  18057. Node: EPSILON428782
  18058. Node: ERF429509
  18059. Node: ERFC430290
  18060. Node: ERFC_SCALED431100
  18061. Node: ETIME431793
  18062. Node: EVENT_QUERY434032
  18063. Node: EXECUTE_COMMAND_LINE435621
  18064. Node: EXIT438216
  18065. Node: EXP439094
  18066. Node: EXPONENT440347
  18067. Node: EXTENDS_TYPE_OF441111
  18068. Node: FDATE441969
  18069. Node: FGET443455
  18070. Node: FGETC445282
  18071. Node: FLOOR447090
  18072. Node: FLUSH448079
  18073. Node: FNUM449958
  18074. Node: FPUT450683
  18075. Node: FPUTC452317
  18076. Node: FRACTION454098
  18077. Node: FREE455002
  18078. Node: FSEEK455845
  18079. Node: FSTAT458151
  18080. Node: FTELL459238
  18081. Node: GAMMA460220
  18082. Node: GERROR461274
  18083. Node: GETARG461996
  18084. Node: GET_COMMAND463769
  18085. Node: GET_COMMAND_ARGUMENT465143
  18086. Node: GETCWD467191
  18087. Node: GETENV468171
  18088. Node: GET_ENVIRONMENT_VARIABLE469603
  18089. Node: GETGID471766
  18090. Node: GETLOG472303
  18091. Node: GETPID473165
  18092. Node: GETUID473895
  18093. Node: GMTIME474411
  18094. Node: HOSTNM476171
  18095. Node: HUGE477092
  18096. Node: HYPOT477814
  18097. Node: IACHAR478640
  18098. Node: IALL479808
  18099. Node: IAND481293
  18100. Node: IANY482866
  18101. Node: IARGC484360
  18102. Node: IBCLR485381
  18103. Node: IBITS486629
  18104. Node: IBSET488133
  18105. Node: ICHAR489376
  18106. Node: IDATE491546
  18107. Node: IEOR492846
  18108. Node: IERRNO494312
  18109. Node: IMAGE_INDEX494861
  18110. Node: INDEX intrinsic495889
  18111. Node: INT497415
  18112. Node: INT2499174
  18113. Node: INT8499942
  18114. Node: IOR500657
  18115. Node: IPARITY502099
  18116. Node: IRAND503631
  18117. Node: IS_IOSTAT_END504990
  18118. Node: IS_IOSTAT_EOR506089
  18119. Node: ISATTY507218
  18120. Node: ISHFT508001
  18121. Node: ISHFTC509570
  18122. Node: ISNAN511377
  18123. Node: ITIME512144
  18124. Node: KILL513442
  18125. Node: KIND514351
  18126. Node: LBOUND515197
  18127. Node: LCOBOUND516535
  18128. Node: LEADZ517670
  18129. Node: LEN518531
  18130. Node: LEN_TRIM519827
  18131. Node: LGE520815
  18132. Node: LGT522328
  18133. Node: LINK523806
  18134. Node: LLE524845
  18135. Node: LLT526345
  18136. Node: LNBLNK527816
  18137. Node: LOC528594
  18138. Node: LOG529326
  18139. Node: LOG10530671
  18140. Node: LOG_GAMMA531661
  18141. Node: LOGICAL532763
  18142. Node: LONG533575
  18143. Node: LSHIFT534333
  18144. Node: LSTAT535419
  18145. Node: LTIME536619
  18146. Node: MALLOC538301
  18147. Node: MASKL539763
  18148. Node: MASKR540530
  18149. Node: MATMUL541300
  18150. Node: MAX542398
  18151. Node: MAXEXPONENT543933
  18152. Node: MAXLOC544750
  18153. Node: MAXVAL546775
  18154. Node: MCLOCK548415
  18155. Node: MCLOCK8549438
  18156. Node: MERGE550668
  18157. Node: MERGE_BITS551420
  18158. Node: MIN552285
  18159. Node: MINEXPONENT553823
  18160. Node: MINLOC554454
  18161. Node: MINVAL556479
  18162. Node: MOD558132
  18163. Node: MODULO560296
  18164. Node: MOVE_ALLOC561599
  18165. Node: MVBITS562632
  18166. Node: NEAREST564284
  18167. Node: NEW_LINE565384
  18168. Node: NINT566157
  18169. Node: NORM2567578
  18170. Node: NOT568720
  18171. Node: NULL569890
  18172. Node: NUM_IMAGES570798
  18173. Node: OR572499
  18174. Node: PACK573785
  18175. Node: PARITY575793
  18176. Node: PERROR577014
  18177. Node: POPCNT577639
  18178. Node: POPPAR578511
  18179. Node: PRECISION579565
  18180. Node: PRESENT580452
  18181. Node: PRODUCT581564
  18182. Node: RADIX583098
  18183. Node: RAN583910
  18184. Node: RAND584366
  18185. Node: RANDOM_NUMBER585701
  18186. Node: RANDOM_SEED586915
  18187. Node: RANGE589364
  18188. Node: RANK590045
  18189. Node: REAL590826
  18190. Node: RENAME592815
  18191. Node: REPEAT593837
  18192. Node: RESHAPE594565
  18193. Node: RRSPACING596032
  18194. Node: RSHIFT596725
  18195. Node: SAME_TYPE_AS597865
  18196. Node: SCALE598697
  18197. Node: SCAN599478
  18198. Node: SECNDS601036
  18199. Node: SECOND602128
  18200. Node: SELECTED_CHAR_KIND603004
  18201. Node: SELECTED_INT_KIND604599
  18202. Node: SELECTED_REAL_KIND605776
  18203. Node: SET_EXPONENT608453
  18204. Node: SHAPE609450
  18205. Node: SHIFTA610874
  18206. Node: SHIFTL611838
  18207. Node: SHIFTR612675
  18208. Node: SIGN613513
  18209. Node: SIGNAL614739
  18210. Node: SIN616245
  18211. Node: SIND617336
  18212. Node: SINH618665
  18213. Node: SIZE619678
  18214. Node: SIZEOF620997
  18215. Node: SLEEP622652
  18216. Node: SPACING623213
  18217. Node: SPREAD624227
  18218. Node: SQRT625378
  18219. Node: SRAND626710
  18220. Node: STAT627944
  18221. Node: STORAGE_SIZE631112
  18222. Node: SUM631991
  18223. Node: SYMLNK633483
  18224. Node: SYSTEM634618
  18225. Node: SYSTEM_CLOCK635873
  18226. Node: TAN638703
  18227. Node: TAND639774
  18228. Node: TANH640858
  18229. Node: THIS_IMAGE642033
  18230. Node: TIME644333
  18231. Node: TIME8645504
  18232. Node: TINY646703
  18233. Node: TRAILZ647304
  18234. Node: TRANSFER648122
  18235. Node: TRANSPOSE650158
  18236. Node: TRIM650848
  18237. Node: TTYNAM651706
  18238. Node: UBOUND652624
  18239. Node: UCOBOUND654014
  18240. Node: UMASK655151
  18241. Node: UNLINK655833
  18242. Node: UNPACK656813
  18243. Node: VERIFY658108
  18244. Node: XOR659837
  18245. Node: Intrinsic Modules661210
  18246. Node: ISO_FORTRAN_ENV661499
  18247. Node: ISO_C_BINDING665902
  18248. Node: IEEE modules669608
  18249. Node: OpenMP Modules OMP_LIB and OMP_LIB_KINDS670751
  18250. Node: OpenACC Module OPENACC672291
  18251. Node: Contributing673218
  18252. Node: Contributors674072
  18253. Node: Projects675703
  18254. Node: Proposed Extensions676510
  18255. Node: Copying678520
  18256. Node: GNU Free Documentation License716066
  18257. Node: Funding741190
  18258. Node: Option Index743716
  18259. Node: Keyword Index760745
  18260. 
  18261. End Tag Table