noinitial_condition
Module
Description
$Id$
This module provide a way for users to specify custom initial conditions.
The module provides a set of standard hooks into the Pencil Code and currently allows the following customizations:
Description | Relevant function call
- Initial condition registration | register_initial_condition
(pre parameter read) |
- Initial condition initialization | initialize_initial_condition
- (post parameter read) |
Initial condition for momentum | initial_condition_uu Initial condition for density | initial_condition_lnrho Initial condition for entropy | initial_condition_ss Initial condition for magnetic potential | initial_condition_aa
- Initial condition for all in one call | initial_condition_all
(called last) |
And a similar subroutine for each module with an “init_XXX” call. The subroutines are organized IN THE SAME ORDER THAT THEY ARE CALLED. First uu, then lnrho, then ss, then aa, and so on.
** AUTOMATIC CPARAM.INC GENERATION ************************ Declare (for generation of cparam.inc) the number of f array variables and auxiliary variables added by this module
CPARAM logical, parameter :: linitial_condition = .false.
HOW TO USE THIS FILE
- Change the line above to
linitial_condition = .true.
to enable use of custom initial conditions.
The rest of this file may be used as a template for your own initial conditions. Simply fill out the prototypes for the features you want to use.
Save the file with a meaningful name, e.g. mhs_equilibrium.f90, and place it in the $PENCIL_HOME/src/initial_condition directory. This path has been created to allow users to optionally check their contributions in to the Pencil Code SVN repository. This may be useful if you are working on/using an initial condition with somebody else or may require some assistance from one from the main Pencil Code team. HOWEVER, less general initial conditions should not go here (see below).
You can also place initial condition files directly in the run directory. Simply create the folder ‘initial_condition’ at the same level as the *.in files and place an initial condition file there. With pc_setupsrc this file is linked automatically into the local src directory. This is the preferred method for initial conditions that are not very general.
To use your additional initial condition code, edit the Makefile.local in the src directory under the run directory in which you wish to use your initial condition. Add a line that says e.g.
INITIAL_CONDITION = initial_condition/mhs_equilibrium
Here mhs_equilibrium is replaced by the filename of your new file, not including the .f90 extension.
This module is based on Tony’s special module.
Quick access
- Variables:
a_blob,a_d,a_d_cgs,a_hill,a_s,a_s_cgs,aa_init,aa_save,actos_data,add_noise,air_field_local,alpha_mlt,amp_scale,ampl_diffrot,ampl_kz,ampl_kz0,ampl_norm,amplaa_cgs,amplnrho,ampltt,ampluu,ampluu_cs_factor,ampluu_noise,apara,asym_factor,b0_scale,b0_spiral,b_bkg,b_field,b_theta1,b_theta2,bb0,bb_left,bb_right,blob_scale,blob_sgn,bmax,bonnor_ebert_sphere,braid_margin,braid_shift_x,braid_shift_y,bump_ampl,bump_radius,bump_width,bv,bz_const,calc_phi,cap_field,cb20,chib,chisgs_top,chit0,coeff_cs2,config,configuration,const_alfven,const_alfven_speed,cooling_select,correct_azimuthal_velocity,correct_azimuthal_velocityn,correct_lorentz_numerical,correct_selfgravity,cs0_c,ct0,d,d0,delrho,deltat0,den,density_power_law,direction,dlnndlntaus,dlnrhodlnr,dsize0,dsteep,edtog,ekman,enforce_numerical_equilibrium,eta_vk,etamu0_spiral,extent,fbottom,file,find_max,find_procno,fluxrings,generate_random_hel,grad_p,gravitational_const_init,h_cr,h_d,h_ss,hd,he_factor,heating_select,hel,hscale,hscale_cgs,hydrostatic_lntt,hydrostatic_x,hydrostatic_z,i_point,iglobal_d2rho0,imidplane,infile,infileprefix,init_amp0,init_k0,init_phase0,init_shallow_density,init_shallow_hydro,init_water1,init_water2,init_yk_1,init_yk_2,initaa_dc,initcond_aa,initial_condition,initial_condition_aa,initial_condition_aatest,initial_condition_all,initial_condition_cctest,initial_condition_chemistry,initial_condition_chiral,initial_condition_clean_up,initial_condition_ecr,initial_condition_fcr,initial_condition_lncc,initial_condition_lnrhon,initial_condition_nd,initial_condition_solid_cells,initial_condition_ss,initial_condition_uu,initial_condition_uud,initial_condition_uun,initial_condition_uutest,initial_condition_vvp,initial_condition_xxp,initring,inittt,inituu,input_fac,integrate,integrate_field,ionbeta,ipressurebump,k_aa,k_eta,k_floor,kav,kkx,kky,kkz,kproftype,kramers_hcond0,ksi,kx_ro,kx_tt,kx_uy,kz0,kz_tt,kzspec,l0_d,l_blob,l_d1,l_sigma,lactos_read,lactos_write,ladd_field,ladd_field_azimuthal,ladd_field_vertical,ladd_noise_propto_cs,ladd_points,lane_emden,lcap_field,lcap_field_radius,lcap_field_theta,lcorona,lcorrect_lorentzforce,lcorrect_pressuregradient,lcorrect_selfgravity,lcurved_xy,lcurved_xz,ld2rho0_global,ldragforce_gas,les_data,lgaussian_distributed_noise,lhelaa,lheluu,lin_inpol,linitial_diffrot,lintegrate_potential,lkappa_constchi,lkvec_allocated,llog_distribution,llowk_noise,lnrho0_c,lnrho_init,lntt,lntt_init,lnumerical_mhsequilibrium,logtausmax,logtausmin,lowk_noise_gaussian_rprof,lp_aver,lperturb,lpolynomial_fit_cs2,lreflectua,lregriding,lreinit_water,lrho_const,lscale_kvector_fac,lscale_kvector_tobox,lselfgravity_logspirals,lsi_random,lsinhron,lsmooth,lsplit_temperature,ltanh_prof_xy,ltanh_prof_xz,ltaus_log_center,lthermal_hse,luse_extfield_file,luse_only_botbdry,lwet_spots,lwrite_cooling_profile,lwrite_hcond_profile,lxn,lzerow,m0,machs,mag_prandtl,magnetic_power_law,major_axis,max_rheat,mdot,minor_axis,mk,mphi,mpoly_special,n_blobs,n_foil,n_pot,n_rings,n_smooth,nad,nadd_points,nagrid,ndata,nfraction_cgs,ngamma,nikz,no_of_modes,nohel,npoly1,npoly2,npoly_exp,npoly_fac,npoly_jump,npolyk1,npolyk2,npot,nsmooth,nsteps,ntot_data,nval,nxtab,nytab,nztab,om,om_inner,omega0_spiral,omega_bkg,omega_exponent,omega_vortex,omegab,oo,oocorot,oog,orientation_a,orientation_b,orientation_c,p_ss,parker_wind_iteration,passive_scalar,pbeta,pert,phase,pi2,pi4,pi6,piecewice_poly,pjump,plasma_beta,poly_fit,power_kz,pp_left,pp_right,prandtl,pressure_offset,prof,profile,profile_cc,psi0,psi0d,psi1,psipn0,psipn1,qgshear,r0_d,r0_pot,r0_spiral,r1_k,r1_poly,r_b,r_cyl,r_jet_cent,r_sph,r_ss,ran0,rayleigh,rborder_ext,rborder_int,rbot,rboundb,rbreak,rcav,rcoreb,read_inputk,reality_check,reinitialization,relhel,rescale_ff,rho0_c,rho0ts,rho0ts_cgs,rho_b,rho_exp,rho_fraction,rho_m_0,rho_ratio,rho_rmax,rho_rmin,rho_rms,rho_save,rho_ss,rhoc,rhoin,rhon_to_rho_ratio,rhopj,rhopload,rhow_coeff,rhox,rk4,rm,rmode_mag,ro_pert,ronyblob,rout,rpos,rs,rstar,rtran,s0,scale_aa,scale_kvectorx,scale_kvectory,scale_kvectorz,set_field,set_field_constbeta,set_lntt_first,set_sound_speed,set_thermodynamical_quantities,setup_profiles,setup_tanh,setup_vert_profiles,sharpblob,shocktube,si_amp,si_ev,si_kx,si_kz,sigma_b,sin_th,spine_resolution,spot_init,spot_number,spot_size,ss_save,star_luminosity,steepness,strat_type,stratitype,stretch,t_0,t_b,t_cr,t_init_cgs,t_ss,tc,tcor_jump,thn,ths,time0,tm_bot,tm_top,tout,truncation_degree,truncation_scale,tt,twist,twist_a,twist_b,twist_c,u0,u_hill,upert,uu_right,vdampl_dust,vk0,vm,vtkfile,vv,wbot,weight,wid,width_k,width_npoly,width_ring,width_ring_a,width_ring_b,width_ring_c,width_tanh,width_tube,widthbb1,widthbb2,widthrho,widthuu,word,write_stratification_dat,wtran,x0_drop,x1,x_0,x_b,x_wind,xblobi,xi,xi0,xmax,xmid,xmin,xmodes,xpos,xscale,xshift,xv0,y0_drop,y1,y2,y_b,ybias_aa,yblobi,ymodes,yscale,yshift,yv0,z0_tanh,z1aa,z_0,z_b,z_cr,z_d,z_d_cgs,z_s,z_s_cgs,z_ss,z_tr,zblobi,zc,zmode_mag,zmodes,zpoly,zrho,zscale,zshift- Routines:
initial_condition_aa(),initial_condition_aatest(),initial_condition_all(),initial_condition_cctest(),initial_condition_chemistry(),initial_condition_chiral(),initial_condition_clean_up(),initial_condition_ecr(),initial_condition_fcr(),initial_condition_lncc(),initial_condition_lnrho(),initial_condition_lnrhon(),initial_condition_nd(),initial_condition_solid_cells(),initial_condition_ss(),initial_condition_uu(),initial_condition_uud(),initial_condition_uun(),initial_condition_uutest(),initial_condition_vvp(),initial_condition_xxp(),initialize_initial_condition(),read_initial_condition_pars(),register_initial_condition(),write_initial_condition_pars()
Needed modules
cdata: $Id$general(keep_compiler_quiet()): $Id$messages: $Id$
Variables
Subroutines and functions
- subroutine initialcondition/register_initial_condition()
Register variables associated with this module; likely none.
07-may-09/wlad: coded
- Called from:
- Call to:
- subroutine initialcondition/initialize_initial_condition(f)
Initialize any module variables which are parameter dependent.
07-may-09/wlad: coded
- Parameters:
- Called from:
- Call to:
- subroutine initialcondition/initial_condition_all([f[, profiles]])
Initializes all the f arrays in one call. This subroutine is called last.
21-dec-10/ccyang: coded 15-feb-15/MR: optional parameter ‘profiles’ added
- Parameters:
- Use :
- Called from:
- Call to:
- subroutine initialcondition/initial_condition_uu(f)
Initialize the velocity field.
07-may-09/wlad: coded
- subroutine initialcondition/initial_condition_lnrho(f)
Initialize logarithmic density. init_lnrho will take care of converting it to linear density if you use ldensity_nolog.
07-may-09/wlad: coded
- Parameters:
- Called from:
- subroutine initialcondition/initial_condition_ss(f)
Initialize entropy.
07-may-09/wlad: coded
- Parameters:
- Called from:
- subroutine initialcondition/initial_condition_aa(f)
Initialize the magnetic vector potential.
07-may-09/wlad: coded
- Parameters:
- Called from:
- subroutine initialcondition/initial_condition_aatest(f)
Initialize testfield.
07-may-09/wlad: coded
- Parameters:
- Called from:
register_testfield(),initialize_testfield(),init_aatest(),initialize_testfield_general()
- subroutine initialcondition/initial_condition_uutest(f)
Initialize testflow.
07-may-09/wlad: coded
- Parameters:
- Called from:
- subroutine initialcondition/initial_condition_lncc(f)
Initialize passive scalar.
07-may-09/wlad: coded
- Parameters:
- Called from:
- subroutine initialcondition/initial_condition_chiral(f)
Initialize chiral.
07-may-09/wlad: coded
- subroutine initialcondition/initial_condition_chemistry(f)
Initialize chemistry.
07-may-09/wlad: coded
- subroutine initialcondition/initial_condition_uud(f)
Initialize dust fluid velocity.
07-may-09/wlad: coded
- subroutine initialcondition/initial_condition_nd(f)
Initialize dust fluid density.
07-may-09/wlad: coded
- subroutine initialcondition/initial_condition_uun(f)
Initialize neutral fluid velocity.
07-may-09/wlad: coded
- subroutine initialcondition/initial_condition_lnrhon(f)
Initialize neutral fluid density.
07-may-09/wlad: coded
- subroutine initialcondition/initial_condition_ecr(f)
Initialize cosmic rays.
07-may-09/wlad: coded
- subroutine initialcondition/initial_condition_fcr(f)
Initialize cosmic ray flux.
07-may-09/wlad: coded
- subroutine initialcondition/initial_condition_solid_cells(f)
Initialize solid cells.
07-may-09/wlad: coded
- subroutine initialcondition/initial_condition_cctest(f)
Initialize testscalar.
07-may-09/wlad: coded
- Parameters:
- Called from:
register_testscalar(),initialize_testscalar(),init_cctest()
- subroutine initialcondition/initial_condition_xxp(f, fp)
Initialize particles’ positions.
07-may-09/wlad: coded
- subroutine initialcondition/initial_condition_vvp(f, fp, ineargrid)
Initialize particles’ velocities.
07-may-09/wlad: coded 16-jan-23/ccyang: pass ineargrid
- subroutine initialcondition/read_initial_condition_pars(iomsg)
- Parameters:
iomsg [character,out]
- Use :
- subroutine initialcondition/write_initial_condition_pars(unit)
- Parameters:
unit [integer,in]
- Called from:
get_datadir(),get_snapdir(),read_all_init_pars(),read_all_run_pars(),get_downpars()