stuff(3f) - [M_calculator] directly store value into calculator dictionary for efficiency (LICENSE:PD)
Synopsis
Definition
Options
Example
Author
License
subroutine stuff(varnam,val,ioflag)
class(*),intent(in) :: varnam character(len=*),intent(in) :: val integer,intent(in),optional :: ioflag
breaking the rule of only accessing the calculator thru calculator(3f):a direct deposit of a value into the calculator assumed to be used only by friendly calls, for efficiency and to avoid problems with recursion if a routine called by the calculator in substitute_subroutine(3f) wants to store something back into the calculator variable table
Normally values are stored or defined in the calculator module M_calculator(3fm) using the calculator(3f) routine or the convenience routines in the module M_calculator(3fm). For efficiency when large numbers of values require being stored the stuff(3f) procedure can be used to store numeric values by name in the calculator dictionary.
breaking the rule of only accessing the calculator thru calculator(3f):
stuff(3f) is assumed to only be used when needed for efficiency and to avoid problems with recursion if a routine called by the calculator in substitute_subroutine(3f) wants to store something back into the calculator variable table.
varnam name of calculator variable to define or replace val numeric value to associate with the name VARNAME. May be integer, real, or doubleprecision. ioflag optional flag to use with journal logging. This string is passed directly to M_framework__journal::journal(3f) as the first parameter. The default is to not log the definitions to the journal(3f) command if this parameter is blank or not present.
Sample program:
program demo_stuff use M_calculator, only : stuff, dnum0 implicit none doubleprecision :: value call stuff(A,10.0) call stuff(PI,3.1415926535897932384626433832795) value=dnum0(A*PI) write(*,*)value end program demo_stuffExpected result:
31.415926535897931
John S. Urban
Public Domain
Nemo Release 3.1 | stuff (3) | February 23, 2025 |