Wrong action of Open command in Fortran( Insted read open command opens .txt file )2019 Community Moderator ElectionImporting data from file to arrayError: Two main PROGRAMs at (1) and (2)Missing explicit interface for subroutinefortran module use wrongReading from .txt file and writing to .txt fileFortran runtime error: End of fileReading a .txt file with fortran, on a MACNetCDF: Start+count exceeds dimension boundOpening and reading a file in Fortranreading in a file from fortran

NASA's RS-25 Engines shut down time

PTIJ: wiping amalek’s memory?

Filtering SOQL results with optional conditionals

Why is computing ridge regression with a Cholesky decomposition much quicker than using SVD?

Should I take out a loan for a friend to invest on my behalf?

Word for a person who has no opinion about whether god exists

meaning and function of 幸 in "则幸分我一杯羹"

How to secure an aircraft at a transient parking space?

Do items de-spawn in Diablo?

Can one live in the U.S. and not use a credit card?

Could you please stop shuffling the deck and play already?

What was the Kree's motivation in Captain Marvel?

Find longest word in a string: are any of these algorithms good?

How can The Temple of Elementary Evil reliably protect itself against kinetic bombardment?

Why was Goose renamed from Chewie for the Captain Marvel film?

Difference on montgomery curve equation between EFD and RFC7748

If I receive an SOS signal, what is the proper response?

What wound would be of little consequence to a biped but terrible for a quadruped?

An alternative proof of an application of Hahn-Banach

Is it "Vierergruppe" or "Viergruppe", or is there a distinction?

What's the "normal" opposite of flautando?

Makefile strange variable substitution

Are tamper resistant receptacles really safer?

Why does Captain Marvel assume the people on this planet know this?



Wrong action of Open command in Fortran( Insted read open command opens .txt file )



2019 Community Moderator ElectionImporting data from file to arrayError: Two main PROGRAMs at (1) and (2)Missing explicit interface for subroutinefortran module use wrongReading from .txt file and writing to .txt fileFortran runtime error: End of fileReading a .txt file with fortran, on a MACNetCDF: Start+count exceeds dimension boundOpening and reading a file in Fortranreading in a file from fortran










0















This is my simple code:



Program Example_Code

Implicit none

Integer :: iERR

Open( Unit = 15, File = 'Read_Something.txt', Action = 'Read', Status = 'Unknown', iostat = iERR )

If ( iERR /= 0 ) stop ( "There is no file Read_Something.txt !!!")


Close( 15, Status = 'Keep')

End Program Example_Code


In the project directory I did not create any .txt file( because I want to test opening file with iostat) and afther the program ends I find Read_Something.txtin the project folder.



What is wrong in this example?
Why does this obvious error occur?



IDE: Code::Blocks 17.12, TDM_GCC_5.0.1 - 03



OS: Win 10 X64










share|improve this question
























  • Use tag fortran for all Fortran questions.

    – Vladimir F
    Mar 6 at 15:34
















0















This is my simple code:



Program Example_Code

Implicit none

Integer :: iERR

Open( Unit = 15, File = 'Read_Something.txt', Action = 'Read', Status = 'Unknown', iostat = iERR )

If ( iERR /= 0 ) stop ( "There is no file Read_Something.txt !!!")


Close( 15, Status = 'Keep')

End Program Example_Code


In the project directory I did not create any .txt file( because I want to test opening file with iostat) and afther the program ends I find Read_Something.txtin the project folder.



What is wrong in this example?
Why does this obvious error occur?



IDE: Code::Blocks 17.12, TDM_GCC_5.0.1 - 03



OS: Win 10 X64










share|improve this question
























  • Use tag fortran for all Fortran questions.

    – Vladimir F
    Mar 6 at 15:34














0












0








0








This is my simple code:



Program Example_Code

Implicit none

Integer :: iERR

Open( Unit = 15, File = 'Read_Something.txt', Action = 'Read', Status = 'Unknown', iostat = iERR )

If ( iERR /= 0 ) stop ( "There is no file Read_Something.txt !!!")


Close( 15, Status = 'Keep')

End Program Example_Code


In the project directory I did not create any .txt file( because I want to test opening file with iostat) and afther the program ends I find Read_Something.txtin the project folder.



What is wrong in this example?
Why does this obvious error occur?



