[FLASH-USERS] Problems with set_parm_in_context

Paul Goodall ptg at astro.ox.ac.uk
Thu Jan 21 13:45:32 EST 2010


Dear Flash-users,

I don't think this qualifies as a bug, more likely just something I've missed out.

I'm using FLASH2.5 (haven't yet had the the chance to upgrade) and having really weird problems with saving parameters to the database.  

In the mark_grid_refinement.F90 subroutine of my 'problem' setups directory, I calculate various quantities which are essential later on in the simulation, and save them to the database using:

call set_parm_in_context(global_parm_context, 'parmname', parmval)    

(N.B I don't use 'add_parm_to_context' because the params in question are already initialised in Config)

These values are calculated and saved during the IF(firstcall) loop.
This is the bit were things become strange...

If I do a new run (i.e. restart = .false. in flash.par) then everything works brilliantly and all the calculated quantities are saved to the database for later use.

However, if I restart from a checkpoint, only *some* of the calculated quantities are saved to the database in the above way.  (i.e. when I call the parms later on in the source_terms/, some of them have the correct saved value, and some of them have reverted to the default value given in Config).  I know that the mark_grid_refinement.F90 is still called during a restart because I get it to print values to the screen/output files in both new starts and restarts such as:

call get_parm_from_context(global_parm_context, 'parmname', parmval)
print *,"Initial value: ", parmval
(** some calculation involving parmval **)
print *,"New value1: ", parmval
call set_parm_in_context(global_parm_context, 'parmname', parmval)
call get_parm_from_context(global_parm_context, 'parmname', parmval)
print *,"New value2: ", parmval

Where "New value1" and "New value2" being the same should surely indicate that the save to the database was successful? (I know that the above example is a bit dramatic, but its what I've resorted to to try and locate the problem).

Two things about this are strange to me:
1) Why does this differ between a new start and a restart?
2) Why are some params saved to the database, and others not, when they each have the same type (e.g REAL).  

Any help with this (or if anyone has experience similar), would be really appreciated,

cheers,

Paul Goodall
========================
Astrophysics D.Phil Student
University of Oxford.
========================
Denys Wilkinson Building
Keble Road
Oxford
OX1 3RH
+44 (0)1865-2-83011
http://astroweb1.physics.ox.ac.uk/~Goodall/
========================




More information about the flash-users mailing list