I am using Fortran 90. I have a line declared as CHARACTER(20) :: Folds , which is assigned its value from a command line argument that looks like x:y:z , where x, y and z are integers. Then I need to select the numbers from this line and assign them to the appropriate variables. Here is how I tried to do this:
i=1 do j=1, LEN_TRIM(folds) temp_fold='' if (folds(j).neqv.':') then temp_fold(j)=folds(j) elseif (i.eq.1) then read(temp_fold,*) FoldX i=i+1 elseif (i.eq.2) then read(temp_fold,*) FoldY i=i+1 else read(temp_fold,*) FoldZ endif enddo
When I compile this, I get errors:
unfolder.f90 (222): error # 6410: This name was not declared as an array or function. [FOLD]
[stud2 @feynman vec2ascii] $ if (folds (j) .neqv. ':'), then the syntax error around the unexpected token `j '[stud2 @feynman vec2ascii] $ -------- ^
unfolder.f90 (223): error # 6410: This name was not declared as an array or function. [TEMP_FOLD]
[stud2 @feynman vec2ascii] $ temp_fold (j) = folds (j)
syntax error around unexpected token `j '
How can I extract these numbers?
source share