 &topology
  nprocs=16,8,24
  nr=296
  nt=230
  np=503
 /
 &data
  r0=1.00
  r1=30.00
  rfrac=      0.000000E+00, 3.103429E-04, 1.286535E-02, 9.934256E-02,
    1.034483E-01, 1.000000E+00
  drratio=    6.597761E-01, 3.472222E+01, 4.972940E+00, 1.000000E+00,
    1.347953E+01
  nfrmesh=5
  tfrac=      0.000000E+00, 1.388889E-01, 8.611111E-01, 1.000000E+00
  dtratio=    4.919341E-01, 1.000000E+00, 2.032793E+00
  nftmesh=5
  pfrac=      0.000000E+00
  dpratio=    1.000000E+00
  nfpmesh=5
  phishift=0.000000E+00
!
! RESTART INFORMATION
!
  n_rs_output_file_parts=17
  n_rs_input_file_parts=17
  rsifile_prefix='../psp1th02aRK/'
  rsifile_root='psp1th02aRK'
!
! PLOTINFORMATION
!
  tpltxint=20.0
  trsdump=20.0
  plotlist='vr','vt','vp','br','bt','bp','jr','jt','jp','rho','t','heat','zp','zm','ep','em'
  tmax=300.0
!
! USE THESE IF you want the run to go
!
  ntmax=100000000
  dtmax=0.001
  dtmin=1e-7
  dt_init=1e-5
  dt_max_wave_cfl=200.
  ifprec_t = 3
  ifprec_v = 3
!
! USE THESE IF you want the run to stop immediately
!
!  ntmax=0
!  dtmax=1e-16
!  dtmin=1e-17
!  rs_final=.false.
!  ifprec_t = 1
!  ifprec_v = 1
!  ncghist = 100
!
  slund=5.e5
  eta_profile='UNIFORM'
!
  visc=.002
  visc_profile='UNIFORM'
!
  epscg_a=1.e-11
  epscg_v=1.e-9
  epscg_potfld=1.e-13
!
! CALCULATION FRAME
!
  calculation_frame='COROTATING'
  restart_calculation_frame='COROTATING'
!
! MAGNETIC FIELD SETUP
!
  initial_field='POTENTIAL_FIELD'
  bnfile='br_thermo_high_zmNrt20181023_1.4x_fb_diffused_tp.hdf'
  potential_field_bc = 'CLOSED_WALL'
  b_in_gauss=.true.
!
  initial_plasma='1dfile'
  onedfile='initial_1au_rho40k.dat'
  upwind_a=1.
  upwind_v=1.
  use_old_vdgv=.true.
!
  ncgmax=20000
!
  tchromo=17500.00
  tbc0   =17500.00
  rho0=40000.00
  char_bc=.true.
  ubzero=.false.
  cfl=.5
!
  advance_tc=.true.
  tcond=1.00
  t_cutoff1=3.50e5
  p_cutoff1=0.00
  nfilt_kappa=0
  radloss=1.00
  ifimplrad=0
  rad_law='CHIANTI_v713_HYBRID'
  tc_r=10.00
  tc_dr=1.00
  tc_fac0=1.00
  tc_fac1=0.00
  print_matrix_t=.false.
  alpha_nocoll=1.00
  tc_nocoll_r=10.00
  tc_nocoll_dr=1.00
!
  iftfloor=.true.
  tfloor=10000.
  ifcheck0temp=.true.
!
  ifrholimit=.true.
  rho_limit_factor = 0.007
  rho_limit_file = 'rho3d_initial_1au_rho40k.hdf'
!
  max_alfven_speed_rho_mod = 100.0
!
! HEATING. First 5 sources are empirical heating, turned off after WTD transition.
!
  heatsource(1)%active=.true.
  heatsource(1)%name='NL'
  heatsource(1)%use_mask=.false.
  heatsource(1)%type='exponential-b-photo-dependent'
  heatsource(1)%nl_mask=.true.
  heatsource(1)%h0=0.10
  heatsource(1)%lambda=0.03
  heatsource(1)%power=1.00
  heatsource(1)%b_profile%active=.false.
  heatsource(1)%b_attenuation=.false.
  heatsource(1)%r_profile%active=.false.
  heatsource(1)%t_profile%active=.false.
!
  heatsource(2)%active=.true.
  heatsource(2)%name='Quiet Sun Heating'
  heatsource(2)%type='br-dependent'
  heatsource(2)%h0=.044
  heatsource(2)%lambda=.2
  heatsource(2)%brmax=.25
  heatsource(2)%r_profile%active=.false.
  heatsource(2)%t_profile%active=.false.
  heatsource(2)%b_profile%active=.false.
  heatsource(2)%b_attenuation=.false.
