List of things to do someday. ***************************** *********************************************************************** 16-March-1999 Hammett compiling on ACL Origin2000. The code works fine on the Princeton/PPPL Origin2000. But on the LANL Origin2000, it seems to require using the new beta version of the f90 compiler, you must first do: module add mpt_default module remove MIPSpro_default module add MIPSpro_7.3_beta_19990208 (No module commands are needed at present on hecate, only at LANL.) With MIPSpro_default, the code works on lintest0, and on some nonlinear cases without trapped electrons, but it bombs on nltest0. To debug this better, one can modify the Makefile to use mpi_stub.f90 instead of the real mpi. Is it some kind of incompatibility between f90 and c memory allocation routines? Something about the compiler environment set up at the ACL doesn't seem to be right, because I'm able to run the code just fine on hecate with the older default f90 compilers. *********************************************************************** 2-March-1999 Hammett round-off errors in m=n=0 modes I wrote the "compare" utility to help compare runs from two different computers, or from two different versions of the code. The "compare" utility provides control over the magnitude of the relative and absolute errors needed to be significant enough to report. For example: compare run1.nc run2.nc 1.e-7 1.e-10 will only report errors with a relative error larger than 1.e-7 and absolute errors larger than 1.e-10. This works for most arrays, but not for mgamx and grtmx. mgamx(md,nd,ne) for example is a WKB-measure of the frequency of the m,n mode at time t, from d/dt of log(phi(m,n)). The problem is that the the nonlinear terms should vanish for the m=n=0 mode, but because of small round-off errors in the FFT there is a small amount of energy that is coupled to it. This 0,0 nonlinear roundoff term is small compared to the rest of the nonlinear terms, but it can be large compared to the amplitude of the 0,0 mode, which would usually be initialized to zero. Thus when you compare two different *.nc files, mgamx and grtmx can be very different for the m=n=0 modes, even though this is due to just a very small roundoff problem. One way to fix this would be to modify the pseudo-spectral fft routines that calculate the nonlinear terms, so that they set the m=n=0 terms to be zero exactly. *********************************************************************** 2-March-1999 Hammett flux-surface-averaged diagnostics In the neoclassical flow tests (iphi00=9), there are a number of flux-surface averaged quantities calculated vs. time, such as phih0, uparh0, denh0, tparh0, tperph0, qparh0, qperph0, uparph0. These are calculated in diagnostics.f90 as: tparh0(ne)=tparh0(ne)+dz(l)*t_par(l,1,1,i) so this involves the m=1,n=1 index. For iphi00=9, only one radial mode is being evolved, and the n=1 index corresponds to kx .ne. 0. But for most runs, the m=1,n=1 index corresponds to ky=kx=0, a mode which is close to zero. But the small roundoff errors in the FFTs for the ky=kx=0 mode makes these tparh0 etc. diagnostics look very different on different machines. For the time being, "compare" can ignore this by setting a higher absolute error threshold. In the longer run, this can be fixed by either the above fix of setting the m=n=0 nonlinear terms to exactly zero, or by calculating these flux-surface-averaged quantities only when iphi00=9. *********************************************************************** 2-March-1999 Hammett built-in routine to strip namelist comments At present itgc and postc spawn a shell script to strip comments from the namelist file. The problem is that it has to know the location of this shell script, and so we have to keep adding a gfbin link in any directory we run in to find the shell script in gryffin/src/nmlstrip. It would be nicer to replace that with a fortran subroutine, such as one of the routines in file_utils.f90 that Peter Liu wrote for GS2. *********************************************************************** 2-March-1999 Hammett don't use mpi for postc, res2nc, etc. On the T3E it is easy to run programs that use mpi on a single processor, but on the Origin2000 you always have to use the mpirun command. Its just a minor annoyance, but it would probably be useful to change Makefile so that the postprocessor postc is not linked with the mpi library but uses mp_stub.f90 instead, since postc hasn't been ported to mpi (though it uses some routines, such as io_netcdf, that have been), and there is no reason to port to mpi since postprocessing is fast. Likewise, res2nc and nc2res and nc2nc should perhaps be compiled with mp_stub.f90 as they will usually be run on 1 processor (though the option to use mpi on them is useful to debug the i/o routines). *********************************************************************** 2-March-1999 Hammett convert postc.f to postc.f90 and other renaming. It would be nice to convert postc.f to postc.f90 to be consistent with the rest of the code. I would suggest renaming the present "README" files to "Copyright", so that README or Readme can be used for building info for users. I suggest renaming itg.hlp to help.txt or intro.txt. Should the main routine main routine and executable be renamed from itgc to something like gf or gryffin? It is fairly straightforward to rename files in CVS by doing: mv old.f new.f cvs add new.f cvs commit new.f cvs remove old.f cvs commit old.f *********************************************************************** 2-March-1999 Hammett pwenr initialization The variable pwenr, used in diagnostics.f90 as the previous value of the energy wenr, has been initialized to zero in diagnostics_arrays.f90. For restarts this isn't quite right. I.e., a single long run compared with two shorter runs (with a restart) may give different answers temporarily at the restart time. I believe this will only affect a couple of diagnostics for 1 time point. It should be possible to initialize pwenr from the fields at the first time step, whatever they are, and avoid this problem. *********************************************************************** 7-March-1999 Hammett improvements to random number generator. There are some improvements that could be made to the random number generator, as noted at the beginning of nag_sub.f90. *********************************************************************** 2-March-1999 Hammett FFT speed on DEC Alphas. Linear runs are comparable on the PPPL DEC Alphas and the Origin2000, but nonlinear runs are about 1.5 times slower. This is probably because of my use of some simple fft routines from the NAG library. May be able to speed things up by using a version of NAG FFT's that precompute and save the trig arrays, or the native DEC dxml library instead of NAG ("man dxml"). *********************************************************************** 2-March-1999 Hammett rdiff and chi_int not read or written in io_netcdf rdiff and chi_int are not read or written in io_netcdf.f90 at the present time, though they are in io_binary.f90 and io_ascii.f90. Since I don't think anyone is actively using these variables right now, they don't matter, but they eventually need to be added to io_netcdf.f90 if they are to used again in the future. *********************************************************************** 2-March-1999 Hammett Parallel netcdf i/o io_netcdf.f90 works fine now in a serial mode on parallel computers, where it ships all of the data to processor 0, and does reading/writing from processor 0. To change to use the experimental parallel version of netcdf available at NERSC, would need to change serial_io=.false. in io_netcdf.f90, and change the funnel.f90 routines to just do a simple transfer between its input and output arguments, B=A, without inter-processor communication. *********************************************************************** Date: Thu, 7 Aug 1997 14:25:47 -0400 (EDT) From: Greg Hammett To: bdorland@peaches.ph.utexas.edu, mbeer@pppl.gov Subject: minor issue: hyperviscosity before Poisson solve? In browsing through the code, I noticed that in itg.f, the order of calls is: timestep poisson filter while it seems to me it should be: timestep filter poisson I.e., the hyperviscosity terms implmemented in filter should logically be part of the time stepping, and the poisson Eq. should be solved after each time step. I don't know if this has any significant impact. For small time steps it probably has little effect. At some point, this should perhaps be investigated and changed. Greg *********************************************************************** GWH 95/08/11 Various Wish List Change the kx spectra plots made in postc.f to allow for possible assymetries in kx?? It would be nice if the reading of the namelist and the reading of a previous results file (*.resp) could be done closer together in the code. One could read the namelist, read the results file, and then reread the namelist, so that one could override any parameters in the *.resp file with new values in the namelist... Should modularize postc.f, so it isn't such a long code. For example, the section which writes the first page of the plots could be a separate subroutine... (On the other hand, should probably use something like IDL or MatLab or Python for postprocessing, and don't bother to improve postc.f)