Okay, I (sort of) figured it out.
Firstly, yes, it is because your version of TOMAWAC is older than mine. I tried running with V7P2R1 and the segmentation fault appeared.
I have absolutely no clue why ¯\_(ツ)_/¯
It shouldn't work on any version. Anyway, let Fortran do its thing...
Don't worry, you don't need (although I recommend) to upgrade to V7P2R2.
Let's go to the problem. You have in your code a few arrays you created (HM0L_PP, FPICL_PP, etc.), and when LT is less than 1 (the initialization of TOMAWAC), you read the input file to these arrays. So far so good.
The problem is that these are local arrays. That is, only LIMWAC knows them, and they have these values only for the current call to LIMWAC. As soon as the program leaves LIMWAC everything is erased.
Then, in the first iteration of TOMAWAC you try to access these arrays to assign the due values to HM0L, FPICL, and TETA1L when AT==AT_PP(K). The problem is that AT_PP is not allocated (not anymore, because it is only allocated when LT < 1).
And when you try to access the Kth value of AT_PP (that doesn't exist) the program throws the vile Segmentation Fault at you.
How to solve the problem? Tell Fortran to keep these arrays to subsequent calls to the subroutine.
To do that just add a SAVE statement with the name of the variables you want to save after their declaration (on line 137):
! #################################################################
! THESE ARE THE VARIABLES INTRODUCED BY PAT PRODANOVIC
DOUBLE PRECISION,DIMENSION(:), ALLOCATABLE :: HM0L_PP,FPICL_PP
DOUBLE PRECISION,DIMENSION(:), ALLOCATABLE :: TETA1L_PP
INTEGER, DIMENSION(:), ALLOCATABLE :: AT_PP
INTEGER NO_TIME_POINTS,K
SAVE HM0L_PP,FPICL_PP,TETA1L_PP,AT_PP,NO_TIME_POINTS !! SAVING THE VARIABLES FOR FURTHER CALLS
! #################################################################
Simple as that!
Hope this clarifies you a little about Fortran. It is quite likeable when you become friends with him.
Best regards,
Phelype