How to Run Fortran Code in Windows (check description)
how to run FORTRAN code in Windows.
1. install minGW from this link:
https://osdn.net/projects/mingw/releases/
2. from the basic setup, select all except ada and objc.
3. it will download lots of files, will take around 5mins. when download and install are completed, close the window.
4. Windows need the gfortran file to run FORTRAN code. so we'll add the directory of it to the path variable.
we've added path C:\MinGW\bin as a user path variable.
5. let's use vs code to write a FORTRAN code and run it. there's an extension in vs code to highlight FORTRAN codes called 'Modern Fortran'. install it.
6. I've used (.f90) as the extension. using (.f) extension has its own issues.
7. in windows, the FORTRAN file will get compiled into a (.exe) file, and then running that (.exe) file will show the output.
to simplify it, we can use a batch (.bat) file on the same folder as the (test.f90) file.
here's the content of the batch file:
--------------
gfortran test.f90 -o output.exe
output.exe
--------------
here, the 1st line tells windows to use gfortran to compile (test.f90) file into (output.exe) file. the 2nd line tells windows to run that (output.exe) file. you'll change the name of the FORTRAN file (test.f90) as needed.
8. now we'll run the (.bat) file to see the output of the program. you can use the following command to run the batch file:
----
.\run.bat
----
you can even use read statement, just type the value in console/cmd when the cursor blinks, and press enter.
Other Videos By matpro
2022-10-04 | ETS2 bus mod - beautiful North Bengal (part 1) - ProBD map |
2022-10-01 | ETS2 bus mod - Crossing BD border at night - ProBD map |
2022-09-29 | ETS2 bus mod - Kolkata highway night trip - ProBD map |
2022-09-27 | ETS2 bus mod - Going to Kolkata - ProBD map |
2022-09-26 | ETS2 bus mod - Sundarbans at night - ProBD map |
2022-09-25 | ETS2 bus mod - timelapse - Cox's Bazar - ProBD map |
2022-09-24 | ETS2 bus mod - Cox's Bazar - ProBD map |
2022-09-16 | ETS2 Bus mod - Teknaf to Cox's Bazar - ProBD map |
2022-09-15 | ETS2 - Greece to Jordan - Promods 2.60 |
2022-09-15 | ETS2 Bus mod - Sajek - ProBD map |
2021-10-13 | How to Run Fortran Code in Windows (check description) |
2020-09-15 | NFS II: SE |
2019-11-07 | first stream |
2019-11-04 | Euro Truck Simulator 2 - V1.35 - Västerås to Linköping |
2019-11-03 | Euro Truck Simulator 2 - V1.35 - Kaunas to Daugavpils |
2019-11-03 | Euro Truck Simulator 2 - V1.35 - Naantali to Västerås |
2019-10-29 | Euro Truck Simulator 2 - V1.35 - Kaunas to Utena |
2019-10-22 | Euro Truck Simulator 2 - V1.35 - Turku to Lahti |