CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   STAR-CD (http://www.cfd-online.com/Forums/star-cd/)
-   -   calculate averaged Temperature (http://www.cfd-online.com/Forums/star-cd/80294-calculate-averaged-temperature.html)

moro September 22, 2010 01:44

calculate averaged Temperature
 
Hi everybody,

I use the star-cd version 4.12.033. I investigate a combustion problem with the LES. Unfortunately I have to calculate the averaged temperature with the user subroutine posdat.f, yet I'm not really a fortran90 specialist...

My Problem now is to save an array (T_mean(NCELL)), the size of the array is NCELL...-> I want to calculate the temperature in every cell and for the next time step I must save the temperature of the previous time step.
But if I do this, the following error will appear:

PNP: posdat.f(132): error #6754: An automatic object must
> not appear in a SAVE statement or be declared with the SAVE attribute.
> [TMEAN]
> PNP: real :: Tmean(NCELL)
> PNP: ----------------^
> PNP: compilation aborted for posdat.f (code 1)
> PNP: ***ERROR*** Compilation error in user file "ufile/posdat.f".
> PNP: ==> Please check the compilation error messages.



My declaration is this:
real :: Tmean(NCELL)

save :: Tmean


Have everyone a idea what else can I do. I have also tried to declare an allocation but without success.

Thank you for every help.

hwangkl January 14, 2011 01:36

u can use the COMMON

COMMON /aaa/ Tmean

once u calculate the Tmean and leave posdat.f, the Tmean will be kept.

i dont know other method, but this method works.


All times are GMT -4. The time now is 02:54.