#!/usr/bin/env bash
export OPENGGCMDIR=$HOME/5.3/openggcm
$OPENGGCMDIR/bin/script.runme $(pwd) $(basename $0) 0; exit

#---------------------------------------------------------------
#  This file defines the input parameters, how they are used,
#  upper/lower bounds, choices, etc.
#  Each parameter in the input file must have an entry here.
#  Hashes are comment characters if they appear in col. 1
#  Blank lines are ignored.
#  variable names can be either upper or lowercase.
#  Blanks and special characters must be protected by placing {}
#  around a value.  Use {{ and }} if value contains braces itself.
#  All 'def' (default) variables are 'eval'ed.
#  Continuation lines have a blank in 1. col.
#  JR, 2000-12-28
#---------------------------------------------------------------
#  scope:
#    shell   - used in runme scripts (tmp.csh)
#    hash    - used by fortran code (jimmy-fortran) (tmp.h)
#    logical - used by fortran code (jimmy-fortran) (tmp.h)
#    inf     - model runtime input (added to in.$RUN) (tmp.i)
#---------------------------------------------------------------
#  precompilation actions and basic switches
#---------------------------------------------------------------
RUN              default  
OUTDIR           default  
TARGETDIR        pp
DOSMF            default  
DOINP            default  
DOGRD            default  
KEEPTMP          1
GGCMDIR          default  
#  TARGET           STOP           
#  TARGET            marvin-Ofast
#  TARGETHOST       plasma.unh.edu
TARGET            remote-unh-quads-03
TARGETHOST       moose.sr.unh.edu
TUSER            jraeder  
TARGETPREP       default  
RUNTIME           94:00:00 
CLASS            default  
PRECISION        default  
MHDCOORD         default  
MHD              default  
SATOUT           default  
TIMELO           default  
CALCE_ASPECT_LOW  default  
LIMIT_ASPECT_LOW  true     
DO_LIMIT2        default  
DO_LIMIT3        false    
DO_LEGACY        false    
CONF_ARGS        --without-hdf5
#---------------------------------------------------------------
#------------- profiling and debugging -------------------------
#---------------------------------------------------------------
LOCALF77         gfortran
MPIF77           default  
MPIF77_FLAGS     default  
MPIF90           default  
MPIF90_FLAGS     default  
MPICC            default  
MPICC_FLAGS      default  
MPICXX           default  
MPICXX_FLAGS     default  
MPIF77OPT        default  
DEBUG_LEVEL      default  
CHECK_MHDVAR     default  
CHECKSUMS        default  
DO_BADVAL_CHECKS  default  
#---------------------------------------------------------------
#------ the input source files
#---------------------------------------------------------------
GLOBU            default  
GRIDA            default  
GRIDB            default  
GRIDC            default  
MHDSC            default  
COTR1            default  
MINVA            default  
CTIM             1.0.10   
#---------------------------------------------------------------
#------  grid definition
#---------------------------------------------------------------
NPX              5   #7       # nx must be divisible by this (def=1)
NPY              3       # 2*ny must be divisible by this (def=1)
NPZ              3       # 2*nz must be divisible by this (def=1)
NX               505           #  (def=100)
NY               240      #  (def=32)
NZ               240      #  (def=32)
DY0              0.120    # (WDC:0.25,JR:0.25) minimum cell size in y (def=0.5)
DZ0              0.120    # (WDC:0.25,JR:0.25) minimum cell size in z (def=0.5)
XX1              -18.01   # sunward extension of box (def=-21.01)
XX2              3000.01  # anti-sunward extension of box (def=250.01)
YY2              36.01    # box size in +-y (def=36.01)
ZZ2              36.01    # box size in +-z (def=36.01)

# switching this to 1 means the runme will try to build libmrc on the host
# machine and generate the mrc grid at runme time
RUNMEGEN_MRC_CRDS  default  #  (def=1)
# this is how one overrides x grid shape if crds_gen_type is fortran
# the cubic grid is: 1.0+150.0*fsm3(x,4.0,400.0)+2.0*fsm3(x,-8.0,-30.0)
# to use tanh parameters with the cubic grid: 
# hmm+(h0-hm)*fsm3(x,x1+4./b1,x1-4./b1)+(hn-hm)*fsm3(x,x5-4./b2,x5+4./b2)+
# (hm-hmm)*(fsm3(x,x3-dmm+4./b3,x3-dmm-4./b3)+fsm3(x,x3+dmm-4./b3,x3+dmm+4./b3))



