Giter Site home page Giter Site logo

pencil-code / pencil-code Goto Github PK

View Code? Open in Web Editor NEW
186.0 186.0 98.0 369.91 MB

A high-order finite-difference code for compressible hydrodynamic flows with magnetic fields and particles

Home Page: https://pencil-code.org/download.php

Perl 2.13% Shell 1.23% Python 6.54% Makefile 0.95% Fortran 69.62% IDL 6.42% C 0.47% C++ 0.44% Prolog 0.25% Julia 0.10% CSS 0.01% HTML 0.11% TeX 0.02% Jupyter Notebook 9.27% Cuda 1.96% CMake 0.03% sed 0.03% Assembly 0.01% Cython 0.01% Mathematica 0.42%

pencil-code's Introduction

The Pencil Code

The Pencil Code is a high-order finite-difference code for compressible hydrodynamic flows with magnetic fields and particles. It is highly modular and can easily be adapted to different types of problems. The code runs efficiently under MPI on massively parallel shared- or distributed-memory computers.

The Pencil Code moved to GitHub on 19 April 2015. It was previously hosted at Google Code.

In order to checkout the code with Subversion, use the command

svn checkout https://github.com/pencil-code/pencil-code/trunk pencil-code --username <github-username>

where <github-username> is your GitHub username.

To get started, run one of the samples:

unix>  cd pencil-code
unix>  source sourceme.csh  [or . sourceme.sh]
unix>  cd samples/conv-slab
unix>  mkdir data

To set up the symbolic links and compile the code:

unix>  pc_setupsrc
unix>  pc_build  [ -f /path/to/config/file.conf ]

To create the initial condition and run the code:

unix>  pc_start  [ -f /path/to/config/file.conf ]
unix>  pc_run    [ -f /path/to/config/file.conf ]

