Ask Your Question
0

Obtain iteration of time step value in fortran

asked 2023-03-09 08:37:43 -0600

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?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2023-03-10 04:36:28 -0600

perolofl gravatar image

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

edit flag offensive delete link more

Comments

thank you very much Dr Perolfl

ramadhan gravatar imageramadhan ( 2023-03-14 00:10:15 -0600 )edit

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 ( 2023-03-21 00:38:03 -0600 )edit

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 ( 2023-03-21 02:49:28 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: 2023-03-09 08:37:43 -0600

Seen: 170 times

Last updated: Mar 10 '23