please note this requires the main program, as well as a separate subroutine out
ID: 3737181 • Letter: P
Question
please note this requires the main program, as well as a separate subroutine outside of the main program.
Problem 2: Write a FORTRAN 90 subroutine named cc that takes as its first argument a two dimensional array of characters named arr with NR rows and NC columns where NR and NC are parameters The second argument to the subroutine is a character string of length 1 named ch. The subroutine source code is in a module in a separate file from the file containing the main program source code For each row the subroutine prints (on a single line) at the screen the characters in the row up to but not including the first occurrence of the character in ch. If the character in ch does not occur in a row, then all characters in the row are printed on a single line on the screen. Write a main program that uses the subroutine cc Provide test results for the following data file which the main program opens and reads. (Use values of 5 and 6 for NR and NC respectively) 231x56 s3fgtr wxr56t 12x3xx xf3f3e Provide a run with user input character "3" and another run when the input ch NOTES aracter "1"Explanation / Answer
DO
if(arr(x,y)!=ch(i) & i!=3 &x!=NR &y!=NC)
print *, arr(x,y)
x = x + 1
y = y + 1
i = i+1;
END DO
ch = "apr"
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.