Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28592 Discussions

FORTRAN: Opening and reading data from a network location

Khaliq__Nadeem
Beginner
485 Views

I am trying to run a simulation using FORTRAN. I have large input data at server A and I want to read input files from server A and run my simulation on server B. I am using a FORTRAN subroutine to assign input into a BCs array. I want to read input file from server A via FTP and assign them into BCs array on server B. I will be grateful if you can suggest me some ways to do so. Thanks

The code I have tried so far is as follows but it gives error.

  FILENAME="//192.255.8.152/home5/nadeem/inflow/Inflow_001"
  OPEN(81,FILE=FILENAME,FORM='UNFORMATTED',STATUS='OLD')

  READ (81)((UBC3(1,J,K),J=1,N2M),K=1,N3M) ! INLET BOUNDARY

  CLOSE(81)
0 Kudos
3 Replies
Steven_L_Intel1
Employee
485 Views

You can't open an FTP connection using a Fortran OPEN. Instead you'll need to call a library that establishes FTP connections and fetch the file.

0 Kudos
Khaliq__Nadeem
Beginner
485 Views

Thanks for your response. I would like to read the data from file rather than to fetch using FTP. Is there any other approach besides FTP to do so.

Regards

0 Kudos
Steven_L_Intel1
Employee
485 Views

If the file is on a remote share mounted by NFS you could read it directly. Perhaps other users will have additional suggestions.

0 Kudos
Reply