DXFUNC     1.0+250.0*fsm3(x,4.0,600.0)+2.0*fsm3(x,-8.0,-30.0)
# DXFUNC     1.0+150.0*fsm3(x,4.0,400.0)+2.0*fsm3(x,-8.0,-30.0)
# DXFUNC default #(def= hm+(h0-hm)*tanhm(b1*(x-x1))+(hn-hm)*tanhp(b2*(x-x5))-(hm-hmm)*(1.0-tanhm(b3*(x-(x3-dmm)))-tanhp(b3*(x-(x3+dmm)))) )



# this is how one can set the x grid shape at run time:
# choose "ggcm_x_tanh" or "ggcm_x_cubic" in x direction,
# "ggcm_yz" in y/z directions
CRDS_GEN_X_TYPE  default  #  (def=fortran)
CRDS_GEN_Y_TYPE  default  #  (def=fortran)
CRDS_GEN_Z_TYPE  default  #  (def=fortran)
GGCM_MHD_CRDS_LEGACY_FD1  default  # when turned on, use the dx func for fd1 crds instead of 1/0.5(x_i+1 - x_i-1), only use this if you want to compare with old fortran crds behavior (def=0)
#.... how the x-grid is defined
#
# tanh:    f = fak*(hm + (h0-hm)*tanhm(b1*(x-x1)) + (hn-hm)*tanhp(b2*(x-x5))
#              - (hm-hmm)*(#one-tanhm(b3*(x-(x3-dmm)))-tanhp(b3*(x-(x3+dmm)))) )
#
# cubic:   f = w0 + w1 * fsm(x, a1, b1) + w2 * fsm(x, a2, b2)
#
# !! IMPORTANT NOTE !!
# these variables (x1, x3, dmm, etc.) are put into in.$RUN, and prefixed with crds_gen_x_
# Keep in mind that one should set all ggx variables when changing crds_gen_x_type... so
# if you put something like b1 in ggx1 and don't set ggx4, the default from ggx4 will
# be used... people are definately going to stub their toes on this one.
# However, it is always respected if you use the bare "crds_gen_x_dmm  15" in your runme
# since those go at the beginning of in.$RUN
GGX1             default  # n:NX, x0:minx, xn:maxx (def= $v="-n   $NX     -x0 $XX1     -xn $XX2 " )
GGX2             default  # x1:center of sunward curve, x3:midpoint of secondary curves, dmm:distance of secondary curves from midpoint, x5:center of tailward curve (def= $v="-x1  -26     -x3   -4     -dmm  16    -x5   80 "  )
GGX3             default  # h0:height of sunward curve above hm, hn:height of tailward curve above hm, hm:height of secondary curves above hmm, hmm:minimum curve height (def= $v="-h0  2.0     -hn   20     -hm 1.00   -hmm 0.60 " )
GGX4             default  # b1:controls sunward curve width, b2:controls tailward curve width, b3:controls secondary curve widths (def= $v="-b1  0.15    -b2  0.025   -b3  0.3 " )
#.... how the x/z-grids are defined
# y / z parameters can be tweaked individually by just putting
# something like "crds_gen_y_xm  0.6" into your runme for instance
GGYZ1            default  #  (def= $v="-xn 2.0  -xm 0.5 " )
#---------------------------------------------------------------
#-------------- mirror dipole ----------------------------------
#---------------------------------------------------------------
XPOS_MIR         default  #  (def=-15.)
MIRDIP           default  #  (def=true)
XXX1             default  # initial magnetosphere transition max (def=14.0)
XXX2             default  # initial magnetosphere transition min (def=12.0)
RRINI            default  # initial density inside magnetosphere (def=3.0)
R1LIM            default  # set initial condition down to this radius (def=1.5)
#---------------------------------------------------------------
#-------------- resistivity ------------------------------------
#---------------------------------------------------------------
MAGDIFFU         nl1
DIFFTHRESHOLD    0.95
DIFFCONSTANT     0.05
DIFFSPHERE       default  # No resistivity inside of this (def=6)
DIFF_TIMELO      default  # No NL1 resistivity before this time (def=600.)
DIFF_SWBND       default  # No NL1 resistivity to the left of this (def=-15.)
DIFF_OBND        default  # No NL1 resisitvity this close to the boundaries (def=4)
D_I              default  # ion skin depth (def=0.)
#---------------------------------------------------------------
#-------------- output unit normalizations ---------------------
#-------------- note: works only with diags=diagsc -------------
#---------------------------------------------------------------
BBNORM0          default  # Output units will be bbnorm0 T, ie nT by default  (def=1e-9)
VVNORM0          default  # Output units will be vvnorm0 m/s, ie km/s by default  (def=1e3)
RRNORM0          default  # Output units will be rrnorm0 kg/m**3, ie amu/cm**3 by default  (def=1.6605655E-21)
PPNORM0          default  # Output units will be ppnorm0 Pa, ie pPa by default (def=1e-12)
CCNORM0          default  # Output units will be ccnorm0 A/m**2, ie muA/m**2 by default (def=1e-6)
EENORM0          default  # Output units will be eenorm0 V/m, ie mV/m by default (def=1e-3)
RESNORM0         default  # Output units will be resnorm0 V*m/A, ie V*m/A by default (def=1.0)
#---------------------------------------------------------------
#---------- output control -------------------------------------
#---------------------------------------------------------------
DIAGS            fdiag2   
OUTPUTMODE       combined  
DIAGSC_SRV       default  # C diag: type of diag srver: nocache,cache (def=nocache)
HDF5_DIR         ""       # Directory where to find HDF5 incl/lib (def= $ENV'HDF5_DIR')
CDF_DIR          default  # Directory where to find cdf include/ and lib/ (def=)
DIAG_MAXFLD      default  # Number of 3d fields to cache (def=23)
NPDIAG           default  # Number of diag servers to create (def=1)
OUTTIMERUN       -9999999
OUTTIME2D        -60
OUTTIMEIO        -600
OUTTIMERC        -60
OUTTIME3D        -240      
outsub3d         -1:49:-17:17:-23:23   # -20:100:-22:22:-22:22    NONE  does not vibe with readmhd
OUTTIMEEX        7200:999999:10 # A:B:C.. increase output cadence by C between A and B (def=0)
OUTPLANEX        0        
OUTPLANEY        0
OUTPLANEZ        0        
ETAJOUT          false
ORBIT_DT         10
ORBITFILE        orbits.txt  
MODTTY           default  # Every how many time steps to write one output line. (def=1)
MAKEIOA          true     # make IPE ionosphere input files (def=false)
#---------------------------------------------------------------
#---------- checkpoint/restart ---------------------------------
#---------------------------------------------------------------
CHECKPOINT       default  # When to write checkpoint files. (def=10000000)
RESTART          default  # Restart from this checkpoint number. Start up regularly if 0 (default). (def=0)
#---------------------------------------------------------------
#---------- time step control ----------------------------------
#---------------------------------------------------------------
RRMIN            0.10     # minimum permitted number density in cm**-3 (def=0.20)
SPEEDLIMIT       1500     # maximum permitted Alfven speed in km/s  (def=1500.0)
THX              0.30     # cfl time step factor (def=0.35)
MODNEWSTEP       1        # recalculate cfl limit every 'modnewstep' step (def=1)
DTMIN            default  # minimum allowed timestep (def=.0002)
#---------------------------------------------------------------
#---------- Times, Solar Wind / IMF ----------------------------
#---------------------------------------------------------------
STARTTIME        2004:05:08:10:00:00.00    # UT when the run starts
ENDTIME          2004:05:08:15:00:00.00
DIPOLTIME        2004:05:08:12:00:00.0                #  time for dipole orientation
ALPHAFAK         1.00     # (WDC:1.10,JR:1.10) Density factor to account for SW alphas (def=1.00)
SWMON            win    # Solar wind monitor sc (wi/ac/i8/ge/fi), use 'fi' if none. (def=fi)
SWFILE           minvar   # File with SW/IMF. This can also be "auto" or "minvar", in which case the input file is automatically generated. These options require that the following variables are set and that the corresponding raw data are available. (def= $v="./swdata"; )
SETIMFBX         0        # For automatic generation, specifies the IMF Bx if necessary (for "auto"). (def=none)
INPAVE           30       # (WDC:30,JR:30) averaging interval for input files, seconds (def=60)
IDATA            ./20040508  # 
F107             100
MOX              0
MOY              0
MOZ              30
SWTURB1          false    # Add turbulence to solar wind input. (def=false)
SWTURB_VV        0.0      # SW turbulence velocity perturbation. (def=0.0)
SWTURB_RR        0.0      # SW turbulence density perturbation. (def=0.0)

