CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Siemens (
-   -   parameter file (

CMB December 15, 2003 07:47

parameter file
Hi, when defining parameters in a .dat file via a macro and setting it in the working directory, how can you call this from a subroutine. That is if I set a parameter in a macro by $*set,pi,3.14159, then, clearing all graph registers and reseting all graphical variables and logicals to default values via 'gres'. Storing pi parameter in a graph register, say: gparam,pi,1,1 -register and location number 1. Then using 'sdat' to save this graph register into file 'parameter.dat'. Now that I have my parameter in this file, how can I call it form a subroutine? regards, CM

Richard December 15, 2003 10:01

Re: parameter file
Assuming there is nothing in the parameter.dat file except the value of the parameter, you just need to open the file and read in the value:

open(85,file='parameter.dat',status='old') read(85,*) pi close(85)

All times are GMT -4. The time now is 12:06.