Mode locking and numerical methods in fortran

I made a visualization that shows how mode locking creates short pulses; the more the number of modes in the cavity, the shorter the pulse width, with the condition that they all have the same phase. You can find it here. It's not yet complete, I also need to show how the output pulse looks when the modes have random phases. The code is in python, was written using the ipython notebook and uses ipywidgets to create the interactive plot.

On the flip side, I was hitting my head against the wall trying to adapt a code to perform numerical integration in fortran. The code would compile but not execute in the first place and google told me to move the executable to a folder in the home directory. Weirdly enough, this worked. Apparently this problem is an after effect from when i was copying these files out of my home dir earlier. chmod helped fix that problem. Having figured out how to define and call functions in fortran, I was now stuck on a type mismatch error, because the function was defined to take a certain type of input and was now being fed a different one. Adding implicit none dealt with that and just when I was happy that i could execute the file, a wild segmentation fault appeared on screen upon execution of said file. Instead of learning on the go, I should probably look up what the fortran standard is and what basic rules are to be followed. I was surprised to find that using a ! to comment files was acceptable on where as using c would throw up an error, only on gfortran though. I'm sure there are more rules that I haven't bothered with so far, that I should look into. For now, i sign off, wondering why there isn't a way to batch comment lines in fortran where as ''' ... ''' does the job in python and /*...*/ does the job in C, which themselves use # and // as comments otherwise. Apparently // is also not acceptable at times in C. Rules, Rules, Rules...

Popular posts from this blog

Arxiv author affiliations using Python

Farewell to Enthought

Elementary (particle physics), my dear Watson