Part IV, Problems 5.1 to 5.5 Axisymmetric linear mean-field dynamo models =============================================================== The files you have grabbed are: sphdyn_eig.f --> Fortran-77 source code butterfly.idl --> IDL source code, to make butterfly diagram (as Fig. IV.5.4 in notes) medplane.idl --> IDL source code, to display solutions in meridional planes (as Fig. IV.5.2 in notes) To facilitate use, nothing very fancy has been done in terms of Input/Output. The fortran code is fully self-contained (does not need to be linked to anything), and produces a single unformatted output file, to be read by the IDL graphics codes. Likewise, the IDL codes are set up to be fully self-contained, and read the output file produced by the fortran code every time they are run. If you are an experienced Fortran and/or IDL user, feel free to tailor the I/O to your tastes (but don't come and bug me if the codes no longer work...) The following gives a few bits of information on running fortran and IDL codes, as well as useful hints for some of the problems. ------------------------------------------------------------------- 1. Running the Fortran code Under most Unix operating systems, compiling a self-contained fortran code will involve a command such as f77 code.f which will produce an executable usually called a.out Running the code is carried out by simply typing a.out And that's it. The input parameter values (C_alpha, C_omega, etc.) as well as the output filename are set in the code itself, so every time you want to change these you must recompile the code. Not elegant, but simple and it works. Note that the code is standard fortran-77, which means that it can be compiled using a fortran-90 compiler. ------------------------------------------------------------------- 2. Running the IDL postprocessing codes To run the IDL postprocessing codes you must first start IDL, which on Unix systems usually means typing idl you will then get the idl prompt IDL> To compile and run the IDL postprocessing codes, simply type IDL> .run medplane.idl which should produce output to the screen. To plot different output files you need to edit the IDL codes and change the name of the variable solfile near the top of the source code. Again not elegant, but simple and it works. To produce printable postscript, you need to type the sequence IDL> set_plot,'ps' IDL> device,filename='outputfile.ps' IDL> device,/portrait,yoffset=2,xsize=18,ysize=14 IDL> .run medplane.idl IDL> device,/close This will produce an output file called outputfile.ps, which you can send to your favorite postscript printer. The various size specification (third IDL> input line) ensure that your plot will have the aspect ratio needed so that your spherical quadrants do not turn out oblate or prolate. ------------------------------------------------------------------- 3. Continuation schemes [ problems 5.3 and 5.5 ] In constructing sequences of solution it is a good idea to proceed as follows; the hardest thing to do will be to obtain your first solution, for a given dynamo number. This will involve some trial-and-error until the code converges to a solution. Call the corresponding dynamo number and solution eigenvalue D_1 and s_1. Your sequence of N solutions can be constructed as follow: for n=2,N do begin set: D_n = D_n-1 *delta set: mu_n = s_n-1 inverse iteration yields: s_n enddo where delta is some multiplicative increment in dynamo number (1.5 to 2 seems to work well), and mu is the trial eigenvalue needed by the inverse iteration. The idea is that for small enough delta, s_n-1 will always be a good guess for s_n. In this way it is relatively straigntforward to construct sequences of eigensolutions where one of the input parameters (for example C_alpha) is varying.