Home

CO5BOLD User Manual

image

Contents

1. 00E 05 4 00E 05 4 00E 04 3 00E 04 3 O0E 04 3 QO0E 0S8 2 00E 09 2 QOE 08 2 00E 02 1 O00E 02 f 00E 02 1 00E 01 0 DOE 01 Q OO0E 01 0 OQOE O1 0 OOE OO 0 50E 00 0 00E 00 0 00E 00 0 00E 00 0 00E 00 0 O0E 01 0 219 868 588 334 001 TAT 486 131 856 577 200 912 621 233 939 645 256 961 571 371 133 019 191 312 597 COL G7T 967 3920 3970 4030 4080 4160 4210 4270 4340 4400 4460 4530 4590 4640 4720 4800 4900 5080 5260 5560 5850 6260 6570 6880 7160 7920 8250 8420 8500 O101010101010101i dS d PP SP BP WWBWWWNHNNNNNRFP KR BS ELL 598 842 042 219 450 618 835 999 162 JATT 541 704 2919 083 245 460 622 830 926 022 070 114 140 191 213 229 242 WWWNHNONRFPRFPRFPRF OOO 8 752 342 105 910 674 508 341 128 967 804 596 437 279 070 094 266 504 705 002 201 613 879 140 363 889 092 196 245 00 00 00 00 00 00 00 00 50 50 50 50 50 50 50 65 85 00 25 40 50 60 TO 80 80 RRRRRRPRRAR RR RPRP OOOOOOOOOOOOOOOoOo oO Q Q rp ppp n o odo 0o CO CG COO CO Oo CG oOo Oo Oo OC 0 0 00 e l 28208 29675 31510 33103 35776 37527 439712 423TT 44765 47248 50256 52925 55173 58792 62415 66867 74558 81447 89163 99911 13453 2
2. Furthermore we currently develop a widget based analysis tool called COSBOLD AT abbrev CAT which will help to work with CO5BOLD data without having to write and edit own IDL code The routines are stored if available in the directory IDL COBOLDAT and have to be started with cat A more detailed documentation is planned 126 8 DOCUMENT HISTORY 8 Document history 2002 02 16 First version on the web lots of extensions and changes in between 2004 02 23 3 7 17 2004 02 23 2004 03 02 2004 03 02 2004 03 03 2004 03 04 2004 03 04 2004 03 04 2004 03 04 2004 03 04 2004 03 04 2004 03 04 2004 03 04 2004 05 03 2004 05 14 2004 07 26 2004 08 18 model 2005 03 08 SGI Origin compiler settings section modified for CINES machines 3 7 16 short example for uio datasetlist rd pro usage 4 7 3 Intel compiler settings section modified LD ASSUME KERNEL 2 4 19 SGI Origin compiler settings section modified IBM compiler settings section added 8 7 9 Document history started pretty late Dedicated OpenMP section 3 7 1 Dedicated inlining section 8 7 2 Parameter for core drag force 5 3 4 New EOS table for solar composition Trademarks List of new dust files the table was split into two 3 4 Installation of UIO UNIX scripts with configure 4 6 1 Thermodynamic relations Point to point tensor viscosity 5 3 8 New gravitational potential mimicking a trave
3. amp u erg K g 3 25E 09 In the case of a central potential the entropy in a sphere with radius r0_grav is adjusted towards this entropy value In both geometry supergiant as well as solar this value is very important as it finally but indirectly determines the luminosity and effective temperature of the star A value of 0 0 default or below disables this energy input real c_schange The entropy s inflow of the material in the bottom layer solar case inoutflow boundary condition or the central region of the model supergiant case is not just set to the specified but adjusted towards it The adjustment rate can be controlled with e g real c_schange f E15 8 b 4 n Rate of entropy change for open lower boundary u 1 0 3 Guide values are o 1 0 fast adjustment o 0 3 typical value o 0 1 slow adjustment o lt 0 0 not allowed real c pchange The inoutflow boundary condition not only controls entropy and velocity but also the pressure in the bottom layers It is locally adjusted towards the global average to damp out possible instabilities The adjustment rate can be specified e g with real c pchange f E15 8 b 4 amp n Rate of pressure change for open lower boundary u 1 1 09 real c tchange In the case of a transmitting upper or outer boundary the temperature of the material streaming into the model is adjusted with a rate given e g by 5 3 Parameter File rhd par 79 real c_tchange f E15 8 b 4 n
4. 5 3 10 Dust dustscheme dust moment04A c2 In this section the parameters for dustscheme dust momentO4 c2 4 bin 4 moments dust scheme for carbon rich dust are described e real c dustO1 The carbon to oxygen ratio is specified with e g real c dustO1 f E15 8 b 4 n C to O ratio u 1 1 4 Larger values mean more dust Values below 1 make no sense for the current dust model real c_dust02 The oxygen abundance is specified with e g real c_dust02 f E15 8 b 4 n Oxygen abundance u 1 6 606934E 04 5 3 Parameter File rhd par 91 e real c dustO3 The cutoff for the integration of the degree of condensation is specified with e g real c dust03 f E15 8 b 4 n cutoff for integration of degree of condensation amp u 1 1 0E 05 e real c dustO4 The relative dust opacity factor is specified with e g real c_dust04 f E15 8 b 4 n Relative dust opacity factor u 1 1 0 5 3 11 Dust dustscheme dust k3mon 03 In this section the parameters for dustscheme dust_k3mon_03 simple 2 bin dust scheme for Forsterite dust are described e integer n dustgrainradius The number of dust grain radius bins including one for the monomers is specified with integer n dustgrainradius f I8 b 4 n Number of dust grain radius bins amp ci Includes bin for monomers 2 The default value is 1 to avoid an empty array The value should be the same as the upper dimension in real ar dustgrainradius For the current
5. NOTE Always check file name and path 7 2 4 Loading the Opacity Table IDL gt opafile opa dat par opafile IDL gt dfopta opafile The opacity table will be stored as common block OPTA_COMMON NOTE Always check file name and path 7 2 5 Computation of Deduced Quantities After having read the model data FUL and the tables for the equation of state EOS and opacity OPTA COMMON see Sects 7 2 3 7 2 4 more quantities can be calculated IDL gt eosbox ful eos eos opa ierror ierror This operation adds the tags EOS and OPA to the data structure FUL which contain more quantities like e g the temperature see Sect 7 3 Based on the thermodynamic quantities now present in the FUL structure further quantities can be computed with combox pro as for instance in IDL gt cs combox cs ful 124 7 DATA ANALYSIS WITH IDL 7 3 IDL Data Structure The data structure FUL contains the following variables and substructures Use help str ful to get this information See also the short description of the contents of a model file in Sect and particularly the man page of the script uiolook in Sect which gives you even more detailed information directly from the file Structure lt 8287a0c gt 9 tags length 78404128 refs 1 TYPE STRING uio HEAD STRUCT gt Anonymous Array 1 DATASET ID STRING single box MODELTIME FLOAT 10050 1 MODELITIME LONG 64088 DTIME FLOAT 0 176381 TIME OUT FULL LAST FLOAT
6. S1 character outconv_end 107 character outconv_fine 111 character outconv_full character outconv_mean character outfile_end character outfile_fine 110 character outfile_full character outfile_mean 107 character outform_end character outform_fine 110 character outform_full character outform_mean character radpressure 110 character radraybase 96 character radraystar 96 character radschene 94 character reconstruction character side_bound 75 INDEX character top_bound 76 chemical reaction network dust 88 effective temperature equation of state fileform uio 73 gravity header 73 hydrodynamics hydrogen ionization input output integer dtimestep out fine 110 integer endtimestep 101 integer hion_chunks 90 integer istep_in_start integer n_outslicedim_mean integer n_dustgrainradius integer n hydcellsperchunk integer n hyditer 83 integer n hydmaxiter 83 integer n radband 97 integer n raditer 95 integer n radmaxiter 95 integer n radminiter 94 integer n radoutput 98 integer n radphi 97 integer n radrsyslevel integer n radsubray 97 integer n radtaurefine 97 integer n radtheta 97 integer n radthickpoint 97 integer n viscellsperchunk integer plustimestep 102 integer starttimestep 100 luminosity MHD molecules 88 opacities 80 process management 100 radiation transport reading in IDL real
7. The optimal value has to be found empirically A good starting point is number of grid points in 1D Number of treads which gives for a model with 171 grid points on a 4 processor machine export OMP NUM THREADS 4 export OMP_SCHEDULE STATIC 43 The behavior of the other modules is not affected The number of threads should equal the number of available processors and has to be set at run time with the environment variable OMP NUM THREADS e g with export OMP NUM THREADS 16 3 7 2 General Inlining Candidate routines for inlining are i e they should be inlined if anyhow possible e file rhd_hyd_module F90 rhd hyd avg rhd hyd upwind rhd_hyd_pred0 rhd hyd predm rhd_hyd_predp rhd hyd alpha rhd_hyd_constanteg rhd_hyd_minmodeg rhd_hyd_minmod rhd hyd vanleereq rhd hyd vanleer rhd_hyd_superbeeeg rhd hyd superbee rhd hyd ppeq rhd hyd pp rhd hyd hdflux e file rhd_1hdrad_module F90 rhd_rad3d_raylhd rhd_rad3d_solve rhd_rad3d_solveeq 36 3 PROGRAM FILES INSTALLATION COMPILATION e file rhd_shortrad_module F90 rhd shortrad operator rhd_shortrad_dtauop On some machines the makefile generated by the configure script contains this list explicitely On others one has to rely on automatic inlining see the following sections All routines that should be inlined are contained in the same modules as the calling routines Therefore no inter procedure inlining is needed 3 7 3 General Single ver
8. ds 0 0 0 0 0 1 real fepb_xmean d 1 1 1 1 1 121 f E13 6 p 4 b 4 amp n Pressure Energy Flux amp u erg cm 2 s amp ds 0 0 0 0 0 1 real fevb xmean d 1 1 1 1 1 121 f E13 6 p 4 b 4 amp n Viscous Energy Flux amp u erg cm 2 s amp ds 0 0 0 0 0 1 real ferb xmean d 1 1 1 1 1 121 f E13 6 p 4 b 4 amp n Radiative Energy Flux amp u erg cm 2 s amp ds 0 0 0 0 0 1 label endbox The above list was slightly edited by adding blanks to improve readability The identifier of an entry together with the name n and the unit u should give a first hint about the meaning of the quantity The suffix _xmean indicates a simple average The suffix _xmean2 indicates the root mean square average note the simple average is not subtracted Some entries e g ferb_xmean have a hidden b in their name have one element more e g 121 instead of 120 than most of the others and are characterized by the ds keyword see Table c These quantities are located at the cell boundaries in contrast to the usual cell centered quantities Clearly there are also two sets of axes e g xc3 and xb3 corresponding to the cell or boundary centered quantities Note The total energy flux can be written as sum feb total feipkgvrb feipb fekb fegb fevb ferb The flux fepb is already part of feipb 72 5 CONTROL AND DATA FILES 5 3 Parameter File rhd par The parameter file rhd par also has t
9. printf A 77s Nn 0 DONE T next print rhdi cmd cat gt nrhd cmd Terminate chain by simulating ACT eoc ACT eoc else Modify command file add in appropriate column to indicate proper execution awk j t print next print next 1 print next DONE T print gt cmdline printf 77s n 0 DONE T next print rhdi cmd cat gt nrhd cmd fi ls 1 Move data into backup directory cp p rhd par 4 BAKDIR PARFILE mv rhd out BAKDIR OUTFILE out mv rhd par BAKDIR OUTFILE par mv rhd sta BAKDIR OUTFILE sta mv rhd end BAKDIR OUTFILE end mv rhd full BAKDIR OUTFILE full mv rhd mean BAKDIR OUTFILE mean chmod gotr BAKDIR PARFILE BAKDIR OUTFILE chmod go w BAKDIR PARFILE BAKDIR OUTFILE HEHEHE HHH RARA RA fi HERA HAHAHA HERRERA RRHH HHRHH RRHH RAMA HERRERO RARA RRHH RARA RARA RA RARA GR Dispose modified command file for next job cp p nrhd cmd STADIR rhd1 cmd Exit loop if end of chain reached if test ACT eoc then break fi 6 2 Running CO5BOLD on a Machine with Batch System 121 t End of Loop 5 2 gt 2 2 5 done Submit next job if not end of chain reached if test ACT eoc then cd STADIR echo Resubmit job tt usr local bin qsub rhd1 job qsub rh
10. If you want to compile in a directory in a completely different place not in a sub directory of for as described above you have to set the environment variable F90_BASEPATH see Sect 3 5 to make the paths to the source files known to the configure script That might look like mkdir SOME WEIRD PLACE cd SOME WEIRD PLACE export F90_BASEPATH HOME for ln s F90_BASEPATH hd rhd conf configure configure The variable F90 BASEPATH also has to be set explicitely if the main directory for should have another name Renaming the sub directories with the source files is not a good idea it requires modifications of the configure script itself 3 3 Directory Structure The files necessary to compile CO5BOLD are distributed over a few directories A typical setup would be to put everything into the main directory for Then the source files would be located as in Tab The executables and makefiles object files module information files are usually located in subdirectories of the source code directories These subdirectories typically have the name of the machine architecture or operating system the executable is compiled for 3 3 Directory Structure setarcdeppaths csh setarcde ppaths sh TMAC MAC RHDEXEPATH HSTEXEPATH rhd RHDPATH MAC MAC 3HDWEXEPATH MEANEXEPATH hdw mean 3HDWPATH IMEANPATH mat Main directory MATPATH FORTRANDISK str f90 jSTRPATH MATSRCPATH uio eos UIOPATH EOSPATH
11. It consists of 12 columns with the following meaning col meaning format 1 reaction ID I4 2 4 reactants max 3 symbols with 8 characters 3 A8 1X 5 8 products max 4 symbols first two with 2 A8 1X 2 1X A4 8 characters last 2 with 4 characters 2 A8 1X 2 1X A4 9 reaction coefficient a 1PE8 2 10 reaction coefficient 6 0PF5 2 11 reaction coefficient y OPF8 1 12 reference A16 The symbols are usually the chemical symbols of the involved species e g C for carbon The present species are recognised automatically Molecules consisting of more than one atom of the same chemical element e g Ha are also possible H2 A special case is the representative metal M which is a catalytic element only ie it must appear as reactant and product The special symbol PHOTON represents a photon as reaction product Currently no photon can be used as reactant ionising or exciting another species The reaction coefficients are needed to calculate the chemical rates at runtime The basic rate is then given by k a Too gut 93 where T7399 T 300 K with T the gas temperature For catalytic reactions which involve a representative metal also the number density ny of the metal enters k nM Q Tio e YT 94 An input file could look like this 5001 H H H2 H2 H2 9 00E 33 0 6 0 0 AK 5002 H H H H2 H 4 43e 28 4 0 0 0 DBDDG72 4069 H2 H2 H2 H H 1 00e 08 0 00 84100 0L 28034 4071 H2 OH 0 H2 H 6 00e 09
12. Op T OAT OTXATXO0p p Tp or j 1 55 1 f1 57 p Nope we Jp Tu T Finally 71 2 3 A collection of thermodynamic relations M Steffen AIP Comparison with Eq 65 implies Similarly replacing de by Oe Oe de 5 dp 5 dp 0p 0p p 1 e 1 e p ds d 7 la GS jj and the requirement that the mixed derivatives must be equal then yields AS Op YT OP 5j Op T NOp Tp 8 55 Ge Ge 2 p p VOp S 3p p P P in Eq 35 we get or or 5 Sz S 1 a2 0p X0mp Onp lpNOp p p Since 5 S5 u 5 u Olnp NOlnp Olnp p p we finally obtain using Eqs 25 and 66 and The isothermal sound speed is then obtained as 2 3 5 Ideal gas with constant specific heats polytropic gas In this case we obtain much simpler relations 1 a a a a py 1 D Y h cpT 2 py 1 s Cy ln p ylnp const y Ty I2 T 3 const V R scc als 15 76 77 78 81 16 Cy R p Y Wd T des 2 a 12 Op m p 2 EQUATIONS 87 88 89 90 91 17 3 Program Files Installation Compilation In this section all the files and modules CO5BOLD contains are listed The installation procedure is outlined and compiler switches necessary to compile COSBOLD and to optimize its performance are described 3 1 Quickstart How to Compile CO5BOLD
13. Rate of temperature change for open upper boundary u 1 0 3 real c tsurf In the case of a transmitting upper or outer boundary the temperature of the material streaming into the model is adjusted towards a temperature teff c tsurf This temper ature can be specified as fraction of the effective temperature e g with real c tsurf f E15 8 b 4 n Temperature factor for open upper boundary u 1 0 62 The value depends on where the outer boundary is located relative to the photosphere If the boundary lies at a point where the solar photospheric minimum temperature is located it can be fairly small If the boundary is far away from the photosphere of a red supergiant the value can be even smaller On the other hand if the boundary lies somewhere within the solar chromosphere even values above 1 0 might be reasonable real c hptopfactor In the case of a transmitting upper or outer boundary the density stratification outside the model has to be extrapolated properly Assumptions about this density affects the amount of mass flowing into the model For the extrapolation it is assumed that the density scale H scales with the pressure scale height Hp as H H c_hptopfactor real c hptopfactor f E15 8 b 4 amp n Correction factor for surface pressure scale height u 1 0 8 Possible values are o C 0 0 No effect actually a value of 1 0 is chosen o 0 0 lt C lt 1 0 The density scale height is enlarged to account for possible e
14. ds 0 0 0 1 0 1 xc2 d 1 1 1 1 1 1 f E13 6 p 4 b 4 n x2 coordinates u cm amp ds 0 1 0 0 0 1 xc3 d 1 1 1 1 1 120 f E13 6 p 4 b 4 n x3 coordinates u cm amp ds 0 1 0 1 0 0 xb1 d 1 2 1 1 1 1 f E13 6 p 4 b 4 n x1 coordinates u cm amp ds 0 1 0 1 0 1 xb2 d 1 1 1 2 1 1 f E13 6 p 4 b 4 n x2 coordinates u cm amp ds 0 1 0 1 0 1 xb3 d 1 1 1 1 1 121 f E13 6 p 4 b 4 n x3 coordinates u cm amp ds 0 1 0 1 0 1 rho xmean d 1 1 1 1 1 120 f E13 6 p 4 b 4 amp n Density amp u g cm 3 vi xmean d 1 1 1 1 1 120 f E13 6 p 4 b 4 amp n Velocity u cm s v2 xmean d 1 1 1 1 1 120 f E13 6 p 4 b 4 amp n Velocity u cm s v3 xmean d 1 1 1 1 1 120 f E13 6 p 4 b 4 amp n Velocity u cm s vi_xmean2 d 1 1 1 1 1 120 f E13 6 p 4 b 4 amp n Velocity u cm s v2 xmean2 d 1 1 1 1 1 120 f E13 6 p 4 b 4 amp n Velocity u cm s v3 xmean2 d 1 1 1 1 1 120 f E13 6 p 4 b 4 amp n Velocity u cm s rhovi xmean d 1 1 1 1 1 120 f E13 6 p 4 b 4 amp n Mass Flux x1 u g cm 2 s rhov2 xmean d 1 1 1 1 1 120 f E13 6 p 4 b 4 amp n time step number n x1 coordinates of n Mass Flux x2 x1 x3 x1 x2 x3 of of of of of cell cell cell cell cell cell centers amp centers amp centers amp boundaries amp boundaries amp boundaries amp 70 real real real real real real real real real real real r
15. dtime lt dtime min stop gt program stop 1 0 5 3 Parameter File rhd par 103 If the actual time step falls below this value the simulation finishes gracefully This val ues has to specified as absolute time and has to be chosen carefully for each individual model or each group of models This time step restriction can be switched off by setting real dtime min stop O0 0 But in general one should keep it activated and try to find a proper positive value e real dtime incmax Sometimes a time step restriction can lead to a sudden drastic drop in the time step To prevent unwanted oscillations in the size of the time step its increase can be restricted e g with real dtime incmax f E15 8 b 4 n Maximum time step increment factor u 1 amp cO dtime max 1 0 gt no restriction ci typically 1 1 1 2 This value specifies the maximum factor by which the time step can be increased from step to step even if the new Courant condition etc would allow more A value value 0 0 deactivates this restriction e real c courant A typical Courant factor for each 1D hydrodynamics step can be specified with e g real c courant f E15 8 b 4 n HD Courant factor u 1 amp cO range 0 0 lt C_Courant lt 1 0 typically 0 5 04 5 From the minimum cell crossing time of a partial wave and this factor a recommendation for the next time step is computed A value of 1 0 is the upper limit which guarantees stability fo
16. no timing information o defined call subroutines to measure elapsed time e rhd_rad3d_dir_t01 in rhd_1hdrad_module F90 rhd radiation 3 dimensions direction timing 01 Category additional output Produce timing information for the routines which solves the radiation transport equation for one direction field The timing measurement are called very frequently and might slow down the code It should not be used in conjunction with OpenMP Values o undefined default no timing information o defined call subroutines to measure elapsed time rhd_rad3d_step_t01 in rhd_1hdrad_module F90 rhd radiation 3 dimensions step timing 01 Category additional output Produce timing information with main 3D radiation transport routine It can be used together with OpenMP and should cause no noticeable performance loss Values o undefined default no timing information o defined call subroutines to measure elapsed time rhd_shortrad_operator_101 in rhd_shortrad_module F90 rhd short characteristics radiation operator loop 01 Category performance enhancement selection of approximation Choose type of short characteristics operator The operators usually come in pairs 1 2 3 4 5 6 There is a development from 1 2 over 3 4 to 5 6 towards higher stability Both members of each pair should do the same operation but use different ways to do a case distinction The even operator has in some cases the better perfo
17. t print next print next N A print next DONE T print gt cmdline printf 77s n 0 DONE T next print rhdi cmd cat gt dummy nrhd cmd read INFILE OUTFILE PARFILE ACT lt cmdline mv dummy nrhd cmd OUTFILE _nrhd cmd echo INFILE echo QUTFILE echo PARFILE echo ACT THEHEREHEEHETHETH E EHERE RH EREHEREHETEHETEHEREHE ERE RE REEREHETEHETHE EHE EREHEREHETEHE TEETH EHE REHETEHETEHETHETMH HE EHE HEREHETHEIN EN if ACT dum then FEE EEE HH BN RHD execution Copy parameter file cp p STADIR PARFILE rhd par Copy start file if test s BAKDIR INFILE then cp p BAKDIR INFILE rhd sta else cp p STADIR INFILE rhd sta cp p rhd sta BAKDIR INFILE 120 6 RUNNING A SIMULATION fi Copy executable cp p RHDEXE rhd exe Execute RHD rhd exe gt rhd out RHD_EXIT if RHD_EXIT 0 s rhd done then Exit status not zero error may have occurred during execution of rhd exe if RHD EXIT 0 then echo Non zero exit status RHD EXIT occurred during execution of RHD else echo No rhd done file found assume error during execution of RHD fi echo Execution of job chain terminated Modify nrhd cmd set termination character awk t print next N print next 1 print next DONE T
18. 0 00 50900 0L 16964 116 5 CONTROL AND DATA FILES 66 C OH 0 CH 2 25e 11 0 50 14800 0L 4934 67 C OH co H 1 81e 11 0 50 0 0 W80 3707 C 0 CO PHOTON 1 58e 17 0 34 1297 4C BDD90 7001 C 0 H CO H 2 14e 29 3 08 2114 0D DBDDG76 4076 CO M 0 C M 2 79e 03 3 52 128700 0D CBDDG76 Refer to Wedemeyer B hm et al 2005 for more details 5 7 HION Input Several input files are required for the time dependent treatment of hydrogen ionization Cur rently they need to be stored in the same input directory as specified with the parameter hion datapath There are four input files e model atom The following formatting rules apply Currently we only provide a hydrogen atom file H_6 2 atom The module might be extended for other species in a future version e electron density look up table edens dat as function of total number density of hydrogen in cm or m gas temperature in K and ionization degree of hydrogen e chemical abundances abundance input e partition functions pf_kurucz dat The first two files are always needed whereas the files containing chemical abundances and partition functions are required the initial LTE electron densities for very first time step of a model sequence and for creating electron density tables Once the first time step has been calculated the last two input files are obsolete We plan to implement another initial guess for the LTE densities so that only the model atom and the electron density l
19. 4 amp n Point to point viscosity coefficient 1 0 20 This parameter is somewhat analogous to real c visartificial see 5 3 8 A value of 0 0 switches it off e real c_visp2pincll The interaction with the edge neighbor cells with indices 1 1 0 can be specified with e g real c_visp2pincli f E15 8 b 4 amp n Point to point viscosity inclined cell factor 1 u 1 1 0 Common values are 1 0 interaction is considered and 0 0 no interaction with these cells The usual value is 1 0 e real c visp2pincl2 The interaction with the corner neighbor cells with indices 1 1 1 can be specified with e g real c_visp2pincl2 f E15 8 b 4 amp n Point to point viscosity inclined cell factor 2 u 1 0 0 Common values are 1 0 interaction is considered and 0 0 no interaction with these cells The usual value is 0 0 to save some computation time 5 3 9 Dust Molecules Hydrogen Ionization General CO5BOLD can now handle a number of additional density arrays They can be used to describe e g the mass density of dust distribution moments or number densities of molecules These species are properly advected with the gas density There is also already a small number of dust molecule formation models available These models have to be improved in the future and the influence on the radiation field opacities radiation pressure on dust has to be taken into account e character dustscheme A s
20. A7 along a path with length Az is than AT kpc 12 The variation of the intensity J with optical depth 7 along a ray with orientation 0 y can be described by the simple differential equation dI atts 13 The radiative energy flux is given by 27 rt Frad I I Icos sin d d 14 0 0 The energy change can than be computed from the flux divergence with OF sad OF 22 rad ER 2 0x1 0x2 0x3 E 15 2 2 Magnetohydrodynamics W Schaffenberger The current MHD module is a reduced version of the original MHD module The aim was to create a stable and easy to use module see Schaffenberger et al 2005 The module has the following features e Use of the HLL solver with the Janhunen source terms e Extension to 2nd order with linear reconstruction and a Hancock predictor step e The following limiters are available Minmod vanLeer Superbee e Hybridization of 1st and 2nd order flux to ensure positivity of pressure and density e Flux interpolated constrained transport step e Small violation of strict energy conservation after the constrained transport step to keep the pressure positive The original test version has the additional features e HLLC HLLEM and Roe solver e Janhunen source terms can be deactivated e Use of entropy equation instead of energy equation possible e Use of both energy equation and entropy equation possible e Field interpolated constrained transport step avail
21. TMAC MAC jSTREXEPATH jSTREXEPATH bin f90 gas f90 UIOSRCPATH 3GASPATH JEOSSRCPATH SMAC man UIOEXEPATH MAC MAC SGASEXEPATH JEOSEXEPATH uiolol 90 exe Unix shell scripts Figure 1 Old directory scheme 21 rad hdrad SRADPATH jRADEXEPATH 22 3 PROGRAM FILES INSTALLATION COMPILATION Paths Abb Description HOME for con f90 CON constants and units HOME for dust f 90 DUST source terms due to dust or molecules HOME for hion f 90 HION time dependent hydrogen ionization HOME for chem CHEM chemical reaction network HOME for eos f90 EOS equation of state HOME for hd mhd MHD MHD routines HOME for hd rhd RHD main rhd routines hydro Bernd s radiation transport HOME for hd rhdb RHDB basic rhd routines HOME for mat str STR string handling HOME for opa opta OPTA opacities HOME for rad hdrad RAD Matthias radiation transport HOME for uio 90 UIO I O routines HOME for time f90 TIME timing routines Table 1 List of source directories with path and file name abbreviation and a short description 3 4 Fortran Files Tables 2 and 3 show a list of all source files necessary to compile the complete version of CO5BOLD 3 5 Configure Script The configure script produces a Makefile It is controlled by environment variables see below It tries to use reasonable default values if they are not set properly In the script the
22. This optional information parameter can be specified with real qmol f E15 8 b 4 n mean molecular weight u u amp cO standard solar mixture 0 13018000E 01 It has no practical consequences because the actually used chemical composition is deter mined by the files for equation of state and opacity e real gamma This optional information parameter can be specified with real gamma f E15 8 b 4 n Adiabatic coefficient u 1 amp c0 0 0 1 6666666666666 1 4 0 0 It has no practical consequences because the actually used chemical composition is deter mined by the files for equation of state and opacity e real c_visneul real c_visneul f E15 8 b 4 amp n Linear viscosity parameter von Neumann Richtmyer type u 1 0 0 e real c visneu2 real c visneu2 f E15 8 b 4 amp n Quadratic viscosity parameter von Neumann Richtmyer type u 1 0 0 e real c radkappasmooth In the LHDrad module the opacity along each ray can be smoothed The amount of smooth ing can be set e g with real c_radkappasmooth f E15 8 b 4 n Opacity smoothing parameter u 1 amp c0 70 0 no smoothing 0 25 light smoothing 0 666 strong smoothing 0 0 The smoothing can perhaps reduce the noise in the intensity images somewhat but has no general beneficial effect and should usually not be used e real c_radtsmooth In the LHDrad module the 3D temperature array can be smoothed The amount of smooth ing can be set e g
23. UIO flexible variable uio varfile module f90 definition and handling of file structure of UIO flexible variables uiocop f90 Program to copy and transform UIO files uiolok f90 Program to look into UIO files uioinf f90 Program to give information about conversion types uiotst f90 Program to produce test UIO file Table 7 UIO Fortran90 files module contents uio cst module channel status information uio cvl module convert type list of current machine uio inf module information about environment uio nam module definition of names uio siz module string length table size uio base module basic set of UIO routines string processing header handling I O channel management Table 8 Contents of uio base module f90 4 5 Fortran90 4 5 1 Files The Fortran UIO package is a collection of Fortran90 modules and programs described in Table 7 The file u o base module f90 contains the basic set of modules see Table 8 The files u o mac module f90 Tab 7 contain machine dependent routines collected in the module uio mac module see Tab 9 It comes in various flavors The machine independent version is uio_mac_module f90 which can be used for first tests but does not provide all possible features Therefore it should be discarded afterwards and replaced by a version more suitable for the platform in use The file uio mac ieee module f90 is appropriate for all machines with IEEE big_endian binary format Ad
24. Wedemeyer B hm and Inga Kamp o hiontd time dependent hydrogen ionization routines from Jorrit Leenaarts and Sven Wedemeyer B hm real c dustOX There are ten parameters real c_dust01 to real c dusti0 to control each dust forma tion scheme in detail A parameter can be given as in real c_dust01 f E15 8 b 4 n Dust parameter 1 0 0 The meaning and unit can vary from scheme to scheme The default value is 0 0 in each case Important The parameter real c_dust01 must be set to 1 0 in order to activate advec tion of particle densities for the CHEM chemreacnet and the HION hiontd module The default value is 0 0 i e advection is switched off character chem_reacfile The name of the input file containing the chemical reaction network character chem reacfile f A80 b 80 n file name of reaction table chem dat character chem_reacpath The path of the input file containing the chemical reaction network character chem reacpath f A80 b 80 n path of reaction table data sven cobold dat chem real chem abumetal Abundance of the representative metal M if present relative to hydrogen em M H A value of 1 0E 04 means there are 10 hydrogen atoms for every metal atom The metal number density for each grid cell is then derived via ny ey p my assuming a pure hydrogen gas This parameter is ignored when a quc array for the metal is found in the input model real chem abumetal f E15 8 b 4 n C
25. a value around 0 001 0 01 seems appropriate real c visbound An additional drag force can be added locally in inflow cells in the outer layer when the transmitting boundary condition is chosen The value can be set e g with real c_visbound f E15 8 b 4 amp n Boundary drag viscosity parameter u 1 0 001 This extra drag force is usually not necessary and should be switched off with c_visbound 0 0 5 3 Parameter File rhd par 85 e real c_resb This parameter is only valid for the hdscheme RoeMHD module It specifies the electric conductivity Values between 0 0 and 1 0 may be reasonable Higher values are possible but reduce the time step The default value is 0 0 Example real c_resb f E15 8 b 4 amp n Parameter for numerical resistivity u 1 951 Note that this parameter has no effect in the current version of the MHD module because the explicit electric conductivity and the addidional energy diffusion have been removed Therefore you can set them to any value you want without consequences However these parameters may be used again in future versions of the module e real c resepsilon This parameter is only valid for the hdscheme RoeMHD module It controls the additional energy diffusion Typical values are between 0 0 and 1 0 The default value is 0 0 Example real c resepsilon f E15 8 b 4 amp n Parameter for additional energy diffusion u 1 0 5 Note that this parameter has no effect in the current versio
26. abux 108 real abuy 109 real ar_dustgrainradius real B1_inflow 85 real c_radkappasmooth 109 real c coredrag 79 real c courant 103 real c courantmax real c_dust01 90 91 93 real c_dust02 90 91 93 real c dustO3 91 93 real c dust04 real c dustO5 INDEX real real real real real real real real real real real real real real real real real real real real real real real real real real real real real real real real real real real real real real real real real real real real real real real real real real real real real real c_dust06 c_dust07 c_dust08 c_dust0g 94 c dustOX chem abumetal c_hptopfactor 79 c_hydexpcourant 103 c hydexpcourantmax 103 c hydpredfactor c maxeichange c_pchange cputime 101 cputime_remainlimit 101 c_radcourant c_radcourantmax c_raddcool c_raddinci c_radhtautop 79 c_radimplicitmu c_raditereps 99 c_raditerstep 99 c_radmaxeichange c_radscool c_radtcool c_radthintimefac 105 E radtinei c_radtintminfac 110 c_radtsmooth c_radtvis 100 c_radtvisdtau 100 c_resb c_resepsilon c_schange 78 c_slopered c_tchange c_tsurf 79 cvisartificial c_visbound c_viscourant c_viscourantmax c_visdrag c_visexpansion c_vislinear c visneu1 109 c visneu2 109 c_visp2pcoeff 88 c_visp2pincli c_visp2pincl2 c_visprturb c_vissmagor
27. and big endian format assume byterecl Necessary for the UIO routines specify that the length of a record is measured in bytes and not in words e cpp invoke the preprocessor on all source files e inline speed V Force automatic inlining optimized for speed e 04 General optimization Drhd hyd roeid 101 0 Optimization Choose standard set of routines for Roe solver See Sect DMSrad raytas 0 Optimization choose default version of loop in SUBROUTINE raytas in file M9rad3D F90 See Sect 3 7 6 Hewlett Packard V2500 The 12 processor machine zeipel from Hewlett Packard is a V2500 PA 2 0 system Now there is a first success to force the compiler to accept the OpenMP directives in CO5BOLD Yet when running on several processors only some routines e g rhd_shortrad_dirsimplel in COSBOLD can benefit while others rhd shortrad dirsimple2 rhd shortrad dirsimple3 are significantly slower than on one processor In addition the single processor performance is not very good partly because the achievable optimization level is not very high Some macros which seem to be necessary e U77 Link proper library to make the machine understand e g call flush 6 e cpp yes Switch on the C preprocessor Note that all Fortran90 files have to end with 90 The F90 suffix does not seem to work parallel openmp Onoautopar Try to enable parallelization with OpenMP direc tives disable au
28. are uio mac intel module f90 in the little endian case and uio mac sun module f90 in the big endian case The compiler is called with ifc Important switches are e Vaxlib Link proper library to make the machine understand e g call flush 6 http www pgroup com 3 7 Optimization Compiler Switches 43 e fpp Activate the preprocessor silently e 03 General optimization flag e tpp6 xK Optimization especially for Pentium III and Athlon includes SSE vector com mands e tpp7 xW Optimization especially for Pentium IV includes SSE2 vector commands e xP Optimization especially for Core 2 Duo and simular architectures e ip Optimization activate interprocedural optimization within each source file This enables inlining e DMSrad raytas 2 Optimization choose non default version of loop in SUBROUTINE raytas in file M rad3D F90 See Sect e Drhd shortrad diri 101 1 Optimization Transpose arrays and use routine rhd shortrad dir3 for rays in x1 direction See Sect e openmp Parallelization OpenMP directives are activated Note that the for compiler versions before 9 0 the UIO routines should be compiled without OpenMP support even if they do not contain any OpenMP directives themselves e i dynamic Helpful against undefined reference to __ctype_b errors e r8 fpconstant Useful to force compilation in double precision see 3 7 3 On Macintosh machines the typical optimization
29. big_endian format the standard for UIO files are automatically transformed to little_endian and vice versa e fast General optimization flag to choose close to optimum optimization for local ma chine e Mvect sse Optimization Allow Pentium III vector commands e Mcache align Optimization Align some data object on cache line boundaries e fastsse From compiler version 4 0 on this option can be used instead of the three previous ones It contains and supersedes them e Minline Optimization the routines that should be inlined are listed in Sect e DMSrad_raytas 2 Optimization choose non default version of loop in SUBROUTINE raytas in file MSrad3D F90 See Sect e Drhd_hyd_roe1d_101 0 Optimization choose standard set of routines for Roe solver See Sect e Drhd_shortrad_operator_102 1 Optimization use the manually inlined version of the short characteristics operator e Drhd_shortrad_dtauop_102 1 Optimization use the manually inlined version of the optical coupling operator 3 7 11 Linux Intel Compiler With Version 7 0 and 7 1 of the Intel compiler CO5BOLD compiled with tricks see below Version 8 0 still caused trouble With version 9 1 everything compiles smoothly The native format on Intel machines is little endian With export F_UFMTENDIAN big to be set at runtime after compilation before running CO5BOLD the default can be changed to big endian The appropriate UIO modules
30. cm 2 real vmicro f F4 2 b 4 n microturbulence u km s real q f F8 5 b 4 n Hopf function u 1 c0 q T tau Teff 4 0 75 tau tauross tau5000 t pgas pel vmic q 2 00E 07 6 539 3900 0 769 3 140 0 00 0 27637 54 4 UIO DATA FORMAT keyword description example descriptor info necessary b byte number 4 format yes d dimension 0 9 format yes arrays ds dimension shift 1 1 yes f Fortran format E13 6 format yes p values per line 4 format yes arrays t transformation log10 format n name density yes u unit g cm 3 yes date date 1 1 98 yes c0 9 comment Dichte yes form file format formatted file yes file header convert conversion leee_4 file yes file header version version 0 1 1997 11 29 yes system system IRIX yes machine machine name atlas yes osrelease OS release 6 3 yes osversion OS version 12161207 yes hardware machine hardware IP32 yes language program language Fortran90 yes program program uiotst yes XYZ user defined source yes Table 6 Standard UIO entry header keywords The keyword is given with a short description and an example The fourth fifth and sixth column indicate if the keyword is a mandatory descriptor in the file header or for the format of an entry or if it gives only additional information and is optional and therefore not necessary to specify FOOoORNFRFREFN eNe ONFPONFPONF OO NF ON FS OND BO0E 07 6 JOOE 0T 5 QO0E 06 5 0OE 06 00E 06 5 00E 05 4
31. dat uio data mode close filename model txt uio data mode close family mod2 uio data mode allclose of UIO files 4 7 3 Reading Data with uio dataset rd pro or uio datasetlist rd pro For a detailed description of how to handle UIO files in IDL see Sect With the new IDL routines uio_struct_rd pro uio dataset rd pro and uio datasetlist rd pro files are not read entry by entry anymore but in larger blocks or data sets With uio struct rd all entries in a file are read and put into an IDL structure variable This is appropriate for the CO5BOLD parameter file or for the UIO table file in Sect 4 3 3 e g par uio struct rd st35gm04nO5 03 par atm uio struct rd holmu atm When groups of entries in an UIO file are properly marked with label dataset and label enddataset delimiters confer the example in Sect 5 1 each group can be accessed with uio dataset rd The first block can be read with ful uio_dataset_rd st35gm04n05_03 full or ful uio_dataset_rd st35gm04n05_03 full ndataset 0 Dataset number i 1 counting starts at zero can be read with ful uio_dataset_rd st35gm04n05_03 full ndataset i If a dataset with that number does not exist an empty structure is returned In this case when called with additional keywords like ful uio_dataset_rd st35gm04n05_03 full ndataset i outstr outstr ierr ierr an error message is returned in outstr and ierr is s
32. f E13 6 p 4 b 4 amp n Entropy amp u erg K cm 3 gammai_xmean d 1 1 1 1 1 120 f E13 6 p 4 b 4 amp n 1st Adiabatic Coefficient amp u 1 gamma3_xmean d 1 1 1 1 1 120 f E13 6 p 4 b 4 amp n 3rd Adiabatic Coefficient amp u 1 delta_xmean d 1 1 1 1 1 120 f E13 6 p 4 b 4 amp n Expansion coefficient amp u 1 kapparho_xmean d 1 1 1 1 1 120 f E13 6 p 4 b 4 Y n Absorption Coefficient amp u 1 cm quc001 xmean d 1 1 1 1 1 120 f E13 6 p 4 b 4 amp n Number density of CO amp 5 2 File with Additional Data rhd mean 71 u 1 cm 3 rreal rhovb xmean d 1 1 1 1 1 121 f E13 6 p 4 b 4 amp n Mass flux amp u g cm amp ds 0 0 0 0 0 1 real frhovi3b xmean d 1 1 1 1 1 121 f E13 6 p 4 b 4 n Momentum x1 flux x3 direction amp u erg cm 3 amp ds 0 0 0 0 0 1 real frhov23b_xmean d 1 1 1 1 1 121 f E13 6 p 4 b 4 n Momentum x2 flux x3 direction Q u erg cm 3 amp ds 0 0 0 0 0 1 real frhov33b_xmean d 1 1 1 1 1 121 f E13 6 p 4 b 4 n Momentum x3 flux x3 direction amp u erg cm 3 amp ds 0 0 0 0 0 1 real feipb_xmean d 1 1 1 1 1 121 f E13 6 p 4 b 4 amp n Enthalpy Flux u erg cm 2 s amp ds 0 0 0 0 0 1 real fekb_xmean d 1 1 1 1 1 121 f E13 6 p 4 b 4 amp n Kinetic Energy Flux amp u erg cm 2 s amp ds 0 0 0 0 0 1 real fegb xmean d 1 1 1 1 1 121 f E13 6 p 4 b 4 amp n Gravitational Energy Flux amp u erg cm 2 s amp
33. flags are 03 no prec div fno alias ip A big problem is the tiny stack size on those ma chines large arrays taken from the stack should be avoided For the SHORTrad module this can be achieved by setting Drhd shortrad arrays 101 2 during compilation In addition relatively small chunk sizes should be specified in rhd par see Sect and Sect Using the Intel compiler before version 9 1 there was a problem with the UIO modules when OpenMP is activated This was a bit weird because the UIO modules do not contain any OpenMP directives However this means that OpenMP can be safely deactivated for these modules A proposed compiling sequence is all modules activated export F90_LHDRAD 1 export F90_MSRAD 1 export F90_SHORTRAD 1 export F90 DUST 1 export F90 MHD 1 export F90 PARALLEL scalar configure make UIO export F90_PARALLEL openmp configure make In some cases it might be helpful to set export LD ASSUME KERNEL 2 4 19 when encountering problems with OpenMP 44 3 PROGRAM FILES INSTALLATION COMPILATION 3 7 12 Linux PathScale Compiler Some experiments with the PathScale compiler have been made It is called with pathf90 The result is not entirely satisfying yet Important switches are e byteswapio With this flag set binary files in big_endian format the standard for UIO files are automatically transformed to little endian and vice versa e 03 General optimization flag More aggressive optimization
34. h 1 copylist o outputfilename filename 4 7 IDL UIO Routines 61 DESCRIPTION The routine uiocat reads each filename file in uio form in sequence and displays its contents formatted on standard output or writes it into a file In the latter case the format change from formatted to unformatted or vice versa is possible OPTIONS 6 Conversion type native ieee_4 machine dependent its specification is only relevant if an output file is specified with the o option and output format unformatted f Output format formatted or unformatted Its specification is only relevant if an output file is specified with the o option H Help print usage of uiocat 1 List of entries to be copi d E g uiocat 1 real rho uiocat 1 real rho integer i uiocat l label real rho integer i uiocat l label real rho i Here copylist is a list separated by Each item consists of exactly two items separated by a blank No additional blanks are allowed Use copylist with as above 0 Output file name If omitted standard output is used and c and f are meaningless Sun0S 5 5 1 Last change 12 January 1998 1 4 6 4 Information about Conversion Types uioinfo The shell script uioinfo calls the Fortran program uioinf f90 The man page uioinfo 1V Misc Reference Manual Pages uioinfo 1V NAME uioinfo print machine dependent information SYN
35. handles the source terms due to gravity A different choice results in different simulation results and not just in slightly faster or slower code The problem is that the original Roe solver interpretes the pressure gradient in a hydrostatic stratification a fluctuation due to shock waves In case of strong stratification this can lead to weird effects With activated correction the Roe solver treats only the deviations from a hydrostatic stratification as due to waves or shocks Several correction formulas have been tried T he latest is the recommended default Values No pressure correction terms in Roe solver Simple correction with rhomean no new average pressure Simple correction with rhomean new average pressure Correction with local rho limited new average pressure Correction with local rho new different formula average pressure o 5 default Correction with local rho new limit new average pressure Oo og F WN HF O o 6 Modification of 5 with different geometry factors in case of non equidistant grid rhd_hyd_entropyfix_p01 in rhd_hyd_module F90 rhd hydrodynamics entropy fix parameter 01 Category performance enhancement The entropy fix can be done in one of two ways to get optimum performance with essentially the same results Values o 0 default if then else construction o 1 use a mask and the signum function rhd_hyd_upwind_p01 in rhd_hyd_module F90 rhd hydr
36. hd rhd rhd_lhdrad_module F90 RHD radiative transfer routines long characteristics supergiant case hd rhd rhd_shortrad_module F90 RHD radiative transfer routines short characteristics supergiant case hd rhd rhd_shortrad_dtauop01 f90 RHD short characteristics tau coupling hd rhd rhd_shortrad_dtauop02 f90 RHD short characteristics tau coupling hd rhd rhd shortrad operator00 f90 RHD short characteristics operator hd rhd rhd shortrad operator08 f90 RHD short characteristics operator hd rhd rhd vis module F90 RHD tensor viscosity routines hd mhd rhd mhd module F90 MHD magnetic fields first version rad hdrad rhd_rad_module f90 RAD interface for Matthias radiation routine rad hdrad MSrad3D F90 RAD Matthias radiation transport routines long characteristics periodic sides eos f90 gasinter_routines f90 EOS equation of state opa opta cubit_module f OPTA cubic interpolation opa opta opta par module f90 OPTA parameters for opacity routines opa opta opta routines f OPTA opacity hd dust rhd dust module F90 DUST dust molecule formation hd dust dust k3mon module f DUST 1 or 2 component dust model hd dust dust bins module f90 DUST multi bin dust model dust momentc2 module f DUST 4 moment dust model C2 INC DUST dust include file C molecule C2H INC DUST dust include file CoH molecule C2H2 INC DUST dust include file CoH molecule CHPAR_CT INC DUST dust include file DINDEX INC DUST dust include file DKSPLINT INC DUST dust include file H2 I
37. installation of these scripts with a configure make make install sequence is described in Sect Without these scripts an UIO file in ASCII format can be examined with any text editor or with more To get an overview about the contents of a binary file the command strings 30 uio_example_file dat can be useful 4 2 Example of UIO Data File To give a first impression about the data structure here follows a simple test file which contains the header a label a couple of scalars an array and a short table fileform uio form formatted convert native version 0 1 1997 11 29 amp date 29 11 1997 21 23 39 835 system IRIX machine atlas osrelease 6 3 amp osversion 12161207 hardware IP32 language Fortran90 program uiotst label testdata n sample test data field date 29 11 1997 21 23 39 835 integer ia f I3 b 4 n This is the answer 4 3 Structure of UIO Files 51 42 complex ca f E13 6 E13 6 b 8 n This is a complex answer 0 400000E 01 0 200000E 01 real da f E23 15 b 8 n precise answer 0 420000000000000E 02 real answer f F4 0 b 4 n answer u 1 42 real real2d d 100 103 200 204 f E13 6 p 4 b 4 0 100000E 01 0 200000E 01 0 300000E 01 0 400000E 01 0 500000E 01 0 600000E 01 0 700000E 01 0 800000E 01 0 900000E 01 0 100000E 02 0 110000E 02 0 120000E 02 0 130000E 02 0 140000E 02 0 150000E 02 0 160000E 02 0 170000E 02 0 180000E 02 0 190000E 02 0 200000
38. largest dust or monomer density Typical values are 1 0E 09 or so The default value is 0 0 e real c dustO6 The sticking coefficient for the condensation rate is specified with e g real c dust06 f E15 8 b 4 n Sticking coefficient u 1 amp cO For C rich dust 0 37 can be between O and 1 1 0 Typical values are between 0 0 deactivating this process and 1 0 The default value is 0 0 The standard choice is 1 0 e real c dustOT The sticking coefficient for the coagulation rate is specified with e g real c_dust07 f E15 8 b 4 n Sticking coefficient for coagulation u 1 amp cO Typically between O and 1 1 0 Typical values are between 0 0 deactivating this process and 1 0 The default value is 0 0 e real c dustO8 The sticking coefficient for the coalescence rate is specified with e g 94 5 CONTROL AND DATA FILES real c_dust08 f E15 8 b 4 n Sticking coefficient for coalescence u 1 amp cO Typically between O and 1 1 0 Typical values are between 0 0 deactivating this process and 1 0 The default value is 0 0 real c dustO9 The sticking coefficient for the nucleation rate is specified with e g real c dust09 f E15 8 b 4 n Sticking coefficient for nucleation u 1 cO Typically between O and 1 1 0 Typical values are between 0 0 deactivating this process and 1 0 The default value is 0 0 The standard choice is 1 0 5 3 13 Radiation Transport Control In this part of the par
39. magnetic fields o transmitting transmitting boundary for hydro and outward radiation Magnetic field lines are orthogonal to the boundary i e the tangential component of the magnetic field vanishes at the boundary In almost every simulation of stellar convection a transmitting top boundary will be selected the closed one is an alternative The periodic condition is only recognized by the hydrodynamics routines and not by any radiation transport routine 5 3 Parameter File rhd par 77 character bottom_bound The boundary condition at the bottom of the model is given for instance by character bottom bound f A80 b 80 n bottom boundary conditions amp cO closedbottom transmitting Possible values are o reflective closed wall no gravity no radiation Like the velocity field the magnetic field is mirrored at the boundary This boundary condition is unphysical because the magnetic field is an axial vector and it violates the divergence free property of the magnetic field Therefore this boundary condition should not be used in MHD simulations Use closed boundary conditions instead o constant open boundary with constant extrapolation of all values no gravity no radiation o closed closedtop closed wall can handle gravity open for outward radiation Mag netic field lines are orthogonal to the boundary i e the tangential component of the magnetic field vanishes at the boundary o closedbottom closed wall handles gr
40. memory 1 GByte To get it it might be necessary to ask for more than one processor for the compi lation especially on the CINES machines e CG longbranch limit 60000 This switch limits needed compiler resources It is sug gested by the compiler on the CINES machines itself e Drhd roeid step 101 1 Slight performance improvement 3 7 17 SGI Origin 2000 3800 at UKAFF CO5BOLD has been also compiled and tested on up to 22 processors on the machines of the UK Astrophysical Fluids Facility UKAFF P in Leicester England UKAFF operates two machines an SGI Origin 3800 with 128 processors named ukaff and an older SGI Origin 2000 with 22 processors named grand which is mainly used for development and test purposes Both machines are binary compatible At the time of testing April 2003 the SGI MIPSpro Compilers Version 7 4 was installed Most of the compiler switches given in the previous section were used except for the following modifications which either gave empirically a better performance or were recommended by the UKAFF Hints for users e Ofast Replaces 03 gave better performance e LN0 cs1 32k 1s1 32 cs2 8M 1s2 128 Explicit cache architecture added The option Ofast is now the default selected by the configure script for all SGIs with IP35 architecture The cache architecture settings are activated for the UKAFF machines only A glitch in the system libraries made it necessary to add a work around to
41. module f90 RHDB averaging routines hd rhdb rhd_prop_module 90 RHDB box properties hd rhdb rhd sub module f90 RHDB additional routines con f90 const module f90 CON physical and mathematical constants mat str str module f90 STR string handling time f90 timing module f90 timing routines zizie SoZ S uio f90 uio_base_module f90 I O routines uio f90 uio_bulk_module f90 I O routines uio f90 uio_filedef_module f90 UIO I O routines uio f90 uio mac crayts module f90 UIO I O routines machine dependent part uio f90 uio mac crayxmp module f90 UIO I O routines machine dependent part uio f90 uio mac decalpha module f90 UIO I O routines machine dependent part uio f90 uio mac hitachi module f90 UIO I O routines machine dependent part uio f90 uio mac ieee module f90 UIO I O routines machine dependent part uio f90 uio mac intel module f90 UIO I O routines machine dependent part uio f90 uio mac module f90 UIO I O routines m d minimal version uio f90 uio mac nec module f90 UIO I O routines machine dependent part uio f90 uio mac sun module f90 UIO I O m d works in most cases Table 3 List of all low level modules the table shows the file name with part of its path the shortcut for the directory and its description 3 5 Configure Script 25 o No extra flags F90_PARALLEL Parallelization scheme o scalar no parallelization default o openmp OpenMP appropriate for CO5BOLD o auto auto parallelization
42. potential or lower and upper boundary routines constant gravitation It can be used together with OpenMP Values o undefined default no timing information o defined call subroutines to measure elapsed time rhd roeid flux tO01 in rhd_hyd_module F90 rhd roe 1 dimension flux timing 01 Category additional output Produce timing information for the routine which computes the Roe fluxes It should not be used in conjunction with OpenMP Values o undefined default no timing information o defined call subroutines to measure elapsed time rhd roeid step tO01 in rhd_hyd_module F90 rhd roe 1 dimension step timing 01 Category additional output Produce timing information for the routine which performs the Roe step It should not be used in conjunction with OpenMP Values o undefined default no timing information o defined call subroutines to measure elapsed time Hydrodynamics tensor viscosity rhd vis density p01 in rhd vis module F90 rhd viscosity density parameter 01 Category selection of approximation Choose formula for density average at cell boundary in tensor viscosity routines Values o 0 rhomean min rholeft rhoright o 1 default rhomean 0 5 rholeft rhoright rhd vis tO1 in rhd vis module F90 rhd viscosity timing 01 Category additional output Produce timing information for 2D 3D tensor viscosity routines It should not be used in conjunction with Ope
43. purpose the environment variable UIOMAC has to be set to the name of the appropriate routine see Sect 3 3 For COSBOLD or the UIO UNIX scripts the respective configure script takes care of this step Many compilers generate module information files with suffixes like M mod or kmo To clean up information files with other suffixes they have to be included in the cleaning step Calling examples make make UIO make UIO F90FLAGS g make clean 58 4 UIO DATA FORMAT make cleanall make remove make removeall A section of a typical makefile using the UIO routines may be Compiler options F90C f90 F90FLAGS Libraries UIOMAC uio mac sun module Dependencies of exe files on object files and libraries test exe test o F90C F90FLAGS o 0 UIOPATH f90 uio base module o UIOPATH f90 UIOMAC o UIOPATH f 90 uio bulk module o test o UIOPATH f90 UIO test f90 F90C c F90FLAGS M UIOPATH 90 test f90 Dependencies on used modules ULOPATH 90 UIO cd UIOPATH f90 make UIO F9OFLAGS F9OFLAGS 4 5 4 Sample Calls of Fortran UIO Routines The needed modules have to be declared by a use statement like use uio bulk module In the initial phase of the program the UIO routine package has to initialized by exactly one call of the uio init routine with the name of the program as optional parameter call uio_init progrm uiotst The
44. should be switched off e g by setting it to 0 0 integer dtimestep_out_fine This parameter can be specified but there is no corresponding output file in CO5BOLD yet integer dtimestep out fine f I4 b 4 n Qutput time step number u 1 amp cO dtimestep out fine O gt no output 1 character outfile_fine The name of the file for the output of additional information at regular small intervals can be specified with e g character outfile_fine f A80 b 80 n Output file name rhd fine Leaving it empty means that no file of this type is written Specifying it means the same yet character outform_fine The format see Sect 4 3 1 of the files with frequent output can be chosen e g with character outform fine f A80 b 80 n Output file format amp cO formatted unformatted unformatted 5 4 Additional Control and Status Files rhd stop rhd cont rhd done and rhd dump 111 Allowed values are o unformatted default fast compact possibly machine dependent output strongly recommended o formatted slow machine independent output big files This parameter can be specified but there is no corresponding output file in COSBOLD yet e character outconv_fine The conversion type see Sect 4 3 1 of the files with frequent output can be specified e g with character outconv fine f A80 b 80 n 0utput file conversion amp c0 ieee_4 ieee_8 crayxmp_8 native ieee 4 The allowed values depend
45. speed that is used in the formula for the kinematic viscosity Ususally it is not activated c vislinear 0 0 It might be useful to damp small amplitude almost linear waves real c visprturb The Prandtl number for turbulent mixing can be specified e g with real c_visprturb f E15 8 b 4 amp n Turbulent Prandtl number u 1 8 0 Values between 1 0 and 10 0 appear reasonable Note that larger values lead to smaller amounts of turbulent mixing A value of 0 0 switches off the turbulent mixing terms but not the entire tensor viscosity real c_vistensordiag The factor in the stress tensor in front of of the diagonal terms can be set with real c_vistensordiag f E15 8 b 4 amp n Diagonal factor for viscous stress tensor u 1 amp cO typically 1 0 1 0 This is not really parameter one would try to adjust The total amount of viscosity should be controlled with parameters like real c vissmagorinsky and real c visartificial But the parameter can be used to tentatively switch off the diagonal terms completely or to change its importance compared to the other terms 5 3 Parameter File rhd par 87 e real c vistensoroff The factor in the stress tensor in front of of the off diagonal terms can be set with e g real c vistensoroff f E15 8 b 4 amp n Off diagonal factor for viscous stress tensor u 1 amp cO typically 0 5 0 5 This is not really parameter one would try to adjust The total amount of viscosity s
46. tar zxvf for tar gz or by copying all files from an existing installation On a restricted UNIX you might be forced to use gunzip for tar gz tar xvf for tar instead Unpacking the tar file creates a sub directory for in the local directory and possible overwrites existing files You get sub sub directories as described in Sect and files as listed in Tables 2 and 3 See the Readme file for README 18 3 PROGRAM FILES INSTALLATION COMPILATION 3 Change with cd for hd rhd into the main directory Look at the existing sub directories e g with ls og grep d to see if you find one that fits your machine The directory for hd rhd conf should not be used It contains only the configure script But any other directory will do If you don t like any of the existing directories create your own e g with mkdir YOUR MACHINE Change into this directory with cd YOUR MACHINE Check if there is a configure script or a link to it with ls og configure which should give something like lrwxrwxrwx 1 17 2002 12 04 17 39 configure gt If it is not there create the link with ln s conf configure configure This gives you a screen output like Configuration script for CO5BOLD Makefile conf configure Start the configure script to create the first version of the Makefile No parallelization requested assume default F90_PARALLEL scalar No debugging requested assume default
47. thermodynamic relations M Steffen AIP 13 This relation is obtained from the equality of the mixed derivatives in Eq 16 together with Eq 40 Entropy change at constant pressure 48 This relation is obtained from the equality of the mixed derivatives in Eq 17 together with Eq 42 Specific heat at constant density To derive the specific heat at constant pressure we start from the relation OlnT OlnT dla T 35 5 dmp Js as GE u 5 lnp r Olnnp Os Using Eqs 40 and 49 we obtain from which we get Now 3 5 E S T a 0 al al u E S np np ue sinp a oz those tea Os J e hence Os Olnp Os Os Olnp et sina Os P ara Sar sina SER amr and finally EE She Y 95 2o Or 49 50 51 52 55 56 57 Using Eqs 23 40 48 52 we finally obtain the relation for the specific heat at constant pressure 58 14 Alternatively c can be obtained from Eq 28 once and yr are known see below or from 2 EQUATIONS 59 We can now express the thermodynamic coefficients provided by COSBOLD in terms of cy I1 I3 and Vaa We consider again Eq 35 replacing de by Oe Oe de dT 4 d 1 0e 1 e p ds dT d T ei a e 72 j The requirement that the mixed derivatives must be equal then yields SO ap x ar az r a 77
48. time that is used in a scalar i e single processor setup Ideally one would like a constant behavior which stays close to one The perhaps most interesting result is that the speedup on ukaff is about 11 for the large model on 16 processors Perhaps not ideal but within the range of practical interest In general the hydrodynamics routines scale more favorably than the radiation routines This is perhaps sim ply related to the fact that in explicit hydrodynamics communication is restricted to neighboring grid cells ME http www ukaff ac uk 3 7 Optimization Compiler Switches Machine grand 125x125x81 grid points 4 OBM band 10 time steps Per processor execution time increase 0 5 10 15 20 25 Number of processors Figure 3 UKAFF machine grand small model Machine grand 315x315x81 grid points 1 OBM band 3 time steps Per processor execution time increase 0 5 10 15 20 25 Number of processors Figure 4 UKAFF machine grand large model 47 48 3 PROGRAM FILES INSTALLATION COMPILATION Machine ukaff 315x315x81 grid points 1 OBM band 3 time steps Per processor execution time increase 0 5 10 15 20 25 Number of processors Figure 5 UKAFF machine ukaff large model For those wondering the black curves do not lie between the red and green curve since more components than just radiation and hydrodynamics add up to the total time Furthermore the normalization of the executi
49. 01 defined rhd roeid step tO1 defined See Sect 3 6 for more information about the meaning of the values The reading of the parameter file starts with ACTION Read parameter file After a parameter is read its value is printed see Sect 5 3 The line ACTION Load EOS data indicates the start of the reading of the equation of state data It is followed by some information about the EOS table in use Similarly the line ACTION Load opacity tables indicates the start of the reading of the opacity data The information that follows is taken directly from the header of the opacity table Currently the last file to be read is the start model which is announced by ACTION Read start model and followed by some information about the start model e g the number of grid points and a new section showing the quantities actually read e g 5 5 Text Output rhd out 113 Properties of start model time time s xci X1 coordinates of cell centers cm xc2 X2 coordinates of cell centers cm xc3 X3 coordinates of cell centers cm xb1 X1 coordinates of cell boundaries cm xb2 X2 coordinates of cell boundaries cm xb3 X3 coordinates of cell boundaries cm rho Density g cm 3 ei Internal energy erg g vi Velocity 1 cm s v2 Velocity 2 cm s v3 Velocity 3 cm s quc001 Number density of CO 1 cm 3 advect 1 bb1 Magnet
50. 10050 1 TIME OUT MEAN LAST FLOAT 10040 0 Z STRUCT gt Anonymous Array 1 If the command in Sect has been performed the following substructures are present EOS STRUCT Anonymous Array 1 OPA STRUCT Anonymous Array 1 The substructure FUL Z contains the original data arrays from the model file like the spatial axes density rho internal energy ei and the three spatial components of the velocity vi v2 v3 Structure 8274184 16 tags length 78403900 refs 2 TYPE STRING uio BOX ID STRING uz DIMENSION LONG Array 2 3 TIME FLOAT 10050 1 ITIME LONG 64088 XC1 FLOAT Array 140 1 1 XC2 FLOAT Arrayli 140 1 XC3 FLOAT Array 1 1 200 XB1 FLOAT Array 141 1 1 XB2 FLOAT Array 1 141 1 XB3 FLOAT Array 1 1 201 RHO FLOAT Array 140 140 200 EI FLOAT Array 140 140 200 vi FLOAT Array 140 140 200 V2 FLOAT Array 140 140 200 V3 FLOAT Array 140 140 200 Spatial axes XC1 XC2 XC3 XB1 XB2 XB3 The indices stand for 1 2 2 y 3 z or h C for the grid cell centre B for the boundaries Most of the quantities are defined for the cell centres In case of doubt this can be found out by checking the array dimensions The substructure FUL Z can contain additional arrays in case of dust formation chemical reaction networks or time dependent hydrogen ionization QUCOO1 FLOAT Array 140 140 200 QUC002 FLOAT Array 140 140 200 QUC003 FLOAT Array 140 140 200 Quco04 F
51. 101 1 3 5 a 2 case distinction with masks weights 0 0 or 1 0 default if rhd_shortrad_operator_101 2 4 6 e rhd_shortrad_dtauop_102 in rhd_shortrad_module F90 rhd short characteristics radiation delta tau operator loop 02 Category performance enhancement Select the way the operator for the tau coupling short characteristics module is accessed Values o 0 default The routine with the tau coupling operator is called within a loop and should be inlined o 1 The program fragment with the tau coupling operator is included No inlining necessary e rhd_shortrad_formal_101 in rhd_shortrad_module F90 rhd short characteristics radiation formal loop 01 Category performance enhancement Select version of loop splitting for exp dtau computation Values o 0 default dtauhalf exp_mdtauhalf expl2t mdtauhalf are computed in a single loop o 1 dtauhalf exp_mdtauhalf exp12t_mdtauhalf are computed in separate loops This prevents the SUN1 machine Sunfire Solaris Forte 6 2 from doing some perfor mance degrading optimization e rhd_shortrad_dir1_101 in rhd_shortrad_module F90 rhd short characteristics radiation direction 1 loop 01 Category performance enhancement Choose routine version for rays in x1 direction Values o 0 default Use routine with permuted indices for rays in x1 direction In this case the innermost loop index is the third array index The transposition of arrays is no
52. 2 ser ui Xp v It can be shown that 2 D 2 p D 2 Cy THK Vu 2 Cp Cy a T Kp or Xp pex oT XT Xo 28 Definition of adiabatic exponents Olnp I 2 s a 99 OlnT rT 1 3 Ge 30 OlnT Da 1 ad 1 Vad 55 5 T2 31 2 3 3 CO5BOLD equation of state CO5BOLD equation of state input p e 32 CO5BOLD equation of state output por 2 se 3 5 P T 5 E e e 33 All required thermodynamic coefficients can be expressed in terms of DO de p dp j e de p 2 3 4 Derived thermodynamic coefficients First the missing derivative 35 can be found from the relation e which is obtained from the equality of the mixed derivatives in Eq 16 written as 1 p ds de d S T Tp p 35 12 2 EQUATIONS Then First adiabatic exponent This relation is obtained by combining Eq 16 with the identity 0 dp 3 dp S de 38 e p The adiabatic sound speed is then obtained as Third adiabatic exponent This relation is obtained by combining Eq 16 with the identity oT oT dT d d 41 m t ae and then using Eq 34 Adiabatic temperature gradient 5 F 52 0 E 43 Oinp Omp Omp Th Adiabatic energy changes since 44 We define the coefficients c and c through the relation or ds c dlnp c d In p 46 Entropy change at constant density 2 3 A collection of
53. 2 27500 0 Setting this value to zero switches off gravity oh wonder e real mass star In the case of a central the mass in cgs units of the star has to be specified with real mass star f E15 8 b 4 n Stellar Mass u g 9 94500e 33 e real r0_grav To avoid the central singularity in a 1 r potential it is smoothed in the center to give a central potential of 1 r0_grav specified with 5 3 Parameter File rhd par 75 real rO grav f E15 8 b 4 n Inner Smoothing Radius u cm 9 45833e 12 This parameter should always be non zero for a central potential e real ri_grav The density in an atmosphere in hydrostatic equilibrium can decline to very low values To artificial enlarge the pressure and density scale height in the outer layers of the star the corners of the box the gravity can be reduced by defining the potential at infinity to be 1 r1_grav specified with real ri grav f E15 8 b 4 n Quter Smoothing Radius u cm amp c0 70 0 Not used 11 35000e 13 Setting this parameter to zero gives the usual 1 r behavior of the potential in the outer layers but also chooses another smoothing formula in the central part where real r0_grav is relevant But a value somewhat larger than the remotest corner of the box effectively cancels this artificial smoothing in the outer layers without changing the formula for the potential e real ri rad For a Star in a Box and particularly when only simple ray directio
54. 2581 17659 13964 70033 46595 80 i 80 3 99552 76404 4 4 Files amp Directories amp Paths 55 4 3 4 Recommendations for Standard File Structure The very first entry in an UIO file is always the fileform uio entry containing information about the file format and conversion type Afterwards entries can follow in any order But it is perhaps a good idea to start the file with three special entries file id description history as in fileform uio form formatted convert ieee 4 character file id f A80 b 80 n File identification uio demofile character description d 1 2 f A80 p 1 b 80 n File description This is a file to demonstrate the recommended start entries for all UIO files character history d 1 1 f A80 p 1 b 80 n File history UIO demo file 22 Dec 1997 14 15 15 A recommended format for sets of multi dimensional arrays e g hydrodynamics x axis y axis Z axis density velocities energy is shown in Sect 5 1 4 4 Files amp Directories amp Paths All UIO routines are located in sub directories of a common directory called e g uio which also contains a old Readme file The subdirectories and their contents are bin Shell scripts uiolook uiocat uioinfo f90 Fortran90 source codes object files executables idl IDL routines man mani manual pages for shell scripts uiolook uiocat uioinfo tex old description files in IATEX the most recent version is pa
55. 3 16 Input Output Control 4 237 2 x 908 E Y EON X NOR RU R RA AAA 105 eee be ew es 108 5 4 Additional Control and Status Files rhd stop rhd cont rhd done and rhd dump 111 5 5 Text Output rhd out e 111 5 6 Chemistry Input ess ee 115 Def HION Inp t e s kso ok x m moo dem ew REOR RR ALES RR dom n d 116 5 8 HION Output ue wa ar Gon a RA RI AER ARA A 116 117 Sa Rha ee X5 X MEE SP Od n Pa EDAD 117 TREES 118 122 OCT EI 122 L2 GQCODBOLD Data in IDOL 2k R R Rmo RR Re a ek xS ERR 122 xcd ti ME RN UR TEES eee 122 7 2 2 Loading COSBOLD Data full sta end lees 122 LAA ROR aoe RR Reda ease aire S ok P aca 123 o a ROUEN MR PERSA ee eae NUR I RENE 123 CIT 123 WT rcr PC 124 74 More IDL routines es 125 8 Document history 126 A CONTENTS 128 10 Trademarks 128 LIST OF FIGURES 5 List of Figures TEC A e hc Tet eee ee 21 2 Performance tests on Hitachi SR8000 o e e 40 3 UKAFF machine grand small model o o o 47 4 UKAFF machine grand large Model o o e 47 5 UKAFF machine ukaff large model 2e 48 pr estas RU E EIER URINE MH IRR RN Ede ER eee 118 List of Tables 1 List of source directories 2 a a lll lesse 22 a fue M IRURE pase E 23 3 List of all low level modules 22e 24 cL 52 uc she wade cect ie ae dr P 53 Hie ah Me Aas cn ee ae ey Ge eh e
56. 3K 3K 3K 2k KKK K K Severe error SHORTRAD Time step below absolute limit Error index 100 Interrupt computation Fk k k ak ak 3k aK K K K K aK aK aK ak aK a 3K 3k 3K 3K 3K 3K K aK aK a a ak aK 3K 3K 3K 3K 3K 3K K aK aK aK 2K 2 2K 3K 3K 3K 3K 3K 3K K K K aK aK 2K 3K A 3K 3K 3K 3K 2K 2K KE K K FK 3K 3K 3K 3K 2K 2K ak ak K K marks an exit with an error and without rhd done file A message about the final model like ACTION Write final model lt lt lt lt lt lt lt lt Model file rhd end opened on channel 12 is followed by some timing information like e g Timing statistics rate x factor 1000000 x 10000 Process Samples Total time Mean time sec sec RHD code 1 410 830017 410 830017 uio output routines 27 37 469997 1 387778 HYD bound_3Dcenter 2000 3 540000 0 001770 Hydrodynamics routines 2000 48944 660156 24 472330 HYD 1 2000 16350 610352 8 175305 HYD 2 2000 16052 459961 8 026230 HYD 3 2000 16520 798828 8 260400 Viscosity routines 3D 2000 25446 400391 12 723200 VIS make box modelvis 2000 0 010000 0 000005 VIS copy box modelvis 2000 1750 960083 0 875480 VIS delete box modelvis 2000 0 000000 0 000000 Radiation transport routines 2000 243729 000000 121 864502 SHC step 2020 244064 515625 120 824020 SHC step dtime init EOS 16024 49312 738281 3 077430 SHC step dtime explicit 16024 174542 343750 10 892558 SHC formal 16024 170085 437500 10 614418 SHC formal init 16024 35591 378906 2 221129 SHC formal di
57. 4 UIO DATA FORMAT or tar zxvf for tar gz cd for uio f90 mkdir YOUR MACHINE cd YOUR MACHINE ln s conf configure configure make make install Some of the environment variables that control the CO5BOLD configure script are also rec ognized see the header of the UIO configure script The command make install generates a directory HOME local and sub directories An init script is put into HOME bin And the resource files cshrc and bashrc are modified to call it Therefore this installation step is potentially dangerous because its effect is not restricted to the local directory 4 6 2 Quick Examination of Files uiolook The shell script uiolook calls the Fortran program uiolok f90 The man page UIOLOOK 1V Misc Reference Manual Pages UIOLOOK 1V NAME uiolook print entry headers of file in uio form SYNOPSIS uiolook h p filename AVAILABILITY DESCRIPTION The routine uiolook reads each filename file in uio form in sequence and displays the headers of the entries in pretty form OPTIONS sh Print usage of uiolook p Entry header keywords in long pretty form Sun08 5 5 1 Last change 27 November 1996 1 4 6 3 Transformation of Files uiocat The shell script uiocat calls the Fortran program uiocat f90 The man page UIOCAT 1V Misc Reference Manual Pages UIOCAT 1V NAME uiocat concatenate file s in uio form SYNOPSIS uiocat c conversion f format
58. 63 f E13 6 p 4 b 4 amp n x2 coordinates of cell boundaries u cm ds 0 1 0 1 0 1 real xb3 d 63 63 63 63 63 64 f E13 6 p 4 b 4 Y n x3 coordinates of cell boundaries u cm ds 0 1 0 1 0 1 real rho d 63 63 63 63 63 63 f E13 6 p 4 b 4 n Density u g cm 3 real ei d 63 63 63 63 63 63 f E13 6 p 4 b 4 n Internal energy u erg g real vi d 63 63 63 63 63 63 f E13 6 p 4 b 4 n Velocity 1 u cm s real v2 d 63 63 63 63 63 63 f E13 6 p 4 b 4 n Velocity 2 u cm s real v3 d 63 63 63 63 63 63 f E13 6 p 4 b 4 n Velocity 3 u cm s label endbox label enddataset date 02 01 2002 16 17 43 322 The UIO format is described in some detail in Sect Each entry has a type e g label real character an identifier e g box time description and ad ditional information about array size e g d 63 63 63 63 63 63 data format e g f E13 6 p 4 b 4 and properties of the quantity e g n Density u g cm 3 Each start rhd sta or final rhd end model file has a structure as shown above The rhd ful1 file usually contains a sequence of these data sets which of course can also be used as start model of a simulation The axes xci xc2 and xc3 describe the positions of the cell centers The axes xbi xb2 and xb3 contain the positions of the cell boundaries they have one element more than the corresponding cell centered quantity Cell boundaries shoul
59. 8 28 Rather old parameters for additional I O control integer n outslicedim mean 5 3 10 integer istep in start 5 3 16 128 REFERENCES 9 Glossary 10 COSBOLD or COBOLD is the short form of COnservative COde for the COmputation of COmpressible COnvection in a BOx of L Dimensions with 1 2 3 EOS Equation Of State HION Hydrogen IONization MHD Magneto HydroDynamics RHD Radiation HydroDynamics UIO the Universal Input Output format It is used in COSBOLD for parameter model mean and EOS files Trademarks AMD is a trademark of Advanced Micro Devices Inc Compaq is a US trademark of Compaq and or Hewlett Packard Company Cray is a trademark of Cray Research HP is a US trademark of Hewlett Packard Company IBM is a US trademark of International Business Machines IDL is a registered trademark of Research Systems Inc Intel Itanium and Pentium are US trademarks of Intel Corporation Linux is a trademark of Linus Torvalds NEC is a registered trademark of Nippon Electric Company PGI is a trademark of The Portland Group Compiler Technology SGl is a trademark of Silicon Graphics Solaris Sun SunOS and SunFire are US trademarks of Sun Microsystems Inc Sparc is a US trademark of SPARC International Inc UNIX is a registered trademark of The Open Group All other product names mentioned in this manual are trademarks or registered trademarks of their respective owners Referenc
60. 900r E wo f ES E D a 0 0 y o Bo E i a A al mare PL 105 Toe 104 104 p 16 chunk size chunk size A r 1 ne 7 gv L n J imr 4 J L tA 4 nat A ng Li a A z if 1 i E vul f 5 oet b Eos V 3 J iu 4 A 4 0 4 ou 4 0 4 L 4 PS 4 gt LT 4 mc ea c a 0 2 e 0 2 53 gt I e l Em 0 0 et 0 9 Lanz L ial E d 393 190 105 106 ig iG 19 108 chunk sizg chunk size Figure 2 Performance tests on Hitachi SR8000 at HLR Stuttgart For models with 128x128x192 and 252x252x188 grid cells different values for the hydrodynamics and viscosity chunk size pa rameters were used See text for more details 3 7 Optimization Compiler Switches 41 Moreover performance and CPU time can be optimized by choosing the right parameter values Interestingly the optimum chunk size is different for hydrodynamics and viscosity Based on these tests a larger value seems to be preferable for the viscosity n viscellsperchunk In the case of the smaller model 50000 seems to be fine for the hydrodynamics whereas the optimum viscosity chunk size is 200000 This difference explains the double peaked structure of performance and CPU time Note that the optimum values do not only depend on the architecture used but also on the dimensions of the model We recommend to test some chunk size values since it might lead to a higher performance 3 7 9 IBM Useful link
61. ALLATION COMPILATION If this variable is set to 1 the compiler is called with Drhd box quc01 1 see Sect e F90 MHD MHD module o 0 do not activate compile and link this module default o 1 activate this magnetohydrodynamics module MHD HLL solver If COSBOLD is compiled with the MHD module your start model must include magnetic fields otherwise you will get an error message e F90 MACHINE Explicit machine specification This is usually not necessary use local or instead o local machine o sun4u Sun o See the header of the configure script for an up to date list o local local machine default o dummy Do not use any machine dependent flags but use module selections o empty Compiler flags are composed from F90_PREFLAGS and F90_POSTFLAGS only e F90 BASEPATH Path for COSBOLD base directory o gt The configure script tries to determine the base directory name automatically de fault This should work if the local directory is located somewhere below hd rhd o otherwise This string is used as base directory name e g home user for Some examples can be found in Sect 3 6 Compiler Macros Some of the modules of the COSBOLD code with suffix F90 employ compiler macros to switch between code versions during compile time Typically you define at least one of the three switches rhd_r01 rhd r02 or rhd r03 to choose a radiation transport module The others have
62. CO5BOLD User Manual Bernd Freytag Matthias Steffen Sven Wedemeyer B hm Hans G nter Ludwig Jorrit Leenaarts Werner Schaffenberger October 8 2008 bo Contents 1 Introduction 2 Equations 2 1 Basic Equations 2 2 Magnetohydrodynamics W Schaffenberger 2 3 A collection of thermodynamic relations M Steffen AIP 2 9 1 2 3 5 3 Program Files Installation Compilation 3 1 Quickstart How to Compile COSBOLD 3 2 Compilation Procedure for COSBOLD Basic thermodynamic equations 2 3 2 Definition of often used thermodynamic coefficients 2 3 3 CO5BOLD equation of state 2 3 4 Derived thermodynamic coefficients Ideal gas with constant specific heats polytropic gas 3 3 Directory Structure 3 4 Fortran Files 3 5 Configure Script 3 6 Compiler Macros 3 7 Optimization Compiler Switches General OpenMP settings 3 7 2 General Inlining 3 7 4 Cray SVI 3 7 6 Hewlett Packard V2500 3 7 7 Hewlett Packard Itanium 2 3 7 8 Hitachi SR8000 3 7 9 IBM 3 7 14 Linux GNU efortran Compiler 3 7 15 NEC SX 5 SX 6 SX 8 3 1 1 3 7 16 SGI Origin 3 7 17 SGI Origin 2000 3800 at UKAFF 3 7 18 Sun SunF ire 4 UIO Data Format 4 1 Quickstart Introduction to UIO 4 2 Example of UIO Data File 4 3 Structure of UIO Files 4 3 1 4 3 2 Data File Structure 4 3 3 Tables 4 4 Files amp 4 5 Fortran90 4 5 1 Files 4 5 2 Use of UIO Modules in Fortran90 Directories amp Paths Data Representation ASCII or Bi
63. E 02 table f77table d 1 5 1 7 f 1X b 1 n test table to test the table routines integer inti f 15 b 4 n Integer 1 column real reali f F5 1 b 4 n Real 2 column character char f A16 b 16 n Char 3 column real real2 f E13 6 b 4 n Real 4 column integer int2 f 15 b 4 n Integer 5 column inti reall chart real2 int2 1 2 0a 0 100000E 02 1 2 4 0 ab 0 200000E 02 2 3 6 0 abc 0 300000E 02 3 4 8 0 abcd 0 400000E 02 4 5 10 0 abcde 0 500000E 02 5 6 12 0 abcdef 0 600000E 02 6 7 14 0 abcdefg 0 700000E 02 7 4 3 Structure of UIO Files 4 3 1 Data Representation ASCII or Binary While opening a file for writing the file format formatted or unformatted and the conversion type native e g eee_4 have to be specified The formatted ASCII data representation allows I O independent of platform or compiler It is useful for parameter files which can be read and edited by hand for the direct inspection of data the transfer between very different systems or for the import of data which exist e g in a table format From the specified conversion type only the default output format for numbers e g E13 6 for 4 byte reals is determined The unformatted binary I O is much faster and gives usually more compact files with higher accuracy ideally exact in the numerical data representation But in principle the file format is machine dependent Fortunately the IEEE format t
64. F90 COMPILER 5 45 F90 DEBUG SX 6 F90 DUST SX 8 F90 HION PathScale F90_LHDRAD PGI F90_MACHINE SGI F90_MHD 26 UKAFF F90 MSRAD Sun F90 PARALLEL compiler macro F90_POSTFLAGS 22 category i F90_PREFLAGS a F90_SHORTRAD B8 Coriolis force MSrad raytas n A ls rhd box bmag01 data format rhd_box_grav01 UIO rhd box quc01 directional splitting 6 rhd hyd entropyfix pO1 double precision rhd_hyd_gravcorr_p01 dust 6 rhd_hyd_roeid_101 rhd_hyd_upwind_p01 29 entropy fix rhd_r01 environment variables rhd_r02 EOS rhd_r03 equation of state rhd_rad3d_dir_t01 rhd_rad3d_fromray_101 files 130 INDEX data files table of Fortran files table of HION IDL UIO input chem dat EOS opacities rhd cont 111 rhd dump 111 rhd par rhd stop 111 output rhd done rhd out rhd snap 111 rhd exe fluxes formatted Fortran 6 g95 44 gfortran HD Er Hewlett Packard HION input output Hitachi HP hydrodynamics 6 hydrodynamics routines hydrogen ionization 6 IBM RI 728 IDL 50 22 128 CAT B LE combox pro 123 eosbox pro 123 UIO routines uio_data pro uio_datasetlist_rd pro uio_dataset_rd pro 64 uio_dataset_rd pro 64 uio_init pro uio_struct_rd pro 64 inlining alpha Cray VX1 IBM Intel compiler on Linux PGI compiler on Linux SGI 131 Sun input chemical reaction ne
65. F90_DEBUG 0 No LHDrad module requested assume default F90_LHDRAD 0 No MSrad module requested assume default F90 MSRAD O No SHORTrad module requested assume default F90 SHORTRAD 1 No CHEM module requested assume default F90 CHEM O No HION module requested assume default F90 HION O No dust module requested assume default F90 DUST O No MHD module requested assume default F90 MHD O No TWEAK module requested assume default F90 TWEAK O No explicit machine requested assume default F90_MACHINE local 3 2 Compilation Procedure for CO5BOLD 19 List of control environment variables F90_COMPILER F90_PREFLAGS F90_POSTFLAGS F9O_PARALLEL scalar F90_DEBUG F90_LHDRAD F90_MSRAD F90_SHORTRAD F90_CHEM F90_HION F90_DUST F90_MHD F90_TWEAK F90 MACHINE local MACHINE i686 MACMODEL Intel Pentium F90_BASEPATH home bf for ll OoO0O0O0oOorPooOo Linux system with i686 architecture PGI compiler version 3 3 2 pgf90 byteswapio fast Mvect sse Mcache align Minfo inline Write compiler name and flags into file compiler flags info Makefile already exists It is appended to Makefile old New Makefile written e eese rh eee eee eee eee wenn A new Makefile is produced An existing one is appended to Makefile_old Addition ally the file compiler_flags info is written which contains the compiler call in Fortran format 7 Check the output of the configure script and the header of t
66. INDEX
67. If you are going to install CO5BOLD on a machine with a known to setup script and makefile operating system and compiler see Sections and 3 7 then the procedure should be fairly easy The general compilation procedure is now If a directory for the current machine exists in the tar ball and the configure script is there tar zxvf for tar gz cd for hd rhd YOUR MACHINE configure make If the directory for the current machine has to be created tar zxvf for tar gz cd for hd rhd mkdir YOUR MACHINE cd YOUR MACHINE ln s conf configure configure make The compilation process is explained in more detail in Sect The configure script is described in its header and in Sect The directory structure is shown in Tab 1 All Fortran files are listed in Tables 2 and 3 2 Compilation Procedure for CO5BOLD The installation procedure has changed significantly since the last release now there is a configure script see Sect that creates the complete temporary makefile which can be used to compile CO5BOLD and produce the executable rhd exe Installation procedure 1 Choose create a proper base directory This will usually be HOME Then the master directory will typically be HOME for this is the default created by the tar file Some prefer to rename it to HOME HYDRO 2 Put all source files and the configure script there This will be done typically by expanding the gzipped tar file for tar gz e g with
68. LOAT Array 140 140 200 The magnetic field components are also stored in this substructure BB1 FLOAT Array 141 140 200 BB2 FLOAT Array 140 141 200 BB3 FLOAT Array 140 140 201 7 4 More IDL routines 125 The magnetic field is defined on the cell boundaries in the direction of the spatial components e g BB1 in direction 1 and in the cell centres for the other directions The resulting array dimensions differ from the cell centred quanties like e g rho The array values must be multiplied with a factor V 47 in order to obtain the field strength in Gauss The substructure FUL EOS which is present only after a call of e g eosbox pro contains important quantities like the temperature T gas pressure P entropy S Structure lt 826a03c gt 6 tags length 109760000 refs 2 P FLOAT Array 140 140 200 DPDRHO FLOAT Array 140 140 200 DPDEI FLOAT Array 140 140 200 T FLOAT Array 140 140 200 DTDEI FLOAT Array 140 140 200 S FLOAT Array 140 140 200 The substructure FUL OPA only contains the opacity KAPPA Structure lt 826a5b4 gt 1 tags length 15680000 refs 2 KAPPA FLOAT Array 140 140 200 7 4 More IDL routines In the directory IDL bflib a lot of useful routines can be found which can be used for further processing and visualisation of COSBOLD data For the visualisation of 2 D models or 2 D data slices in general we recommend plotfield pro With combox pro further quantities can be calculated
69. M Intel AMD with Linux OS and PGI Intel or Pathscale compiler NEC SX 5 SGI and Sun Problems might arise with the transition to records larger than 2 GByte which require an extension of the current standard The GNU Fortran compilers particularly g95 might introduce a 64 bit system that does not allow to read older 32 bit files even small ones Each file entry is a header data unit The header contains information to identify the entry and to specify the format and size of the following data block This block usually consists of a scalar or an array In some cases it is empty e g for labels or it contains more complex information for tables The first version of UIO routines was written in FORTRANTT It still exists However further development was done with the Fortran90 versions Therefore the use of the FORTRANT7 routines is not recommended anymore The current Fortran version of the UIO routines is a set of Fortran90 modules To allow a communication between Fortran and IDL programs an IDL version of the UIO routines has been written The correspondence between Fortran and IDL routines is rather close But in detail there are differences Currently IDL Version 6 0 is used Amazingly the UIO routines also used to work under PV WAVE Version 6 01 sun4 solaris sparc So far there exist three UNIX shell scripts calling Fortran routines useful to quickly examine data sets or to change the format or conversion type of files The
70. NC DUST dust include file H molecule chem rn module F90 CHEM chemical reaction network chem rn dvode F90 CHEM chemical reaction network solver hion main module f90 HION hydrogen ionization hion_io_module f90 HION hydrogen ionization I O hion_def_module f90 HION hydrogen ionization definitions hion_dvode_module f90 HION hydrogen ionization solver hion_lineq_module f90 HION hydrogen ionization linear algebra hion_util_module f90 HION hydrogen ionization utility package hion_devel_module f90 HION hydrogen ionization developer kit edens_module f90 HION electron densities Table 2 List of all high level modules the table shows the file name with part of its path the shortcut for the directory and its description 24 3 PROGRAM FILES INSTALLATION COMPILATION File and path Abb Description hd rhdb rhd_action_module f90 RHDB routines for control parameter passing hd rhdb rhd box module f90 RHDB box handling routines hd rhdb rhd dat module f90 RHDB handling of additional data averages hd rhdb rhd gl module f90 RHDB global parameters hd rhdb rhd io module f90 RHDB input output routines hd rhdb rhd mac cray module f90 RHDB machine dependent routines CRAY hd rhdb rhd mac default module f90 RHDB machine dependent routines default hd rhdb rhd mac hitachi module f90 RHDB machine dependent routines Hitachi wa Ss hd rhdb rhd_mac_sun_module f90 RHDB mac dependent routines Sun others hd rhdb rhd mean
71. OPSIS uioinfo DESCRIPTION The routine uioinfo prints information about its environment and a list of possible conversion types OPTIONS Sun08 5 5 1 Last change 12 January 1998 1 4 7 IDL UIO Routines The UIO package in IDL comes as a list of routines with names quite similar to the Fortran90 version Instead of using global variables as in Fortran90 there are now common blocks in Include files 62 4 UIO DATA FORMAT 5 2K k ak ak ak ak a a lead ale ole a ok ale le ade ale e a ad ale 2 dad le dale le ad ale ad ale e dad ale dad led ale le ad ale ad al dad ale dale led 2 e ad ale a FK 2K K Routines functions uio pro adkey1 adkey2 adkey3 chconv chpos chunit closrd closwr cpentr T d data most important user routine comfortable useful Add one keyword to term table keyword value no link character Add one keyword to term table with keyword value Add one keyword to term table with keyword value or default Actualize list of conversion types for all channels Give current file position or jump to specified position Initialize store and actualize a list of free and occupied unit numbers Close file after reading Close file after writing Copy entry from one file to another Read data from uio file s in quasi direct access mode Handle uio file s in quasi direct access mode dataset rd Read uio file and put data in
72. OpenMP you have to set the corresponding environment variable see 3 5 before calling the configure script like export F90_PARALLEL openmp configure make This will insert the corresponding compiler switch e g openmp omp mp confer the following sections into the compiler calls in the makefile see Sect 3 5 The calls to the timing routines that would be executed in parallel are removed by not setting the appropriate compiler macros see Sect 3 6 In addition the switch rhd shortrad dir 102 see 3 6 might be set according to experience about performance enhancements The user has to find optimum values for the parameters n hydcellsperchunk for the Roe solver module see Sect and n_viscellsperchunk for the tensor viscosity module see Sect to optimize the size of the chunk given to one thread per time So far only for the SHORTrad module the environment variable OMP SCHEDULE can be set before running CO5BOLD to control its OpenMP scheduling behavior Important parallel loops in the SHOR rad module have a SCHEDULE RUNTIME modifier that allows this external control The old default is achieved by not defining the variable or by setting export OMP_SCHEDULE STATIC 1 On some machines e g Intel Xeon with Linux and PGI compiler a dynamic scheduling activated with export OMP_SCHEDULE DYNAMIC 1 is advantageous The size of the individual chunks might be set to larger values than 1 in the examples above
73. able e Different choices for the energy correction after the constrained transport step no energy correction exact energy conservation for each cell or energy correction only if pressure remains positive Originally the module included also an explicit electric conductivity and an additional energy diffusion These were removed due to a modification of the constrained transport routine These features may be supported again in a future version of the module The magnetic field is located at the cell boundaries rather than in the cell centers Therefore the format of the magnetic field arrays is slightly different from that of the other hydrodynamic variables 2 2 Magnetohydrodynamics W Schaffenberger 9 Staggered grid representation of the magnetic field in 2 dimensions 4 4 4 4 2 4 4 gt gt gt gt ko gt k gt gt 4 4 4 4 4 4 gt gt gt gt gt gt gt 4 4 4 4 2 4 4 gt gt gt gt gt gt gt 4 4 4 4 2 2 4 4 gt gt gt gt gt gt gt 4 4 4 4 2 4 4 gt gt gt gt ko gt k gt gt 4 4 4 4 2 2 4 4 hydrodynamic variables gt x component of the magnetic field y co
74. ailable from table amp c2 3 two bands 1 grey 2 C0 density via XCO amp c3 4 two bands 1 grey 2 CO density from chemistry 5 CONTROL AND DATA FILES Allowed values are o 1 Use the grey part of the table o 2 Use the other possibly non grey frequency dependent part of the table o 3 Use a continuum band plus an infrared band with CO opacity calculated with CO equilibrium density o 4 Use a continuum band plus an infrared band with CO opacity calculated with CO density resulting from time dependent chemistry Only the MSrad module so far can handle non grey tables integer n_radrsyslevel This parameter specifies the zero point of the ray system default 0 MSrad only The parameter is specified with e g integer n radrsyslevel f I4 b 4 n Zero index of ray system amp c0 70 default amp 0 integer n radoutput This parameter controls additional output into the file rhd qrad default 0 MSrad only The parameter is specified with e g integer n radoutput f 14 b 4 n Output level of MSrad amp c0 70 default amp 1 real c radtcool Parameter for surface cooling option N_radband lt 0 of MSrad It can be activated with the parameter real c radtcool f E15 8 b 4 amp n Surface cooling u 1 amp c0 70 0 default 0 0 real c raddcool Parameter for surface cooling option N_radband lt 0 of MSrad It can be activated with the parameter real c raddco
75. al composition The EOS file can be specified for instance with character eosfile f A80 b 80 n E0S file name amp cO eos_gamma140 eos eos_mm20_1 eos eos_mm00_13 eos eos_mm00_15 eos There exists an increasing number of files O O O eos_mm00_13 eos Standard EOS file for solar composition with extra large density range towards low densities There exist two other files for the same composition but smaller density range eos_mm00 eos eos_mm00_1 eos eos_XXXX_14 eos Several EOS tables for various compositions eos mmOO 15 eos EOS file for solar composition with temperature range extended to very low values by keeping yu fixed below 500 K The number of points for the density sampling has been reduced The number of points for the energy sampling has been increased eos_mm20_1 eos Standard EOS file for metal poor star M H 2 0 with ex tended range in internal energy and density towards lower values The older file eos mn20 eos did not reach far enough eos gammai40 eos EOS table for simple gas with constant 1 4 In this case all quantities could be faster computed than by interpolation in a table Nevertheless for compatibility reasons to be able to use the existing EOS Fortran routines the table is provided eos gamma166 eos EOS table for simple gas with constant 5 3 cpheos_mm00 eos Copenhagen EOS for their solar composition e character eospath The equation of state file does not have to be i
76. al c viscourantmax f E15 8 b 4 n maximum viscous Courant factor u 1 amp cO range C visCourant lt C visCourantmax typically smaller than 2 0 1 0 Its value should be slightly above c viscourant and below 2 0 5 3 16 Input Output Control With this group of parameters the start model and the type and amount of output can be specified Parameters with the suffix _start describe the initial model these with suffix _end the corresponding final model Additional data can be written into the file described by the parameters with suffix _fu11 full 2D 3D model dumps huge see Sect or into the file described by the parameters with suffix _mean additional information see Sect B 2 e real dtime_out_full The interval between datasets in the full file can be set e g with real dtime out full f E15 8 b 4 n Dutput time step u s amp cO dtime out full lt 0 0 gt no output amp ci dtime out full 0 0 gt output every time step 2 0E 06 Allowed values are o lt 0 0 No output to this file o 0 0 Output at every time step Attention This can produce HUGE files in no time o gt 0 0 Output to full file approximately every dtime out full seconds 106 5 CONTROL AND DATA FILES Some examples The classical value for this output for simulations of solar granulation is 20sec To save memory this can be increased to 30sec But in this case chromospheric shocks are very badly
77. ameter file the radiation transport module has to be selected Depending on this selection a couple of additional parameters have to be specified Table 11 gives a list of the parameters and the modules they apply to The standard routines are now in the MSrad module for local models and the SHORTrad module for global Star in a Box models The LHDrad module is not maintained very much anymore e character radscheme So far there exist three different radiation transport modules The active on can be selected e g with character radscheme f A80 b 80 n Radiation transport scheme amp c0 LHDrad MSrad SHORTrad amp ci None skip radiation transport step entirely SHORTrad Possible values are o None Skip radiation transport entirely o LHDrad old supergiant module It uses long characteristics and is restricted to an equidistant grid and open boundaries at all surfaces Note that the switch Drhd r01 1 has to be set during compilation see Sect 3 6 o MSrad solar module It uses long characteristics The lateral boundaries have to be periodic Top and bottom can be closed or open Note that the switch Drhd r02 1 has to be set during compilation see Sect 3 6 o SHORTrad new supergiant module It uses short characteristics and is restricted to an equidistant grid and open boundaries at all surfaces Note that the switch Drhd_r03 1 has to be set during compilation see Sect 3 6 inte
78. are only necessary for some nasty under resolved supergiant models Setting c vissmagorinsky c visartificial c visexpansion c vislinear c_visp2pcoeff 0 0 skips the tensor viscosity step entirely 86 5 CONTROL AND DATA FILES e real c_visartificial A standard artificial viscosity can be activated e g with real c_visartificial f E15 8 b 4 amp n Artificial viscosity tensor parameter 1 1 2 In many cases values around 0 5 are sufficient to stabilize the code Larger values 1 2 in the example above are only necessary for some nasty under resolved supergiant models real c visexpansion An additional viscosity can be activated e g with real c_visexpansion f E15 8 b 4 amp n Expansion viscosity tensor parameter u 1 1 2 While the standard artificial viscosity acts on compressed regions this viscosity acts in expansion areas Ususally it is not activated c_visexpansion 0 0 However it might be useful in cases were strong localized expansions cause problems real c vislinear Another viscosity can be activated e g with real c vislinear f E15 8 b 4 amp n Linear viscosity tensor parameter u 1 5 In the formulae for the standard artificial compression Smagorinsky viscosity velocity gradients appear That means that in regions with smooth small amplitude flows these types of viscosity essentially vanish Here the linear viscosity comes in It uses RgasT as approximation for the sound
79. ata pro For the EOS table eos mn00 15 eos there exists a double precision binary version 3 7 4 Cray SV1 On craSHi in Kiel a CRAY SV1 20 32768 SN9542 now out of service COSBOLD could use all 4 processors per board Documentation about the system and the compiler can be found with the CRAYdod system The new configure script still includes a branch for this system even if has never been tested on that machine In some cases the non default versions of loops in the CO5BOLD code vectorize better and are preferred over the standard ones e F Enable macro expansion e Otask1 Parallelization Enable tasking in this case OpenMP e Dinline3 Optimization enable high level of inlining e vector3 Oscalar3 General optimization http www cray com craydoc 3 7 Optimization Compiler Switches 37 Drhd hyd roeid 101 1 Optimization Choose non standard set of routines for Roe solver See Sect Drhd hyd entropyfix p01 1 Optimization version with masks weights See Sect 3 6 Drhd_hyd_upwind_p01 1 Optimization version with masks weights e Drhd shortrad operator 101 2 Optimization short characteristics operator with masks weights e Drhd shortrad dir 102 1 Optimization OMP PARALLEL statement outside of outer loop in rhd shortrad dirX 3 7 5 Compaq alpha The appropriate machine dependent UIO module is uio mac decalpha module f90 It allows the reading and writing of files in little endian
80. ature of the model e character grav mode Gravity is another characteristic of a stellar atmosphere The type or geometry of the external gravity field has to be specified e g with character grav mode f A80 b 80 n Type of gravity field amp cO constant central central Three values are possible so far o constant In the standard solar case the constant gravity specified with real grav is directed downward in x3 direction o localboxtide This activates a simple model for the action of a tidal wave on con vection in a local box model It adds to the case of constant gravity a potential ex which is harmonic in space and time according to De Dex cos k 11 wt 92 It is intended to mimic a travelling tidal wave Since the setup is considered experi mental the parameters are set by the C_test parameters according Dex C testi amplitude of potential variations kn C_test2 horizontal wavenumber w C_test3 frequency Boundary conditions in order to be compatible with periodic lateral boundaries kp should be an integer multiple of 27 times the inverse lateral box size Oo central For the supergiant case a central potential is assumed with an origin at x 0 The stellar mass as well as inner and outer smoothing radius have to be specified e real grav In the case of a constant gravity the amount of the acceleration has to specified with real grav f E15 8 b 4 n Gravity u cm s
81. avity radiation in diffusion approximation Magnetic field lines are orthogonal to the boundary i e the tangential component of the magnetic field vanishes at the boundary o periodic periodic boundaries for hydrodynamics radiation and magnetic fields o transmitting transmitting boundary for hydro and outward radiation The parame ters real c tchange real c tsurf and real c hptopfactor have to be specified Magnetic field lines are orthogonal to the boundary i e the tangential component of the magnetic field vanishes at the boundary o inoutflow classical open lower boundary for deep convection gravity and radiation possible The parameters real s inflow real c_schange and real c pchange have to be specified Magnetic field lines are orthogonal to the boundary i e the tangential component of the magnetic field vanishes at the boundary o inoutflow2 variant of the open lower boundary condition The parameters real s inflow real c schange real c pchange and real B1 inflow have to be specified In simulations of a solar like star with the MSrad radiation transport module the bot tom boundary is typically of type inoutflow A supergiant simulation will have a transmitting lower boundary character heat mode The mode in which energy is supplied can be adjusted with this parameter The classical choice is to leave it empty in which case the mode is chosen from s inflow see Sect and luminositypervolume s
82. can be activated with 0fast or Ofast ipa e mp Parallelization OpenMP directives are activated 3 7 13 Linux GNU g95 Compiler One of the available GNU Fortran compilers is the g95 compilei with the g95 home pagd It is called with g95 Important switches are e fendian big With this flag set binary files in big_endian format the standard for UIO files are automatically transformed to little endian and vice versa e 03 General optimization flag The appropriate UIO module is uio mac ieee module f90 OpenMP is not there yet The binary I O format unformatted is incompatible with the one used before in COSBOLD no existing UIO files can be read 3 7 14 Linux GNU gfortran Compiler The Fortran compileiH of the GNU project is called with gfortran Important switches are e fconvert big endian frecord marker 4 With this flag set binary files in big_endian format the standard for UIO files are automatically transformed to little_endian and vice versa In addition the old 32 bit record marker convention is maintained and existing UIO files can be read e 03 General optimization flag fopenmp Activates the OpenMP directives but causes COSBOLD to crash currently The appropriate UIO module is uio mac ieee module f90 And use rhd mac default module I haven t found out how to use the standard modules yet OpenMP does not work yet And the scalar code is significantly slower than code com
83. cheme for dust or molecule formation and transport can be selected e g with character dustscheme f A80 b 80 n Dust model amp cO none default nosource dust simple 01 co_component01_01 amp ci dust k3mon O1 dust k3mon 02 dust k3mon 01 The following values are currently possible o none None No handling of any dust molecule density at all o nosource Skip source term step for dust molecules entirely but do the transport o dust simple O1 Simple and unrealistic dust formation model only for testing of the numerics o co componentO1 01 Simple CO formation from Matthias Steffen with one compo nent only but realistic time scales 5 3 Parameter File rhd par 89 o dust k3mon 01 Simple C rich dust formation routines from Susanne H fner with one component only but realistic time scales o dust k3mon 02 Simple C rich dust formation routines from Susanne H fner with two components for dust density and free carbon density o dust k3mon 03 Simple Forsterite dust formation based on routines from Susanne H fner with two components for dust density and free Forsterite monomer density o dust bins 01 Multi size bin Forsterite dust formation based on Rossow s equations with one bin for the monomers and several bins for the different grain sizes o dust momentO4 c2 C rich dust chemistry 4 moments routines from Susanne Hofner o chemreacnet chemical reaction networks routines from Sven
84. d be centered in the middle between cell centers for the best represen tation of radiative fluxes with MSrad3D 5 2 File with Additional Data rhd mean A rhd mean file contains derived data averaged fluxes other averaged quantities surface intensities in addition to the complete data sets in rhd full files It has more entries than a full model file However they are much smaller Therefore one can afford a higher output sampling rate Its format is usually Fortran unformatted binary 5 2 1 Organization of rhd mean File A mean file usually consists of several datasets The overall structure is fileform uio form unformatted convert ieee_4 character file id f A8 b 8 n File identification 68 5 CONTROL AND DATA FILES character description d 1 1 f A14 p 2 b 14 n File description character history d 1 20 f A80 p 1 b 80 n File history character version f A80 b 80 n Program version label dataset n RHD model label enddataset label dataset n RHD model label enddataset Each dataset has the following structure for a supergiant simulation label dataset n RHD model date 25 05 2001 09 41 29 405 label box date 25 05 2001 09 41 29 408 character box id f A80 b 80 n Block identification rad label endbox label box date 25 05 2001 09 41 29 983 character box id f A2 b 2 n Block identification zi label endbox label box date 25 05 2001 09 41 30 078 characte
85. del files can be specified e g with character outconv end f A80 b 80 n QOutput file conversion amp c0 ieee_4 ieee_8 crayxmp_8 native ieee_4 108 5 CONTROL AND DATA FILES The allowed values depend on the machine Leaving this field empty means that the default is chosen that is build into the local UIO module If the type ieee_4 is supported which is always the case so far it should be chosen character outform_full The format see Sect 4 3 1 of the full model files can be chosen e g with character outform_full f A80 b 80 n Output file format amp cO formatted unformatted unformatted Allowed values are o unformatted default fast compact possibly machine dependent output strongly recommended o formatted slow machine independent output big files character outconv full The conversion type see Sect 4 3 1 of the full model files can be specified e g with character outconv full f A80 b 80 n Output file conversion amp c0 ieee_4 ieee_8 crayxmp_8 native ieee 4 The allowed values depend on the machine Leaving this field empty means that the default is chosen that is build into the local UIO module If the type ieee_4 is supported which is always the case so far it should be chosen character outform mean The format see Sect 4 3 1 of the additional data files can be chosen e g with character outform mean f A80 b 80 n Output file format amp cO formatted
86. di job nice nohup rhd1 job amp nohup rhdi job amp else echo End of job chain fi EIEEIEIEHIETHEIEIHIETHEIEIHIEHEIEIHETHEIETHETHEIETHETHEIETHETHEIERTHETHEHETHETHEHETHEIHEIETHEIEHETHEIEHETHEIEIHETHHEHEHHEER A more detailed description of the script will come sometime in the future e g from Sven s manual 122 7 DATA ANALYSIS WITH IDL 7 Data Analysis with IDL In this section some basic commands for handling COS5BOLD data in IDL are described See also Sect 7 1 Preparations Make the UIO IDL routines visible to IDL somehow There are several ways to do that Three are described below We recommend to create an initialization file e g named start pro which should be called after starting IDL e g start This is necessary to define relevant paths of IDL subroutines and to provide the UIO package Thus the file should contain the following Add user IDL directory to search path addpath expand path UIOPATH idl addpath addpath expand path HOME HYDRO IDL rhdpro if strtrim addpath 2 ne then path addpatht path delvar addpath Initialize uio routines uio init progrm by hand Note Before using IDL the environment variables for the COSBOLD paths should have been set Use setarcdeppaths sh or ksh csh for this purpose Important is UIOPATH which specifies where to find the IDL routines for the UIO handling in the script above Alternativel
87. dii of the dust grains are specified with e g real ar dustgrainradius f E15 8 b 4 p 1 d 1 8 n Dust grain radii u cm 0 0 0 00390625E 04 0 0156250E 04 0 06250E 04 0 25000E 04 1 00000E 04 4 00000E 04 16 0000E 04 5 3 Parameter File rhd par 93 The default value is 0 0 e real c_dust01 The density of the grain material is specified with e g real c_dust01 f E15 8 b 4 n Density of grain material u g cm 3 3 3E 00 e real c_dust02 The atomic weight of the dust monomer is specified with e g real c dust02 f E15 8 b 4 n Atomic weight of dust monomer u u 140 71 The value 140 71 should be appropriate for Forsterite MgoSiO4 The unit is the atomic mass unit The default value is 0 0 e real c dustO3 The number fraction of the rarest component is specified with e g real c_dust03 f E15 8 b 4 n Number fraction of rarest component u 1 amp cO For Mg25i04 Mg is the rarest its fraction is 3 1187E 05 amp ci Mg28i04 contains 2 Mg gt 1 2 gt 1 55935e 05 1 55935e 05 For Mg3SiO the rarest component is usually Mg So half the magnesium abundance is required as value The default value is 0 0 e real c dustO4 The lower dust limit fraction is specified with e g real c dustO4 f E15 8 b 4 n Lower dust limit fraction u 1 1 0E 10 If the density in a bin relative to the gas density falls below this value the bin is completely emptied and the material is added to the bin with the
88. distribu tion onto the threads in case of parallel runs with OpenMP Due to the special han dling of boundary cells the overhead per call increases significantly for small chunks Typically larger chunk sizes compared the the hydrodynamics chunk sizes set with integer n_hydcellsperchunk see Sect are adequate On the other hand they should not be too large to limit the usage of temporary memory and to allow parallelization the distribution of chunks to threads For simulations with activated OpenMP on a par allel machine the chunk size has to be made small enough to allow at least as many chunks as processors available This is particularly important for models with a small number of grid points e g 2D models An example is given for the Hitachi SR8000 in Sect In addition to the standard tensor viscosity described above there is a more experimental point to point viscosity It relies on a completely different discretization It should conserve angular momentum exactly and guarantee positivity of dissipated energy for sufficiently small time steps The current version should only be used for equidistant grids same spacing in all directions as for the supergiant models by experienced users If activated the point to point viscosity is typically used in addition to the standard one 88 5 CONTROL AND DATA FILES e real c visp2pcoeff The strenght of the viscosity can be controlled with e g real c_visp2pcoeff f E15 8 b
89. ditionally there exist files containing calls of machine library routines uio_mac_crayts_module f90 uio mac crayxmp module f90 uio mac sun module f90 These make it possible to write information about the platform in use into the file header The CRAY versions allow unformatted I O in the CRAY specific format and additionally via the FFIO ASSIGN logic in IEEE format The file uio mac intel module f90 is appropriate for all machines with IEEE little endian binary format and no mechanism for automatic conversion 4 5 Fortran90 9T routine purpose uio getenv Get information about environment uio mkcvls Make list with possible conversion types uio uopen Open file with special handling for conversion type uio uclose Close file with special handling for conversion type Table 9 Contents of uio mac module The main set of routines is contained in uio bulk module f90 in the module uio bulk module The three files uio base module f90 uio mac module f90 and uio bulk module f90 comprise the standard set of UIO routines Additionally there exists a file uio table module f90 with the single module uio table module which permits the I O and manipulation of a certain table format see the example in section 4 2 The latest extension comes within the modules uio var module f90 and uio varfile module f90 The module uio var module f90 contains a type definition for a variable uio flexible variable of general ty
90. drodynamics Roe solver e rhd roeid slope 101 in rhd_hyd_module F90 rhd roe 1 dimension slope loop 01 Category feature activation When this compiler switch is set a new extra stabilization mechanism can be activated If one of the reconstruction methods VanLeer Superbee or PP see Sect 5 3 7 is activated the slope can be reduced by averaging with the results from a MinMod reconstruction by setting c slopered see Sect 5 3 7 to a positive non zero value This can improve the stability without significantly reducing the effective numerical resolution Switch values o 0 default no slope reduction o 1 slope reduction in case of expansion wave o 2 slope reduction in case of strong density contrast e IDF in rhd_hyd_module F90 Integer Delta Flux Category performance enhancement Number of padding cells for flux like variables This number was introduced to check whether the increase of the size of vectors for flux like quantities defined at cell boundaries can improve the performance especially on a CRAY machine The gain is marginal if present at all The parameter is usually set to zero or left undefined Values o 0 default no padding cells o 1 2 3 extra padding cells 3 6 Compiler Macros 29 rhd hyd gravcorr pO1 in rhd_hyd_module F90 rhd hydrodynamics gravitation correction parameter 01 Category selection of approximation This parameter controls the way the Roe solver
91. dust scheme there should always be exactly two bins e real ar dustgrainradius The radii of the dust grains are specified with e g real ar dustgrainradius f E10 4 b 4 p 1 d 1 2 n Dust grain radii u cm 0 0 1 0E 04 The default value is 0 0 e real c_dustoOl The density of the grain material is specified with e g real c_dust01 f E15 8 b 4 n Density of grain material u g cm 3 3 3E 00 e real c_dust02 The atomic weight of the dust monomer is specified with e g real c dust02 f E15 8 b 4 n Atomic weight of dust monomer u u 140 71 The value 140 71 should be appropriate for Forsterite MgoSiO4 The unit is the atomic mass unit The default value is 0 0 e real c dustO3 The number fraction of the rarest component is specified with e g real c_dust03 f E15 8 b 4 n Number fraction of rarest component u 1 amp cO For Mg25i04 Mg is the rarest its fraction is 3 1187E 05 amp ci Mg28i04 contains 2 Mg gt 1 2 gt 1 55935e 05 1 55935e 05 92 5 CONTROL AND DATA FILES For Mg2SiO4 the rarest component is usually Mg So half the magnesium abundance is required as value The default value is 0 0 real c_dust04 The lower dust limit fraction is specified with e g real c dustO4 f E15 8 b 4 n Lower dust limit fraction u 1 1 0E 10 It is used in the calculation of the settling velocity where a division by the total density of monomers and dust is required To prevent this denom
92. e Skip data block Search header of variables given by list and extract keywords Parse dimension string Read uio file and put data into anonymous structure Create empty table structure Change and modify table contents rearrange lines Merge two tables in different ways Read 1d array from 2d table array all types Write 1d array into table all types Close file with special handling for conversion type Open file with special handling for conversion type Transform a string to give a correct name of a variable Produce from write format string corresponding read format string Writing scalar and array data of all types Write file header Write header of variable input term table Write header of variable input line table Write label Write table of integer real and or character data to file SEEDS Include Files uio_ pro 4 7 IDL UIO Routines 63 filedefinc uiocstinc channel status information common uio_chainf uiocvlinc convert type list of current machine common uio_cvlist uionaminc names of types keywords identifiers default formats common uio defnam uiosizinc length of strings size of tables trmtab lintab uiotabinc empty table structure common uio_taborg kkk ak ak ak ak k k ak ak ak ak ak 2k a 3k 3K 3K I K aK aK I I I Ik 3K 3K 3K 3K K aK aK aK 3 A AACA A 3K 3K 3K K K K 2 AC 2K K K K K K K I I OO 2K A AC Most of the routines are low level ones and do not have to be wor
93. e behavior This might be due to the effect that the shortest radiative timescale only occurs at single points or in 2D layers but that already the immediate neighbors have longer timescales and can damp the most sensitive points Based on real c radcourant the recommended typical radiative time step is computed real c radcourantmax With this parameter the maximum allowed radiative time step is prescribed as e g in real c radcourantmax f E15 8 b 4 n maximum RAD Courant factor u 1 amp cO range C radCourant lt C radCourantmax typically 2 0 2 0 This value will typically be somewhat larger than real c radcourant real c radmaxeichange The relative energy change per radiative sub step can be restricted e g with real c radmaxeichange f E15 8 b 4 n maximum radiative energy change amp u 1 c0 range 0 01 1 0 0 25 The default is 0 5 Values between 0 1 and 0 5 seem reasonable A value lt 0 0 deactivates this time step check However the check of the radiative energy change should usually be performed A way to maximize the radiative time step and therefore the performance of the entire code can be to first set real c_radmaxeichange to a proper value say 0 25 Then real c radcourant and real c radcourantmax are adjusted by trial and error in a way that the radiative time step is almost always restricted by the Courant condition and only sometimes in extreme cases by the maximum energy change res
94. e ere aie ae 54 7 UIO Fortran90 file sso a e a a a a a e n 56 8 Contents of uio base modulef90 a 56 DURER A IA 57 10 CO5BOLD control and data files llle 66 11 Radiation transport parameters 4 4 0 ll s 95 6 1 INTRODUCTION 1 Introduction CO5BOLD nickname COBOLD is the short form of COnservative COde for the COmputa tion of COmpressible COnvection in a BOx of L Dimensions with 1 2 3 It is used to model solar and stellar surface convection For solar type stars only a small fraction of the stellar surface layers are included in the computational domain In the case of red supergiants the computational box contains the entire star Recently the model range has been extended to sub stellar objects brown dwarfs COSBOLD solves the coupled non linear equations of compressible hydrodynamics in an ex ternal gravity field together with non local frequency dependent radiation transport Operator splitting is applied to solve the equations of hydrodynamics including gravity the radiative energy transfer with a long characteristics or a short characteristics ray scheme and possibly additional 3D turbulent diffusion in individual sub steps The 3D hydrodynamics step is further simplified with directional splitting usually The 1D sub steps are performed with a Roe solver accounting for an external gravity field and an arbitrary equation of state from a table The radiation transport
95. e file header entry Example real time f F9 2 b 4 n Time u s cO Simulation time in seconds amp ci Time count starts at 0 0 12 34 The entry header is followed by the entry data block This block is empty for labels and the fileform entry but non empty otherwise 4 3 Structure of UIO Files 53 entry type entry contents fileform file description first entry integer scalars 1D 4D arrays real scalars 1D 4D arrays single amp double precision complex scalars 1D 4D arrays single precision character scalars 1D 4D arrays table table with integer real character columns label label entry for file structuring Table 5 UIO entry types In an unformatted file each header line is an individual record containing a string with exactly 80 characters The following data block scalar or array is one single record In a formatted file each header line is a string of at most 80 characters delimited by a LINEFEED of whatever the operating system decided to be appropriate as EOL character sequence The following data block is written as sequence of lines The number of items per line is specified by the p keyword in the header 4 3 3 Tables For a table the entry header is followed by a list of headers for the individual table columns a single table header line consisting of abbreviations of the table entry identifiers and the table itself see the example in section 4 2 The dime
96. eader of the file can should contain a short description of the simulation as in e g character description d 1 4 f A80 p 1 b 80 n File description Parameter file for RHD code Full size 3D Betelgeuse model 5 M_Sun 650 R_Sun Start with st35gm04n03_09 end 12773 gt 17173 Run with SHORTrad This entry is optional it can be omitted completely but it is recommended to put at least some relevant keywords into this array If you change the number of lines between 1 and 20 you have to adjust the size specification d 1 4 in the example above character history The file history has a similar purpose as the previous entry It can be used to keep infor mation about the parent parameter file as in character history d 1 2 f A80 p 1 b 80 n File history Taken from st35gm04n03_09 par Last Modification 01 01 2002 Its use is optional 74 5 CONTROL AND DATA FILES 5 3 3 Fundamental Model Parameters e real teff The effective temperature is one of the basic model parameters and is specified e g with real teff f F13 3 b 4 n Effective Temperature u K 3500 0 for a relatively cool star Note that the actual effective temperature can only be deter mined a posteriori and that the entropy of the instreaming entropy see below is more important than teff itself In fact teff is only used to control material properties at the outer boundary Its value should be close to the expected effective temper
97. eal real real real real real real real real real real 5 CONTROL AND DATA FILES u g cm 2 s rhov3 xmean d 1 1 1 1 1 120 f E13 6 p 4 b 4 amp n Mass Flux x3 amp u g cm 2 s bci xmean d 1 1 1 1 1 120 f E13 6 p 4 b 4 amp n Magnetic field 1 amp u G bc2 xmean d 1 1 1 1 1 120 f E13 6 p 4 b 4 amp n Magnetic field 2 u G bc3 xmean d 1 1 1 1 1 120 f E13 6 p 4 b 4 amp n Magnetic field 3 u G bci xmean2 d 1 1 1 1 1 120 f E13 6 p 4 b 4 amp n Magnetic field 1 u G bc2 xmean2 d 1 1 1 1 1 120 f E13 6 p 4 b 4 amp n Magnetic field 2 u G bc3_xmean2 d 1 1 1 1 1 120 f E13 6 p 4 b 4 amp n Magnetic field 3 amp u G ei xmean d 1 1 1 1 1 120 f E13 6 p 4 b 4 n Internal energy 4 u erg g rhoei xmean d 1 1 1 1 1 120 f E13 6 p 4 b 4 amp n Internal energy amp u erg cm 3 rhoek xmean d 1 1 1 1 1 120 f E13 6 p 4 b 4 amp n Kinetic energy amp u erg cm 3 rhoeg_xmean d 1 1 1 1 1 120 f E13 6 p 4 b 4 amp n Gravitational energy amp u erg cm 3 t xmean d 1 1 1 1 1 120 f E13 6 p 4 b 4 n Temperature amp u K t xmean4 d 1 1 1 1 1 120 f E13 6 p 4 b 4 n Temperature amp u K t xmeankapparho d 1 1 1 1 1 120 f E13 6 p 4 b 4 amp n Temperature amp u K p_xmean d 1 1 1 1 1 120 f E13 6 p 4 b 4 n Pressure amp u dyn cm 2 s xmean d 1 1 1 1 1 120 f E13 6 p 4 b 4 n Entropy amp u erg K g rhos_xmean d 1 1 1 1 1 120
98. ect e Drhd_hyd_entropyfix_p01 1 Optimization version with masks weights See Sect B 6 e xarch native64 Produces 64 bit code optimized for local machine 50 4 UIO DATA FORMAT 4 UIO Data Format 4 1 Quickstart Introduction to UIO The UIO Universal Input Output routines are a set of routines in Fortran90 and IDL to manage I O of scalars arrays and a certain table type Files can be formatted or unformatted The formatted ASCIT text data representation is machine independent and appropriate for human reading for short files The binary representation uses the Fortran unformatted read and write routines provides much faster I O gives smaller files and the IEEE format is a quasi standard among many platforms compilers On all machines the native binary representation can be chosen On some platforms additional conversion types are offered IEEE on most machines CRAY format an CRAYs The Fortran standard does not guarantee that unformatted i e also UIO files are readable on all machines But it is always possible to produce formatted UIO files on a machine which are readable on all others And with some fiddling with compile options or the call of machine specific subroutines provided by the compiler vendor it was up to now always possible to enable the access to binary UIO files of one common format IEEE big_endian on all machines and compilers tested Compaq alpha Cray Hitachi HP V2500 HP Itanium2 IB
99. ee Sect B 3 4 Example character heat mode f A80 b 80 n Heating mode amp c0 bottom_entropy1 bottom_energy1 bottom entropyi Possible values so far o empty The classical value For local models the energy comes through the lower boundary either by radiation for a closed bottom boundary closedbottom or by convection 4 radiation for an open bottom boundary inoutflow o bottom entropyi The entropy in the bottom layers defined as being less than rO grav above the bottom of the model is adjusted towards s_inflow on a rate given by c schange 78 5 CONTROL AND DATA FILES o bottom_energyl Energy in the bottom layers is added according to luminositypervolume real luminositypervolume The luminosity of a Star in a Box or a local model with the appropriate heat mode can be set with this parameter To avoid numbers that do not fit into a 4 Byte real the luminosity per volume has to be specified as e g in real luminositypervolume f E15 8 b 4 n Luminosity per core volume amp u erg cm 3 s 4 5E 02 Reference volume is 4 Bares If this parameter is set to a value of 0 0 or below the entropy of the material within the core defined by as all cells within radius r0 grav is adjusted instead real s inflow The entropy of the material streaming through an open boundary of type inoutflow into the model can be specified e g with real s_inflow f E15 8 b 4 n Entropy of core material
100. elfile listdata listdata ierr ierr amp if ierr eq 0 then begin amp print i ful z itime ful z time format A I4 I6 E15 8 amp Now do the data handling demo print Mean density avg ful z rho amp i i 1 amp endif amp endwhile All necessary counter information is stored in the structure listdata Note that you can specify an entire group of files with e g modelident _ modelident modelident _3 or modelident _429 3 0 2 7P 66 5 Control and Data Files 5 CONTROL AND DATA FILES Table 10 shows a list of all files necessary to run COSBOLD Figure 6 gives similar information but is not quite up to date Executing the makefile produces an executable rhd exe Its name can of course be changed afterwards The names of the control files rhd par rhd stop rhd cont and rhd dump and of the status file rhd done cannot be changed without modification of the source code The names of EOS opacity and COS5BOLD data files can be chosen freely in the parameter file rhd par Table 10 only contains dummy names File Sect I O Type Description rhd exe executable main program rhd par I control data UIO central control file rhd stop I control file to force controlled stop of simulation rhd cont I control file to force continuation after stop rhd dump I control file to request output of current model data eos I data UIO tabu
101. emark about the parent file of the pa rameter file under construction and the current date into the character history array see Sect 5 3 2 4 Check modify the name of start model and output files infile start outfile end outfile full outfile mean On a system with batch queue this has not to be done in the parameter file itself but in the external command file see Sect 5 3 16 5 Check modify the fundamental parameters including boundary condition specifiers see Sections and 5 3 4 respectively e effective temperature control s inflow teff luminositypervolume C radHtautop e gravity grav mode grav mass star e abundances eosfile opafile check the paths 6 If the gravity of the new model and therefore the characteristic time scale signifi cantly deviates from the old one the time specifications controlling the output frequency dtime out full dtime out mean the total length of the simulation if specified as stel lar time endtime plustime and absolute boundaries specifications for the time step dtime min dtime min stop dtime max dtime start have to be scaled Look for pa rameters with units u s see Sections 5 3 15 and 5 3 16 T l he rest of the parameters controls additional details Most of the constants are specified in dimensionless form and keep their value in a class of related simulations The previously used values will probably be reasonable for the new simulation t
102. es Freytag et al 2002 Freytag B Steffen M amp Dorch B 2002 Astron Nachr 323 213 Leenaarts amp Wedemeyer B hm 2005 Leenaarts J amp Wedemeyer B hm S 2005 A amp A 431 687 Schaffenberger et al 2005 Schaffenberger W Wedemeyer B hm S Steiner O amp Freytag B 2005 in ESA SP 596 Chromospheric and Coronal Magnetic Fields ed D E Innes A Lagg amp S A Solanki Wedemeyer et al 2004 Wedemeyer S Freytag B Steffen M Ludwig H G amp Holweger H 2004 A amp A 414 1121 W04 REFERENCES 129 Wedemeyer B hm et al 2005 Wedemeyer B hm S Kamp I Bruls J amp Freytag B 2005 AGA 438 1043 Index alpha rhd_rad3d_r02 AMD rhd_rad3d_solve_t01 rhd rad3d step t01 32 batch queue 118 rhd rad3d toray 101 big endian 4 rhd_roeid_flux_101 boundary conditions rhd roeid flux tO1 rhd roeid slope 101 Pang force rhd roeid step t01 PRODI aal rhd shortrad diri 101 33 chemical composition rhd shortrad dir 102 chemical reaction network rhd shortrad dtauop 101 CINES ES Dx rhd shortrad dtauop 102 a Bs rhd shortrad formal 101 33 y rhd_shortrad_formal_t01 J4 compilation A compiler rhd_shortrad_operator_102 alpha rhd_shortrad_step_t01 Cray rhd_vis_density_p01 895 44 rhd_vis_t01 gfortran timing c factor Hewlett Packard ae saini Hitachi SR8000 control variables IBM F90 BASEPATH Intel F90 CHEM i
103. es density arrays o 1 handling of additional density arrays is activated 28 3 PROGRAM FILES INSTALLATION COMPILATION To actually include dust formation in a simulation it is necessary to 1 set the switch Drhd_box_quc01 1 during compilation this is done by the configure script if the environment variable F90 DUST is set to 1 see the description of the variable in Sect 3 5 2 put arrays specifying the initial conditions of the additional density into the start model as real quc001 real quc002 3 select a proper model describing dust or molecule formation in the parameter file with character dustscheme e rhd box bmag01 in rhd box module F90 and rhd F90 rhd box b magnetic 01 Category feature activation COSBOLD can handle magnetic field arrays if this compiler switch is set Values o default no handling of magnetic field arrays o handling of magnetic field arrays is activated To actually account for magnetic fields in a simulation it is necessary to 1 set the switch Drhd box bmag01 1 during compilation this is done by the configure script if the environment variable F90 MHD is set to 1 see Sect 3 5 2 put arrays specifying the initial conditions of the boundary centered magnetic field arrays into the start model as real bbi real bb2 real bb3 3 select an hydrodynamics scheme that is able to handle magnetic fields in the parameter file with character hdscheme Hy
104. et to a value larger than 0 To read all entries in a list of files in sequence the routine uio_datasetlist_rd pro is con venient as in the short example 4 7 IDL UIO Routines 65 ierr 0 delvar listdata Loop over all datasets while ierr eq 0 do begin amp 7 Read the next dataset ful uio_datasetlist_rd testmodel_0 full listdata listdata ierr ierr amp if ierr eq 0 then begin amp print ful z time format A E15 8 amp Now do the data handling demo print Mean density avg ful z rho amp endif amp endwhile or in the more detailed example model st33gm06n03 modelident amp parmodelident 01 modeldisk getenv HOME dat rhd d model modelfile modeldisk model modelident ocolfull parfile modeldisk model parmodelident par Read parameter file par uio struct rd parfile Open first dataset to get some information about array sizes delvar listdata ful uio_datasetlist_rd modelfile listdata listdata ierr ierr uio closrd listdata channel delvar listdata nxci n elements ful z xc1 nxc2 n elements ful z xc2 nxc3 n elements ful z xc3 n timestep 1000 Some huge value to get everything Reduce for tests ierr 0 i 0 Loop over all datasets while ierr eq 0 and i lt n timestep do begin amp Read the next dataset ful uio datasetlist rd mod
105. ffects of turbulent pressure on the scale height The density decays less rapidly with height than in an isothermal hydrostatic stratification o C 1 0 Density scale height is pressure scale height o C gt 1 0 Density scale height is smaller than pressure scale height Not really useful real c radhtautop The MSrad radiation transport module needs the specification of the scale height of the optical depth at the upper boundary e g with real c_radhtautop f E15 8 b 4 n Scale height of optical depth at top u cm 60 0E 05 real rho_min During long periods of matter infall the density at an open outer boundary can become very low To limit the decrease of the density a lower limit in the extrapolated ghost cells can be set e g with real rho min f E15 8 b 4 n Minimum boundary density u g cm 3 1 0E 25 The density within the model will typically not fall much below this value A value of 0 0 default or below deactivates this feature real c coredrag To damp the flow in the core of models with central potential a drag force restricted to the inner part of the model r r0 grav can be applied It is controlled e g with real c coredrag f E15 8 b 4 n Core drag force parameter u 1 1 0 A value of 0 0 default or below deactivates this feature 80 5 CONTROL AND DATA FILES 5 3 5 Equation of State e character eosfile The equation of state file together with the opacity file implicitly determine the chemic
106. forma tion to standard output After the header its with a block Compiler call e g 112 5 CONTROL AND DATA FILES pgf90 byteswapio fast Mvect sse Mcache align Minfo inline Minline rhd hyd a vg rhd hyd upwind rhd hyd predO rhd hyd predm rhd hyd predp rhd hyd alpha rhd h yd constanteq rhd hyd minmodeq rhd hyd minmod rhd hyd vanleereq rhd hyd vanleer rhd hyd superbeeeq rhd hyd superbee rhd hyd ppeq rhd hyd pp rhd hyd hdflux rhd _hyd_entropyfix Minline rhd rad3d raylhd rhd rad3d solve rhd rad3d solveeq rhd _shortrad_operator rhd_shortrad_dtauop Drhd hyd roeid 101 0 Drhd r02 Drhd r0 3 DMSrad_raytasi Drhd hyd entropyfix pOi 1 Drhd roeid step tO1 Drhd roeid f lux t01 Drhd vis t01 Drhd bound tO1 Drhd shortrad step tO1 Drhd shortrad fo rmal_t01 Drhd shortrad lambda tO1 These lines were produced by the configure script see Sect 3 5 and written into the file compiler flags info which is accessed from rhd F90 via include during compilation Various modules now have a routine XXX switchinfo that prints the values of the compiler switches used during the compilation of that particular module The output can look e g like Compiler switches rhd hyd module ii cence nig tee vas e ts IDF 0 rhd_hyd_gravcorr_p01 5 rhd_hyd_entropyfix_p01 1 rhd_hyd_upwind_p01 0 rhd hyd roeid 101 0 rhd roeid step 101 0 rhd_roeid_slope_101 0 rhd roeid flux 101 undefined rhd bound t01 defined rhd roeid flux t
107. function diagram L 1 A 011 _ oes Figure 6 Program scheme Here comes an example of the script rhd1 job for a system without dedicated batch system The submission of a job is done via nohup rhd1 job amp bin sh PBS N rhdi PBS 1 walltime 72 00 00 PBS 1 nodes 1 ppn 4 Job file for the execution of RHD on gunnar Itanium 2 Hee Source rhd1 job original from HGL Last modification 2002 12 13 me 6 2 Running CO5BOLD on a Machine with Batch System 119 d set xv d BASEDIR users bf dat job j1 STADIR BASEDIR sta Start directory contains par rhdi cmd rhd1 job WRKDIR BASEDIR wrk Work directory BAKDIR BASEDIR bak Backup and output directory RHDEXE STADIR rhd exe RHD program to be executed export NCPUS 4 ttecho NCPUS export OMP_NUM_THREADS 1 Jump into work directory cd WRKDIR tt Loop execute RHD code possibly several times in one job for IRUN in 1 do echo echo CO5BOLD Run IRUN date Clear up work directory set e rm set e HEAHEA EEH A HEEE HEHE AE HEE BEHE HEEE E EEE TE EE E EE ME HEEE HETE TE HEE EE HE HETE HE BEHE E DETERE BEE TE EE ETE HE PETE TETE HE HEE HE EHE TEHETE PEHE H EEHEHE REE Get old command file select actual command line and read variables from command line cp p STADIR rhd1 cmd rhd1 cmd awk
108. ger n_radminiter Usually the stability considerations dictate a radiative time step smaller than the hydrody namics or tensor viscosity time step To remedy this situation it is possible to allow several radiation transport steps per global time step Hitherto all three radiation transport mod ules support this iteration The minimum number of iterations radiative sub steps can be specified e g with integer n radminiter f 14 b 4 amp n Minimum number of radiation transport iterations c0 8 1 5 3 Parameter File rhd par 95 Parameter Section LHDrad MSrad SHORTrad radscheme l i i n radminiter 5 3 13 ii i n_raditer 5 3 13 ii i n radmaxiter 5 3 13 i radraybase 5 3 13 i radraystar 5 3 13 ii n radtheta 5 3 13 P n radphi 5 3 13 n radsubray 5 3 13 n radthinpoint n radthickpoint T ii n radtaurefine 5 3 13 s ii n radband 5 3 13 dj n_radrsyslevel 5 3 13 n radoutput 5 3 13 b c_radtcool 5 3 13 c raddcool 5 3 13 bi c radscool 5 3 13 c radtinci 5 3 13 T c_raddinci 5 3 13 ii c_radimplicitmu 5 3 13 li c_raditereps 5 3 13 li c_raditerstep 5 3 13 i c radtvisdtau 5 3 13 c_radtvis 5 c radhtautop c radcourant 5 3 15 c radcourantmax 5 3 15 m c radmaxeichange 5 3 15 P i Table 11 List of radiation transport control parameters and the modules they are relevant for If less iterations are needed the time step limit for the next step is increased Th
109. gure script It is always save to switch any of them off by removing or undefining them 3 6 Compiler Macros 27 The macros in the category test mark parts of code under development The default values should only be changed with great care typically by the author of that code segment The configure script does not touch these settings General timing_c_factor in timing_module F90 timing count factor Category account for property of machine To produce the timing statistics printed at the end of a simulation run the standard Fortran routine SYSTEM_CLOCK is used The macro timing_c_factor specifies by how much the count rate of this routine is reduced when storing its count value This does not prevent all overflows but can make the output much more useful Values o 1 default count rate of SYSTEM_CLOCK is used directly o otherwise e g 1000 count rate of SYSTEM CLOCK is reduced by this factor By a proper choice of this factor the timing measurements of individual routines can be made meaningful the reduction of the count rate prevents overflows due to the addition of several measurements An overflow during an individual measurement can not be prevented Therefore the count rate for the entire program still tends to produce overflows gasinter 101 in gasinter routines F90 gas interpolation 101 Category performance enhancement This switch determines how temporary arrays are handled to improve perfor
110. hat after a restart with rhd cont the specifications about the length of the job e g the number of time steps will be counted from the restart point and not from the beginning of the original simulation To interrupt a job with rhd stop can be very handy The continuation with rhd cont and the old parameter file is not to be preferred over an ordinary restart with a new parameter file At the beginning of every time step COS5BOLD checks in the working directory whether the file rhd dump exists If it has been generated e g with touch rhd dump and the file rhd snap does not exist the current model is written into rhd snap It has the same file properties format and conversion as the regular rhd end file The run of the simulation itself is not modified This feature might be useful for debugging purposes If a run was successful i e it was completed because one of the regular termination conditions was fulfilled e g the requested number of time steps was performed the exit status file rhd done is produced Currently it contains the date and time of its generation The existence of this file can be checked within a script to determine if the simulation was successful and should be continued Note the existence of an rhd end file only indicates that CO5BOLD managed to exit gracefully due to an error or in a regular way 5 5 Text Output rhd out During execution expecially during the initialization phase CO5BOLD writes lots of in
111. he time step In hydrodynamics this works in most cases In MHD however reduction of the time step often does not help and other methods are necessary to avoid this problem Therefore the 10 2 EQUATIONS MHD module uses a HLL solver instead of a Roe solver like the hydrodynamic module It was shown numerically by Janhunen that using a HLL solver together with additional source terms in the induction equation keeps pressure and density positive under all circumstances Because the constrained transport step which is performed after the 1D sweeps with the MHD solver changes the magnetic field a correction of the internal energy in each cell is necessary to keep the total energy conserved Because this correction can lead to negative pressure it is omitted if the internal energy would become too small Therefore the total energy is not exactly conserved but this affects only a few cells in the simulation box Concluding remarks The methods described above result in a very robust scheme which guarantees positivity of pressure and density under almost all conditions However this does not mean that these values are accurate The pressure and temperature distribution may be very inaccurate in regions with strong magnetic fields This may be relevant if one includes special chromospheric physics such as dynamic hydrogen ionization and CO formation in the simulation A possibility to get more accurate pressure and temperature would be the use of t
112. he UIO format But it will be usually Fortran formatted ASCII It contains a list of parameter entries which are collected in groups to make it easier to find an entry Otherwise the order is arbitrary except for the very first fileform uio entry If there are more than one entry with the same name the first occurrence will be used by COBBOLD But the doubling of entries is strongly discouraged because it will almost certainly lead to confusion at some time In addition the IDL routine to read the parameter file will fail with an error message Additional entries can be added if the names differ from the standard ones described below Theses entries will be ignored by COS5BOLD but read by the IDL input routine They can be used to provide comments additional information about the model or control parameters for further processing 5 3 1 Quickstart How to Make a Proper Parameter File You will never write a new parameter file from scratch Typically you take an old file e g the one controlling the simulation which produced the model which is used to start the new run and edit it 1 Take the parameter file corresponding to the model you want the new simulation to start with 2 Most of the parameters should be already OK E g most of the parameters controlling the boundaries do not have to be changed 3 Write a brief description of the purpose of the planned simulation into the character description array You might but a r
113. he entropy equation instead of the energy equation for the computation of the internal energy in regions with strong magnetic field This was included in the original test version of the MHD module An other possibility is the use of the equation for the thermal energy itself This is the dual energy approach used in many MHD codes Due to the Courant condition the time step can become considerably smaller than in the hydrodynamic case This happens because the time step is also limited by the Alfv n speed which is large in regions with strong magnetic field and low density This module has been extensively tested It should be able to handle many MHD flows of astrophysical interest Bugs and problems can be reported to werner schaffenbergerOgmx at 2 3 A collection of thermodynamic relations M Steffen AIP 2 3 1 Basic thermodynamic equations Differential relations E p de Tds iP 16 where e is the internal energy 1 dh Tds dp 17 p where the specific enthalpy h is defined as h e p p 18 This implies p p 2 r 2 EUR i 2 3 A collection of thermodynamic relations M Steffen AIP 11 2 3 2 Definition of often used thermodynamic coefficients a ar 7 ar sir es Definition of specific heats de Os Os Velo emi e 24 i E EN Gaal eS Definitions of further thermodynamic coefficients our XT 25 OMT Olnp j K 2 v 555 K 26 ln p XT aT
114. he new Makefile You get an overview over the relevant environment variables that control the configure script see Sect 3 5 with env grep F90_ Obs at the beginning there might be none 8 Look into the header and if necessary the rest of the configure script or into Sect to find out how to change the environment variables to control the script properly For instance if you want to enable debugging options type export F90_DEBUG 1 Restart the configure script after every change in the control variables With e g export F90_MACHINE dummy export F90_PREFLAGS Oprettyfast Qsomethingelse configure 20 3 PROGRAM FILES INSTALLATION COMPILATION it is possible to specify all machine dependent settings yourself see Sect 3 5 and Sect 3 5 This is useful when dealing with a compiler hitherto unknown to the configure script 9 Start the compilation with make to produce the executable rhd exe A simple sample installation may look like the following the sub directory for is put into the home directory Choose base directory cd HOME 4 Put the tar file there 4 Expand the tar file tar zxvf for tar gz Go into default master directory cd for hd rhd YOUR MACHINE Activate OpenMP und MSrad radiation transport export F90 PARALLEL openmp export F90_MSRAD 1 4 Start the configure script configure Compile make echo Voila
115. hemical abundance of repres metal 1 0E 04 character hion datapath The path of all input files for HION character hion datapath f A80 b 80 n HION data path data sven cobold dat hion 90 5 CONTROL AND DATA FILES character hion_atomfile The file name of the model atom for HION character hion_atomfile f A80 b 80 n HION atom file name H_6 atom character hion_abufile The name of the HION input file containing the chemical abundances character hion abufile f A80 b 80 n HION abundance file name abundance input character hion_edensfile The name of the HION input file containing the electron density table character hion edensfile f A80 b 80 n HION electron density file name edens dat character hion pffile The name of the HION input file containing the partition functions character hion pffile f A80 b 80 n HION partition function file name pf kurucz dat real dtime out hion Time increment for additional HION output Positive values specify the time increment in seconds negative values the increment in computational time steps Setting the parameter to zero suppresses the output real dtime out hion f E15 8 b 4 n Output file time step HION 210 0 integer hion chunks Number of chunks to use for HION in order to limit the required memory Do not make it bigger than the number of points in the x2 direction integer hion chunks f I9 b 4 n Number of HION chunks 1
116. hould be controlled with parameters like real c vissmagorinsky and real c visartificial But the parameter can be used to tentatively switch off the off diagonal terms completely or to change its importance compared to the other terms e real c vistensordiv The factor in the stress tensor in front of of the divergence terms also on the diagonal can be set with e g real c vistensordiv f E15 8 b 4 amp n Divergence factor for viscous stress tensor u 1 amp cO typically 1 3 0 0 This is not really parameter one would try to adjust The total amount of viscosity should be controlled with parameters like real c_vissmagorinsky and real c visartificial But the parameter can be used to switch off the divergence terms completely or to change its importance compared to the other terms These divergence terms can be used to reduce the effect of the tensor viscosity in the case of isotropic compression But this reduction c_vistensordiv 0 333333 in 3D c_vistensordiv 0 5 in 2D is usually switched off e integer n viscellsperchunk The number of cells per box or chunk treated by the tensor viscosity scheme at one call and by one thread can be set e g for an Intel Macintosh with integer n viscellsperchunk f I9 b 4 amp n Number of cells per viscosity chunk amp c0 0 gt old chopping amp c0 12000 reasonable value 32000 It can be adjusted to improve cache efficiency and to modify the work load
117. hydpredfactor The hydrostatic pressure correction terms in the two acoustic waves are always present However for the entropy wave and the ionization wave it is not quite clear if the terms should be there the classical default or if they should be set to zero The value of a factor in front of these terms can be set e g with real c_hydpredfactor f E15 8 b 4 amp n hydrostatic pressure reduction in waves 3 and 6 u 1 amp c0 70 0 Deactivation of pressure reduction terms amp ci 1 0 Activation of pressure reduction terms default 0 0 Possible choices are o 0 0 Deactivation of pressure reduction terms in waves 3 and 6 in Roe solver o 1 0 Activation of pressure reduction terms in waves 3 and 6 in Roe solver default This parameter is not recognized by the MHD module integer n_hyditer After each complete hydiative time step the recommendation for the next time step will be chosen so that n_hyditer iterations will probably needed The parameter can be set e g with integer n_hyditer f 14 b 4 amp n Number of hydrodynamics iterations c0 10 8 For a simulation of a solar type star it will typically be set to 1 E g for brown dwarfs with shorter hydrodynamical time scales values around 10 may be considered Note that the hydrodynamics iteration works somewhat differently than the radiation transport iteration in the latter case the size of the actual time step can be determined after comp
118. ic field vanishes at the boundary Any of these values can be specified But in fact not all of them are recognized by all modules Therefore some parameters are for test purposes e g shock calculations only In simulations of a solar like star with the MSrad radiation transport module the side bound aries have to be periodic In simulations of a red supergiant all boundaries including the sides will typically be transmitting As an alternative closed boundaries can be chosen in this case character top bound The boundary condition at the top of the model is given by for instance character top bound f A80 b 80 n top boundary conditions transmitting Possible values are o reflective closed wall no gravity no radiation Like the velocity field the magnetic field is mirrored at the boundary This boundary condition is unphysical because the magnetic field is an axial vector and it violates the divergence free property of the magnetic field Therefore this boundary condition should not be used in MHD simulations Use closed boundary conditions instead o constant open boundary with constant extrapolation of all values no gravity no radiation o closed closedtop closed wall can handle gravity open for outward radiation Mag netic field lines are orthogonal to the boundary i e the tangential component of the magnetic field vanishes at the boundary o periodic periodic boundaries for hydrodynamics radiation and
119. ic case are available in the MHD module e character side_bound The boundary condition at all four sides is given by e g character side bound f A80 b 80 n side boundary conditions amp cO closed transmitting periodic transmitting 5 CONTROL AND DATA FILES Possible values are o reflective closed wall no gravity no radiation Like the velocity field the magnetic field is mirrored at the boundary This boundary condition is unphysical because the magnetic field is an axial vector and it violates the divergence free property of the magnetic field Therefore this boundary condition should not be used in MHD simulations Use closed boundary conditions instead o constant open boundary with constant extrapolation of all values no gravity no radiation o closed closedtop closed wall can handle gravity open for outward radiation Mag netic field lines are orthogonal to the boundary i e the tangential component of the magnetic field vanishes at the boundary o closedbottom closed wall handles gravity radiation in diffusion approximation Magnetic field lines are orthogonal to the boundary i e the tangential component of the magnetic field vanishes at the boundary o periodic periodic boundaries for hydrodynamics radiation and magnetic fields o transmitting transmitting boundary for hydro and outward radiation Magnetic field lines are orthogonal to the boundary i e the tangential component of the magnet
120. ic field 1 G bb2 Magnetic field 2 G bb3 Magnetic field 3 G It might follow ACTION Initialize MS radiation transport routines lt lt lt lt lt lt lt lt And finally ACTION Open output files lt lt lt lt lt lt lt lt which indicates that the rhd full file see Sect 5 1 and the rhd mean file see Sect 5 2 have been opened and now contain a header The end of the initialization phase and the beginning of the proper simulation is marked by e g Start Computation E Time step number itime 47050 time 2 5821813E 08 t job 8 510000E 00 The output for a typical simulation time step can look like for a supergiant model with SHORTrad radiation transport Time step number itime 49048 time 2 6822680E 08 t job 1 272180E 06 dtime 5 3047E 03 HD 1 4838E 04 RAD 5 3047E 03 VIS 1 0723E 05 Luminosity per core volume 4 49999049E 02 HYD 1 N_cellsperchunk n_chunks 10000 1410 HYD 2 N_cellsperchunk n_chunks 10000 1410 HYD 3 N_cellsperchunk n_chunks 10000 1410 VIS3D N_cellsperchunk n_chunks 10000 1360 Start of rhd_shortrad_step n_subdtime al minmax T 1 111651E 03 1 630733E 05 Main 1 3 ray direction 2 0 000000 1 000000 0 000000 Main 2 3 ray direction 3 0 707105 0 000000 0 707109 Main 3 3 ray direction 3 0 707105 0 000000 0 707109 Time step ratio d
121. ieee_32 ieee_dp and ieee 64 respectively On a machine with an internal data representation not within the list in the existing uio mac module f90 files one could use the standard file uio_mac_module f90 and is restricted to the native conversion type But it is better to invent an appropriate name for the new data format and to build a proper machine dependent UIO file e g from uio_mac_ieee_module f90 conversion type I R D description native 7 7 7 internal data format on all machines sometimes useful but not recommended ieee 4 4 4 S8 standard IEEE big endian format recommended ieeele 4 4 4 8 IEEE little endian format ieee 8 8 8 16 double precision IEEE big endian format on some machines possible crayxmp 8 8 8 16 CRAY internal data format idl 4 4 8 IDL format but IDL also supports ieee 4 xdr 4 4 S8 format possible with IDL ieee 4 limit 4 8 8 standard IEEE format ieee 4 ieee NR NE IEEE format unknown length not recommended Table 4 UIO conversion types with length of integers single precision reals and double precision reals in bytes and an explanation Some attention has to be paid if weird compiler switches as e g r16 i2 are used to modify the accuracy and standard memory size of variables If an existing file is opened for reading the file format and conversion type are determined automatically from the file if the conversion type of the data in the file is a
122. inator to become zero a term Cdusto4 P is added The default value is 0 0 real c dustO5 The minimum number of monomers during condensation is specified with e g real c dustO05 f E15 8 b 4 n Minimum number of monomers during condensation u 1 10 0 For very small grains just one or very few monomers the condensation rates can be very small in this dust model nucleation that would form already small clumps of monomers is not considered Therefore to speed things up a minimum number of monomers can be given that is considered for the condensation rate With 1 0 or smaller values the enhancement is switched off The default value is 0 0 real c dustO6 The sticking coefficient for the condensation rate is specified with e g real c_dust06 f E15 8 b 4 n Sticking coefficient u 1 amp cO For C rich dust 0 37 can be between O and 1 1 0 The default value is 0 0 5 3 12 Dust dustscheme dust bins 01 In this section the parameters for dustscheme dust bins 01 multi size bin dust scheme for Forsterite dust are described integer n dustgrainradius The number of dust grain radius bins including one for the monomers is specified with integer n dustgrainradius f I8 b 4 n Number of dust grain radius bins amp ci Includes bin for monomers 8 The default value is 1 to avoid an empty array The value should be the same as the upper dimension in real ar dustgrainradius real ar dustgrainradius The ra
123. insky c_vistensordiag c_vistensordiv c_vistensoroff 87 133 real dtime_out_hion real dtime_incmax 103 real dtime_max real dtime_min 102 real dtime_min_stop 102 real dtime_out_end 106 real dtime out full l05 real dtime out mean 106 real dtime_start 102 real endtime 101 real gamma 109 real grav 74 real luminositypervolune 78 real mass_star 71 real nu_rotation 75 real plustine 101 real qmol 109 real rO grav 74 real ri_grav 75 real ri_rad 75 real rho_min 79 real s_inflow 78 real starttime 100 real teff 74 tensor viscosity time step 102 rhd snap 111 rhd stop 111 Roe solver rotation 75 SGI short characteristics SHORTrad 6 single precision Sparc 128 Sun tensor viscosity tensor viscosity routine thermodynamic relations adiabatic gradient enthalpy entropy internal energy polytropic gas sound speed specific heats time step timing statistics total energy flux uro conversion type example 134 format Fortran IDL makefile record length unit uiocat uio_datasetlist_rd pro 64 uio dataset rd pro 64 uio dataset rd pro 64 uioinfo uio init pro 63 uiolook uio mac module uio struct rd pro 64 UNIX scripts UKAFF unformatted UNIX viscosity point to point tensor 23 30 85 xb1 67 xb2 67 xb3 67 xc1 67 xc2 67 xc3 67
124. integer n radsubray Using the MSrad module the number of rays per cell with the same direction can be specified e g with integer n radsubray f I4 b 4 n KPHI Number of rays per cell c0 2 2 integer n radthickpoint With the MSrad module the lower part of the model can be computed in diffusion approxi mation The number of points in diffusion approximation can be set with e g integer n radthickpoint f I4 b 4 amp n Number of grid points with optically thick diff approximation c0O 0 no diffusion approximation 0 The value should be choosen so that for all points in that region Ar gt 1 is valid Setting this value to O means that the diffusion approximation is not used in any part of the model integer n radtaurefine With the LHDrad and the M8rad module the number of points on the rays can be finer than the number of points in the basic numerical grid T he refinement can be set e g with integer n radtaurefine f I4 b 4 amp n Refinement factor 0 integer n_radband It can be specified whether the grey opacity table or the binned frequency dependent part of the opacity table is used during the computation The grey part contains only one bin The other possibly non grey contains one or more bins depending on the table chosen The parameter is specified with e g integer n_radband f 14 b 4 n Number of frequency bins amp c0O 1 grey opacities amp ci 2 non grey opacities if av
125. internal list of logical I O unit numbers may be changed with calls of uio_chunit and uio_chconv A file can be opened for writing with file test txt form formatted or unformatted conv ieee 4 or native crayxmp_8 call uio openwr ncout file form form conv conv Header and data block are written together with one command as e g in call uio wr ncout time time name time unit s call uio wr ncout rho 1 10 rho name density unit g cm 3 There are two different routines to close a file after reading or writing A file opened for writing is closed by call uio closwr ncout To open a file for reading only the file name has to specified File form and conversion type are determined automatically 4 6 UNIX Scripts 59 file test txt call uio openrd ncin file In contrast to the writing of an entry by one routine call the reading is performed in two separate sub steps for the header and the data part After the reading of the header e g with use uio siz module use uio nam module integer zi ntt character let termt 2 nttmx call uio rdhd ncin termt ntt the identifier type and dimension if any of the entry is contained in the character array termt with ntt entries and special actions may be taken The data part may be skipped with uio skipda ncin termt ntt or it can be read with call uio rd ncin termt ntt time ident If the entr
126. ipt e 03 Choose optimization level Higher levels that involve interprocedural analysis cause the compiler to stop with an error message e qarch auto qtune auto qcache auto To allow optimization specific for the local machine default in the configure script Cross compilation can be activated e g with qarch pwr3 qtune pwr3 or qarch pwr4 qtune pwr4 by setting an environment vari able e g F90 MACHINE pur3 before calling configure e Q Q To activate inlining and to specify the list of routines that should be inlined see Sect 3 7 2 e qsmp noauto omp Parallelization OpenMP directives are activated A job script rhd job on the Loadleveler batch system on io cines fr can be submitted with llsubmit rhd job http www 306 ibm com software awdtools fortran xlfortran library ittp publib boulder ibm com infocenter comphelp index jsp http os cc biu ac il documentation http os cc biu ac il documentation xIf 8 1 1 html http pct nersc gov computers SP craytoSP htm 42 3 PROGRAM FILES INSTALLATION COMPILATION The jobs in the queue for user testuser can be checked with llq u testuser A job with ID n34 56789 0 can be canceled with llcancel n34 56789 0 3 7 10 Linux PGI Compiler Under Linux the compiler of the Portland Group was first used to compile CO5BOLD It is called with pgf90 Important switches are e byteswapio With this flag set binary files in
127. iption d 1 1 f A24 p 1 b 24 n File description character history d 1 20 f A80 p 1 b 80 n File history character version f A80 b 80 n Program version label dataset n RHD model date 02 01 2002 16 17 26 043 character dataset id f A10 b 10 n Type of box hierarchy real modeltime f E13 6 b 4 n time u s real modeltime db f E23 15 b 8 n time u s 5 2 File with Additional Data rhd mean 67 integer modelitime f 111 b 4 n time step number u 1 real dtime f E13 6 b 4 n time step u s real time out full last f E13 6 b 4 n Time of last output of full model u s real time out mean last f E13 6 b 4 n Time of last output of averaged data amp u s label box date 02 01 2002 16 17 26 049 character box id f A80 b 80 n Block identification integer dimension d 1 2 1 3 f I7 p 6 b 4 real time f E13 6 b 4 n time u s real time db f E23 15 b 8 n time u s integer itime f 111 b 4 n time step number u 1 real xci d 63 63 63 63 63 63 f E13 6 p 4 b 4 amp n x1 coordinates of cell centers u cm ds 0 0 0 1 0 1 real xc2 d 63 63 63 63 63 63 f E13 6 p 4 b 4 amp n x2 coordinates of cell centers u cm ds 0 1 0 0 0 1 real xc3 d 63 63 63 63 63 63 f E13 6 p 4 b 4 Y n x3 coordinates of cell centers u cm ds 0 1 0 1 0 0 real xb1 d 63 64 63 63 63 63 f E13 6 p 4 b 4 Y n x1 coordinates of cell boundaries u cm ds 0 1 0 1 0 1 real xb2 d 63 63 63 64 63
128. irectives only e procnum 8 generated code for 8 processors on one node e orphaned 1 Checks if the regions sequentially executed contain orphaned directives dur ing run time when PROCNUME 8 is specified If a sequentially executed region contains an orphaned directive the system outputs a message and terminates the program e nestcheck 1 Checks for nesting errors in parallel regions If a parallel region is nested the system returns an error and terminates the program Without this option the code aborts with an error message indicating illegal nesting Compiler bug e pmpar Collects the performance monitor information for each parallelization unit pmfunc Collects the performance monitor information for each procedure Drhd hyd roeid 101 1 Optimization Choose non standard set of routines for Roe solver See Sect e DMSrad raytas 0 Optimization choose default version of loop in SUBROUTINE raytas in file M9rad3D F90 See Sect e Important note The UIO routines need in addition the compiler option subchk Array bound checking Without this checking option some UIO routines are not working properly compiler bug A proposed compiling sequence is only default modules activated export F90_PREFLAGS subchk configure make UIO export F90 PREFLAGS configure make Performance tests on hwwsr8k Some tests have been performed on the machine hwwsr8k at HLR Stuttgart in order to de termine the optimum ch
129. is computed with either one of three modules e MSrad module It uses long characteristics The lateral boundaries have to be periodic Top and bottom can be closed or open solar module e LHDrad module It uses long characteristics and is restricted to an equidistant grid and open boundaries at all surfaces old supergiant module e SHORTrad module It uses short characteristics and is restricted to an equidistant grid and open boundaries at all surfaces new supergiant module Recently the code was supplemented with an optional MHD version Schaffenberger et al 2005 that can treat magnetic fields There are also modules for the forma tion and advection of dust available The current version now contains the treatment of chemical reaction networks mostly used for the formation of molecules Wedemeyer Bohm et al 2005 and hydrogen ionization ee E mere Ben DU mer Bn Od COSBOLD is written in Fortran90 The parallelization is done with OpenMP directives To get a brief overview you might want to look into the Quickstart Sections How to Compile CO5BOLD Sect 3 1 Introduction to UIO Sect 4 1 How to Make a Proper Parameter File Sect 5 3 1 How to Run CO5BOLD Sect 6 1 2 Equations 2 1 Basic Equations The hydrodynamics equations are expressed as conservation relations plus source terms for p pul pv2 pv3 peikg 1 the mass density the three mass fluxes and the total e
130. is value will in almost any case for explicit radiation transport be set to 1 In the implicit case it is set to a higher value typically 5 integer n raditer After each complete radiative time step the recommendation for the next time step will be chosen so that n raditer iterations will probably needed The parameter can be set e g with integer n raditer f I4 b 4 amp n Number of radiation transport iterations c0 10 8 For a simulation of a solar type star with comparatively long radiative time scales it will typically be set to 1 For stars with shorter radiative time scales values around 10 may be considered All three radiation transport modules understand this parameter integer n radmaxiter The absolute maximum number of iterations can be specified e g with integer n radmaxiter f I4 b 4 amp n Maximum number of rad transport iterations c0 30 0 96 5 CONTROL AND DATA FILES If more iterations are needed the computation for the current time step is stopped and resumed with a smaller one which means that the hydrodynamics and the tensor viscosity step have to be done again Usually n_radmaxiter will either be set to a value somewhat larger than the recommended number of iterations n_raditer or to O which disables the check for too many iterations completely This can be safely allowed in many cases and has the advantage that there is no need to save the initial model before calling the radiation transport
131. lated equation of state data opta I data tabulated opacities rhd sta I data UIO start model e g end file of last run rhd done O status exit status written if run was successful rhd end O data UIO end model rhd full O data UIO sequence of 2D or 3D snapshots large rhd mean O data UIO derived data mean flux intensity rhd snap O data UIO file with model snapshot if requested rhd out O data text human readable text output data dat I data text chemical reaction data data atom I data text HION data file model atom edens dat I data UIO HION data file electron density table abundance input I data text HION data file abundances pf kurucz dat I data UIO HION data file partition functions HION time H out O data UIO HION additional output HION step H out O data UIO HION additional output 5 1 Model Files rhd sta rhd end rhd full Table 10 List of all control and data files of COBBOLD If the UIO scripts Sect 4 6 are properly installed you can view the contents more precisely the headers of the data entries of an UIO file with uiolook filename e g uiolook st35gm04n05_03 end gives the output slightly edited fileform uio form unformatted convert ieee 4 version 0 1 2000 11 26 amp date 02 01 2002 16 17 26 036 system craSHi machine craSHi osrelease 10 0 0 6 amp osversion UoK 4 hardware CRAY SV1 language Fortran90 program RHD character file id f A8 b 8 n File identification character descr
132. ller than one full dataset it is possible to request a higher sampling rate without using too much disk space integer n outslicedim mean The index of the optional slice in the mean output file can be specified with e g integer n outslicedim mean f I4 b 4 n index of slice in mean output file u 1 amp c0 0 no output of slice amp ci 1 2 3 output of slice with plane perpendicular to this direction 2 With a value of 0 the output is suppressed A value of 1 2 3indiciates the direction of the normal to the output plane for instance in a local 3D box in a star model with gravity along direction 3 a value of 3 gives a horizontal plane in the middel of the model useful only in special cases whereas a value of 2 or 1 gives a vertical slice with a horizontal and the vertical axis useful for movies of 2D slices The grid index of the slice cannot be specified character infile start The filename of the initial model is specified e g with 5 3 Parameter File rhd par 107 character infile start f A80 b 80 n File name of start model rhd sta Default is rhd sta for a parameter file used within a batch system Typical filenames are st35gm04n01_01 sta or gt57g44n20dz end integer istep_in_start The index number of the dataset in the start model file to be used can be specified e g with integer istep in start f 14 b 4 n Number of dataset to read as start model amp u 1 cO0 1 first dataset defau
133. lling tidal wave 5 3 3 New control files rhd dump and rhd snap to request a snapshot of current New control parameter dtime out end 5 3 16 2006 07 28 Preparation for major code release beta version with the new modules CHEM 5 6 and HION 5 7 including new parameters 5 3 9 and switches for the configure script 33 2006 08 14 MHD section MHD parameters 5 3 7 2007 02 12 Hydro section with new modii and parameters heat mode 5 3 4 rotating coordinate system possible hydrodynamics iteration 5 3 7 new pressure correction scheme 3 6 unsplit hydrodynamics operator possible 2007 10 22 Double precision time as additional scalar in model file 2007 12 18 Rather stable version and parameter rearrangements for dust model dustscheme dust_k3mon_03 5 3 11 and dustscheme dust_bins_01 5 3 12 2008 03 13 Expansion Courant number C_hydExpCourant C_hydExpCourantmax 5 3 15 2008 03 17 Hydrostatic pressure correction in waves 3 and 6 switch on and offable with C_hydPredfactor 5 3 7 127 2008 04 27 Expansion viscosity C_visExpansion 2008 07 03 Linear viscosity C_visLinear 5 3 8 2008 08 13 Parameters N_radrsyslevel N_radoutput C_radTcool C_radDcool C_radscool in MSrad 5 3 13 parameters C radTinci and C radDinci to control inci dent radiation in MSrad 5 3 13 2008 08 14 Compiling double precision code 3 7 3 2008 08 19 Some parameters possibly valid for MHD module 2008 0
134. lt 2 second dataset 1 character outfile end The file name for the final model can be specified with e g character outfile end f A80 b 80 n Output file name rhd end The default is rhd end Leaving it empty means that no final model is written This of course inhibits follow up simulations but can be useful to save time and disk space for some tests character outfile_full The name of the file for the output of additional full models at regular intervals see Sect 5 1 can be given with e g character outfile full f A80 b 80 n Output file name rhd full Leaving it empty means that no file of this type is written character outfile_mean The name of the file for the output of additional information average stratification mean fluxes surface intensities at regular intervals see Sect 5 2 can be specified with e g character outfile_mean f A80 b 80 n utput file name rhd mean Leaving it empty means that no file of this type is written character outform_end The format see Sect 4 3 1 of the final model files can be chosen e g with character outform end f A80 b 80 n Output file format amp cO formatted unformatted unformatted Allowed values are o unformatted default fast compact possibly machine dependent output strongly recommended o formatted slow machine independent output big files character outconv end The conversion type see Sect 4 3 1 of the final mo
135. machine type is determined with uname m According to the control variables and the machine architecture the compiler name and its compiler flags are composed These are written into the header of a Makefile which is produced in the end An existing Makefile is appended to Makefile old Additionally the compilation command is written into the file gt compiler_flags info in a form ready to be included in a Fortran program The environment variables that control the script are e F90_COMPILER Fortran compiler o a machine dependent default is chosen individually for each architecture o f90 general default e F9O_PREFLAGS Compiler flags to be put at the beginning of the list Usually the list of compiler flags produced by the configure script should be pretty complete But you might want to add special switches like Bstatic to enforce static linking of libraries o No extra flags e F90 POSTFLAGS Compiler flags to be put at the end of the list Usually the list of compiler flags produced by the configure script should be pretty complete However you might want to overwrite some settings This can be done by setting this variable to a none empty value because typically a compiler should interpret the flags from left to right 3 5 Configure Script 23 File and path Abb Description hd rhd rhd F90 RHD main program hd rhd rhd hyd module F90 RHD hydrodynamics routines
136. mance Values o 0 default Temporary coefficient arrays are actually copied o 1 Temporary coefficient arrays just get a pointer link into the big arrays rhd box gravO1 in rhd box module F90 rhd box gravitation 01 Category feature activation Switch to activate the array for the gravitational potential in the box structure If the switch is set to 1 a 3D array for the potential is created copied removed There is no module to compute the gravitational potential yet Therefore the entire thing has no practical value yet Values o 0 default no handling of array o 1 array handling activated rhd box qucO1 in rhd box module F90 and rhd F90 rhd box quantity centered 01 Category feature activation CO5BOLD is able to handle a number of further quantities quc quantity centered in addition to the basic hydrodynamics quantities p ei if this compiler switch is activated These additional quantities can be e g densities of dust distribution moments or densities of molecules They are required for the treatment of chemical reaction networks and time dependent hydrogen ionization For the latter the quc arrays contain the number densities of the atomic level populations For the chemical reaction network the arrays contain the species number densities in cm and with headers following this example Number density of H2 Values o 0 default no handling of additional quantiti
137. ment There might be a performance gain by splitting the main loop in routine rhd_rad3d_toray into three separate loops Typically one big loop is to be preferred Values o undefined default One big loop o defined Three smaller loops rhd_rad3d_fromray_101 in rhd_lhdrad_module F90 rhd radiation 3 dimensions from ray loop 01 Category performance enhancement There might be a performance gain by splitting a big loop in routine rhd_rad3d_fromray into two separate loops Typically one big loop is to be preferred Values o undefined default One big loop o defined Two smaller loops rhd_rad3d_r02 in rhd_1hdrad_module F90 rhd radiation 3 dimensions radiation 02 Category test Module rhd_lhdrad_module contains a routine for the handling of periodic boundaries It is in an experimental state and is deactivated by default Values o undefined default Skip routine rhd_rad3d_dirper during compilation o defined Compile routine rhd rad3d dirper rhd rad3d solve tO1 in rhd_1hdrad_module F90 rhd radiation 3 dimensions solve timing 01 Category additional output Produce timing information for the routines which solves the 1D radiation transport equa tion along single ray This routine is called very frequently The timing measurement might slow it down somewhat It should not be used in conjunction with OpenMP Values 32 3 PROGRAM FILES INSTALLATION COMPILATION o undefined default
138. module which saves some memory To disable the iteration of the radiation transport sub step set n_radminiter n_raditer n_radmaxiter 1 All three radiation transport modules understand this parameter character radraybase Using the modules LHDrad or SHORTrad the orientation of the base axis system can be selected e g with character radraybase f A80 b 80 n Base axis system amp cO unity random randomgroup random Allowed values are o unity default During all time steps and radiative sub steps the direction of the rays stays the same o random At each time step and radiative sub step a new base axis system is chosen at random o randomgroup At each new time step a new base axis system is chosen at random It is kept for all radiative sub steps Because typically only a relatively small number of rays is chosen per time step with radraystar it is advisable to vary the directions of the rays by choosing radraybase random or randomgroup to cover the entire sphere at least over a longer time character radraystar Using the modules LHDrad or SHORTrad the list of ray directions i e the number of rays and their coordinates relative to the base axis system can be specified with e g character radraystar f A80 b 80 n List of relative ray directions amp c02 x1 1 x2 1 x3 1 oktaeder 3 tetraeder 4 cube 4 amp ci ikosaeder 6 dodekaeder 10 oktaeder Examples for allowed values are o x1 N 1 one si
139. mong the conversion types supported by the compiler If the file has a conversion type native but is created on a machine with different internal data representation the file header might be readable but an error will probably occur during the reading of a real variable 4 3 2 Data File Structure The UIO routines only handle sequential files Each file consists of a list of entries The first entry describes the file format conversion type and the machine who is responsible for it The following entries contain data scalars and 1D 4D arrays of type integer real single amp double precision complex single precision character tables with columns of type integer real single precision or character or structuring information labels Each entry consists of the header and the possibly empty data block Each header is a list of at most 20 terms separated by blanks or linefeeds The first term is the entry type e g real see table 5 followed by an identifier T his identifier should follow the standard rules for variables lowercase letters numbers underscore starting with letter It is a name as e g rho v 1 The rest of the terms come in the form keyword value See Tab 6 for some pre defined keywords A header line has a maximum length of 80 characters A continuation line is indicated by at the end of the line A header consists of 20 lines at maximum It can be preceded by empty lines except for th
140. mponent of the magnetic field The extension to 3 dimensions should be clear Variables at the left or the bottom boundary have the same indices as the cell For a box with 120x120x120 cells the headers for the magnetic field arrays in the start model may look like real bbi d 1 121 1 120 1 120 f E13 6 p 4 b 4 amp n cell boundary magnetic field 1 u G sqrt 4pi real bb2 d 1 120 1 121 1 120 f E13 6 p 4 b 4 amp n cell boundary magnetic field 2 u G sqrt 4pi real bb3 d 1 120 1 120 1 121 f E13 6 p 4 b 4 amp n cell boundary magnetic field 3 u G sqrt 4pi For simplicity the MHD module uses units such that the 4 pi factors do not appear in the MHD equations THEREFORE YOU HAVE TO MULTIPLY YOUR ORIGINAL MAGNETIC FIELDS IN GAUSS WITH THE FACTOR 1 SQRT 4 PI TO GET THE CORRECT MAGNETIC FIELD STRENGTH FOR CO5BOLD AFTER THE COMPUTATION YOU HAVE TO MULTIPLY THE MAGNETIC FIELDS FROM THE CO5BOLD OUTPUT WITH THE FACTOR SQRT 4 PI TO GET THE MAG NETIC FIELD STRENGTH IN GAUSS The CO5BOLD analysis tool CAT does this automatically during the reading of model data so you can use the COBBOLD output directly with CAT Positivity of pressure and density A special problem of MHD simulations is that pressure or density can become negative in some situations This problem is also present in pure hydrodynamic simulations but gets worse for MHD The original hydrodynamic version of COSBOLD tries to fix this problem by reducing t
141. n In some rare cases it might be useful to specify explicitly the minimum time step with e g real dtime_min f E15 8 b 4 n Minimum time step u s amp c0 dtime_min 0 0 gt no restriction 1 0 This value is used even if restrictions from the Courant condition try to enforce a smaller value A fixed time step can be prescribed by setting dtime min dtime max to some positive value A value dtime min lt 0 0 means that this time step restriction is completely ignored which is the case that should usually be chosen real dtime max It is possible to explicitly specify the maximum time step too e g with real dtime_max f E15 8 b 4 n Maximum time step u s amp cO dtime max 0 0 gt no restriction 1 0E 05 A fixed time step can be prescribed by setting dtime_min dtime_max to some positive value A value dtime max lt 0 0 means that this time step restriction is completely ignored which is the case that should usually be chosen real dtime min stop Sometimes a simulation can run into a pathological state where the time step decreases rapidly without recovering To prevent a simulation in such a case from running forever or until some other process time restriction applies without actually advancing significantly in time it is possible to specify an absolute minimum time step e g with real dtime min stop f E15 8 b 4 n Minimum time step u s amp cO dtime min stop 0 0 gt no restriction amp ci
142. n of the MHD module because the explicit electric conductivity and the addidional energy diffusion have been removed Therefore you can set them to any value you want without consequences However these parameters may be used again in future versions of the module e real bi inflow This parameter is only valid for the hdscheme RoeMHD module It controls the strength of the inflowing horizontal magnetic field B1 at the lower boundary bottom bound inoutflow2 The default value is 0 0 Example real bi inflow f E15 8 b 4 amp n Strength of inflowing horizontal magnetic field u G 20 The units are only certain up to a factor y4r or so 5 3 8 Tensor Viscosity Control In many test problems it is not necessary to activate the 2D 3D tensor viscosity But when strong slow shock fronts are aligned with the grid the Roe solver runs into problems and at least some additional 2D or 3D viscosity is necessary And even if the Roe solver can handle sharp shocks by its own the radiation transport algorithm might cause trouble because of the enormous opacity variations across a shock front Here the tensor viscosity is useful too e real c vissmagorinsky A turbulent viscosity of Smagorinsky type can be activated e g with real c vissmagorinsky f E15 8 b 4 amp n Turbulent eddy viscosity parameter Smagorinsky type u 1 1 2 In many cases values around 0 5 are sufficient to stabilize the code Larger values 1 2 in the example above
143. n the working directory Instead its path can be specified e g with character eospath f A80 b 80 n path of EOS file amp c0 astro b bf for eos dat home a_bf for eos dat 5 3 6 Opacities e character opafile The opacity file can be specified with e g character opafile f A80 b 80 n opacity file name amp cO g2va opta big grey opta amp ci empty gt no radiation transport phoenix_opal_grey opta So far there exist already a couple of files O davmf opta f5v opta g2va opta g2v_lowhe opta g2v_m20 opta 5 3 Parameter File rhd par 81 o g2v opta o hmin_p00 opta o opal_lowhe opta o opal_m05 opta o opal_m10 opta o opal_m20 opta o phoenix_dust_grey opta o phoenix_dust_ob4 opta o phoenix_opal_grey opta o ross_m05 opta o ross_m10 opta o ross_m20 opta o sunuri opta o sunur2 opta o t5000g44mm20 opta o t5000g47mm20 opta o t6300g40mm20 opta o t6500g44mm20 opta o zzcetilg opta o zzcetil opta e character opapath The opacity file does not have to be in the working directory Instead its path can be specified e g with character opapath f A80 b 80 n path of opacity file amp c0 astro b bf for opa dat home a_bf for opa dat 5 3 7 Hydrodynamics Control HD and MHD Allmost all parameters in the parameter file are valid for the HD and the MHD module Only a few parameters for the hydrodynamics control character hdscheme Sect character reconstr
144. nMP Values o undefined default no timing information o defined call subroutines to measure elapsed time Radiation transport e rhd rO1 in rhd F90 rhd radiation 01 Category feature activation Switch to include LHDrad radiation transport module It uses long characteristics and is restricted to an equidistant grid and open boundaries at all surfaces old supergiant module Values 3 6 Compiler Macros 31 o undefined default LHDrad routines are deactivated o 1 LHDrad routines are recognized by the compiler rhd_r02 in rhd F90 rhd radiation 02 Category feature activation Switch to include MSrad radiation transport module It uses long characteristics The lateral boundaries have to be periodic Top and bottom can be closed or open solar module Values o undefined default MSrad routines are deactivated o 1 MSrad routines are recognized by the compiler rhd_r03 in rhd F90 rhd radiation 03 Category feature activation Switch to include SHORTrad radiation transport module It uses short characteristics and is restricted to an equidistant grid and open boundaries at all surfaces new supergiant module Values o undefined default SHORTrad routines are deactivated o 1 SHORTrad routines are recognized by the compiler rhd_rad3d_toray_101 in rhd_1hdrad_module F90 rhd radiation 3 dimensions to ray loop 01 Category performance enhance
145. nary CONTENTS CONTENTS 3 CP ER 59 4 6 1 Installation of UIO UNIX Scripts en 59 4 6 2 Quick Examination of Files uiolook o 60 4 6 3 Transformation of Files uiocat lees 60 4 6 4 Information about Conversion Types uioinfo 61 4 7 IDL UIO Routines ee ee 61 4 7 1 Initialization of UIO Routines under IDL 63 a a e dt ie d UE dea 63 21 64 5 Control and Data Files 66 5 1 Model Files rhd sta rhd end rhd full o o 66 Sug hou amp PR EME Boe ACE eee Ao x E uode 67 DN RR E IRR SNR NEN RUNE ES 67 5 2 2 Contents of Individual rhd mean File Entry llle 69 Eh oh a EOR a Rd c 72 eo mae 72 5 8 2 Header 2 ooo oko Roo a URGERE Ux 73 5 3 3 Fundamental Model Parameters o e e e 74 A tee he Beek ate eee es E Oe 75 rrr 80 5 3 6 Opacitie llenos 80 5 3 7 Hydrodynamics Control HD and MHD 81 5 3 8 Tensor Viscosity Control ln 85 5 3 9 Dust Molecules Hydrogen Ionization General 88 5 3 10 Dust dustscheme dust_moment04 c2 2 2 20200 90 5 3 11 Dust dustschemezdust k3mon 03 02 0202 08 22 ee 91 5 3 12 Dust dustschemezdust binsOll leen 92 5 3 13 Radiation Transport Control len 94 5 3 14 Process Time Management 0 00 eee ee ee 100 5 3 15 Time Step Controll ooa ee 102 5
146. nergy density per volume respectively Each quantity q has its corresponding flux f q and possibly source term s q For convenience p v1 v2 v3 ei 2 are chosen as independent quantities The conserved quantities are purely algebraic combinations of these The 3D hydrodynamics equations including source terms due to gravity are the mass con servation equation Op Opwvl 2Opv2 Opv3 q 3 Ot 0x1 0x2 0x3 l the momentum equation pul pul vi P pul v2 pul v3 p gl gt pv2 TOS pv2 v1 Tap pv2 v2 P 53 pv2 v3 pg2 4 pu3 pv3 v1 pu3 v2 pv3 v3 P p 93 and the energy equation including radiative heating term Qrad Opeik peik P uh 9 peik P v2 0 peik P v3 1 vl g2 v2 93 v3 A ES Ot dal 912 913 p gl vl g2 v2493 v3 Qiaa 5 The pressure P is computed from density p and internal energy ei via a tabulated equation of state P P p d 6 For local models the gravity field is simply given by 0 j ol 7 g For global models it is given by o nr ag j 32 22 o 8 g3 ET with GM d 9 dri Here M is the mass of the star to be modeled ry and r are free smoothing parameters In addition there are equations for the non local radiation transport If grey opacity tables are used the opacities k are a simple function of e g temperature T and pressure P k K T P 10 and the source function S is given by S Bll 11 8 2 EQUATIONS The change in optical depth
147. nge do not have much meaning The implicit transport does not work efficiently yet It does not yield significantly larger time steps than possible with a sequence of purely explicit sub time steps Additionally it turns out that the hydrodynamics runs into trouble if a too large time step still well within the Courant condition is requested e real c raditereps With activated implicit radiation transport LHDrad module only the requested convergence accuracy of the iteration can be set e g with real c raditereps f E15 8 b 4 amp n Relative accuracy for radiation iteration u 1 amp cO Typical value 1 0E 03 2 0E 03 e real c raditerstep With activated implicit radiation transport LHDrad module only the step size of the iter ation can be restricted with e g real c raditerstep f E15 8 b 4 amp n Step size of radiation iteration u 1 cO Typical values 0 7 0 81 1 0 Allowed values are o 0 0 1 0 Restricted step size o 1 0 No restriction standard step size o gt 1 0 Extra large steps 100 5 CONTROL AND DATA FILES This value has to be chosen carefully to get optimal performance Is the step size too small the convergence is safe but too slow A too large step size inhibits convergence and leads to a decrease in the time step which results in a bad performance too real c radtvisdtau Using the LHDrad module the limit in delta optical depth rho kappa dx below which the radiative temperat
148. ngle ray along x1 axis not enough to specify fluxes in all directions o x2 N 1 one single ray along x2 axis not enough to specify fluxes in all directions o x3 N 1 one single ray along x3 axis not enough to specify fluxes in all directions o oktaeder N 3 default octahedron o tetraeder N 4 tetrahedron o cube N 4 o ikosaeder N 6 icosahedron o dodekaeder N 10 dodecahedron o list 01 list 01 3 Choose ray systems from a list oktahedrons tetrahedrons If character radraybase isset to unity the rays will only be aligned to the axes or diag onals and thus avoid the time consuming interpolation step of the short characteristics method 5 3 Parameter File rhd par 97 Several other choices are possible which are meant for test purposes only Choosing one of the five Platonic solids Ops German Greek names only so far means that the 3 to 10 rays are equally distributed over the solid angle from the center to each corner of the respective solid integer n_radtheta Using the MSrad module the ray directions have to specified in a different way The number of ray sets in theta direction can be chosen with e g integer n radtheta f 14 b 4 amp n NTHETA Number of ray sets in theta direction c0 2 2 integer n radphi Using the MSrad module the number of ray sets in phi direction can be set e g with integer n radphi f I4 b 4 amp n NPHI Number of ray sets in phi direction c0 2 2
149. not implemented for all machines F90_DEBUG Debugging level o 0 No extra debugging information produced full optimization is chosen default o 1 standard debugging mode typically switch g instead of fast o 2 other debugging or array checking modes possible if implemented for the requested machine F90_LHDRAD LHDrad radiation transport o 0 do not activate compile and link this module default o 1 activate this radiation transport module F90_MSRAD MSrad radiation transport o 0 do not activate compile and link this module default o 1 activate this radiation transport module F90_SHORTRAD SHORTrad radiation transport o 0 do not activate compile and link this module default o 1 activate this radiation transport module F90_CHEM CHEM module chemical reaction networks o 0 do not activate compile and link this module default o 1 activate this source step module Setting this variable to 1 will set F90_DUST 1 The compiler is then called with Drhd_chem01 F9O_HION HION module time dependent hydrogen ionization o 0 do not activate compile and link this module default o 1 activate this source step module Setting this variable to 1 will set F90_DUST 1 The compiler is then called with Drhd hionO01 F90 DUST DUST module o 0 do not activate compile and link this module default o 1 activate this source step module 26 3 PROGRAM FILES INST
150. ns are allowed in the radiation transport step the temperature in the outer corners of the box tends to become very small To artificially increase the effect of radiative heating the parameter real r1 rad can specify a radius beyond which only positive contributions of the radiative energy transport to the energy budget are taken into account This ruins the conservativity of the code in these layers and should be applied only in very remote corners which are then considered only as sort of extended boundary region but not as part of the real model The parameter can be specified e g with real ri rad f E15 8 b 4 n Outer radiation transport radius u cm amp c0 70 0 Not used 8 00000e 13 A value of 0 0 default or below deactivates this feature e real nu_rotation To transform onto a coordinate system rotation around the x3 axis a rotation rate can be specified with e g real nu rotation f E15 8 b 4 n Rotation frequency u 1 s 0 0 The potential is modified by adding terms due to a centrifugal force In addition a Coriolis force are applied during the hydrodynamics step 5 3 4 Boundary Conditions The boundary conditions at the six sides of the computational box cannot be specified indepen dently For the naming convention of the boundaries a gravitational acceleration in x3 direction is assumed Accordingly there is a bottom and a top boundary and four side boundaries All boundary conditions of the hydrodynam
151. nsion keyword gives the number of columns and rows in the form d 1 columns 1 rows The Holweger M ller Atmosphere is chosen as the following real world example for a file with a table in UIO format fileform uio form formatted convert ieee 4 version 0 0 1996 10 29 amp date 20 Feb 1997 18 40 45 system Sun0S machine saturn osrelease 4 1 3 osversion 3 hardware sun4m language IDL 4 0 program by hand character description d 0 3 f A80 p 1 b 80 d 13 Nov 1996 18 29 48 Holweger Mueller Atmosphere Hartmut Holweger amp Edith Mueller 1974 Solar Physics 39 19 30 table II empirical solar temperature stratification to fit solar spectral lines and limb darkening character history d 0 3 f A80 p 1 b 80 d 13 Nov 1996 18 29 52 Holweger Mueller Atmosphere from 1974 uio form 13 Nov 1996 18 29 52 conversion type added 20 Feb 1997 18 21 01 xi gt vmicro 20 Feb 1997 18 23 43 real teff f F6 1 b 4 n effective temperature u K texa T_ eff 5780 0 table atmosphere d 1 7 1 29 f X b 1 n Holweger Mueller Atmosphere amp cO Hartmut Holweger amp Edith Mueller 1974 Solar Physics 39 19 30 table II c1 Teff Sun 5780K real tauross f E9 2 b 4 n optical depth Rosseland u 1 real tau5000 f F7 3 b 4 n optical depth lambda5000 u 1 t logi0 real t f F7 0 b 4 n temperature u K real pgas f F6 3 b 4 n gas pressure u dyn cm 2 real pel f F6 3 b 4 n electron pressure u dyn
152. o a certain time step its values can be specified e g with integer endtimestep f I11 b 4 n total simulation time step number u 1 1234 This might be useful to advance the simulation up to a point shortly before a previous simulation crashed A value lt 0 cancels this halt condition it is not checked at all 102 5 CONTROL AND DATA FILES integer plustimestep If the initial model should be advanced by a certain number of time steps their number can be set e g with integer plustimestep f 111 b 4 n simulation advance time step number u 1 2000 A value lt 0 deactivates this halt condition it is not checked at all 5 3 15 Time Step Control In this group parameters to control the time step restrictions can be set They are important because decide about performance and stability of CO5BOLD They should be tested and adjusted for a simulation of a new type of object But all the dimensionless parameters can stay unchanged for a group of similar simulations Only the parameters with an explicit time dimension should be checked in all cases they scale with characteristic timescales and depend particularly on gravity real dtime start The initial time step recommendation of a simulation is usually taken from the start model file It can be overwritten e g with real dtime start f E15 8 b 4 n Start time step u s 1 0E 03 A value lt 0 0 means that the original value from the start model is used real dtime_mi
153. odynamics upwind parameter 01 Category performance enhancement The determination of the upwind direction can be done in one of two ways to get optimum performance with essentially the same results Values o 0 default if then else construction o 1 use a mask and the signum function rhd hyd roeid 101 in rhd_hyd_module F90 rhd hydrodynamics roe 1 dimension loop 01 Category performance enhancement The computation of the Roe fluxes can be done by either of two sets of routines to find the set which gives optimum performance with essentially the same results Values o 0 default lots of small routines acting on scalars inlining needed cache reuse is optimized o 1 routines acting on arrays more temporary arrays necessary vectorization is easier rhd roeid flux 101 in rhd_hyd_module F90 rhd roe 1 dimension flux loop 01 Category test By setting this switch an alternative way of computing the upwind centered Roe states is activated only for constant reconstruction for performance test purposes only do not activate Values o undefined default Use standard method to compute the Roe states 30 3 PROGRAM FILES INSTALLATION COMPILATION o defined Use non standard method to compute the Roe states rhd_bound_t01 in rhd_hyd_module F90 rhd bound timing 01 Category additional output Produce timing information for inner boundary routine central
154. oe not with hdscheme RoeMHD Usually the VanLeer reconstruction is a good choice If a more stable and diffusive scheme is needed take Minmod The PP reconstruction gives the highest accuracy However it tends to produce somewhat noisy models with small wiggles e g in the velocity The 2nd order piecewise parabolic reconstruction PP is not implemented in the MHD module By speci fying e g VanLeer Superbee it is possible to use the VanLeer scheme for the hydrodynamics scheme as such and Superbee only for the advection of additional quc quantities 5 3 Parameter File rhd par 83 real c_slopered When Drhd roeid slope 101 2 is set see Du a new extra stabilization mechanism can be activated If one of the reconstruction methods VanLeer Superbee or PP see Sect 5 3 7 is activated the slope can be reduced by averaging with the results from a MinMod reconstruction by setting c_slopered to a positive non zero value This value can be set e g with real c slopered f E15 8 b 4 amp n Slope reduction parameter in case of strong density contrast u 1 amp c0 0 00 off default 0 02 reasonable value 0 10 large value 0 02 Typical choices are o 0 0 Slope reduction switched off Original reconstruction is used o 0 02 Moderate slope reduction in case of large density jumps o 0 10 More pronounced slope reduction in case of strong density contrast This parameter is not recognized by the MHD module real c_
155. of COS5BOLD the leftover CPU time is computed by subtracting the used CPU time which is given by e time etime tarray in rhd mac sun module f90 from the specified total CPU time for the job real cputime_remainlimit Because COSBOLD needs some time to finish the last time step it should start exiting well before all CPU time is used up This amount of buffer CPU time can be specified e g with real cputime remainlimit f E15 8 b 4 n maximum remaining CPU time u s 2000 0 Its value depends on the size of the model and the speed of the machine more precisely the maximum CPU time per time step real endtime If the simulation should run up to a certain stellar time its values can be specified e g with real endtime f E15 8 b 4 n total simulation time limit u s 10000 0 A value lt 0 0 deactivates this halt condition it is not checked at all If this parameter is set to a non negative value a follow up simulation should not use the same parameter file it would stop immediately real plustime If the initial model should be advanced by a certain stellar time span this value can be set e g with real plustime f E15 8 b 4 n simulation advance time u s 5 0E 07 A value lt 0 0 cancels this halt condition it is not checked at all This condition assures if it is the only one that all individual simulation runs cover approximately the same stellar time integer endtimestep If the simulation should run up t
156. ol f E15 8 b 4 amp n Surface cooling u 1 amp c0 70 0 default 0 0 real c radscool Parameter for surface cooling option N_radband lt 0 of MSrad It can be activated with the parameter real c radscool f E15 8 b 4 amp n Surface cooling u 1 amp c0 70 0 default 0 0 real c radtinci Temperature of black body that emits incident radiation default 0 0 MSrad only It can be used e g with 5 3 Parameter File rhd par 99 real c_radtinci f E15 8 b 4 amp n Temperature of black body that sends incident radiation u K amp c0O 0 0 default 0 0 e real c_raddinci Dilution factor R d of black body that emits incident radiation default 0 0 MSrad only It can be used e g with real c_raddinci f E15 8 b 4 amp n Dilution factor of black body that sends incident radiation u 1 amp c0 0 0 default 0 0 e real c_radimplicitmu So far only the LHDrad and the SHORTrad module support implicit radiation transport It can be activated with the parameter real c_radimplicitmu f E15 8 b 4 amp n Implicitness parameter for radiation transport u 1 c0 0 0 explicit 0 5 time centered 1 0 fully implicit 0 0 Allowed values are o 0 0 Fully explicit radiation transport possible with all modules o 0 0 C 1 0 Partly implicit radiation transport o 0 5 Radiation transport time centered o 1 0 Fully implicit radiation transport Values outside this ra
157. on the machine Leaving this field empty means that the default is chosen that is build into the local UIO module If the type ieee_4 is supported which is always the case so far it should be chosen This parameter can be specified but there is no corresponding output file in CO5BOLD yet 5 4 Additional Control and Status Files rhd stop rhd cont rhd done and rhd dump Before each time step COSBOLD checks in the working directory whether the file rhd stop exists If it has been generated e g with touch rhd stop the code exits gracefully i e it produces a proper final model which can be used to restart the code This method of stopping a simulation is to be preferred over a simple kill or qdel command because it allows to analyze the state of the model just at the end of the simulation and a smooth restart Before the restart the rhd stop file has to be deleted The simulation can be continued by just initiating a new run If the file rhd cont exists at the beginning of a simulation the code tries to resume an interrupted computation The initial model will not be taken from the start model file nfile start but from the final model outfile end The data for the full and the mean file is not written into new files but will be appended to the existing ones In this way a simulation can be interrupted and continued in a fairly safe way It is possible to analyze the final model and to changes values in the parameter file Keep in mind t
158. on times given by CO5BOLD is not exact 3 7 18 Sun SunFire CO5BOLD has been used on the SunFire machines firel fire2 and fire3 in Uppsala with compiler version Sun WorkShop 6 update 2 Fortran 95 6 2 2001 05 15 and later An older version was not able to compile CO5BOLD properly Information about Fortran and the Sun compiler can be found on the Sun Fortran data sheet pagd under Documentation ngstr m Sun cluster Important switches are openmp Enable OpenMP fast xvector yes no General optimization On the Sun the fast option switches on more or less all optimization features of the compiler That works reasonable well However during the compilation of gasinter_routines f90 and only there the switch xvector no is required This is done automatically in the Makefile inline Optimization routines that should be inlined see Sect DMSrad_raytas 2 Optimization choose non default version of loop in SUBROUTINE raytas in file MSrad3D F90 See Sect Drhd_shortrad_formal_101 1 Optimization split loop for exp dtau computation into two loops See Sect 19http developers sun com sunstudio products previous fortran datasheet htm es ttp www uppmax uu se ComputerSystems AngstromSunCluster SunCluster htm 3 7 Optimization Compiler Switches 49 e Drhd shortrad dir1 101 1 Optimization Transpose arrays and use routine rhd shortrad dir3 for rays in x1 direction See S
159. oo Of course a complete control of COS5BOLD is only possible after studying of the meaning of the parameters in detail e g by reading the following pages AND unfortunately an accompanying look into the source code itself 5 3 Parameter File rhd par 73 5 3 2 Header The header of the parameter file contains information about the file format and contents The description array can be used to specify the goal of the simulation special model characteristics or important parameter changes compared to a previous or standard model The history array may contain the predecessor of the parameter file to simplify a tracing of parameter changes fileform uio The header of the parameter file e g fileform uio form formatted convert ieee 4 date 01 01 2002 amp program by hand can be abbreviated to fileform uio form formatted convert ieee_4 which indicates that the file is in UIO form and Fortran formatted ASCII The speci fication of the conversion type convert ieee_4 is more relevant for unformatted files These terms should not be changed But it can be of interest to append e g the date of the last modification e g date 01 01 2002 character file_id The file identification string character file id f A80 b 80 n File identification rhd parameter indicates the intended use of the file as parameter file for the RHD code COS5BOLD Do not edit character description The h
160. ook up table are necessary Refer to Leenaarts amp Wedemeyer Bohm 2005 for more details 5 8 HION Output The HION module can produce two types of output The first is the standard output of the quc ar rays in the full and end files holding the level populations This is all that is needed to restart a computation The second optional output is a HION specific output system that generates files in UIO format after a prescribed number of simulation timesteps or alternatively after a pre scribed time interval see parameter dtime out hion Output after a fixed number of timesteps is mainly useful for debugging The files are named HION aaaa bb cccc out with aaaa either step or time indicating output after a fixed number of timesteps or a fixed amount of solar time bb the atom identifier and cccc the number of the output file e g HION step H 0001 out The HION files can be read with the IDL uio dataset rd C filename function The result ing data structure contains mass density gas temperature electron density of the atmosphere as well as the axes in the atmos substructure The atom substructure contains the time dependent populations ntd the LTE populations nstar the total population ntot a number of atomic pa rameters and 1 ntr and c ntr arrays of the z index per column where the radiation temperature in a transition starts to deviate from the gas temperature Refer to Leenaarts amp Wedemeyer B hm 2005 fo
161. pe i e it may be a scalar integer value or a 1D character array or a 3D real array together with some routines for the basic handling of the variables I O in UIO format construction and modification of variables The module uio varfile module f90 contains a type definition for a file built of UIO flexible variables together with routines for the handling of these files 4 5 2 Use of UIO Modules in Fortran90 To make the UIO routines available in a Fortran program the appropriate modules have to be specified in a USE statement At maximum five modules play a role The uio bulk module contains the main part of the UIO routines and also uses the relevant sub modules Instead of uio bulk module the module uio table module is used if the UIO table routines are needed The modules uio siz module and uio nam module contain specifications about the size of some arrays and the length of strings and the names of types and keywords respectively The module uio filedef module contains some definitions in addition to the basic UIO standard as e g the label names which delimit a data set label dataset and label enddataset A typical case for the use of UIO modules is use uio bulk module use uio siz module use uio nam module 4 5 3 Compiling and Makefiles For a certain platform it is necessary to change the name of the module file with the machine dependent routines uio mac module f90 in a Makefile for the UIO routines For this
162. pi exp rhd shortrad operator exp rhd_shortrad_dtauop F90MODULES FOOTIME DMSrad raytas 1 For the SX 8 the configure scripts gives the output sxf90 EP P openmp Chopt sx8 W1 Z 8G m dw floatO Wf L nostdout L fmtlist map summary transform L inclist L mrgmsg M noflunf M noinv Drhd_r03 Drhd shortrad step t01 Drhd shortrad formal tO01 DMSrad raytas 1 Drhd_hyd_entropyfix_p01 1 Drhd_hyd_upwind_p01 1 Drhd hyd roeid 101 1 Dgasinter 101 2 3 7 16 SGI Origin CO5BOLD has been compiled and tested on up to 8 processors on the SGI 2000 machine at TAC in Copenhagen and the SGI 3800 machine at the Nsa in Link ping More recently the code was used on the UKAFF machines see Sect 3 7 17 and the computers at CINES See e g the excellent SGI Fortran90 manual Information about the CINES machines can be found under CINES or CINES Introduction Important switches are e macro expand Enable macro expansion mp Enable parallelization with OpenMP directives INLINE aggressive 0N INLINE list INLINE preempt 0N General keywords for in lining http www nsc liu se systems sgi3k 46 3 PROGRAM FILES INSTALLATION COMPILATION e INLINE must Optimization routines that should be inlined see Sect 3 7 2 e Ofast OPT Olimit 0 General optimization On older compiler versions 03 was the achievable optimum e IPA plimit 5500 Even more optimization This option requires lots of
163. piled e g with the Intel compiler see Sect However the factor is not prohibitive For not too demanding test runs the gfortran compiler can already be useful http g05 sourceforge net http www g95 org http gcc gnu org fortran 1 3 7 Optimization Compiler Switches 45 3 7 15 NEC SX 5 SX 6 SX 8 First attempts to compile CO5BOLD on neSH at the Rechenzentrum Kiel and on hwwsx5 at HLR Stuttgart An environment variable has to be set to F_RECLUNIT BYTE before execution of a program to enable UIO to compute proper record lengths The cross compiler on sunsrv or crossi is called with sxf90 Thus the environment variable F90 COMPILER sx90 has to be set before running the configure script No optimized version of COBBOLD has been achieved yet Some maybe useful switches are e sx5 generate instructions for SX 5 Use sx6 or sx8 when appropriate e C vopt normal optimization in vector mode e Wf M noflunf M noinv M noinexact M setall suppress some exceptions e P openmp parallelization with OpenMP e Ep call cpp preprocessor e pi exp inlining of a list of routines see Sect e dw floatO no special environment variable use internally and in files the 4 Byte big endian format For the SX 5 the compiler flags in the configure script are FOOFLAGS C hopt sx5 dw floatO Wf L nostdout L fmtlist L inclist L mrgmsg L transform M noflunf M noinv M noinexact M setall
164. r box id f A2 b 2 n Block identification z2 label endbox label box date 25 05 2001 09 41 30 170 character box id f A2 b 2 n Block identification z3 label endbox label box date 25 05 2001 09 41 30 260 character box id f A1 b 1 n Block identification r label endbox label box date 25 05 2001 09 41 30 359 character box id f A80 b 80 n Block identification Z label endbox label enddataset date 25 05 2001 09 41 30 489 There a six sub blocks delimited with box and endbox labels They contain surface intensity and flux arrays rad averages in the 23 plane z1 the 13 plane z2 the 12 plane z3 and over spherical shells r and a 2D slice through the model z 5 2 File with Additional Data rhd mean 5 2 2 Contents of Individual rhd mean File Entry 69 An individual box inside a dataset entry in a mean file can have e g the following contents describing horizontal averages in a plane parallel model With uiolook chro2D03c008_01 mean less you get this and more label box date 06 11 2002 17 58 05 533 character box id f A2 b 2 n Block identification integer dimension d 1 2 1 3 f I7 p 6 b 4 real real real real real real real real real real real real real real real real real time f E13 6 b 4 n time amp u s time db f E23 15 b 8 n time amp u s integer itime f I10 b 4 u 1 xci d 1 1 1 1 1 1 f E13 6 p 4 b 4 u cm amp
165. r does not affect the result of the computation but the memory usage and performance Smaller and more chunks may result in an optimum cache usage and need the smallest amount of memory but result in additional overhead due to frequent subroutine calls Bigger and less chunks are to be preferred for vector machines and processors with large caches Very rough guide values may be o 2500 Pentium III Core 2 Duo processor o 20000 RISC processor o 100000 Vector machine Note For simulations with activated OpenMP on a parallel machine the chunk size has to be made small enough to allow at least as many chunks as processors available This is particularly important for models with a small number of grid points e g 2D models An example is given for the Hitachi SR8000 in Sect real c visdrag This viscosity parameter controls the drag force which is if requested applied inside the hydrodynamics routines themselves It does not act on velocity gradients as usual viscosity but applies a force proportional to the velocity itself but with the opposite sign The amount can be specified e g with real c visdrag f E15 8 b 4 amp n Drag viscosity parameter u 1 0 001 The value gives the fraction the velocity is reduced per time step Therefore reasonable values lie between 0 0 and 1 0 In almost every case the drag forces will be switched off c_visdrag 0 0 If e g strong pulsation have to be damped in the initial phase of a simulation
166. r more details 117 6 Running a Simulation 6 1 Quickstart How to Run COSBOLD The generation of a start file and the modification of the parameter file is a somewhat complex process In short the following steps have to be performed 1 2 Produce an executable rhd exe see Sect 3 1 and put it into your working directory Choose a start model e g the final model of an earlier simulation or a model produced with an IDL routine Edit the parameter file rhd par typically you will start with an existing file and edit it You should check that the paths and names of EOS opacity and start file are set correctly Watch the username For details about the parameter file see Sect 5 3 1 Start the simulation with nice nohup rhd exe gt rhd out amp You can see how the simulation proceeds with tail f rhd out The other data files usually are in a binary format this can be changed to ASCII for matted in rhd par Their contents can be read and analyzed with IDL routines see Sect 4 7 3 For machines with batch queue there is a script which can handle an entire sequence of simulations see Sect 6 2 118 6 RUNNING A SIMULATION 6 2 Running CO5BOLD on a Machine with Batch System For longer simulations it is inconvenient to restart the individual jobs by hand This task is done by a script originally from Hans G nter Ludwig Its basic function is sketched in Fig 6 CO5BOLD
167. r some simple linear test problems Values around 0 5 are recommended for fully non linear simulations e real c courantmax A typical Courant factor for each 1D hydrodynamics step can be specified with e g real c courantmax f E15 8 b 4 n maximum HD Courant factor u 1 amp cO range C Courant lt C Courantmax lt 1 0 typically 0 9 0 8 From the minimum cell crossing time of a partial wave and this factor an upper limit for the current time step is computed If this limit is exceeded the computation is interrupted and resumed with a smaller time step based on c_courant Usually this parameter should be restricted by c_courant c_courantmax lt 1 0 A value around 0 8 appears to be a good choice e real c hydexpcourant In addition to the usual Courant condition one could restrict the maximum expansion between two adjacent grid cells with e g real c hydexpcourant f E15 8 b 4 n HD expansion Courant factor u 1 amp cO range 0 0 lt C_hydExpCourant lt C hydExpCourantmax typically 0 3 0 2 e real c hydexpcourantmax This parameter can be set e g with real c hydexpcourantmax f E15 8 b 4 n HD max expansion Courant factor u 1 amp cO range 0 0 lt C hydExpCourant lt C hydExpCourantmax typically 0 5 0 3 104 5 CONTROL AND DATA FILES The pair c_hydexpcourant c_hydexpcourantmax works analogously to the pair c_courant c_courantmax real c_maxeichange The relative change in internal du
168. reasonable default values To find the combination with the optimal performance you should look into Sect The macros are sorted into different categories Some activate a certain feature like a radiation transport module or the dust module They have to be selected by the user typically via environment variables and the configure script see Sect 3 5 each time the code is compiled for a certain purpose Other macros are meant to improve the performance by offering the choice between e g different loop structures or case distinctions These macros are set by the configure script to the best knowledge of the author s Ideally they should be checked and modified if necessary each time CO5BOLD is compiled on a new machine It should be save to modify these settings the results between runs with different settings should only differ slightly due to round off errors Some macros select between different numerical approximations A change here should be visible in a more or less drastic change of the results of a simulation Usually the default values should be accepted Other settings typically only exist to allow the comparison with older versions of COSBOLD or because there are new developments going on which have not yet managed to become the default A couple of macros only activate timing measurements and result in additional output Some of them are not thread save und should only be activated for runs on one thread as done by the confi
169. resolved To cover them properly a sampling rate of 10 sec or below is needed real dtime_out_end The interval between outputs into the end file can be set e g with real dtime_out_end f E15 8 b 4 n Output time step u s amp cO dtime out end lt 0 0 gt output only at very end amp ci dtime_out_end 0 0 gt output every time step amp ci dtime out end gt 0 0 gt output every dtime out end seconds and at end 1 0E 04 Allowed values are o lt 0 0 Output only at very end of run classical behavior o 0 0 Output at every time step Attention This can produce lots of I O operations and can take a long time However it will not produce a large file Instead the end file is written over and over again o gt 0 0 Output to end file approximately every dtime_out_end seconds and at the very end of the simulation The standard value is 1 0 not enabling any additional output into this file A value a reasonable factor smaller than real dtime out full seems appropriate real dtime out mean The interval between datasets in the mean file can be set e g with real dtime out mean f E15 8 b 4 n utput time step u s amp cO dtime out mean 0 0 gt no output 0 5E 06 Allowed values are o 0 0 No output to this file o 0 0 Output at every time step o gt 0 0 Output to mean file approximately every dtime out mean seconds Because the size of one mean dataset is much sma
170. ried about because they rarely will be used directly For accessing data in UIO format within IDL the initialization routine uio_init see Sect 4 7 1 and the high level reading routines uio_struct_rd pro uio dataset rd pro and uio datasetlist rd pro see Sect might suffice 4 7 1 Initialization of UIO Routines under IDL The directory containing the IDL UIO routines should be added to the IDL variable PATH This could be done by a program segment in the startup procedure like Try to determine language if n elements X TICKV eq 150 then langua WAVE else langua IDL Add user IDL directory to search path if langua eq IDL then begin amp addpath expand path C UIOPATH idl amp endif else begin amp addpath home supas024 uio idl home supas024 wave amp endelse if strtrim addpath 2 ne then path addpath path delvar addpath Alternatively one might want to set the IDL path variable accordingly like export IDL PATH UIOPATH idl for example in the bashrc file Or one just copies or links the UIO IDL routines to a location in the standard IDL search path It is reasonable to include the UIO initialization in the startup procedure as e g Initialize uio routines uio init progrm by hand IDL can handle the conversion types native ieee_4 ieeele 4 ieee idl xdr compare Tab 4 in Sect 4 3 1 Here ieee 4 is the defa
171. ring a single 1D hydrodynamics step can be used to restrict the time step by specifying real c maxeichange f E15 8 b 4 n maximum hydro energy change u 1 amp c r nge 0 1 1 0 typically 0 5 off O 0 0 5 The default is 0 9 Nevertheless since the Roe solver is constructed to handle shocks and rapid changes in density and energy this check is usually not needed It can be switched off by setting c_maxeichange 0 0 real c radcourant The radiation transport routines are subject so time step restrictions too And in typical scenarios its the radiative timescale are the shortest one and poses the tightest restriction Contrary to the hydrodynamics routines the timescale relevant for the stability of the radi ation transport scheme can only be estimated using the characteristic timescale of a small sinusoidal temperature disturbance with a wavelength of the grid size in a homogeneous background and grey radiative energy exchange The radiative Courant factor can be set e g with real c radcourant f E15 8 b 4 n RAD Courant factor u 1 amp cO range 0 0 lt C_radCourant typically 1 0 2 5 If the estimate of the timescale would be correct a value of 2 0 would cause the temperature fluctuation on the shortest scale to flip its sign setting the absolute stability limit A value of 1 0 would lead to a damping of theses fluctuations within one time step But in practice even higher values for example 2 5 show a reasonabl
172. rloop 16024 133010 687500 8 300717 SHC formal exp 28014 9014 280273 0 321778 5 6 Chemistry Input 115 SHC formal exp expl2t 28014 3950 409912 0 141016 SHC formal dir3 36083 63222 242188 1 752134 SHC time dir3 36083 19676 009766 0 545299 SHC formal limitei 16024 1306 419922 0 081529 SHC step dtime final 16024 12730 129883 0 794441 SHC formal dir2 11959 22205 000000 1 856761 SHC time dir2 11959 5731 149902 0 479233 SHC formal diri 4044 10674 429688 2 639572 SHC time diri 4044 1893 760010 0 468289 SHC step dtime final output 181 8620 870117 47 629116 Radiation trans output only 20 335 929993 16 796499 In this example the value for the overall time rhd code 410 830017 sec is not useful because of an overflow in the counter However it is evident that the radiation transport consumes most of the time 243729 000000 sec followd by the hydrodynamics routines 48944 660156 sec and the tensor viscosity routines 25446 400391 sec Some of these values are split further 5 6 Chemistry Input The number densities of the chemical species must be provided as cell centred quantities que in cm see Sect 3 6 The array UIO headers must be named following this example Number density of H2 The chemistry input file contains all data for the reaction network It is a text file with a strict format following the UMIST 99 ratefile standard FORMAT 14 5 48 1X 2 1X A4 1X 1PE8 2 3X 0PF5 2 2X 0PF8 1 A16
173. rmance But the odd operator might be saver to use Values o 0 simple test operator fast but results are utterly useless o 1 case distinction with if then else construct case distinction with masks weights 0 0 or 1 0 0 1 2 o 3 case distinction with if then else construct slope reduction of source function 4 case distinction with masks weights 0 0 or 1 0 slope reduction of source function 5 case distinction with if then else construct modified slope reduction of source function o 6 default case distinction with masks weights 0 0 or 1 0 modified slope reduction of source function o 8 test version rhd shortrad operator 102 in rhd shortrad module F90 rhd short characteristics radiation operator loop 02 Category performance enhancement Select the way the short characteristics operator is accessed Values o 0 default The routine with the short characteristics operator is called within a loop and should be inlined o 1 The program fragment with the short characteristics operator is included No inlining necessary 3 6 Compiler Macros 33 e rhd_shortrad_dtauop_101 in rhd_shortrad_module F90 rhd short characteristics radiation delta tau operator loop 01 Category performance enhancement Choose type of short characteristics tau coupling operator Values o 1 case distinction with if then else construct default if rhd_shortrad_operator_
174. rt characteristics It can be used together with OpenMP and should cause no noticeable performance loss Values o undefined default no timing information o defined call subroutines to measure elapsed time rhd shortrad step t01 in rhd_shortrad_module F90 rhd short characteristics radiation step timing 01 Category additional output Produce timing information for main short characteristics routine It can be used together with OpenMP and should cause no noticeable performance loss Values o undefined default no timing information o defined call subroutines to measure elapsed time MSrad_raytas in MSrad3D F90 Matthias Steffen radiation ray tau s Category performance enhancement Values o 0 default Loop with IF THEN ELSE o 1 Loop with ABS SIGN o 2 Loop with MIN MAX 3 7 Optimization Compiler Switches In this section some mandatory or useful compiler flags are described These have different functions Enable necessary macro processing expansion for the F90 files Force proper handling of binary I O Choose module for radiative transfer Activate module for dust formation and or magnetic field transport Enable parallelization with OpenMP directives Choose a version of a subroutine or loop which is optimized for a specific architecture Tell the compiler if and what to inline Improve the general performance 3 7 Optimization Compiler Switches 35 3 7 1 General OpenMP settings To activate
175. rt of this document To use the UNIX scripts and the makefile you need a global system variable UIOPATH pointing to this directory The path to the shell scripts and to the man pages should be added to your shell path variables e g in one of the login scripts C shell cshrc uio setenv UIOPATH HOME uio setenv PATH PATH UIOPATH bin setenv MANPATH MANPATH UIOPATH man dp PER Korn shell kshrc F LO UIOPATH HOME uio export UIOPATH PATH PATH UIOPATH bin export PATH MANPATH MANPATH UIOPATH man export MANPATH xk 56 4 UIO DATA FORMAT File contents uio base module f90 Collection of basic modules uio mac module f90 Possibly machine dependent routines Standard version all machines uio mac ieee module f90 Machine dependent routines IEEE format uio mac sun module f90 Machine dependent routines Sun SGI Linux HP uio mac intel module f90 Machine dependent routines Linux Intel little endian uio mac crayts module f90 Machine dependent routines CRAY uio mac crayxmp module f90 Machine dependent routines CRAY uio mac decalpha module f90 Machine dependent routines alpha uio mac hitachi module f90 Machine dependent routines Hitachi uio bulk module f90 Main part of UIO routines uio filedef module f90 Standard file descriptors and labels uio table module f90 Table manipulation routines uio var module f90 definition and handling of
176. s IBM compiler documentation IBM XL Fortran especially IBM AIX compiler information centerT Another source of the compiler documentation Documentation for AIX Systems especially IBM XL Fortran for AIX Version 8 1 1 Library Particularly useful hints Porting Programs from the Crays to the sp The compiler to be used for OpenMP runs is called with x1 90_r which binds the object files to the thread safe components IBM documentation For scalar code x1 90 might be sufficient Important switches are e qsuffix f f90 qsuffix cpp F90 To tell the compiler about the existence of Fortran90 and to enable the preprocessing for files with suffix F90 e qextname flush etime Append underscore to both routine names The non standard routine call system used by the uio mac sun module is recognized automatically e WF Drhd r03 The compiler does not send switches starting with D to the preprocessor but tries to interpret it itself unlike all other compilers Therefore each switch e g Drhd r03 has to escaped with WF as e g WF Drhd_r03 e q64 Activate the 64 bit mode In the default 32 bit mode a very small model with total memory requirements far below the 2 GByte limit might run However experienced IBM users might experiment instead with the compiler switches bmaxstack bmaxdata and qsmallstack with the UNIX commands limit or ulimit or with the settings in the header of the batch scr
177. se all data of the particular time step n will be provided in the structure FUL Loading more than one timestep from the same file could be achieved as follows 7 2 CO5BOLD Data in IDL 123 IDL gt uio_openrd nc modelfile outstr ierr IDL gt for i 0 ntime 1 do begin amp IDL gt ful uio dataset rd modelfile channel nc ierr ierr outstr err msg amp IDL gt endfor amp IDL uio elosrd nc Again this operation would cause an error if the wanted time step is not contained in the file Via checking the error flag ierr of the routine uio dataset rd such errors can be avoided This way it is unnecessary to know exactly of how many time steps the model file consists IDL gt uio openrd nc modelfile outstr ierr IDL gt i 0 IDL gt repeat begin amp IDL gt ful uio dataset rd modelfile channel nc ierr ierr amp IDL gt if ierr eq 0 then begin amp IDL gt Do the data processing here IDL gt i i 1 amp IDL gt endif else begin amp IDL gt print IDL gt Reached EOF amp IDL gt endelse amp IDL gt endrep until ierr ne 0 or EO0F nc IDL gt uio_closrd nc To read a number of entries from a list of files in sequence the routine uio_datasetlist_rd pro see Sect 4 7 3 is appropriate 7 2 3 Loading the Equation of State IDL gt eosfile eos dat par eosfile IDL gt tabinter_rdcoeff eosfile eos The table for the equation of state is provided in the structure EOS
178. sus double precision Usually the files containing the hydrodynamics and EOS data use 4 byte to represent a single number and most of the computations within CO5BOLD are performed in single precision except for certain routines in e g MSrad or some dust modules To switch to double precision everywhere one has to deal with the binary files and force the transformation of single precision variables to double precision during the compilation Compiling all COSBOLD files with such a switch produces problems with the UIO modules there would be a name conflict between the routines that usually deal with double precision reals and those that are written to deal with single precision reals and are now forced to pretend to be also a double precision version Therefore one should compile the UIO routines and the rest with separate settings e g for the Intel compiler configure make UIO export F90_PREFLAGS r8 fpconstant configure make Code compiled in this way cannot read anymore single precision binary UIO files However there are no problems with the opacity tables ASCII files and formatted UIO files To make existing single precision binary UIO files readable one could transform them to the formatted version with uiocat see 4 6 3 e g like uiocat f formatted o rhd ascii sta rhd binary sta New start models could be written in double precision binary UIO format directly using the double flag in the IDL routine rhd_wrboxd
179. t needed but some machines e g SUN1 do not like this index arrangement o 1 Transpose arrays and use routine rhd_shortrad_dir3 for rays in x1 direction The extra step for the transposition of some arrays and the reverse procedure needs some time But now the routine with the optimum index ordering can be used e rhd shortrad dir 102 in rhd_shortrad_module F90 rhd short characteristics radiation direction loop 02 Category performance enhancement OpenMP Determine position of PARALLEL statement relative to outer loop in rhd_shortrad_dirX Both settings give the same results but might show a different performance on a specific machine Values o 0 default PARALLEL statement inside of outer loop o 1 PARALLEL statement outside of outer loop 34 3 PROGRAM FILES INSTALLATION COMPILATION e rhd_shortrad_lambda_101 in rhd_shortrad_module F90 rhd short characteristics radiation lambda loop 01 Category feature activation Handling of extra arrays to allow partially implicit Lambda iteration Values o 0 default Only fully implicit Lambda iteration allowed or fully explicit treatment o 1 Also partially implicit Lambda iteration allowed rhd shortrad formal t01 in rhd_shortrad_module F90 rhd short characteristics radiation formal timing 01 Category additional output Produce timing information for routine which gives the formal solution of the radiation transport equation with the help of sho
180. the source code file rhd F90 A bus error occurred whenever the system routine flush was trying to flush an empty file buffer The temporary work around was simply to add a write statement before every call of flush This made the log file look less nice but did the job Now the few flush statements that are not necessarily preceded by a write statement are removed The main goal was to investigate the scaling of the performance of COSBOLD with the number of processors This was done only for the MSrad module considering local surface convection models Two model sizes were tested a small one with 125x125x81 grid points employing non grey radiative transfer 4 frequency bands and a large one with 315x315x81 grid points employing grey radiative transfer Rather short runs of 10 small model and 3 large model time steps were performed Even for the large model the memory demand was ca 800Mb which is very modest considering that every sub node of the machine consisting of 4 processors has 2Gb of memory The results are summarized in the following three figures The black lines give the scaling of the total time the green lines the scaling of the time needed by the hydrodynamics routines and the red lines the scaling of the radiative transfer routines The scaling is presented as the increase of processing time per processors as the problem is distributed among more and more processors The times are normalized to the
181. the start model file But sometimes is simulation is to be started with the final model of a previous run but should start at time 0 0 This can be achieved by setting the start time with real starttime f E15 8 b 4 n Start time u s 0 0 Allowed values are o gt 0 0 Set the initial time of the simulation to this value and override value from start model o lt 0 0 default Take the initial time from start model integer starttimestep The start time step count of a simulation is usually taken from the start model file But sometimes is simulation is to be started with the final model of a previous run but should start at time step 0 This can be achieved by setting the start time step count with integer starttimestep f I11 b 4 n Start time step number u 1 0 5 3 Parameter File rhd par 101 Allowed values are o gt 0 Set the initial time step of the simulation to this value and override value from start model o 0 default Take the initial time step count from start model real cputime Because of the long simulation time usually CO5BOLD will run in some sort of batch mode which might impose limits on the execution time per run On a CRAY the CPU time that is left can be accessed with a special subroutine in call tremain in rhd mac cray module f90 On other machines it is possible to specify the allowed total time for the job e g with real cputime f E15 8 b 4 n CPU time u s 1000000 0 During the run
182. time dtime rad 1 750409E 01 dtime rad drhoei limit this all 6 667E 02 2 510E 03 6 276E 02 0 000E 00 n subdtime 2 minmax T 1 116348E 03 1 630658E 05 Main 1 3 ray direction 1 1 000000 0 000000 0 000000 Main 2 3 ray direction 3 0 000000 0 707105 0 707109 Main 3 3 ray direction 3 0 000000 0 707105 0 707109 Time step ratio dtime dtime_rad 1 836970E 01 dtime rad drhoei limit this all 6 353E 02 3 188E 03 7 971E 02 6 276E 02 114 5 CONTROL AND DATA FILES n_subdtime 8 minmax T 1 118540E 03 1 630164E 05 Main 1 3 ray direction 2 0 707105 0 707109 0 000000 Main 2 3 ray direction 2 0 707105 0 707109 0 000000 Main 3 3 ray direction 3 0 000000 0 000000 1 000000 Time step ratio dtime dtime rad 1 791384E 01 dtime rad drhoei limit this all 6 515E 02 3 894E 03 8 884E 02 4 814E 03 End of rhd_shortrad_step A simulation ends with e g Time step number itime 49050 time 2 6823742E 08 t job 1 273407E 06 2 End Computation Exit information Requested number of time steps done Exit status 0 In this case a file rhd done see Sect 5 4 is produced A messages like AK k k ak ak k K k K IIIA I I ICICI I I I ak 2k 21 21 25 21 21 21 3K K K A ACI II I 1 1 1 K K KK KK K FK
183. to anonymous structure datasetlist rd Read data from list of files and put it into an structure deform dim2st exkeyw exitrm exmtrm filcon getenv init meitrm memtrm mkcvls nc2nt openrd openwr pptrmt qmaadd qmadel rd rdfifo rdhdex rdhead rdlabl rdtab Skipda slhdex st2dim struct rd tabO tabe tabm tabr tabw uclose uopen vnanrm wf2rf wr wrfifo wrhdme wrhead wrlabl wrtab Determine the default output format for numbers Compose dimension string Extract value of keyword from table Extract one term from the input line Transform a list of items into its components Determine file contents list of all entries with its positions Get information about environment Initialization procedure for input output routines Merge the input term keyword value gt keyword value Merge a list of terms keywords and their values into a line table Make list with possible conversion types From column number or entry name find table entry number Open file for reading read header Open file for writing write header Print term table in pretty form Transform a string into a string with quotation marks if necessary Parse string inline and remove quotation marks if necessary Reading scalar and array data of all types Read file header Read header of variable and extract keywords Read header Read label Read table of integer real and or character data from fil
184. to parallelization e noinline Disables inlining This can simplify things With a proper choice of routine versions inlining is not really necessary anymore e 03 0limit General optimization with limited resource usage during compilation Some modules should only be compiled with 02 others compile even with 03 Onolimit The UIO modules and the string handling module should be compiled in debug mode A proposed compiling sequence is MSrad does not compile all other modules are activated 38 3 PROGRAM FILES INSTALLATION COMPILATION export F90_LHDRAD 1 export F90_MSRAD 0 export F90_SHORTRAD 1 export F90_DUST 1 export F90_MHD 1 export F90_PARALLEL openmp export F90_DEBUG 1 configure make UIO STR export F90_DEBUG 0 configure make 3 7 7 Hewlett Packard Itanium 2 The 2 processor system gunnar from Hewlett Packard is a dual Itanium 2 machine with two 900MHz ia64 CPU modules 4GB of RAM and 70GB user disk space The single processor performance of COSBOLD is very good On two processor the code runs even faster but just stops after a few time steps The number of time steps varies even for simulations with the very same start model and parameter file Therefore OpenMP should not be activated currently The compiler settings are somewhat similar to the settings of the HP V2500 system in Sec tion 3 7 6 e U77 Link proper library to make the machine understand e g call flush 6 e cpp yes S
185. triction The computed output intensity should be checked for the size of its fluctuations due to a possibly too large value of c radmaxeichange 5 3 Parameter File rhd par 105 e real c_radthintimefac In the LHDrad module only the radiative time step restriction due to energy changes can be relaxed further in the optically thin by specifying e g real c_radthintimefac f E15 8 b 4 amp n time scale reduction in optically thin u 1 amp c0 range 0 1 1 0 typically 0 5 0 60 A value lt 0 0 or real c_radtvisdtau lt 0 0 switches off this relaxation e real c_viscourant The tensor viscosity routines have their own time step restriction The recommended typical viscous time step can be set e g with real c viscourant f E15 8 b 4 n viscous Courant factor u 1 amp cO range 0 0 lt C_visCourant typically 0 5 1 0 better 0 25 0 5 As the corresponding viscous timescale is typically longer than the radiative one and even the Courant timescale from the Roe hydrodynamics routines this factor is often irrelevant The absolute upper stability limit is located at c viscourant 2 0 Values around 0 5 to 1 0 are more typical In some extreme cases in simulations of the solar chromosphere it has turned out that an even lower value 0 2 is necessary to prevent some spikes in the neighborhood of strong colliding shocks e real c viscourantmax The absolute upper limit for the viscous time scale can be set with re
186. twork HION Intel Itanium LHDrad 6 Linux little_endian 44 Loadleveler Macintosh magnetic fields 6 magnetohydrodynamics makefile configure script UIO MHD molecules 6 MSrad 8 23 B1 67 BO E E3 E9 79 PA cell centering NEC SX 5 SX 6 SX 8 OMP NUM THREADS OMP SCHEDULE opacities OpenMP activation in configure script chunk size OMP NUM THREADS 35 OMP SCHEDULE on Cray VX1 on Hitachi on HP on Linux gfortran on Linux Intel on Linux Pathscale on NEC on SGI on Sun operator splitting 6 output full data sets HION mean data PathScale PGI precision double single 132 que 26 7 BY 115 radiation transport 6 README rhd cont 111 rhd done rhd dump 111 rhd exe rhd out 111 rhd par 66 72 111 boundary conditions character bottom_bound 77 character chem_reacfile character chem_reacpath character description character dustscheme dust_bins_01 dust_k3mon_03 91 dust_moment04_c2 character dustschene 88 character eosfile 80 character eospath 80 character file_id 73 character grav_mode 74 character hdschene 81 character hdsplit character heat_mode 77 character hion_abufile character hion atomfile character hion datapath character hion_edensfile 90 character hion pffile character history 73 character infile_start 106 character opafile 80 character opapath
187. uction Sect 5 3 7 real c_slopered Sect are slightly modified or extended for the MHD module e character hdscheme With this parameter the type of the hydrodynamics scheme can be specified as in character hdscheme f A80 b 80 n Hydrodynamics scheme amp cO Roe approximate Riemann solver of Roe type amp ci RoeMagKin Roe solver kinetic magnetic field transport amp c2 None skip hydrodynamics step entirely Roe Possible values are o None The hydrodynamics step is skipped entirely for test purposes Note that in this case some initializations necessary for the generation of the mean file are omitted too o Roe default The standard Riemann solver of Roe type is activated This value will in almost every case be chosen 5 CONTROL AND DATA FILES o RoeMagKin The standard Roe solver is extended to transport passively a magnetic field This is a test implementation to check if the general magnetic field handling works For proper MHD simulations use RoeMHD instead o RoeMHD Compile the MHD HLL solver e character hdsplit With this parameter the type of the hydrodynamics operator directional splitting scheme can be specified as in character hdsplit f A80 b 80 n Hydrodynamics directional splitting scheme amp c0 123 default directional splitting amp ci unsplit new unsplit operator 123 Possible values are o 123 default The standard directional splitting is acti
188. ult and should be used as a standard Attention The IDL type long corresponds to the standard Fortran type integer The IDL types byte and integer are not known in standard Fortran and are therefore transformed to the IDL type long before writing in the IDL routine uio wr Be aware of The parsing and interpretation of the entry headers can only be done by scalar operations which are comparatively slow in IDL 4 7 2 Reading Data with uio data pro The IDL routine uio data and the IDL function uio d were the first set of high level routines to read UIO data in IDL They were useful for the easy reading of not too complex data files By now they are replaced by the routines uio struct rd and uio dataset rd see see next Section and Sect 7 The old routines allow the opening 64 4 UIO DATA FORMAT uio data mode open filename model dat uio data mode open filename model txt uio data mode open filename model dat family modi uio data mode open filename model txt family mod2 examination uio_data mode content uio_data mode files reading uio_data mode read value rho rho uio data value temp temp uio data value p p filename model dat uio data value p p family mod1 plot oi uio d p uio d t and closing uio data mode close filename model
189. unformatted unformatted Allowed values are o unformatted default fast compact possibly machine dependent output strongly recommended o formatted slow machine independent output big files character outconv mean The conversion type see Sect 4 3 1 of the additional data files can be specified e g with character outconv mean f A80 b 80 n Output file conversion amp c0 ieee_4 ieee_8 crayxmp_8 native ieee_4 The allowed values depend on the machine Leaving this field empty means that the default is chosen that is build into the local UIO module If the type ieee_4 is supported which is always the case so far it should be chosen 5 3 17 Additional Information Obsolete and Test Parameters e real abux This optional information parameter can be specified with real abux f E15 8 b 4 n hydrogen abundance number fraction u 1 amp cO standard solar mixture 0 90851003E 00 5 3 Parameter File rhd par 109 It has no practical consequences because the actually used chemical composition is deter mined by the files for equation of state and opacity e real abuy This optional information parameter can be specified with real abuy f E15 8 b 4 n helium abundance number fraction u 1 Y cO standard solar mixture 0 90850003E 01 It has no practical consequences because the actually used chemical composition is deter mined by the files for equation of state and opacity e real qmol
190. unk sizes which are set by the parameters n hydcellsperchunk and n viscellsperchunk see Sect 5 3 7 and Sect 5 3 8 T wo different models have been used one consisting of 128x128x192 grid cells the other of 252x252x188 respectively Grey radiative trans fer has been performed with the MSrad module Different values for the chunk size s have been assumed where the hydrodynamics and the viscosity parameter were set equal In all cases three time steps have been computed The results are shown in Fig 2 The number of resulting chunks for step HYD1 the values for HYD2 HYD3 and VIS are very similar total memory perfor mance and the wall clock duration of the hydrodynamics and the viscosity routines are shown as functions of the chunk size parameter s Clearly the number of chunks decreases towards larger chunk sizes whereas the required memory increases in particular for very large chunk size values 40 3 PROGRAM FILES INSTALLATION COMPILATION Performance test on Hitachi SRBODO at HLRS 4 18x128 192 3 time steps d 252x252x108 3 time steps y wT J norm OO 0 8 0 6 x b aa FA E m L a e a T pr Mer La oops on dad Jb Lal aa 4 1 i E n nt ge 1085 pr n 16 chunk size chunk size J la 13nn gw de J300 wi i n 2 1100 a LAE h 6 a e ls am i iz F y Lx uad A I E 14 i Taai LI 4 ry eurer ni E l Eo a de I Fa e D 7 z
191. ure viscosity temperature smoothing is to be applied can be set with e g real c_radtvisdtau f E15 8 b 4 amp n Optical depth limit for temperature viscosity u 1 0 1 The introduction of this temperature diffusion is a somewhat desperate and inelegant attempt to improve the behavior of the Greens function hot cells should be cooled cool cells should be heated This diffusion is necessary for not well resolved models It is switched off with c radtvisdtau lt 0 0 real c radtvis Using the LHDrad module the amount of the radiative temperature viscosity tempera ture smoothing can be specified e g with real c_radtvis f E15 8 b 4 n Temperature viscosity u 1 1 6 For well resolved models it should be switched off with c radtvis lt 0 0 But often its use is necessary 5 3 14 Process Time Management In this group several parameters can be set which control the start of the time counting during a simulation and the total length of a job If either one of the halt conditions below is met CO5BOLD finishes the current step writes a final model plus some final information to other files and stops execution For example on a CRAY one typically wants to use most of the CPU time given for an individual batch job In this case one can set e g real cputime remainlimit 2000 0 and the values for the other halt conditions to 1 0 or 1 e real starttime The start time of a simulation is usually taken from
192. urns out to become a quasi standard among a variety of machines Most workstations work internally with this format Some CRAYS which have a different internal data representation allow the hidden transformation between the internal and IEEE format during the I O process The UIO routines support this feature of CRAY FORTRAN compilers by means of a module uio mac module individually designed for two types of CRAY machines using certain CRAY specific system calls CRAY FFIO assign logic Nevertheless there is also a machine independent version of this module written completely in standard Fortran90 but providing less features than the machine dependent versions Besides the format the conversion type see table has to be specified The native conversion type is the internal binary data representation which is also standard for unformatted Fortran output If this representation happens to be conformal with the IEEE standard the conversion type ieee 4 should be used It gives the same data format but in the header of the file the term convert ieee_4 instead of convert native describes the data format precisely in a way also understandable by other machines On CRAY machines the native format is equal to the conversion type crayxmp_8 but also the conversion types ieee_4 ieee_4 limit and 52 4 UIO DATA FORMAT ieee_8 can be chosen The last three conversion types correspond to the CRAY internal types
193. uting the fluxes whereas the hydrodynamics step is possibly of at least second order in time and the time step has to be known in advance integer n_hydmaxiter The absolute maximum number of hydro iterations can be specified e g with integer n_hydmaxiter f 14 b 4 amp n Maximum number of hydro iterations c0 14 0 84 5 CONTROL AND DATA FILES If more iterations are needed the computation for the current time step is stopped and resumed with a smaller one Usually n_hydmaxiter will either be set to a value somewhat larger than the recommended number of iterations n_hyditer or to O which disables the check for too many iterations completely This can be safely allowed in many cases To disable the iteration of the hydrodynamics sub step set n_hyditer 0 integer n hydcellsperchunk In every directional sub step neighboring 1D columns are independent from each other They can be grouped and computed in chunks of arbitrary size The approximate number of grid cells per chunk can be specified e g with integer n hydcellsperchunk f I9 b 4 amp n Number of cells per hydro chunk amp cO0 0 gt one 2D slice at a time amp c0 1 gt minimum chunk size inefficient amp c0 2500 reasonable value amp c0 1000000000 maximum chunk size inefficient and memory intensive 20000 The exact number is determined at run time to get approximately equal sizes of the individual chunks The choice of this paramete
194. vated where the 1D operators for the individual directions are applied in the given order So far only the order 123 is possible o unsplit The standard Roe solver is applied However the changes from the indi vidual steps are computed from and applied to the same model configuration The result is an unsplit scheme e character reconstruction This parameter determines the order and aggressiveness of the reconstruction scheme with e g character reconstruction f A80 b 80 n Reconstruction method amp cO Constant ci Minmod VanLeer Superbee c2 PP Minmod Possible values are o Constant The run of the partial waves inside the cells is assumed to be constant A highly dissipative first order scheme results This values will usually only be used for test or comparison purposes o Minmod Chooses the smallest slope which still results in a second order scheme It is the most diffusive and most stable one in this class Oo VanLeer default The recommended second order scheme o Superbee The most aggressive stable 2nd order scheme It results in the steepest shocks which works well in some test cases but might be to difficult for the radiation transport module to handle o PP Chooses the piecewise parabolic reconstruction of the PPM scheme Piecewise Parabolic Method Colella amp Woodward 1984 Results in 3rd order accuracy for the advection This method can only be used with the standard hdscheme R
195. witch on the C preprocessor Note that all Fortran90 files have to end with 90 The F90 suffix does not seem to work e 0fast High optimization level And Ofaster is even higher e Dopenmp Onoautopar Try to enable parallelization with OpenMP directives disable auto parallelization The code compiles and runs fast but crashes after a few time steps A proposed compiling sequence is LHDrad DUST MHD do not compile export F90_MSRAD 1 export F90_SHORTRAD 1 configure make 3 7 8 Hitachi SR8000 Some information about the Hitachi compiler is herd The appropriate machine dependent UIO module is uio mac hitachi module f90 The appropriate machine dependent RHD module is rhd mac hitachi module f90 e contii99 Up to 199 continuation lines can be interpreted otherwise not more than 39 continuation lines are accepted e limit Limits the amount of time and memory for compilation 3 7 Optimization Compiler Switches 39 e opt ss use highest possible optimization level e nopredicate this option switches off a sub option activated by opt ss It is necessary to disable the predicate option because the code crashes otherwise segmentation violation The switch must appear after setting opt ss e pvfunc 2 heferences the pseudo vectorizing mathematical function and applies the tem porary array to reference the pseudo vectorizing mathematical function e omp parallel 1 parallelize based on OpenMP d
196. with 110 5 CONTROL AND DATA FILES real c_radtsmooth f E15 8 b 4 n Temperature smoothing parameter u 1 amp c0 70 0 no smoothing 0 5 reasonable smoothing 1 0 max smoothing 0 0 The smoothing can sometimes reduce the noise in the intensity images but causes amplifies some anomalies of the radiative Greens function Some cool cell just above the sharp sub photospheric temperature drop are not heated but cool further down Negative temperature spikes may result This smoothing should not be used anymore character radpressure In the LHDrad module there exists a simple prescription for the radiative pressure reason able in the optically thin which can be activated with character radpressure f A80 b 80 n Radiation pressure mode amp cO on off on Allowed values are o on Radiation pressure on o off Radiation pressure off The scheme is pretty slow and wrong in the optically thick Do not use real c radtintminfac In the LHDrad module The fraction the interpolated temperature at a point on the ray may exceed the minimum temperature at its four neighbors on the HD grid can be set e g with real c radtintminfac f E15 8 b 4 amp n Temperature interpolation parameter u 1 amp c0 1 0 only bilinear 1 1 reasonable weighting between min und bil 0 0 The introduction of this parameter was an attempt to reduce the negative cooling effect of a single hot cell on its cool neighbors It
197. y one might set the IDL path variable accordingly like export IDL_PATH UIOPATH id1 for example in the bashrc file before starting IDL Or you just make a symbolic link from the UIO IDL routines at their original location to a sub directory of the main IDL directory which should be in the IDL path anyway The initial single call of uio init is necessary in any case 7 2 CO5BOLD Data in IDL Important to know is that all operations can be performed in the command line of IDL This allows an interactive processing of COSBOLD data Moreover there are already prepared IDL scripts for this purpose but most of them are rather complex and still have to be edited e g changing file names Huuhh For the beginning it is more clear to use single commands We give a short overview of some essential commands 7 2 1 Loading the Parameter File IDL gt parfile mymodel par IDL gt par uio struct rd parfile All control parameters are provided in the structure PAR 7 2 2 Loading CO5BOLD Data full sta end IDL gt modelfile home user mymodel full amp n 0 IDL gt ful uio dataset rd modelfile n n First the name and full path if not in the actual directory of the model file and the wanted time step should be defined Here time step means the consecutive number of the model snapshot in the file Declaring a time step number greater than the number of snapshots contained in the file will cause an error Otherwi
198. y is an array it may be necessary to allocate memory call uio exkeyw termt ntt dimna dimstr call uio st2dim dimstr ilow iup ndim ndim allocate rho ilow 1 iup 1 call uio rd ncin termt ntt rho ident ilb ilow 1 1 Alternatively it is possible to search in the file for a special entry or to search in a specially generated entry list with call uio srhd ncin termt ntt type real ident rho outstr outstr ierr ierr Additionally the module uio var module makes it possible to read any entry into an UIO flexible variable and the module uio varfile module allows the reading of a complete file into a special file structure of UIO flexible variables To close a file after reading use uio closrd ncin There are several examples of programs with UIO routines like uio var test f90 uio varfile test f90 uiotst f90 uio demo f90 and of course CO5BOLD 4 6 UNIX Scripts So far there exist three UNIX shell scripts useful to quickly examine data sets uiolook to change the format or conversion type of files uiocat or to print some information about the conversion types possible on the local machine uioinfo 4 6 1 Installation of UIO UNIX Scripts Recently the installation procedure for the UIO scripts has been updated to make use of its own configure script Therefore the procedure should now look like tar zxvf for tar gz cd for uio f90 YOUR MACHINE configure make make install 60

Download Pdf Manuals

image

Related Search

Related Contents

MANUAL DEL OPERADOR  Epson PictureMate Charm Compact Photo Printer - PM 225 Basic Guide  Nikon 550A S User's Manual  Conseils Eco-Drive pour rouler futé avec un véhicule électrique  introduction symboles utilises dans le manuel  Advanced 8080 Debugger User`s Manual  Samsung C61R2CAST Manual de Usuario  取扱説明書 保証書付  Soehnle 65054 2 personal scale  SDMN5 Manómetro diferencial de dos puertos  

Copyright © All rights reserved.
Failed to retrieve file