Ask Your Question
0

Obtain iteration of time step value in fortran

asked Mar 9 '3

ramadhan gravatar image

hello everyone, I want to get value of DELT (time step) in fortran, however using CALL DSRVAL('DELT', INDX, RVAL, IERR) has a problem. main purpose is simple, just want to use this function as a record time at certain condition example [The plus-equals operator in python (+=) which provides a convenient way to add a value to an existing variable and assign the new value back to the same variable]

--> i += DELT -->if i > a: ------>certain condition

is there any other way to simulate this condition using FORTRAN?

1 answer

Sort by » oldest newest most voted
0

answered Mar 10 '3

perolofl gravatar image

I believe += is unique for python. In fortran use i = i+DELT.

link

Comments

thank you very much Dr Perolfl

ramadhan gravatar imageramadhan (Mar 14 '3)

Dear Dr Perolofl, i tried using DELT function but it seems (DELT is not iterated just a fixed value) is there any Fortran code for time step iteration (example 0.00025, 0.00050, 0.00075)

ramadhan gravatar imageramadhan (Mar 21 '3)

yes, DELT is the time step for the simulation. Are you using a time step of 0.00025 s? The actual time of the simulation is stored in variable TIME, so TIME is increased with DELT for every time step in the simulation.

perolofl gravatar imageperolofl (Mar 21 '3)

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.
Want to format code in your answer? Here is a one minute demo on Youtube

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: Mar 9 '3

Seen: 181 times

Last updated: Mar 10 '23