#---------------------------------------------------------------
#--------------------- Dipole Rotation -------------------------
#---------------------------------------------------------------
DO_DIPROTATE     default  # Rotate the dipole, 0=off, 1=on (def=0)
MODDIPCOEFF      default  # update mapping coefficients every moddipcoeff steps (def=100)
MODDIPFIELD      default  # updipole field every "moddipfield" steps (def=1)
#---------------------------------------------------------------
#-------------- MI coupling and ionosphere ---------------------
#---------------------------------------------------------------
ISPHERE          2.1      # inner boundary radius (RE) (def=3.0)
IONODT           10       # do iono every ionodt secs (def=30.0)
IO_SHIELD_LAT    30.0     # ionosphere shielding latitude (boundary where pot=0) (def=50.0)
BND_IO_RR        1.0      # density at inner boundary in cc (def=2.0)
BND_IO_TT        400      # temperature at inner bndry in eV (def=50)
NTHETA           default  # ionosphere grid latitude points (def=361)
NPHI             default  # ionosphere grid longitude points (def=121)
NIOX             default  # no of panels in theta for one hemisphere (def=40)
NIOY             default  # no of modes in phi (def=8)
NIOGO            default  # order of gauss legendre integration (def=4)
NJSLIDE          default  # fac sliding time averages (def=2)
SIGMATRANS       15000    # After which timestep begin transition to self-consistent sigmas. Use a very large value for constant conductivity. (def=5000000)
SIGMAFAK         1.0      # factor to multiply all ionosphere conductances. (def=1.0)
MAPE1            1.0      # MI coupling factor for mapped E (def=1.0)
EMAPFAK          1.0      # factor for adjusting delta of finite diff calc for e-field map coef (def=1.0)
FAC_FILT         2        # how often to spatially filter FAC (def=4)
SIG_FLOOR        2.0      # minimum sigmas (nightside not actually zero), sigh uses 0.5*sig_floor (def=0.5)
SIG_FLOOR_START  3.0      # minimum sigmas for startup, sigh uses 0.5*sig_floor_start (def=3.0)
SIG_FLOOR_TRANS  default  # After which timestep begin transition from sig_floor_start to sig_floor (def=0)
FAK_FAC_DYN      default  # factor for dynamo currents (only w/ctim)  (def=1.0)
FAK_FAC_RCM      default  # factor for rcm fac when blending with mhd  (def=1.0)
SIG_SMOOTH       default  # spatially smoothing sigmas (def=2)
SIG_CONST        default  # constant sigma (S) for startup  (def=5.0)
SIG_H_BACK       default  # nightside P background conductance (def=0.3)
SIG_P_BACK       default  # nightside P background conductance (def=0.5)
SIG_TI_TE        5.0      # ion-to-electron temperature ratio for precipitation (def=1.0)
SIGFAC_FAK       default  # fudge factor for discrete e-flux (def=1.0)
SIGFAC_FAK2      default  # fudge factor for discrete e-mean energy (def=1.0)
SIGDIF_FAK       default  # fudge factor for diffuse e-flux (mhd) (def=1.0)
SIGDIF_FAK2      default  # fudge factor for diffuse e-mean energy (mhd) (def=1.0)
SIGDIF_FAK_RCM   default  # fudge factor for diffuse e-flux (rcm) (def=1.0)
SIGDIF_FAK2_RCM  default  # fudge factor for diffuse e-mean energy (rcm) (def=1.0)
MHD_IONO_IGNORE_INVALID_MAPPING  false   
#---------------------------------------------------------------
#-------------- normalization constants ------------------------
#---------------------------------------------------------------
RE               default  # earth radius (def=6371040.0)
DIPOLESTRENGTH   default  # dipole strength (def=30574.0)
EARTH_MAG_MOMENT  default  # earth magnetic moment (def=0.79064817E+23)
#---------------------------------------------------------------
#-------------- memory management ------------------------------
#---------------------------------------------------------------
BIGDIM           default  # Size of global global memory array. 
#---------------------------------------------------------------
#-------------- CTIM specific inputs ---------------------------
#---------------------------------------------------------------
CTIM_IN          default  # dir containing ctim input data files (def="./ctim-indata")
CTIM_START_TIME  default  # CTIM start time in seconds (def=300.0)
CTIM_DELTA_T     default  # CTIM calling frequency in seconds (def=60.0)
CTIM_POTFAK      default  # factor for driving ctim potential (def=1.0)
CTIM_F_PRSXXXX   default  # This is either an ascii file that contains everything included in the 'prs', 'mmm', and 'vel' files (in which case ctim_f_mmmxxxx and ctim_f_velxxxx are not used), or the binary 'prs' file. (def="$CTIM_IN/inp_ctim.fields.20000921000.asc")
CTIM_F_MMMXXXX   default  #  (def="$CTIM_IN/inp_ctim.mmm20000921000")
CTIM_F_VELXXXX   default  #  (def="$CTIM_IN/inp_ctim.vel20000921000")
CTIM_F_BMAGFLD   default  #  (def="$CTIM_IN/inp_ctim.bmagfld")
CTIM_F_SUBSTORM  default  #  (def="$CTIM_IN/inp_ctim.substorm")
CTIM_F_CORMAG    default  #  (def="$CTIM_IN/inp_ctim.cormag")
CTIM_F_DATAM     default  #  (def="$CTIM_IN/inp_ctim.datam")
CTIM_F_LEVPI     default  #  (def="$CTIM_IN/inp_ctim.levpi")
CTIM_F_GWATTS    default  #  (def="$CTIM_IN/inp_ctim.gwatts")
CTIM_F_CPCPD     default  #  (def="$CTIM_IN/inp_ctim.cpcpd")
CTIM_F_IONPROF   default  #  (def="$CTIM_IN/inp_ctim.ionprof")
CTIM_F_PROF2     default  #  (def="$CTIM_IN/inp_ctim.prof2")
CTIM_F_DMSP      default  #  (def="$CTIM_IN/inp_ctim.dmsp")
CTIM_F_HOLT      default  #  (def="$CTIM_IN/inp_ctim.holt")
CTIM_F_DMSPMOD   default  #  (def="$CTIM_IN/inp_ctim.dmspmod")
CTIM_F_RICE91    default  #  (def="$CTIM_IN/inp_ctim.rice91")
CTIM_F_RICEPROF  default  #  (def="$CTIM_IN/inp_ctim.riceprof")
CTIM_F_HPROF     default  #  (def="$CTIM_IN/inp_ctim.hprof")
CTIM_F_HOUGH     default  #  (def="$CTIM_IN/inp_ctim.hough")
CTIM_F_INSHAUN   default  #  (def="$CTIM_IN/inp_ctim.d1d2")
CTIM_I10         default  # I10 is the smothing frequency. (def=5)
CTIM_I5          default  #  i5 is mwt calling frequency. (def=1)
CTIM_I8          default  #  i8 is shaun frequency. (def=6)
CTIM_WINDMX      default  # maximum wind (def=1000.0)
CTIM_TMPMIN      default  # minimum temperature (def=130.0)
CTIM_AMPL22      default  # amplitudes of the tidal model (def=608.0)
CTIM_AMPL23      default  #  (def=500.0)
CTIM_AMPL24      default  #  (def=138.0)
CTIM_AMPL25      default  #  (def=138.0)
CTIM_AMPL11      default  #  (def=200.0)
CTIM_PHASE22     default  # Phases of tidal model. (def=9.6)
CTIM_PHASE23     default  #  (def=4.6)
CTIM_PHASE24     default  #  (def=1.2)
CTIM_PHASE25     default  #  (def=2.2)
CTIM_PHASE11     default  #  (def=12.0)
CTIM_KP          default  # kp index (def=3)
CTIM_XX          default  # global setting??? (def=91)
CTIM_AMP         default  # ratio of E foster field to real E field. (def=1.3)
CTIM_SWITCH_1    default  # ctim boolean switches (def=1)
CTIM_SWITCH_2    default  #  (def=1)
CTIM_SWITCH_3    default  #  (def=0)
CTIM_SWITCH_4    default  #  (def=1)
CTIM_SWITCH_5    default  #  (def=0)
CTIM_SWITCH_6    default  #  (def=0)
CTIM_SWITCH_7    default  #  (def=1)
CTIM_SWITCH_8    default  #  (def=1)
CTIM_SWITCH_9    default  #  (def=1)
CTIM_SWITCH_10   default  #  (def=1)
CTIM_SWITCH_11   default  #  (def=0)
CTIM_SWITCH_12   default  #  (def=0)
CTIM_SWITCH_13   default  #  (def=1)
CTIM_SWITCH_14   default  #  (def=1)
CTIM_SWITCH_15   default  #  (def=1)
CTIM_SWITCH_16   default  #  (def=1)
CTIM_SWITCH_17   default  #  (def=0)
CTIM_SWITCH_18   default  #  (def=0)
CTIM_SWITCH_19   default  #  (def=0)
CTIM_SWITCH_20   default  #  (def=0)
CTIM_SWITCH_21   default  #  (def=0)
CTIM_SWITCH_22   default  #  (def=0)
CTIM_SWITCH_23   default  #  (def=0)
CTIM_SWITCH_24   default  #  (def=1)
CTIM_SWITCH_25   default  #  (def=1)
CTIM_SWITCH_26   default  #  (def=1)
CTIM_SWITCH_27   default  #  (def=1)
CTIM_SWITCH_28   default  #  (def=1)
CTIM_SWITCH_30   default  #  (def=0)
CTIM_SWITCH_31   default  #  (def=0)
CTIM_SWITCH_32   default  #  (def=1)
CTIM_SWITCH_33   default  #  (def=0)
CTIM_SWITCH_34   default  #  (def=0)
CTIM_SWITCH_35   default  #  (def=0)
CTIM_SWITCH_37   default  #  (def=1)
#---------------------------------------------------------------
#---------------------------------------------------------------
#-------- Inner magnetosphere specific inputs ------------------
#--------          (RCM, CRCM, CIMI)          ------------------
#--  NOTE: species 1=electron, 2=proton, 3=O+, 4=He+ for all ---
#-----  (RCM only handles electrons and protons for now)  ------
#---------------------------------------------------------------
RCMCODE          none     #  (def=none)
# --- generic ring current model variables
RCM_IDT1         default  # [sec] how often to call RC, output rcm files (def=60)
RCM_FB_PRECON    default  # time for first call to rcm (def=5400.0)
RCM_IONO         default  # ionosphere altitude km (def=120.0)
RCM_PLASMASPHERE  default  # Use a primitive model for the plasmasphere. (def=.FALSE.)
RCM_PLSFAC       default  # multiply plasmaspheric density by this factor (if rcm_plasmasphere is .TRUE.) (def=0.01)
RCM_DEBUG        default  # if fdiag2, write pp, rr, fbmask to RUN_RCM.pXX_0 files (def=false)
RCM_DEBUG_LEVEL  default  # if >0 write mhd-rc exchange info to RUN_RCM.in file (def=0)
# --- variables which influence rc boundary location
RCM_XX1          default  # sunward boundary of rcm domain (def=-10.0)
RCM_XX2          default  # anti-sunward boundary of rcm domain (def=20.0)
RCM_YY1          default  # +- y boundary of rcm domain (def=20.0)
RCM_ZZ1          default  # +- z boundary of rcm domain (def=20.0)
RCM_MIN_B        default  # if positive, consider fieldlines with |B| < rcm_min_b to be open for the purposes of the rcmcode (def=0.0)
RCM_MAX_BETA     default  # maximum allowed beta in equatorial plane. negative values represent infinity. (def=-1.)
# --- variables which influence (MHD) feedback
RCM_PP_RR_FEEDBACK  default  # pressure and density feedback (def=yes)
RCM_FB_STRENGTH  default  # Strength factor for rcm feedback nudging - affects the speed of mhd press approaching rcm press (def=0.01)
RCM_FB_KICKIN_TIME  default  # at this time feedback starts to kick in the case where rcm_pp_rr_feedback is yes (def=7200.0)
RCM_FB_RAMP_UP   default  # ramp up the rcm feedback over this many seconds (def=3600.0)
RCM_FEEDBACK_BND  default  # If positive, feedback only to this radial L shell (def=10.0)
RCM_FB_MIN_B     default  # if positive, don't feedback on fieldlines where |B| < rcm_fb_min_b (def="$RCM_MIN_B")
RCM_FB_B_CEIL    default  # partially limit feedback up to |B| = rcm_fb_b_ceil (def=100.)
RCM_MAKE_NEW_FAC  default  # overwrite MHD FAC with RCM FAC if RCM FAC is not zero (def=false)
RCM_MAKE_NEW_PRECIP  default  # overwrite MHD diffuse precip with RCM precip (def=false)
RCM_DIAG         default  # write diagnostics for rcm feedback in the 2d (pXX), 3d (3df) output files; pp, rr, mask (def=1)
# --- variables for fieldline tracing ---
RCM_RFLMAX       default  # max allowed field line length (def=80.0)
RCM_RMAX         default  # field line is considered open if further than this (def=15.0)
RCM_FLSTEPSIZE   default  # stepsize to take when calculating fieldline (def=0.05)
RCM_RMIN_DIP_MHD_BLEND  default  # lower boundary for dipole-mhd blend -- below this is only dipole (def=4.5)
RCM_RMAX_DIP_MHD_BLEND  default  # upper boundary for dipole-mhd blend -- beyond this is only mhd (def=6.5)
FL_HUEN          default  # Use (2nd order) huen method for fieldline tracing (instead of 1st order Euler) (def=.true.)
#do_rcm_input_diag    scope=logical:shell type=choice def=false choice=true:false
#                     help={Write the fieldline tracer output
#                           to a file as a diagnostic}
#---------------------------------------------------------------
#------  Parallel Fieldline Tracer Module (not implemented) ----
#---------------------------------------------------------------
#rcm_serial_fb_tracer scope=logical:shell type=choice def=false choice=true:false
#                     help={(NOT USED) Use serial feedback tracer,
#                           (even if parallel_tracer is true)}
#rcm_serial_tracer    scope=logical:shell type=choice def=false choice=true:false
#                     help={(NOT USED) Use serial forward tracer,
#                           (even if parallel_tracer is true)}
#parallel_tracer  scope=logical:shell:inf type=choice def=false choice=true:false
#                 help={(NOT USED) Use parallel fieldline tracing module}
#npar_trace       scope=shell:hash:inf def=0
#                 help={(NOT USED) Use npar_trace processes for tracing.
#                       Only used if parallel_tracer is true}
#par_trace_debug  scope=logical type=choice def=false choice=true:false
#                 help={(NOT USED) print verbose debugging messages
#                       for parallel tracer}
#fl_use_cotr      scope=logical type=choice def=false choice=true:false
#                 help={(NOT USED) use cotr to get dipole field
#                       instead of coordinate
#                       independent (analytic) formula for dipole}
#-----------------------------------------------------------------------------
#-- Rice Convection Model (RCM) specific inputs (tmp.rcm.in, rcm_include.h) --
#-----------------------------------------------------------------------------
RCM_NTHETA       default  # rcm grid latitude points (max=360) (def=200)
RCM_LAT_HIGH     default  # [deg] high latitude boundary in ionosphere (def=82.0)
RCM_LAT_LOW      default  # [deg] low latitude boundary in ionosphere (def=45.0)
RCM_NPHI         default  # rcm grid longitude points (incl. 3 wrap points) (max=123) (def=101)
RCM_BND_X_SUN    default  # rcm ellipse boundary +Xsm (sunward) location (def=10.0)
RCM_BND_X_TAIL   default  # rcm ellipse boundary -Xsm (tailward) location (def=-13.0)
RCM_BND_Y        default  # rcm ellipse boundary +/- Ysm location (def=12.0)
RCM_BND_KAPPA    default  # Use kappa distribution at boundary instead of maxwellian to convert pressure to eta (def=.FALSE.)
RCM_KAPPA_ELE    default  # kappa for electrons (def=3)
RCM_KAPPA_ION    default  # kappa for ions (def=6)
RCM_IDEBUG       default  # if 0, produce extra rcm data files (def=1)
RCM_IDT          default  # basic time step in program (def=2)
RCM_IDT2         default  # [sec] t-step for writing formatted output (def=($RCM_IDT1)*5)
RCM_IDT3         default  # t-step for edge cleanup (invoking ADD & ZAP) (def=600000)
RCM_IVOPTN       default  # 1 is euler time derivs in vcalc, 2--runge-kutta (def=1)
RCM_NSMTHI       default  # How much to smooth cond in I (def=0)
RCM_NSMTHJ       default  # How much to smooth cond in J (def=0)
RCM_DSTMIN       default  # min allowed dist. between adjacent pnts (def=1.5)
RCM_DSTMAX       default  # max allowed dist. between adjacent pnts (def=3.1)
RCM_RHOMAX       default  # max correction factor in adding inner edge tracer points (def=0.5)
RCM_VMFACT       default  # flux tube volume factor in adding inner edge tracer points (def=0.1)
RCM_EPSLON       default  # correct motion at inner edge; in MODULE rcm_mod_edgpt (def=0.0001)
RCM_DLIM         default  # min tail thickness for FMRWIF (def=0.25)
RCM_I_ADVECT     default  # advance eta dist. ;1-interpolate, 2-CLAWPACK/inter, 3-CLAWPACK, 4-CLAWPACK v2 (def=3)
RCM_KILL_FUDGE   default  # remove fudge factors for Vpara calc; .true. means no loss (def=.FALSE.)
RCM_DKTIME       default  # use charge exchange decay time from dktable file (def=.TRUE.)
RCM_SUNSPOT_NUMBER  default  # calc chex loss rate from this (also using dktable vals) (def=96)
#---------------------------------------------------------------
#---- Comprehensive Ring Current Model (CRCM) specific inputs --
#---------------------------------------------------------------
#crcm_write_n_timesteps    scope=inf:shell:hash type=txt def=1.0
#                          help={at how many crcm_delta_t intervals to write down the CRCM flux, etc...}
#
#crcm_species              scope=inf:shell:hash type=txt def=2
#                          help={1=electrons; 2=protons}
#crcm_write_time           scope=inf:shell:hash type=txt def=1.0
#                          help={[sec] the time interval defined approximately as (crcm_write_time) x (crcm_delta_t) at which to write down the CRCM flux, etc...}
# --- at least one of the two 'make_new_fac' options should be 'no'. Otherwise the 'rc' option will simply add/overwrite
#crcm_make_new_fac_w_pc    scope=logical:shell type=choice choice=yes:no def=yes
#                          help={[yes,no] FAC feedback overwrite MHD FAC with MHD integrated parallel FAC. (crcm_make_new_fac_w_rc must be no, otherwise will overwrite)}
#crcm_make_new_fac_w_rc    scope=logical:shell type=choice choice=yes:no def=no
#                          help={[yes,no] FAC feedback overwrite MHD FAC with CRCM FAC if CRCM FAC is not zero (takes precedence over crcm_make_new_fac_w_pc)}
#crcm_new_fac_smooth       scope=inf:shell:hash type=txt def=2
#                          help={[integer] average the new FAC (CRCMs/integrated + MHDs) over this number of grid cells - basic smoothing. Zero does nothing.}
#crcm_intgrd_fac_smooth    scope=inf:shell:hash type=txt def=4
#                          help={[integer] average the integrated parallel FAC over this number of grid cells - basic smoothing. Matters if crcm_make_new_fac_pc=yes}
#crcm_crcm_fac_smooth      scope=inf:shell:hash type=txt def=4
#                          help={[integer] average the CRCM FAC over this number of grid cells - basic smoothing. Matters if crcm_make_new_fac_rc=yes}
#crcm_lowbndry_condition   scope=logical:shell type=choice choice=yes:no def=yes
#                          help={set lower boundary density, temperature, potential for CRCM}
#crcm_fac_lowbnd_lat       scope=inf:shell:hash type=txt def=54.0
#                          help={[deg] lower boundary condition latitude if crcm_lowbndry_condition is yes}
#crcm_makefac_lowbnd_lat   scope=inf:shell:hash type=txt def=63.0
#                          help={[deg] lower boundary condition (merging FACs control) latitude if crcm_lowbndry_condition is yes}
#crcm_null_isphere_vars    scope=logical:shell type=choice choice=yes:no def=yes
#                          help={set CRCM feedback pressure and density zero inside ISPHERE (otherwise stability issues?)}
#
# --- Factoring of the Input/Output stuff for CRCM and MHD------
#crcm_mhd_pot_factor       scope=inf:shell:hash type=txt def=1.0
#                          help={factor the mhd potential before input in crcm if wanted}
#crcm_mhd_dens_factor      scope=inf:shell:hash type=txt def=1.0
#                          help={factor the mhd density before input in crcm if wanted}
#crcm_mhd_temp_factor      scope=inf:shell:hash type=txt def=1.0
#                          help={factor the mhd temperature before input in crcm if wanted}
#crcm_to_mhd_pres_factor   scope=inf:shell:hash type=txt def=1.0
#                          help={factor the crcm pressure before feedback in mhd if wanted}
#crcm_to_mhd_dens_factor   scope=inf:shell:hash type=txt def=1.0
#                          help={factor the crcm density before feedback in mhd if wanted}
#crcm_pp_rr_scale_length   scope=inf:shell:hash type=txt def=0.5
#                          help={[RE] scale the pressure and density from 0 at ishpere to 1 at isphere+crcm_pp_rr_scale_length with a sin^2 to reduce the gradient jump before passing them to the MHD grid}
#crcm_pp_out_smooth        scope=inf:shell:hash type=txt def=0
#                          help={[integer] smooth CRCM output pressure before passing it to the MHD grid. No smoothing if zero}
#crcm_rr_out_smooth        scope=inf:shell:hash type=txt def=0
#                          help={[integer] smooth CRCM output density before passing it to the MHD grid. No smoothing if zero}
# --- Field-line tracer stuff for CRCM -------------------------
#crcm_max_lat_grid_limit   scope=inf:shell:hash type=txt def=69.458
#                          help={[degrees] max latutide on the crcm ionosphere grid - 69.458 degrees is default - do not go less that that. Go only higher than that.}
# --- debug
#crcm_debug                scope=logical:shell type=choice choice=yes:no def=no
#                          help={[yes,no] write more output for debug}
#---------------------------------------------------------------
#------  hidden parameters
#---------------------------------------------------------------
#     rarely needed (probably shouldn't be hidden)
#---- these are here for historical reasons, or set by other parameters