See pencil-code/config/hosts/*/*.conf for sample config files. For more details, see the manual in the doc/ directory (also available here).


If you are using bash and you do not want to "source sourceme.sh" on each session, you can insert the following into your .bashrc and/or .bash_profile:

export PENCIL_HOME=$HOME/pencil-code  [or wherever you have the code]
_sourceme_quiet=1; . $PENCIL_HOME/sourceme.sh; unset _sourceme_quiet

If you are using csh insert the following into your .cshrc:

setenv PENCIL_HOME $HOME/pencil-code  [or wherever you have the code]
source $PENCIL_HOME/sourceme.csh

Documentation

List of Contributors

  • Around 100 people have contributed to various extent during the nearly 20 years of Pencil Code history.
  • The current list of contributors shows the temporal check-in activity of the those who stayed connected with the code over the various host changes (Nordita 2001-2007, Google Code 2007-2015, and Github since 2015). Some additional contributors are also listed in the manual.

How to contribute to the Pencil Code

  • For all changes to the code, make sure the auto-test still runs

  • If you have write access: check in your changes and make sure you can fix possible problems emerging on travis-ci.com as well as the minutely, hourly, and daily auto-tests.

  • If you have only read access: fork this repository and use pull requests to contribute.

Code of Conduct

License

pencil-code's People

Contributors

ajohan avatar andreas-schreiber avatar axelbrandenburg avatar bingert avatar chaochinyang avatar christersandin avatar dhrubaditya avatar fredgent avatar grsarson avatar illarl avatar iomsn avatar jaarnes avatar jenschober avatar jnskrueger avatar joishi avatar jwarne avatar kishore96in avatar mewek avatar mppiyali avatar mrheinhardt avatar nbabkovs avatar nilshau avatar onlymee avatar pabourdin avatar pkapyla avatar tobson avatar wdobler avatar wlyra avatar xiang-yu avatar zhouhz1992 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pencil-code's Issues

compilation fails after update: complains about gpu

The code fails to compile after an update complaining about GPU related issue.
I am not using GPU and tried both mpi (mpif90) and nompi (gfortran) with explicit
mention of "nogpu" and also without, and get the following error:

gpu_astaroth_ansi.o: In function rhs_gpu_c_': gpu_astaroth_ansi.c:(.text+0xf3): undefined reference to RKintegration'
gpu_astaroth_ansi.o: In function initialize_gpu_c_': gpu_astaroth_ansi.c:(.text+0xbc): undefined reference to intitializeGPU'
gpu_astaroth_ansi.o: In function finalize_gpu_c_': gpu_astaroth_ansi.c:(.text+0xc3): undefined reference to finalizeGPU'
collect2: error: ld returned 1 exit status
Makefile:2352: recipe for target 'start.x' failed
make[2]: *** [start.x] Error 1

Does one know what causes this?

Regards,
nishant

Python pencil module does not import

Down below is the error message (I did run sourceme.csh beforehand)

Python 2.6.6 (r266:84292, Jul 23 2015, 15:22:56)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux2

import pencil
Traceback (most recent call last):
File "", line 1, in
File "/u/beres/pencil/pencil-code/python/pencil/init.py", line 15, in
from pencil.files.xyaver import *
File "/u/beres/pencil/pencil-code/python/pencil/files/xyaver.py", line 12, in
from subprocess import check_output

ImportError: cannot import name check_output

There's no subprocess.py in the codebase.
Also "subprocess" is not defined anywhere in *.py files
the only matches are in
./python/pencil/files/xyaver.py
./python/pencil/files/yzaver.py
./bin/test/test_git-pc.py

Change IDL plot color for find_spectrum for turbulent box

I was able to run the turbulent box and was able to look at the spectrum with IDL. However, I want to change the colors for the plotting in IDL (for visualization) and need to know how to change the color map for the Pencil Code.

Sincerely,
Himakar Ganti

Unable to compile forcing_cont_sample.f90

Hello,

I am trying to run the provided tokamak sample, but I cannot proceed beyond the compilation step as outlined in the quick start guide. There is an error of no implicit type for the "calc_diagnostics_forcing", "forcing_after_boundary", and "forcing_pars_hel" submodules (see attached image). So far, I am able to run other sample simulations without error.

I am running in Ubuntu 20.04 with gfortran and gcc via WSL for Windows, and I have checked out the latest "master" commit.

Best regards,
Todd Mendenhall
Screenshot 2024-02-13 162625

pc_auto-test fail for two of the samples

Hi everyone. I am new to pencil
.
I followed the manual to setup pencil, and run pc_auto-test to validate it.

First I setup on my laptop with Ubuntu 16.04. All the test cases are OK, except for "GravitationalWaves" and "2d-tests/turbulent_potential". Initially I thought it was the problem with the compiler or MPI library. I tried different combinations of Intel Fortran/GNU-GCC and Intel MPI/Openmpi, but they all ended up getting wrong the same way (getting the same results). Then I tried one of our local supercomputer with CentOS and pre-installed modules for compilers and libraries. The output was the same as my laptop.

I wonder if anyone is getting the same problem as I do, or I haven't set it up properly?

Thanks in advance.

The following screen print is for gcc 5.4+openmpi 1.10.2

/home/zhisong/codes/pencil-code/samples/GravitationalWaves:
    Compiling..                               ok      
    Starting..                                ok      
    Running..                                 ok      
    Validating results..                      not ok: 
Files reference.out, data/time_series.dat differ:
  uxpt: Row 2: 5.706e-10 < 1.784e-09 according to absolute accuracy 1.5e-12
  uxp2: Row 2: 7.128e-10 > -9.843e-09 according to absolute accuracy 1.5e-12
Expected:  
 --it-----t--------dt-------uxpt-------uxp2--------EEM-------EEGW-------gg2m------hrms---  
    0    0.000  2.00E-02  0.000E+00  0.000E+00 4.9997E-01 0.0000E+00  0.00E+00  0.00E+00  
    1    0.020  2.00E-02  5.706E-10  7.128E-10 4.9997E-01 2.5117E-03  2.53E-01  5.03E-03  
    2    0.040  2.00E-02  1.123E-09  1.395E-09 4.9997E-01 1.0031E-02  1.01E+00  2.01E-02  
    3    0.060  2.00E-02  1.638E-09  2.017E-09 4.9997E-01 2.2509E-02  2.26E+00  4.52E-02  
    4    0.080  2.00E-02  2.099E-09  2.548E-09 4.9997E-01 3.9866E-02  4.01E+00  8.03E-02  
    5    0.100  2.00E-02  2.486E-09  2.958E-09 4.9997E-01 6.1992E-02  6.23E+00  1.25E-01  
    6    0.120  2.00E-02  2.781E-09  3.217E-09 4.9997E-01 8.8746E-02  8.92E+00  1.80E-01  
    7    0.140  2.00E-02  2.968E-09  3.296E-09 4.9997E-01 1.1995E-01  1.21E+01  2.45E-01  
    8    0.160  2.00E-02  3.027E-09  3.166E-09 4.9997E-01 1.5542E-01  1.56E+01  3.19E-01  
    9    0.180  2.00E-02  2.943E-09  2.798E-09 4.9997E-01 1.9491E-01  1.96E+01  4.03E-01
Got:  
 --it-----t--------dt-------uxpt-------uxp2--------EEM-------EEGW-------gg2m------hrms---  
    0    0.000  2.00E-02  0.000E+00  0.000E+00 4.9997E-01 0.0000E+00  0.00E+00  0.00E+00  
    1    0.020  2.00E-02  1.784E-09 -9.843E-09 4.9997E-01 2.5117E-03  2.53E-01  5.03E-03  
    2    0.040  2.00E-02  3.547E-09 -1.974E-08 4.9997E-01 1.0031E-02  1.01E+00  2.01E-02  
    3    0.060  2.00E-02  5.265E-09 -2.974E-08 4.9997E-01 2.2509E-02  2.26E+00  4.52E-02  
    4    0.080  2.00E-02  6.918E-09 -3.990E-08 4.9997E-01 3.9866E-02  4.01E+00  8.03E-02  
    5    0.100  2.00E-02  8.482E-09 -5.026E-08 4.9997E-01 6.1992E-02  6.23E+00  1.25E-01  
    6    0.120  2.00E-02  9.937E-09 -6.088E-08 4.9997E-01 8.8746E-02  8.92E+00  1.80E-01  
    7    0.140  2.00E-02  1.126E-08 -7.181E-08 4.9997E-01 1.1995E-01  1.21E+01  2.45E-01  
    8    0.160  2.00E-02  1.243E-08 -8.311E-08 4.9997E-01 1.5542E-01  1.56E+01  3.19E-01  
    9    0.180  2.00E-02  1.343E-08 -9.481E-08 4.9997E-01 1.9491E-01  1.96E+01  4.03E-01

----------------------------------------------------------------------
### auto-test failed ###
Failed 1 test(s) out of 1:
  /home/zhisong/codes/pencil-code/samples/GravitationalWaves/. (results)

----------------------------------------------------------------------
The following configuration has been used:
Found config file </home/zhisong/codes/pencil-code/config-local/hosts/ubuntu/host-ubuntu-GNU_Linux-Ubuntu.conf>
$config = {
            'makefile' => {
                            'FC' => 'mpif90',
                            'LD_FFTW2' => '',
                            'CFLAGS_DOUBLE' => '-DDOUBLE_PRECISION',
                            'LD_FFTW3' => '',
                            'FFLAGS_FFTW2' => '',
                            'FFLAGS_FFTW3' => '',
                            'LDFLAGS_HELPER' => '-dynamic',
                            'CFLAGS' => '-DFUNDERSC=1 -O3 -DFUNDERSC=1',
                            'MAKE_VAR1' => '-j4',
                            'CFLAGS_FFTW2' => '',
                            'LD_MPI' => '',
                            'FFLAGS_DOUBLE' => '-fdefault-real-8 -fdefault-double-8',
                            'CC' => 'mpicc',
                            'FSTD_95' => '-std=f95',
                            'FFLAGS' => '-O -O3',
                            'CFLAGS_FFTW3' => '',
                            'FSTD_2003' => '-std=f2003',
                            'F77' => 'mpif77'
                          },
            'runtime' => {
                           'mpiexec' => 'mpirun',
                           'mpiexec_opts' => '',
                           'mpiexec_opts2' => ''
                         },
            'environment' => {
                               'MODULE_PREFIX' => '__',
                               'MODULE_SUFFIX' => '',
                               'MODULE_INFIX' => '_MOD_'
                             }
          };
Perl version v5.22.1

Turbulent_Flame not accepting FlameMaster File for main simulation

I am trying to run a 3D turbulent_flame case with modified chemistry, and was able to figure out the how to make the mechanism work with Pencil-Code. I was able to run the turbulent box and the 3d initial conditions for the simulation. I was having a problem with the laminar flame solution from Pencil code using the RK3 & RKF time-marching scheme for the mechanism I am using - the solution oscillates very badly and crashes, and I cant go down any lower on the time-step size (~1e-15). Hence I tried to generated the Flame solution with FlameMaster which is accepted by Pencil-Code.
This is a high priority for my work and I appreciate any help I can get to get this going. However, I am running into the following issue when trying to run the main simulation:
A bunch of the following:

Error termination. Backtrace:
At line 6051 of file chemistry.f90 (unit = 1, file = 'H2_p01_0phi0_7000tu0300')
Fortran runtime error: Bad real number in item 259 of list input

followed by:

Error termination. Backtrace:
init_lnrho: nothing
init_lnrho: cs2bot,cs2top= 1.0000000000000000 1.0000000000000000
init_energy: nothing
Reading initial conditions in file H2_p01_0phi0_7000tu0300
At line 6051 of file chemistry.f90 (unit = 1, file = 'H2_p01_0phi0_7000tu0300')
Fortran runtime error: Bad real number in item 259 of list input

and then by:

#0 0x7fb5b034ad18 in read_real
at ../.././libgfortran/io/list_read.c:2026
#1 0x7fb5b034ca7d in list_formatted_read_scalar
at ../.././libgfortran/io/list_read.c:2179
#2 0x411655 in ???
#3 0x42893f in ???
#4 0x650413 in ???
#5 0x650d11 in ???
#6 0x7fb5af4af3d4 in ???
#7 0x403168 in ???
#8 0xffffffffffffffff in ???
#0 0x7f0a024b0d18 in read_real
at ../.././libgfortran/io/list_read.c:2026
#1 0x7f0a024b2a7d in list_formatted_read_scalar

and this keeps going on for the 64 cores I am trying to use. I am sure it is not an encoding issue. My FlameMaster file is:
FM.zip

Can someone please please help me get main simulation running?

How to export the operation result?

I am a freshman in operating pencil-code, I can't find the way to export the running result after updating. If there is a instruction like ”pc_collect"? The data folder is too big for my computer to directly copy and paste. Thank you!

Hebbe, mpif90 error

Dear all,

The code can compile sucessfully on Hebbe, but could not
run because of the mpi error.

Setup in the "Makefile.src" file is,

FC=ifort #(hebbe)

FFLAGS= -O2 #(hebbe)

FC=mpif90 #(hebbe)

CC=mpicc #(hebbe)

CFLAGS=-O3 -DFUNDERSC=1 #(hebbe)

LD_MPI= #(hebbe)

FFLAGS_DOUBLE=-fdefault-real-8 #(hebbe)

LIBMPISUFFIX=#(hebbe)

*Error report: *
4 CPUs
HOSTNAME = hebbe08-3
USER = lixian
Running under MPI
masterhost=hebbe
Simple Linux Utility for Resource Management (SLURM) job
SLURM_NODELIST = hebbe08-3
nodelist = hebbe08-3
SLURM_TASKS_PER_NODE = 20
Generic setup; hostname is .
No valid 'mpirun' setting, use default 'mpiexec'.
datadir = data
Setting nodelist to node hebbe08-3
$mpi = <2>
$ncpus = <4>
$npops = <-n 4>
$local_disc = <0>
$one_local_disc = <1>
$remote_top = <0>
$local_binary = <0>
$datadir =
$SCRATCH_DIR = </scratch/pencil-8202>
$hn =
$masterhost =
$mpirun =
$mpirunops = <>
$mpirunops2 = <>
$x_ops = <>
$NODELIST =
$SSH =
$SCP =
$PARENT_PID = <8202>
$copysnapshots =
$particles = <1>
$particles_nbody= <0>
tor mar 31 10:51:20 CEST 2016
mpiexec -n 4 src/start.x
File "/c3se/apps/Common/intel/ips_xe_ce_2016/impi/5.1.1.109/bin64/mpiexec", line 187
except EOFError, e:
^
SyntaxError: invalid syntax
0.030u 0.061s 0:00.98 9.1% 0+0k 0+0io 427pf+0w

tor mar 31 10:51:21 CEST 2016
Error status 1 found -- aborting

Here is the sample used as a test,
/pencil-code/samples/dust_turb_globaldisk/

Does anyone come across the same problem?

Best,

Xiangyu

"init" variables in start.in are producing errors in read_namelist/sub.f90

Using the most recent version of the code, some (though apparently not all) parameters in start.in beginning with "init" (e.g., inituu, initaa, initxxp, initvvp) are crashing:

WARNING: read_namelist: namelist "particles_init_pars" has an error!

=== BEGIN SAMPLE "start.in" ===>
&init_pars
/
&initial_condition_pars_init_pars
/
&eos_init_pars
/
&hydro_init_pars
/
&density_init_pars
/
&special_init_pars
/
&particles_init_pars
/
&particles_nbody_init_pars
/
<=== END SAMPLE ===

FATAL ERROR: read_all_init_pars: Please fix all above WARNINGs for file "start.in"

Commenting out inituu, etc. in start.in "fixes" the problem.

Also, I get a similar crash with pc_run with the following variables run.in: idiff, ivisc, iresistivity. So for samples/2d-tests/globaldisc, for example, both pc_start and pc_run crash.

comment on commit ea51334 by Matthias

Hi Matthias

I noticed this problem a bit late and hence cannot directly reply to the commit mesg from Github which I deleted.

Do you think adding the ldownsampled flag and corresponding changes in pc_varcontent may have created an error? What does this flag do? I am asking this because I have data from a 2d run with lnrho, lntt, magnetic field, ionisation and aux variables like shock, radiative fluxes which I was able to read and plot correctly using IDL till a fortnight ago but now after this change executing a pc_read_var gives a syntax error at line number 314 in pc_read_var where it calls pc_varcontent and on output does not create a structure array for the magnetic vector potential. Also upon printing the output x,y,z coordinate vectors from pc_read_var command contain NaNs. Do you know what the problem might be? I tried reading several VAR files in this run unsuccessfully.

Cheers
Piyali

namelist "run_pars" has an error (5010)!

While running the init_cond_3D_isotropic for isotropic turbulence I am facing this error.
I am attaching
run.txt

the run.in file Any kind of help will be appreciated

The output shown is as follows:

Found config file </home/yuvraj/Public/pencil-code/config/compilers/GNU-GCC_MPI.conf>
hostname = optiflex-790
MPI run
4 CPUs
4 nodes, 1 CPU per node
lparticles = 0
lpointmasses = 0
Subcommand: run
Revision: adc529f
M src/Makefile.src
Sun Jan 12 18:52:25 2020
Running under MPI
Running 'env MODULE_PREFIX=__ MODULE_INFIX=MOD MODULE_SUFFIX= /usr/bin/time -p mpiexec -n 4 ./src/run.x'...
SVN: ------- v. ( ) $Id$
SVN: ------- v. ( ) $Id$
WARNING: read_namelist: namelist "run_pars" has an error (5010)!

=== BEGIN SAMPLE "run.in" ===>
&run_pars
/
&eos_run_pars
/
&hydro_run_pars
/
&density_run_pars
/
&entropy_run_pars
/
&chemistry_run_pars
/
&forcing_run_pars
/
&viscosity_run_pars
/
<=== END SAMPLE ===

STOPPED: read_all_run_pars: Please fix all above WARNINGs for file "run.in"
STOP 1

Primary job terminated normally, but 1 process returned
a non-zero exit code. Per user-direction, the job has been aborted.


mpiexec detected that one or more processes exited with non-zero status, thus causing
the job to be terminated. The first process to do so was:

Process name: [[21027,1],0]
Exit code: 1

Command exited with non-zero status 1
real 0.66
user 0.51
sys 0.05
'env MODULE_PREFIX=__ MODULE_INFIX=MOD MODULE_SUFFIX= /usr/bin/time -p mpiexec -n 4 ./src/run.x' failed:
Found ERROR file from start.x
Aborting.

Compilation error

Hi, I am trying to run a test case of your code for my MHD graduate course. I ultimately want to run the test case in the tokamak folder, so I would appreciate any pointers on that as well please. I am having a compilation issue that is taking me too much time to solve. Can you please help?
pencil_code_output.pdf

Running Pencil-Code with SLURM

I am trying to run Pencil-Code on a cluster with SLURM and having the following errors:

Running 'env MODULE_PREFIX=__ MODULE_INFIX=MOD MODULE_SUFFIX= time mpiexec -n 16 ./src/start.x'...
env: time: No such file or directory
'env MODULE_PREFIX=__ MODULE_INFIX=MOD MODULE_SUFFIX= time mpiexec -n 16 ./src/start.x' failed:
Aborting.

Can anyone please help me figure out how to run it on multiple Nodes & cores using SLURM?

Preferred Citation(s)

I am a data/software editor with the AAS Journals (ApJ/AJ). Pencil Code has been mentioned in a submitted manuscript, but the authors have not added a proper attribution. Could you please let me know if there are 1 or more preferred citations for this code (from among the reference list here I presume).

Adding this material to the ReadMe landing page for this repository may also help users ensure proper attribution of this code. You can read more about how the AAS Journals are trying to improve software citation in our Journal's software policy.

[JOSS] python "is" error on import

In derived_h5.py, should the line 240:

if 'rho' is src.keys() or 'lnrho' in src.keys():

be

if 'rho' in src.keys() or 'lnrho' in src.keys()

?

i.e., the first is should be in? This module complains on import (with python 3.8) about the is.

Custom palette using guide requires user be logged in, making link sharing difficult

Using David's custom block suggestion, with a guide, I find that I can load a guide with a custom blocks palette but only if the user is logged in, e.g.:

http://eleventy.pencilcode.net/edit/first#guide=https://umdrive.memphis.edu/aolney/public/pencilcode/1-functions-maps.html

If I use a bare domain, e.g.:

http://pencilcode.net/edit/first#guide=https://umdrive.memphis.edu/aolney/public/pencilcode/1-functions-maps.html

The guide will load, but I get a popup error "Cannot Load" for the rest. I assume there is some kind of authentication or session management that needs to happen.

Ideally I'd like to send students a link that works for them. Right now, I'm asking them to log in and then copy/paste the guide portion of the url onto their url.

To set up my custom palette, I'm calling this script on the guide page:

<script>
//required for palette
function filterblocks(a) {
  // Show 'say' block only on browsers that support speech synthesis.
  if (!window.SpeechSynthesisUtterance || !window.speechSynthesis) {
    a = a.filter(function(b) { return !/^@?say\b/.test(b.block); });
  }
  // Show 'listen' blocks only on browsers that support speech recognition.
  if (!window.webkitSpeechRecognition || window.SpeechRecognition) {
    a = a.filter(function(b) { return !/\blisten\b/.test(b.block); });
  }
  return a.map(function(e) {
    if (!e.id) {
      // As the id (for logging), use the first (non-puncutation) word
      e.id = e.block.replace(/^\W*/, '').
             replace(/^new /, '').replace(/\W.*$/, '');
      // If that doesn't turn into anything, use the whole block text.
      if (!e.id) { e.id = e.block; }
    }
    return e;
  });
}

