WPC =$Jf* T=-S_ɵ6buthaaHSR\9^Kd0J`9B0Ik_%C=*䱼X*^*#cB3JO Lg47ژ ) r`_Y717 ]>n[~TE]LUg3$l7^;QLrT{׮ MVcjnojk1c{3s Yݐ;ֱPYq*"aZ6G݂OsHX2,/giqrz+[I lPBaxgvlv2KVkHkyP (^,ji l8Dƪ~P@9u-P%Ҿvj\R!?Qn(JX ,|Y%P;^F{I/laѹSev,gx77V#aUMUIf[wہUL % 0 0LwnULeUV   0;   $ * 00w@6ULv4ULUL1UV}2p`4New Century Schoolbook( $XXX  ޢޢޢ    (2c$  !XX       d:\office\wpwin\template\x3j3-rpt.wpt<6X9`(CourierXx6X@KX@<6X9`(Courierd6X@K@+`4New Century Schoolbooke P'CP+`4New Century Schoolbook  c'      ,X>(#q#qq# qX3J3/96-071#q #qq#q#Ԉ X X3J3ANSIFortranStandardsCommittee>(#CraigT.Dedo b  VariableFormatExpressions=(#April24,1996 ) (#Page  1  ڀof39LXp>New Century Schoolbook BoldVariable Format ExpressionsReport,' ' X3J3/96-071$Craig T. Dedo$Craig T. Dedo .   /4 Fortran 2000 Standard+None     "1 302Original   ,X.F 6D:\X3J3\VARIAB~1\96-071.WPDFD:\X3J3\VARIAB~1\96-071.WPD/  (3u#$  !XX       H hijkHlm[nop[q2p`4New Century Schoolbook ^3|xq2p`4New Century Schoolbook+`4New Century Schoolbook9LXp>New Century Schoolbook Bold  !XX       ݛ ֜   r^4` <hDp Lx !(#T$%&Xrqo%  oqq%  q@v v  VariableFormatExpressions   @SS"byCraigT.Dedo@#April24,1996 1.0  Rationale  7(#(#   Avariableformatexpression(VFE)allowsaprogrammertouseanarithmeticexpressionatanyplaceinaformateditdescriptorwhereanintegercanbeused.ThecurrentFortran90standardandϜtheFortran95DISonlyallowformateditdescriptorswhichareeithercharacterexpressions#^#Ԁorhard  S  codedintothesourcecode.  AVFEprovidestheapplicationprogrammeraconvenientandstraightforwardmethodofvaryingtheformateditdescriptoratruntime,asconditionsrequire.ManyapplicationprogrammersconsiderVFEstobeeasiertouseandlesserrorpronethantheonlycurrentalternativeofbuildingformatspecificationsincharacterexpressions.Thus,VFEsoffertheapplicationdeveloperanopportunitytosaveonprogrammingtimeandeffort,withaconsequentincreaseinproductivity.  Itistheintentofthisproposaltoratifyexistingpractice.Asurveyofexistingcompilersindicatesthatmostimplementations##Ԁwhichofferthisfeaturedosoinasimilar,ifnotidentical,manner.  ##  2.0  TechnicalSpecification n(#(#   Avariableformatexpressionisascalarnumericexpressionenclosedinsideanglebrackets,<>.AVFEcanbeusedinaformateditdescriptoranyplacethatanintegercan.Duringprogramexecution,theVFEisreevaluatedeachtimeitisencounteredinthenormalformatscan.  IftheVFEisnotofintegerdatatype,itisconvertedtointegertypebeforeitisused,accordingtotheusualrulesfordatatypeconversion.AVFEmaybeofanyKINDtypethatisdefinedontheprocessor.  TheVFEcanbeanyvalidscalarnumericexpression.Itcanincludedummyarguments,functionreferences,andnamedconstants.ItshallnotincludeanyarrayvalueddataitemoranyvariablewiththePOINTERattribute.AnyfunctionreferencedinaVFEshallnotexecuteanyI/Ooperation.  ThevalueofaVFEmustobeytherestrictionsonmagnitudeapplyingtoitsuseintheformat,oranerroroccurs.  VFEsshallnotbeusedinacharacterformatspecification(10.1.2).  VFEsareevaluatedeachtimetheyareencounteredinthescanoftheformat.IfthevalueofthevariableusedintheexpressionchangesduringtheexecutionoftheI/Ostatement,thenewvalueisusedthenexttimetheformatitemcontainingtheexpressionisprocessed.Example )O#- Considerthefollowingstatements:    INTEGER :: IWIDTH,IDIGITS,IEXPONENT,NF,NE \+$/     REAL,ALLOCATABLE <  h ::  FREAL(:),EREAL(:) #,%0 !    InterveningstatementsdefiningthevaluesofNFandNE ,k&1     ALLOCATE FREAL(NF) -2'2     ALLOCATE EREAL(NE) x.'3 !    InterveningstatementsdefiningtheelementsofFREAL,EREAL,IWIDTH,IDIGITS,  !     4 andIEXPONENT. F     WRITE(*,601)FREAL,EREAL601  FORMAT(5X,F.,& U     &5X,E.E)  If,ononeexecutionoftheWRITEstatement,NFis5,NEis3,IWIDTHis12,IDIGITSis7,andϜIEXPONENTis2,thenstatement601wouldbeequivalentto:601  FORMAT(5X,5F12.7,5X,3E18.7E2)  8   If,onasubsequentexecutionoftheWRITEstatement,NFis6,NEis2,IWIDTHis10,IDIGITSis5,andIEXPONENTis3,thenstatement601wouldbeequivalentto:#U#    601  FORMAT(5X,6F10.5,5X,2E16.5E3) T  #|# 3.0  EditstotheStandard ( (#(#   Theseeditsarepreliminaryandareofferedprimarilyasabasisfordiscussion. Section10.2  D ChangeruleR1004andthefollowingconstraintstoread:̜R1004  r 4  `      is  < intliteralconstantorvfe S Constraint: ` rshallbepositive.  Constraint: ` rshallnothaveakindparameterspecifiedforitifrisaconstant. a Theexpressionpprppiscalleda repeatspecification.  (  Section10.2.1  8 ChangerulesR1006,R1007,R1008,R1009andthelastconstraintfollowingthemtoread:̜R1006  w 4  `      is  < intliteralconstantorvfe E МR1007  m 4  `      is  < intliteralconstantorvfe# #   #'#ԜR1008  d 4  `      is  < intliteralconstantorvfe#~# V #]#ԜR1009  e 4  `      is  < intliteralconstantorvfe#Ǵ#  #Ǔ#Constraint:0 ` w,m,d,andeshallnothavekindparametersspecifiedforthemiftheyareconstants., !` (#` (# ChangeruleR1011andtheconstraintfollowingittoread:̜R1011  k 4  `      is  < signedintliteralconstantorvfe "$ Constraint: ` kshallnothaveakindparameterspecifiedforitifitisaconstant. I#% ChangeruleR1013andtheconstraintfollowingittoread:̜R1013  n 4  `      is  < intliteralconstantorvfe %( Constraint: ` nshallnothaveakindparameterspecifiedforitifitisaconstant. f&) ## Section10.2.3  'u!+ Addasection10.2.3toread: 10.2.3 4  ` VariableFormatExpressions  I*#.   Avariableformatexpressionisascalarnumericexpressionenclosedinsideanglebrackets,<>.Avariableformatexpressioncanbeusedinaformateditdescriptoranyplacethatanintegercan.Duringprogramexecution,thevariableformatexpressionisreevaluatedeachtimeitisencounteredinthenormalformatscan. N.'3 Ї#ǟ#ԜR1017  vfe 4  `      is  < <numericexpr>  Constraint:0 ` Thenumericexprshallnotbearrayvalued.G` (#` (# Constraint:0 ` ThenumericexprshallnothavethePOINTERattribute.` (#` (# Constraint: ` Avfeshallnotappearinacharacterformatspecification(10.1.2). V # #  Anyfunctionreferencedinthenumericexprshallnotexecuteanyinputoutputstatement. c  hh  Ifthevfeisnotofintegerdatatype,itisconvertedtointegertypeafteritisevaluatedandbefore  r itisused.AvfemaybeofanyKINDtypethatisdefinedontheprocessor.  9 ̜pn%  np  Thevalueofammlvfelmmllllkvariableformatexpressionkshallobeytherestrictionsonmagnitudeapplyingtoitsuseintheformatj.ji,oranerroroccurs.i F    Avfeshallbeevaluatedeachtimeitisencounteredinthescanoftheformat.Ifthevalueofthe U  МgvfegchangesduringtheexecutionoftheI/Ostatement,thenewvalueisusedthenexttimetheformat   Мnh%  hnitemcontainingtheexpressionisprocessed.#$## 4.0  References 8 (#(# #nj'#0   DigitalEquipmentCorporation.February1995.DECFortranLanguageReferenceManual. ~  Maynard,MA:DigitalEquipmentCorporation.Section8.3.7,pp.8-26thru8-28. (#(# 0   DigitalEquipmentCorporation.April1995.DECFortran90LanguageReferenceManual.Maynard, T MA:DigitalEquipmentCorporation.Section11.6,pp.11-44thru11-45. (#(# 0   InternationalBusinessMachinesCorporation.December1993.AIX/XLFortranCompiler/6000 ( LanguageReferenceVersion3Release1.NorthYork,ON:InternationalBusinessMachines p Corporation.p.272. (#(# ISO/IEC1539-1:1991(E)InternationalStandardProgrammingLanguageFortran90,10.1.2. D М[Endof96-nnn]h%  h