In bash I could write a simple script like below; to read the content of a file in the folder as I define the path for the file using environment variable "fileplace"
#!/bin/bash
fileplace="/home/vijay/data1/process-folder1/"
cat $file/file1.dat
I would like to achieve the same like above in FORTRAN 90, by defining the path using variable. I want to do like this because my folder location path is long and I wanted to avoid using & and + symbol for long lines in FORTRAN 90.
I have tried writing simple FORTRAN 90 code as below for testing.
program test_read
implicit none
open (unit=10, status="old",file="/home/vijay/data1/process-folder1/file1.dat")
read(10,*) junk
write(*,*) junk
stop
end
If can I want to avoid using the long path (/home/vijay/data1/process-folder1/) in the FORTRAN code. Is there any possibility to achieve this? If yes can anyone help to correct this FORTRAN code? Appreciate any help in advance.
Thank you
Vijay