!
  heatsource(3)%active=.true.
  heatsource(3)%name='FW'
  heatsource(3)%use_mask=.false.
  heatsource(3)%type='exponential'
  heatsource(3)%h0=0.000435
  heatsource(3)%lambda=1.00
  heatsource(3)%b_profile%active=.false.
  heatsource(3)%b_attenuation=.false.
  heatsource(3)%r_profile%active=.false.
  heatsource(3)%t_profile%active=.false.
!
  heatsource(4)%active=.true.
  heatsource(4)%name='SS'
  heatsource(4)%use_mask=.false.
  heatsource(4)%type='exponential'
  heatsource(4)%h0=0.10
  heatsource(4)%lambda=0.03
  heatsource(4)%b_profile%active=.false.
  heatsource(4)%b_attenuation=.false.
  heatsource(4)%r_profile%active=.false.
  heatsource(4)%t_profile%active=.false.
!
  heatsource(5)%active=.true.
  heatsource(5)%name='Active Region Heating'
  heatsource(5)%type='b-dependent'
  heatsource(5)%h0=.06
  heatsource(5)%power=1.0
  heatsource(5)%r_profile%active=.true.
  heatsource(5)%r_profile%f=1.,0.
  heatsource(5)%r_profile%x=2.
  heatsource(5)%r_profile%w=0.5
  heatsource(5)%t_profile%active=.false.
  heatsource(5)%b_profile%active=.true.
  heatsource(5)%b_profile%f=0.,1.
  heatsource(5)%b_profile%x=11.3
  heatsource(5)%b_profile%w=9.07
  heatsource(5)%b_attenuation=.false.
!
! HEAT 6: Keep SS heating with the WTD model
!
  heatsource(6)%active=.true.
  heatsource(6)%name='SS'
  heatsource(6)%use_mask=.false.
  heatsource(6)%type='zw-exponential'
  heatsource(6)%h0=0.10
  heatsource(6)%lambda=0.03
  heatsource(6)%b_profile%active=.false.
  heatsource(6)%b_attenuation=.false.
  heatsource(6)%r_profile%active=.false.
  heatsource(6)%t_profile%active=.false.
!
! HEAT 7: Keep a bit of FW heating with the WTD model
!
  heatsource(7)%active=.true.
  heatsource(7)%name='FW'
  heatsource(7)%use_mask=.false.
  heatsource(7)%type='zw-exponential'
  heatsource(7)%h0=.00010875
  heatsource(7)%lambda=1.00
  heatsource(7)%b_profile%active=.false.
  heatsource(7)%b_attenuation=.false.
  heatsource(7)%r_profile%active=.false.
  heatsource(7)%t_profile%active=.false.
!
  heating_flat_topped=.false.
  heat_mask_file=' '
!
  add_ohmic_heating = .false.
!
! WKB WAVE PRESSURE OPTIONS
!
  advance_pw=.true.
  pw0=0.17
  rho_aw=10.00
  awthprof_th=10
  awthprof2_th=-10
  awthprof_dth=-4.00
!
! WTD HEATING/PRESSURE PARAMETERS
!
  advance_zw = .true.
!
  wtd_z0 = 0.016330326
  wtd_b0 = 3.86834
  wtd_lambda0 = 0.01
!
  zw_dissp = .true.
  zw_reflection = .true.
  zw_add_heat = .true.
  zw_add_pw = .false.
  zw_add_reynolds = .false.
!
  zw_uwc_s = 0.0
  zw_uwc_z = 1.0
!
  fluxlim_gradzw = .true.
  fluxlim_gradsrc = .false.
  wtd_flux_limiter='ospre'
  zw_cfl=0.9
!
  zw_amplitude_limit = .true.
  zw_amplitude_value = 1.6
  zw_radial_limit = .true.
  zw_radial_limit_file = 'zw_limit_test01.dat'
!
  zw_keep_exponential_heat = .true.
!
  zw_field_aligned_reynolds = .true.
  zw_field_aligned_pressure = .false.
!
  zw_use_radial_rhoaw=.false.
  zw_rho_aw = 3.0
!
  zw_use_effective_rho=.true.
  zw_effrho_lr=2.20412
  zw_effrho_lw=0.3
!
  zw_limit_horho=.true.
  zw_limit_horho_rlim=8.0
  zw_limit_horho_value=5.e-2
!
  use_chromo_heat=.true.
  chromo_heat_t_zqc_0=10000.0
  chromo_heat_t_zqc_1=40000.0
  debug_chromo_heat=.false.
!
  rhobc_maxfac_r1 = 0.1
!
! TIME PROFILE FOR WKB WAVE PRESSURES AT INNER BOUNDARY
!
  tprofile(1)%t=0.00,0.50,1.00
  tprofile(1)%f=0.00,0.00,1.00
  tprofile(1)%vars='pw0_factor'
!
! TIME PROFILE FOR WTD HEATING TRANSITION (transition from t=20-25).
!
  tprofile(2)%t=0.0, 20.0, 25.0
  tprofile(2)%f=0.0, 0.0 ,  1.0
  tprofile(2)%vars='zw_heat_factor'