IDE: Code::Blocks 17.12, TDM_GCC_5.0.1 - 03



OS: Win 10 X64










share|improve this question
















This is my simple code:



Program Example_Code

Implicit none

Integer :: iERR

Open( Unit = 15, File = 'Read_Something.txt', Action = 'Read', Status = 'Unknown', iostat = iERR )

If ( iERR /= 0 ) stop ( "There is no file Read_Something.txt !!!")


Close( 15, Status = 'Keep')

End Program Example_Code


In the project directory I did not create any .txt file( because I want to test opening file with iostat) and afther the program ends I find Read_Something.txtin the project folder.



What is wrong in this example?
Why does this obvious error occur?



IDE: Code::Blocks 17.12, TDM_GCC_5.0.1 - 03



OS: Win 10 X64







fortran gfortran tdm-gcc






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 6 at 15:34









Vladimir F

40.9k44072




40.9k44072










asked Mar 6 at 15:24









Enlil MaratovichEnlil Maratovich

226




226












  • Use tag fortran for all Fortran questions.

    – Vladimir F
    Mar 6 at 15:34


















  • Use tag fortran for all Fortran questions.

    – Vladimir F
    Mar 6 at 15:34

















Use tag fortran for all Fortran questions.

– Vladimir F
Mar 6 at 15:34






Use tag fortran for all Fortran questions.

– Vladimir F
Mar 6 at 15:34













1 Answer
1






active

oldest

votes


















4














You use status="unknown", that means the compiler can create the file for you so that you can read from it. If you want to open a file only when it exist, use status="old".



BTW, I find it quite useless to explicitly specify any ="unknown", just leave the argument out completely. But that is my personal style.






share|improve this answer























  • @francescalus, The Fortran standard states for ACTION= For a new file, the processor creates the file with a set of allowed actions that includes the specified action.

    – Steve
    Mar 6 at 22:36











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55026559%2fwrong-action-of-open-command-in-fortran-insted-read-open-command-opens-txt-fil%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









4














You use status="unknown", that means the compiler can create the file for you so that you can read from it. If you want to open a file only when it exist, use status="old".



BTW, I find it quite useless to explicitly specify any ="unknown", just leave the argument out completely. But that is my personal style.






share|improve this answer























  • @francescalus, The Fortran standard states for ACTION= For a new file, the processor creates the file with a set of allowed actions that includes the specified action.

    – Steve
    Mar 6 at 22:36
















4














You use status="unknown", that means the compiler can create the file for you so that you can read from it. If you want to open a file only when it exist, use status="old".



BTW, I find it quite useless to explicitly specify any ="unknown", just leave the argument out completely. But that is my personal style.






share|improve this answer























  • @francescalus, The Fortran standard states for ACTION= For a new file, the processor creates the file with a set of allowed actions that includes the specified action.

    – Steve
    Mar 6 at 22:36














4












4








4







You use status="unknown", that means the compiler can create the file for you so that you can read from it. If you want to open a file only when it exist, use status="old".



BTW, I find it quite useless to explicitly specify any ="unknown", just leave the argument out completely. But that is my personal style.






share|improve this answer













You use status="unknown", that means the compiler can create the file for you so that you can read from it. If you want to open a file only when it exist, use status="old".



BTW, I find it quite useless to explicitly specify any ="unknown", just leave the argument out completely. But that is my personal style.







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 6 at 15:36









Vladimir FVladimir F

40.9k44072




40.9k44072












  • @francescalus, The Fortran standard states for ACTION= For a new file, the processor creates the file with a set of allowed actions that includes the specified action.

    – Steve
    Mar 6 at 22:36


















  • @francescalus, The Fortran standard states for ACTION= For a new file, the processor creates the file with a set of allowed actions that includes the specified action.

    – Steve
    Mar 6 at 22:36

















@francescalus, The Fortran standard states for ACTION= For a new file, the processor creates the file with a set of allowed actions that includes the specified action.

– Steve
Mar 6 at 22:36






@francescalus, The Fortran standard states for ACTION= For a new file, the processor creates the file with a set of allowed actions that includes the specified action.

– Steve
Mar 6 at 22:36




















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55026559%2fwrong-action-of-open-command-in-fortran-insted-read-open-command-opens-txt-fil%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved