# Scientists are using artificial intelligence and large language models to rewrite old code in modern languages

**URL:** <https://fortran-lang.discourse.group/t/scientists-are-using-artificial-intelligence-and-large-language-models-to-rewrite-old-code-in-modern-languages/9598>\
**Category:** Uncategorized\
**Created:** [April 20, 2025, 5:35am UTC](https://fortran-lang.discourse.group/t/scientists-are-using-artificial-intelligence-and-large-language-models-to-rewrite-old-code-in-modern-languages/9598 "2025-04-20T05:35:46Z")\
**Posts on this page:** 1\
**Showing post:** 37

<div class="post-metadata">

**Author:** ![aledinola](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@aledinola](https://fortran-lang.discourse.group/u/aledinola)\
**Post date:** [April 21, 2025, 12:23pm UTC](https://fortran-lang.discourse.group/t/scientists-are-using-artificial-intelligence-and-large-language-models-to-rewrite-old-code-in-modern-languages/9598/37 "2025-04-21T12:23:27Z")

</div>

As a simple but not trivial program using multidimensional arrays, please see this example

> [@Performance of vectorized code in ifort and ifx](https://fortran-lang.discourse.group/t/performance-of-vectorized-code-in-ifort-and-ifx/7783):
>
> I created a small Fortran example of discrete dynamic programming that occurs quite often in macroeconomics. It is an optimal savings problem for a consumer who received idiosyncratic shocks to their income. I was interested in comparing loop-based Fortran code vs vectorized code, both in ifort and in ifx. Just to avoid misunderstandings, the definition of “vectorizing” that I am using is the following: I vectorize if I replace this code do i=1,n yvec(i) = exp(xvec(i)) enddo with the followin…

I created the program above for a post on this forum a while ago (you can find the link to github repo in the post)  
I might have another example that uses 4-dimensional arrays, if I can dig it out

---

_[View the full topic](https://fortran-lang.discourse.group/t/scientists-are-using-artificial-intelligence-and-large-language-models-to-rewrite-old-code-in-modern-languages/9598)._
