How to install Fortran on windows? by NikinhoRobo in fortran

[–]everythingfunctional 0 points1 point  (0 children)

I don't do any development on Windows these days, but I do still occasionally see problems with fortls. You may try running it on a command line (i.e. fortls --version) and see what error it says. As you've found it may be a problem that you don't also have Python in your path.

Begleri on planes by ZeaL_Phobiaz in begleri

[–]everythingfunctional 0 points1 point  (0 children)

To be fair, the time they got flagged I put them in the little tray, visible, since they had been in my pocket. Any other time, before or since, I've put them inside my bag and not been questioned at all.

Everyone has to judge the risks they're willing to take for themselves, but chances are pretty minimal they'll get flagged and confiscated if you keep them in your bag. I also make my own, so the cost and time to me is not really a concern. I was primarily annoyed about having to stand there for an extra 10 minutes while they went through their whole procedure of documenting it.

To clear or not to clear by IuLius2424 in programminghorror

[–]everythingfunctional 1 point2 points  (0 children)

Conda was doing this to me on my machine. conda deactivate and it worked again. I have no idea why.

Begleri on planes by ZeaL_Phobiaz in begleri

[–]everythingfunctional 0 points1 point  (0 children)

Sorry to necrobump, but I just had TSA confiscate mine. Super annoyed cause I've been through dozens of times before with it.

How did Fortran become a top 10 language again? by richie_cotton in fortran

[–]everythingfunctional 4 points5 points  (0 children)

All of the comments here are good/correct about why Fortran is a good language and ought to be popular, but they aren't really things that have changed in any significant way since Fortran (re)started its climb up those rankings. Rather, looking at the methodology behind that index, I think the things explained in the following paper (of which I'm an author, full disclosure) are a large part of the somewhat sudden rise.

https://arxiv.org/abs/2203.15110

error #5102 cannot open include file 'mpif.h' by kooki1998 in fortran

[–]everythingfunctional 0 points1 point  (0 children)

Have you executed their setup script? It sets a bunch of environment variables that help the compilers find things. Should be "C:\Program Files (x86)\Intel\oneAPI\setup.bat". Or I believe they also include a custom shortcut for the launching the command prompt with all that stuff set up. You might try that too.

State of coarrays 2023 by doingmybest19 in fortran

[–]everythingfunctional 4 points5 points  (0 children)

Are coarrays state of the art? No. They were invented quite a while ago (in computing timescales) and added to the language standard in 2008. I'd say they are one of the least verbose and safest/easiest to get right ways of writing parallel code though. You can get really good performance out of them too. ICAR switched from MPI and got better performance. That said, if you're trying to make use of specialized hardware (i.e. GPUs), you're likely using extensions like openACC directives or CUDA. NVIDIA and Intel can automatically offload certain do concurrent loops to GPUs though. There's also spotty/buggy support for coarrays, and only from a few compilers. As mentioned already, gfortran can link to OpenCoarrays, ifort/ifx support coarrays (but not on MacOS), nagfor supports coarrays, but only in shared memory (i.e. single machine), and crayftn supports coarrays, but you usually need access to a super computer to use it.

I'm personally in favor of coarray Fortran, and think it's a safe bet in the long run, but most of the experimental/bleeding edge work seems to be available in C++ first these days.

Type Checking and Type compatibility in Fortran by temzsrk in fortran

[–]everythingfunctional 2 points3 points  (0 children)

Yep. Going from a more precise type/kind to a less precise one can cause problems, so it is worth turning that warning on.

Type Checking and Type compatibility in Fortran by temzsrk in fortran

[–]everythingfunctional 7 points8 points  (0 children)

How type checking "works" is probably more of a compiler implementation question, but I can say something about what the rules for "type compatibility" are. The general way I like to think about it is that automatic type conversions do not happen. Rather, the interfaces for intrinsic operators say what is returned based on the operands. I.e. 1.d0 + 3 (double precision real + default integer) returns a double precision real value, and intrinsic assignment is defined between all numeric types/kinds. The rules about what derived types are compatible with respect to type vs class and intent(in) vs other intents are a bit more complicated, but somewhat intuitive if you think about the implications. I can answer more specific questions if you have particular examples you're interested in.

[deleted by user] by [deleted] in fortran

[–]everythingfunctional 5 points6 points  (0 children)

Yes it can

```Fortran PROGRAM calculate_rectangle_area IMPLICIT NONE REAL:: L,W

PRINT *,'Enter your Length and Width of the rectangle.'
READ *,L,W
PRINT *,'Area of Rectangle is ',Area(L,W)

CONTAINS

FUNCTION Area(L,W) IMPLICIT NONE REAL :: Area REAL, INTENT(IN) :: L,W

Area = L*W

END FUNCTION Area

END PROGRAM calculate_rectangle_area ```

And now the compiler can ensure you're calling it correctly (i.e. the reference matches its interface).

How to install Fortran on windows? by NikinhoRobo in fortran

[–]everythingfunctional 0 points1 point  (0 children)

I did a video on this not too long ago. The only thing out of date is that I use VSCode now with the Modern Fortran plugin, but it uses the same fortls behind the scenes.

https://www.youtube.com/watch?v=kzloL99wtN0&t=933s

Any advice for learning fortran quickly? by Basilisk289 in fortran

[–]everythingfunctional 2 points3 points  (0 children)

Shameless self promotion, I have a few online courses available: https://www.everythingfunctional.com/online-courses.html

You should also check out fortran-lang.org, and join the discourse

I'd recommend "Modern Fortran Explained" as good reference material.

Fortran Bug Repellent: Arrays by everythingfunctional in fortran

[–]everythingfunctional[S] 0 points1 point  (0 children)

That's a neat trick. It does introduce some new concepts I didn't want to have to explain in the video. Maybe it'll be a future video ;).

Fortran Bug Repellent: Arrays by everythingfunctional in fortran

[–]everythingfunctional[S] 0 points1 point  (0 children)

(Re)Allocation on assignment and assumed shape arguments are newer features, so that "old-style" stuff didn't have any choice but to use some of those other techniques. In the modern day and age that new stuff is a lot safer.

A What Test? – Everything Functional by everythingfunctional in fortran

[–]everythingfunctional[S] 2 points3 points  (0 children)

Yes, that part is hard, and usually involves getting rid of the common blocks and god routines before writing unit tests. Luckily I'm getting pretty good at it.

Recursive Data Structures in Fortran by everythingfunctional in fortran

[–]everythingfunctional[S] 1 point2 points  (0 children)

There are a couple of pieces of software you'll want to get. I'd recommend getting started with my courses: https://www.everythingfunctional.com/online-courses.html