Hello Viviana,
This previous code had two problems in it.
1. Wind speeds (Veast,Vnorth) were initialized as REAL instead of DOUBLE PRECISION explaining why i was getting the SOLUTION X = 0 remainder.
2. The modified subroutine is called every iteration. When the subroutine finishes, the initialized variables (TV,VX,VY,TV0,VX0,VY0) die. Next iteration, the code could not remember their previous values so i was getting a crash at 2nd iteration. The lines i have added at the beginning are :
LOGICAL DEJA
DATA DEJA /.FALSE./
DOUBLE PRECISION :: TV,VX,VY,TV0,VX0,VY0
SAVE DEJA, TV,VX,VY,TV0,VX0,VY0
I'm attaching the updated code here.
Take note that i do not interpolate data between timesteps.
Have fun
Mathieu