0

Obtain iteration of time step value in fortran

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?

ramadhan's avatar
1
ramadhan
asked 2023-03-09 08:37:43 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

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

perolofl's avatar
3.8k
perolofl
answered 2023-03-10 04:36:28 -0500
edit flag offensive 0 remove flag delete link

Comments

thank you very much Dr Perolfl

ramadhan's avatar ramadhan (2023-03-14 00:10:15 -0500) 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's avatar ramadhan (2023-03-21 00:38:03 -0500) 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's avatar perolofl (2023-03-21 02:49:28 -0500) edit
add a comment see more comments

Your Answer

Login/Signup to Answer