//  This is where we customize the blocks palette 
PencilCodeGuide.session(
    {
        palette : [
            {
                name: 'Snippets',
                color: 'deeporange',
                blocks: filterblocks([
                    {
                        block: "encode = (x)->\n  map = new Map\n  map.set('a','.-')\n  map.get( x )",
                        title: 'Define an encoding using a map',
                        id: "encode-definition"
                    },
                    {
                        block: "write encode('a')",
                        title: 'Encode a letter using the encode function and write it out',
                        id: "encode"
                    }
                    ])
            }
        ]
    }
);
</script>

Additional boundary drivers

Currently we have a few different drivers for the boundaries which prescribe a velocity field, e.g. bc_force_axy_sin_cos in boundcond.f90. I see the need for implementing more complex drivers like footpoint motins. Those would require individual parameters like the strength of the driving. However, all the parameters for boundcond.f90 are given in the &run_pars group name. A neat solution would be to move such boundary drivers into one directory and access them like the initial conditions. That way we could have one new group entry, e.g. &boundary_drivers.

Request for git permission to translate documents

Hello guys, I am an undergraduate student from Tsinghua University, China. Would you be willing to let me translate the document to Chinese? That would be helpful to spread pencil-code all over the world. And I promise I would not to destroy anything when committing changes to pencil-code.

