- Timestamp:
- 09/05/08 11:49:42 (16 years ago)
- Branches:
- master
- Children:
- fafe4d6
- Parents:
- 2ebb8b6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
redstr.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: extstr,ibegst,iendst,4 ciredin,iredrl,iopfil,5 ctolost,toupst6 c 7 cCopyright 2003-2005 Frank Eisenmenger, U.H.E. Hansmann,8 cShura Hayryan, Chin-Ku9 cCopyright 2007 Frank Eisenmenger, U.H.E. Hansmann,10 cJan H. Meinke, Sandipan Mohanty11 c 12 c**************************************************************1 !************************************************************** 2 ! 3 ! This file contains the subroutines: extstr,ibegst,iendst, 4 ! iredin,iredrl,iopfil, 5 ! tolost,toupst 6 ! 7 ! Copyright 2003-2005 Frank Eisenmenger, U.H.E. Hansmann, 8 ! Shura Hayryan, Chin-Ku 9 ! Copyright 2007 Frank Eisenmenger, U.H.E. Hansmann, 10 ! Jan H. Meinke, Sandipan Mohanty 11 ! 12 ! ************************************************************** 13 13 14 14 15 15 subroutine extstr(spr,ib,ie,str,strn,l) 16 16 17 c..........................................................18 cPURPOSE: Extract substring preceeding separator 'spr'19 cfrom 'str' searching from position 'ib' up to20 cposition 'ie' and put it into 'strn(1:l)'.21 c'ib' is shifted to position following 'spr' or22 cto 'ie+1', if 'spr' is not found23 c 24 c! 'spr' should not be blank25 c 26 cCALLS: ibegst,iendst27 c..........................................................17 ! .......................................................... 18 ! PURPOSE: Extract substring preceeding separator 'spr' 19 ! from 'str' searching from position 'ib' up to 20 ! position 'ie' and put it into 'strn(1:l)'. 21 ! 'ib' is shifted to position following 'spr' or 22 ! to 'ie+1', if 'spr' is not found 23 ! 24 ! ! 'spr' should not be blank 25 ! 26 ! CALLS: ibegst,iendst 27 ! .......................................................... 28 28 29 29 implicit integer*4 (i-n) … … 64 64 l=0 65 65 strn=blnk 66 c____________________________ make string in 'strn' left justified66 ! ____________________________ make string in 'strn' left justified 67 67 elseif (i.gt.1) then 68 68 j=iendst(strn) … … 75 75 76 76 return 77 c______________________________________________________________ Error77 ! ______________________________________________________________ Error 78 78 1 write (*,'(a)') ' extstr> Substring to be extracted is too long !' 79 79 stop 80 80 81 81 end 82 c**********************************82 ! ********************************** 83 83 integer*4 function ibegst(str) 84 84 85 c.............................................................86 cPURPOSE: returns position of 1st non-blank character in 'str'87 c 88 cCALLS: none89 c 90 c.............................................................85 ! ............................................................. 86 ! PURPOSE: returns position of 1st non-blank character in 'str' 87 ! 88 ! CALLS: none 89 ! 90 ! ............................................................. 91 91 92 92 implicit integer*4 (i-n) … … 106 106 return 107 107 end 108 c**********************************108 ! ********************************** 109 109 integer*4 function iendst(str) 110 110 111 c..............................................................112 cPURPOSE: returns position of last non-blank character in 'str'113 c 114 cCALLS: none115 c 116 c..............................................................111 ! .............................................................. 112 ! PURPOSE: returns position of last non-blank character in 'str' 113 ! 114 ! CALLS: none 115 ! 116 ! .............................................................. 117 117 118 118 implicit integer*4 (i-n) … … 132 132 return 133 133 end 134 c**************************************134 ! ************************************** 135 135 integer*4 function iredin(line,in) 136 136 137 c..........................................138 cPURPOSE: Read integer*4 value 'in' from 'line'139 cwith format 'i9'140 c 141 ciredin=0 : error status142 ciredin=1 : success143 c 144 cCALLS: ibegst,iendst145 c..........................................137 ! .......................................... 138 ! PURPOSE: Read integer*4 value 'in' from 'line' 139 ! with format 'i9' 140 ! 141 ! iredin=0 : error status 142 ! iredin=1 : success 143 ! 144 ! CALLS: ibegst,iendst 145 ! .......................................... 146 146 147 147 implicit integer*4 (i-n) … … 172 172 1 return 173 173 end 174 c*************************************174 ! ************************************* 175 175 integer*4 function iredrl(line,r) 176 176 177 c..........................................178 cPURPOSE: Read real*8 value 'r' from 'line'179 cwith format 'd17.6'180 c 181 ciredrl=0 : error status182 ciredrl=1 : success183 c 184 cCALLS: ibegst,iendst185 c..........................................177 ! .......................................... 178 ! PURPOSE: Read real*8 value 'r' from 'line' 179 ! with format 'd17.6' 180 ! 181 ! iredrl=0 : error status 182 ! iredrl=1 : success 183 ! 184 ! CALLS: ibegst,iendst 185 ! .......................................... 186 186 187 187 implicit integer*4 (i-n) 188 188 189 189 parameter (mxd =17, ! max. # of digits 190 #mxap= 6, ! max. # of digits after period191 #mxip=mxd-mxap)190 & mxap= 6, ! max. # of digits after period 191 & mxip=mxd-mxap) 192 192 193 193 real*8 r … … 222 222 1 return 223 223 end 224 c**************************224 ! ************************** 225 225 subroutine tolost(str) 226 226 227 c..........................................228 cPURPOSE: converts 'string' to lower-case229 cINPUT: str - string to be converted230 cCALLS: ibegst,iendst231 c..........................................227 ! .......................................... 228 ! PURPOSE: converts 'string' to lower-case 229 ! INPUT: str - string to be converted 230 ! CALLS: ibegst,iendst 231 ! .......................................... 232 232 233 233 include 'INCL.H' … … 246 246 return 247 247 end 248 c**************************248 ! ************************** 249 249 subroutine toupst(str) 250 250 251 c..........................................252 cPURPOSE: converts 'string' to upper-case253 cINPUT: str - string to be converted254 cCALLS: ibegst,iendst255 c..........................................251 ! .......................................... 252 ! PURPOSE: converts 'string' to upper-case 253 ! INPUT: str - string to be converted 254 ! CALLS: ibegst,iendst 255 ! .......................................... 256 256 257 257 include 'INCL.H' … … 270 270 return 271 271 end 272 c*****************************************************272 ! ***************************************************** 273 273 integer*4 function iopfil(lun,filnam,stat,format) 274 274 275 c........................................................276 cPURPOSE: open 'lun' with 'filnam' 'stat' 'format'277 c 278 creturns: 1 = file successful opened279 c0 = error during open of existing file280 c-1 = file does not exist281 c 282 cCALLS: ibegst283 c........................................................275 ! ........................................................ 276 ! PURPOSE: open 'lun' with 'filnam' 'stat' 'format' 277 ! 278 ! returns: 1 = file successful opened 279 ! 0 = error during open of existing file 280 ! -1 = file does not exist 281 ! 282 ! CALLS: ibegst 283 ! ........................................................ 284 284 285 285 implicit integer*4 (i-n) … … 299 299 if (j.gt.0.and.k.gt.0) then 300 300 open(lun,file=filnam(i:),status=stat(j:), 301 #form=format(k:),err=1)301 & form=format(k:),err=1) 302 302 iopfil=1 303 303 endif
Note:
See TracChangeset
for help on using the changeset viewer.