Hello, and congratulations for your community.
My problem is as follows...
I have a model that calculates several parameters in a parent grid and in several (5 nested) grids. The program runs in timesteps, which are controlled with a DO-WHILE loop. Within each do-while loop itteration the program calls a subroutine and decides if it is time to calculate the parent grid or the nested ones. So the general pseudo-code is as follows
DO WHILE (SIMULATION HAS NOT ENDED)
IF (iG=1, meaning that it is time for the parent grid timestep) THEN
call NESTING (THIS FUNCTION CALCULATES IF IT IS TIME FOR THE PARENT OR THE NESTS, and as a results gives iG=1(parrent) or iG=2 (nests))
So, as the code is it first runs one large timestep for the parent grid and then it runs some timesteps for the nested grids, then again for the parent and so on...The goal is to run the nest timesteps in parallel, meaning that when it is time to run the 5 nests, each thread can run each nest (from 2 to 6). My attempts to parallelize the inner DO loop, either cause segmantation faults or cause the program to run in a wierd fashion (for example one nest proceeds further than the other ones). The problem is that the TIMESTEP subroutine is pretty complex and that all the handling is beeing done within an inner DO-While loop. However, each "nest" timestep calculation, is completely irrelevant than the other nests.