How to run dual fuel combustion?

I need to run cases made up with dual fuel combustion, thus I entered this directory: pencil-code/samples/turbulent_flame/init_cond_1D and then changed some files in it like air.dat, chem. inp, start.in and corresponding parameters in cparam.local in src/. After I do this, the initialization can proceed smoothly, but failed to run. I tried to overcome the error but failed, and I think the error is not just caused by density like the following jpg, all parameters are NAN when I output them. Has anyone ever run dual fuel combustion or had similar experiences? Please contact with me, thank you!
IMG_20230505_102912

Paraller run not working

I'm running samples/turbulence/helical-MHDturb32-4procs .It runs succesfully with one processor.
With multiple procssors, after pc_build command I get error with mpif.h file. I copied this file from MPI install directory to local src and tried pc_build and then I get error saying undefined reference to mpi_send...
FAQs in maual suggest to add _ (Underscore) in Makefile.local but that also doesn't work. Same error appears again. Errors at end say waiting for unfinished jobs .
Can anybody help?

gfortran 5.3 / opemMPI 1.10.1 error

When I try to build the conv-slab problem using gfortran 5.3 with the GNU-GCC_MPI.conf config file with the fdefault-real-8 and fdefault-double-8 flags I get this error message:

Possible precedence issue with control flow operator at /home/mdevalbo/project/hydro/pencil-code/bin/pc_build line 360.
Running make '-j' 'FFLAGS_DOUBLE=-fdefault-real-8 -fdefault-double-8' 'CFLAGS_DOUBLE=-DDOUBLE_PRECISION' 'LD_MPI=' 'CFLAGS_FFTW3=' 'FFLAGS_FFTW3=' 'LD_FFTW3=' 'CFLAGS_FFTW2=' 'FFLAGS_FFTW2=' 'LD_FFTW2=' 'FC=gfortran' 'F77=$(FC)' 'FFLAGS=-O' 'FSTD_95=-std=f95' 'FSTD_2003=-std=f2003' 'CC=gcc' 'CFLAGS=-DFUNDERSC=1'
MAKING src/Makefile.inc
precision-check: No such file src/.current-precision -- creating new one at ./src/scripts/precision-check line 36.
touch src/.build-history
echo mdevalbo"@"`hostname` "("`date`")" >> src/.build-history
( cd src && \
  echo "===== " make FROM_PARENT=src/ -f Makefile.src code "====="; \
  make FROM_PARENT=src/ -f Makefile.src default_to_be \
)
=====  make FROM_PARENT=src/ -f Makefile.src code =====
make[1]: Entering directory '/home/mdevalbo/project/hydro/pencil-code/samples/conv-slab/src'
scripts/mkcparam -b noborder_profiles.f90 nochemistry.f90 nochiral.f90 nocosmicray.f90 nocosmicrayflux.f90 density.f90 deriv.f90 nodetonate.f90 nodustdensity.f90 nodustvelocity.f90 entropy.f90 eos_idealgas.f90 nofixed_point.f90 noforcing.f90 gravity_simple.f90 grid.f90 hydro.f90 nohyperresi_strict.f90 nohypervisc_strict.f90 noimplicit_diffusion.f90 noimplicit_physics.f90 noinitial_condition.f90 nointerstellar.f90 nolorenz_gauge.f90 nomagnetic.f90 magnetic/nomeanfield.f90 magnetic/nomeanfield_demfdt.f90 noneutraldensity.f90 noneutralvelocity.f90 noNSCBC.f90 noopacity.f90 noparticles.f90 noparticles_adaptation.f90 noparticles_coagulation.f90 noparticles_collisions.f90 noparticles_map.f90 noparticles_density.f90  noparticles_mass.f90 noparticles_nbody.f90 noparticles_number.f90 noparticles_radius.f90 noparticles_grad.f90 noparticles_selfgravity.f90 noparticles_sink.f90 noparticles_drag.f90 noparticles_spin.f90 noparticles_stalker.f90 noparticles_stirring.f90 noparticles_diagnos_dv.f90 noparticles_diagnos_state.f90 noparticles_temperature.f90 noparticles_adsorbed.f90 noparticles_surfspec.f90 noparticles_chemistry.f90 nopoisson.f90 nopolymer.f90 nopscalar.f90 noradiation.f90 noselfgravity.f90 noshear.f90 noshock.f90 nosignal_handling.f90 nosolid_cells.f90 nospecial.f90 nostreamlines.f90 notestfield.f90 notestflow.f90 notestscalar.f90 viscosity.f90 noheatflux.f90 nopower_spectrum.f90 cparam.local -o cparam.inc
make -f Makefile.src  start.o run.o combine_videofiles.o read_videofiles.o read_all_videofiles.o read_vectorfiles.o pre_and_post_processing/pc_collect.o pre_and_post_processing/pc_reduce.o pre_and_post_processing/pc_distribute.o pre_and_post_processing/pc_distribute_z.o pre_and_post_processing/pc_extract.o pre_and_post_processing/pc_configtest.o start.x run.x combine_videofiles.x read_videofiles.x read_all_videofiles.x read_vectorfiles.x pre_and_post_processing/pc_collect.x pre_and_post_processing/pc_reduce.x pre_and_post_processing/pc_distribute.x pre_and_post_processing/pc_distribute_z.x pre_and_post_processing/pc_extract.x pre_and_post_processing/pc_configtest.x
make[2]: Entering directory '/home/mdevalbo/project/hydro/pencil-code/samples/conv-slab/src'
if [ "" ]; then \
    rm -f cparam.inc; \
    rm -f cparam_pencils.inc; \
    ln -s cparam.inc cparam.inc; \
    ln -s cparam_pencils.inc cparam_pencils.inc; \