!
! TIME PROFILE FOR WTD WAVE PRESSURE TRANSITION (turned off here).
!
  tprofile(3)%t=0.0, 1.0
  tprofile(3)%f=0.0, 0.0
  tprofile(3)%vars='zw_pressure_factor'
 /
!
! psp1th02aR (svn mas_wtd r210)
! ----------------------
! - this run is now restarting psp1th02aRK from 154.265
!  - this arch is faster but taking a TON of time in the queue.
! - use the latest version (update r209) of mas because the restart bug was causing sklake restarts
!   to fail in the write stage (but not KNL... wierd)
! - update r204 also fixed the bug in init_zw that was causing io crash for large core counts.
!
! psp1th02a (svn mas_wtd r202)
! ----------------------
!
! - psp1th01b ran to 300 (dtmax trick worked!) and we looked at it a bit.
!  - MLSO suggests that it is still not quite dense enough.
!  - EUV suggesets that it is not quite hot enough.
!  - The coronal holes also looked a bit wide, but that could have also been where
!    was looking.
!
! - Otherwise 01b was OK but it had older data (CR2208) and we can have most of 2209 
!   before the preliminary run needs to be done --> run with newer data
!
! - ZM produced a new map for the HMI NRT data available on 20181023.
!  - it has slightly weaker poles than before but is made/processed the same way
!
! - Because I can, I will increase the heating by 20% (multiply z0 by sqrt(1.2)
!
! - Start again from t=0, go to 300.
!
! - Running on stampede2 because NAS will have a shutdown.
!
! psp1th01b (svn mas_wtd r202)
! ----------------------
!
! - psp1th01a died at 11.88 because of instability at the pole
!   near r=20
! - we probably aren't resolving the polar field varation well enough or
!   i'm not supplying enough heat with the wtd model.
! - I know in the past i can get around it with a smaller dtmax --> go from 0.003
!   to 0.001.
! - restart from 80, hopefully the solution will have enough time to fix itself
!
! psp1th01a (svn mas_wtd r202)
! ----------------------
!
! - Preliminary thermo case for the first perihelion pass of Parker Solar Probe.
! 
! - The setup / constraints for this run series are as follows:
!
!  A) MAGNETOGRAM: Here we use the HMI synoptic map for CR2208 (2018/09/02 - 2018/09/29).
!    - ZM estimated the polar field strengths and uses his pole filling script to add
!      mixed polarity fluxes, whose net flux match his polar field estimates.
!      - This is the same approach we used in the eclipse case.
!    - The combined ZM map was processd and diffused to the mesh resolution by CD.
!    - I did this here: downstown: /Users/cdowns/work/runs/ParkerPass1/Magnetogram
!      - see 02c_prelim_zm_map.txt and the directory thermo_high_zm2208_1.4x
!
!  B) MAGNETOGRAM SCALING: we use the same approach as the eclipse and scale br by 1.4.
!
!  C) HEATING MODEL: same as the eclipse prediction, including the 1/4x FW correction.
!
!  D) WAVE PRESSURE MODEL: increase pw0 slightly from eclipse because we thought  
!     that the eclipse wind was a bit too slow.
!    - Zoran suggested pw0=0.17, which is based on ZMs analysis of doing interplanetary 
!      sims using eclipse coronal boundary conditions for 2018 Solar Wind conference.
!
!  E) RADIATION LAW: This run uses CHIANTI_v713_HYBRID abundances.
!    - The eclipse model had densities that were a bit too low. This will bring them
!      up a bit, at the cost of the field opening a bit more. 
!
!  E) SIMULATION FRAME:
!    - Because we want the spiral to be better, run this in the co-rotating frame.
!    - We "think" this should be fine despite the questions about the invariance of
!      the visc operator...................
!
!  F) MESH: 
!    - extend mesh to 30Rs to ensure we are beyond the sonic point. This might take
!      a bit longer to relax but it is important as we learned.
!    - the angular resolution is 0.0125 and uniform in phi.
!    - the mesh setup was done by the same idl script as the magnetogram processing:
!      downstown:/Users/cdowns/work/runs/ParkerPass1/Magnetogram/02c_prelim_zm_map.txt
!    - the total number of points is 34 million, compared to 65 used by the eclipse case.
!
!  G) OTHER MISC:
!    - I set the wave cfl to 200
!    - I set chromo_heat_t_zqc_1=40000.0 like in my prior hybrid 1d/3d experiments.
!      - the eclipse used chromo_heat_t_zqc_1=30000.0 (ideal for coronal abundances).
!    - Because the outer boundary is 30Rs, set tmax to 300.
!    - I set dtmax=0.003 (vs. 002) mainly because the field strengths (wavecfl) are so low.
!
