[FLASH-USERS] Newbie Question: Adding Variables

John ZuHone jzuhone at milkyway.gsfc.nasa.gov
Fri Dec 21 10:04:04 EST 2012


Also, I should point out that ./resetup takes most of the normal setup options that you can use at setup time.

For example, to set maxblocks = 50, switch to parallel I/O, and remove the Multigrid gravity unit and replace it with Multipole, you can do:

./resetup -maxblocks=50 +parallelIO --without-unit=physics/Gravity/GravityMain/Poisson/Multigrid --with-unit=physics/Gravity/GravityMain/Poisson/Multipole

The User's Guide has a lot of info on the details of the setup script and the Config files: they are actually pretty powerful:

http://flash.uchicago.edu/site/flashcode/user_support/flash4_ug/node9.html

John Z

On Dec 21, 2012, at 9:50 AM, "Henry (Trae) Winter" <hwinter at cfa.harvard.edu> wrote:

> Sorry I was unclear.  
> 
> It was the tweak in the config file.
> 
> PARAMETER sim_crho  REAL  2 ->PARAMETER sim_crho  REAL  2.
> 
> I had made all of the changes under the directory Simulation/SimulationMain/SodClump and then used ./setup to put the files in the object directory.  The ./resetup wasn't relevant to my case but it is a handy thing to know.  
> 
> Thanks John.
> Trae
> 
> On Dec 20, 2012, at 9:15 PM, John ZuHone wrote:
> 
>> What was the fix? Resetting up or the tweak in the Config file?
>> 
>> John ZuHone
>> Laboratory for High-Energy Astrophysics
>> NASA/Goddard Space Flight Center
>> 8800 Greenbelt Rd., Code 662
>> Greenbelt, MD 20771
>> (w) 301-286-2531
>> (m) 773-758-0172
>> jzuhone at gmail.com
>> john.zuhone at nasa.gov
>> 
>> On Dec 20, 2012, at 8:06 PM, "Henry (Trae) Winter" <traewinter at gmail.com> wrote:
>> 
>>> John,
>>> 
>>> I made a new directory under Simulation/SimulationMain/ called SodClump. I made the changes before I did ./setup SodClump -auto.
>>> 
>>> -Trae
>>> 
>>> 
>>> On Dec 20, 2012, at 5:45 PM, John ZuHone wrote:
>>> 
>>>> Hi Henry,
>>>> 
>>>> Just a quick question first--had you compiled this code first in an object directory and you're trying to recompile after making these changes? If you add anything to the Config file you need to re-setup the code in this directory first, which you can do by issuing "./resetup" within the object directory, after which you can recompile. 
>>>> 
>>>> Best,
>>>> 
>>>> John
>>>> 
>>>> On Dec 20, 2012, at 5:41 PM, "Henry (Trae) Winter" <hwinter at cfa.harvard.edu> wrote:
>>>> 
>>>>> I am teaching myself to use Flash and need some very basic help.  
>>>>> 
>>>>> I want to add clumps of material to the Sod simulation and watch them evolve as the shock hits them.  Simple.  I define an x and y position, a radius, a density, and a pressure for a clump.
>>>>> 
>>>>> In the flash.par file for the Sod problem I add the following:
>>>>> 
>>>>> #  Clump parameters. rho and pressure are added to background values.
>>>>> sim_cposx=  2.5
>>>>> sim_cposy=  2.5
>>>>> sim_crad=    0.5
>>>>> sim_crho=    2
>>>>> sim_cp=        0.0 
>>>>> 
>>>>> In my Config file I add the following:
>>>>> 
>>>>> PARAMETER sim_cposx REAL  2.5
>>>>> PARAMETER sim_cposy  REAL 2.5
>>>>> PARAMETER sim_crad  REAL  0.5
>>>>> PARAMETER sim_crho  REAL  2
>>>>> PARAMETER sim_cp     REAL   0.0
>>>>> 
>>>>> In my Simulation_data.F90 file I add:
>>>>> 
>>>>> real, save :: sim_cposx, sim_cposy, sim_crad, sim_crho, sim_cp
>>>>> 
>>>>> 
>>>>> In the Simulation_init.F90 file I add:
>>>>> 
>>>>> call RuntimeParameters_get('sim_cposx', sim_cposx)
>>>>> call RuntimeParameters_get('sim_cposy', sim_cposy)
>>>>> call RuntimeParameters_get('sim_crad', sim_crad)
>>>>> call RuntimeParameters_get('sim_crho', sim_crho)
>>>>> call RuntimeParameters_get('sim_cp', sim_cp)
>>>>> 
>>>>> In the Simulation_initBlock.F90 I add the last line:
>>>>> 
>>>>> use Simulation_data, ONLY: sim_posn, sim_xCos, sim_yCos, sim_zCos, &    
>>>>> &  sim_rhoLeft,  sim_pLeft, sim_uLeft, sim_rhoRight, sim_pRight, sim_uRight, &
>>>>> &  sim_smallX, sim_gamma, sim_smallP, &
>>>>> &  sim_cposx, sim_cposy, sim_crad, sim_crho, sim_cp
>>>>> 
>>>>> The code compiles.  When I try to run it I get the following error:
>>>>> 
>>>>> WARNING: requested real parameter 'sim_crho' not found  
>>>>> 
>>>>> What am I forgetting?
>>>>> 
>>>>> Thanks,
>>>>> -Trae
>>>>> 
>>>>> 
>>>>> 
>>>>> -------------------------------------------------------------------------------------
>>>>> Dr. Henry (Trae) Winter III        
>>>>> Astrophysicist                Tel:    617-495-7400
>>>>> Center for Astrophysics        Fax:   617-496-7577
>>>>> 60 Garden Street, MS 58        Cell:  617-755-7967
>>>>> Cambridge, MA 02138        hwinter at cfa.harvard.edu
>>>>> -------------------------------------------------------------------------------------
>>> 
>>> 
>>> -------------------------------------------------------------------------------------
>>> Dr. Henry (Trae) Winter III        
>>> Astrophysicist                Tel:    617-495-7400
>>> Center for Astrophysics        Fax:   617-496-7577
>>> 60 Garden Street, MS 58        Cell:  617-755-7967
>>> Cambridge, MA 02138        hwinter at cfa.harvard.edu
>>> -------------------------------------------------------------------------------------
>>> 
>>> 
>>> 
>>> 
>>> 
> 
> 
> -------------------------------------------------------------------------------------
> Dr. Henry (Trae) Winter III 		
> Astrophysicist				Tel:    617-495-7400
> Center for Astrophysics		Fax:   617-496-7577
> 60 Garden Street, MS 58		Cell:  617-755-7967
> Cambridge, MA 02138		hwinter at cfa.harvard.edu
> -------------------------------------------------------------------------------------
> 
> 
> 
> 
> 




More information about the flash-users mailing list