fi
gcc -DFUNDERSC=1    -o syscalls_ansi.o -c syscalls_ansi.c
gcc -DFUNDERSC=1    -o nogsl.o -c nogsl.c
gfortran -O    -std=f95 -o cparam.o -c cparam.f90
cparam_pencils.inc:369:0:

    , 'gradnu        ' /)
 1
Warning: Limit of 39 continuations exceeded in statement at (1)
gfortran -O    -std=f95 -o cdata.o -c cdata.f90
gfortran -O    -std=f95 -o general.o -c general.f90
gfortran -O    -std=f95 -o noweno_transport.o -c noweno_transport.f90
gfortran -O    -std=f95 -o syscalls.o -c syscalls.f90
gfortran -O     -std=f95 -o mpicomm.o -c mpicomm.f90
gfortran -O    -std=f95 -o nompicomm.o -c nompicomm.f90
mpicomm.f90:54: Error: Can't open included file 'mpif.h'
Makefile.src:2395: recipe for target 'mpicomm.o' failed
make[2]: *** [mpicomm.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/home/mdevalbo/project/hydro/pencil-code/samples/conv-slab/src'
Makefile.src:2350: recipe for target 'code' failed
make[1]: *** [code] Error 2
make[1]: Leaving directory '/home/mdevalbo/project/hydro/pencil-code/samples/conv-slab/src'
Makefile:23: recipe for target 'default_to_be' failed
make: *** [default_to_be] Error 2
'make -j FFLAGS_DOUBLE=-fdefault-real-8 -fdefault-double-8 CFLAGS_DOUBLE=-DDOUBLE_PRECISION LD_MPI= CFLAGS_FFTW3= FFLAGS_FFTW3= LD_FFTW3= CFLAGS_FFTW2= FFLAGS_FFTW2= LD_FFTW2= FC=gfortran F77=$(FC) FFLAGS=-O FSTD_95=-std=f95 FSTD_2003=-std=f2003 CC=gcc CFLAGS=-DFUNDERSC=1 default_to_be' failed: <>

Any help with this problem would be much appreciated.

Update on Python Package

Hi PC Team,
we discussed to update our python package and do an overhaul in style and structure. I encourage all python users and contributors to participate! As soon as we have a decision on how to structure the code we will have an transition phase where we will have two python modules in our repository. Feel free to add your features to the new one. When everything is converted/added to the new package the old one will be deleted/replaced. There probably will be no backwards compatibility!

Please check my email on a first draft on python pc package structure. The more contribute, the faster we're done!
best wishes

some problems when running 'pc_collect'

I ran a turbulent flame sample according to the 'quick start' before IDL>.r .........., then I run the command 'pc_collect', the f90 file of it is in 'pencil-code/src/pre_and_post_processing/pc_collect.f90'.
It shows an error message 'grep: src/Makefile.local: No such file or directory' firstly, then I input 'apt-get install csh' and run again. But it still can't work and popup another error message after I run the 'pc_collect', it shows 'PENCIL_CONFIG_FILES: Undefined variable.'
My system is Ubuntu 20.04, my shell is Xshell7. How can I run the command correctly?
图片1

python/pencil and python/pencilnew

Is it about time to delete the old python directory python/pencil?

Having two sets of python files is confusing for new users and annoying for people who want to update the routines. Would we loose any functionality by deleting python/pencil and moving all files from python/pencilnew to python/. ?

lsode_for_chemistry

I use pencil-code to simulate the 3D H2/02 turbulence flame, and after 31800 steps , the program incorrect report:
DLSODE- Warning. internal T(=R1) and H(=R2) are such that in the machine,T+H=T on the next step(H = step size). Solver will continue anyway
R1=0.435645e-5,R2=0.254653e-30
DLSODE- Above warning has been issued I1 times.It will not be issued again for this problem
I1=10
And I also tried to change timestep_LSODE to timestep,but pencil_check reported some error.
How can I slove it? Thanks

Running failed due to changing mechanism files

Does anyone simulate turbulent flame in directory '/pencil-code/samples/turbulent_flame/' ?
I want change mechanism files like chem.inp, tran.dat in order to a run a simulation with another fuel(still gas), before that I just changed mechanism files but not change the reactants and ratio in any places. After running some error appeard: 'FATAL ERROR: calc_pencils_density: NaNs in p%glnrho!!!' or 'TT_full is out of range', errors are reported on the second iteration(it=2). I changed a few mechanics files but it's still the same. It sames that only this reaction mechanism can normally work.
Which files shouled I change? Which line in the file needs to be modified? And how to write it?
屏幕截图 2023-09-13 160811
屏幕截图 2023-09-13 160845

How to change NCHEMSPEC for a run?

I have not had success so far in increasing the number of species for a run, I tried the following and all of them fail:

  1. Changed cparam.local as follows to include additional species:
    integer, parameter :: nchemspec=13
  • pc_build fails
  • pc_run fails
  1. Changed Makefile.local as follows to include additional species:
    NCHEMSPEC = 13
  • pc_build successfully compiles
  • pc_run fails with the following error:

Running 'env MODULE_PREFIX=_ MODULE_INFIX=MOD MODULE_SUFFIX= /usr/bin/time -p ./src/start.x'...
SVN: ------- v. ( ) $Id$
WARNING: read_namelist: namelist "init_pars" has an error (5010)!
STOPPED: read_all_init_pars: Please fix all above WARNINGs for file "start.in"_

I have added all species, boundary conditions & values in start.in but still get the above Warning, which stops the run.

Can anyone please help with this issue?

File "data/xyaverages.dat" corrupted!

Sometimes very high values (larger than 1000 at some time,
when typical numbers should be around +/-0.1) for particularly
the variable "uxmz" are generated in the "xyaverages.dat".
When trying to read using "pc_read_xyaver", I get the Warning
message: File "data/xyaverages.dat" corrupted!

Has somebody seen this before? Are there some known issues
related to this?

Regards,
nishant

Compilation error

I'm using latest version of PENCIL code from GitHub. It works fine on our workstation. When I try to compile it on supercomputing facility it is giving following error. Our workstation works on CentOS 6.3 where as supercomputing facility has CentOS 6.2. Previous version of PENCIL code worked fine on both the systems. I'm using mpif90 compiler.

mpif.h:549.16:
Included at mpicomm_double.f90:55:

   integer*8 MPI_DISPLACEMENT_CURRENT
            1

Error: Nonstandard type declaration INTEGER*8 at (1)
mpif.h:550.42:
Included at mpicomm_double.f90:55:

   PARAMETER (MPI_DISPLACEMENT_CURRENT=-54278278)
                                      1

Error: Symbol 'mpi_displacement_current' at (1) has no IMPLICIT type
make[2]: *** [mpicomm_double.o] Error 1
make[2]: Leaving directory /home/external/iitb/kedarb/pencil-code/samples/2d-te sts/2d_methane_flame/8_proc_parallel/src' make[1]: *** [code] Error 2 make[1]: Leaving directory/home/external/iitb/kedarb/pencil-code/samples/2d-te sts/2d_methane_flame/8_proc_parallel/src'
make: *** [default_to_be] Error 2
'make -j FFLAGS_DOUBLE=-fdefault-real-8 -fdefault-double-8 CFLAGS_DOUBLE=-DDOUBL E_PRECISION LD_MPI= CFLAGS_FFTW3= FFLAGS_FFTW3= LD_FFTW3= CFLAGS_FFTW2= FFLAGS_F FTW2= LD_FFTW2= FC=mpif90 F77=mpif77 FFLAGS=-O FSTD_95=-std=f95 FSTD_2003=-std=f 2003 CC=mpicc CFLAGS=-DFUNDERSC=1 default_to_be' failed: <>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.