Skip to content

Commit 4efdf0c

Browse files
author
Miles A. Engel
committed
Merge branch 'energy_by_species' of github.com:Pheosics/RAM-SCB into energy_by_species
2 parents 49702af + fe664c8 commit 4efdf0c

93 files changed

Lines changed: 32260 additions & 468 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Dockerfile.RoR

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ ENV PERL5LIB=.
1010
ENV DEBIAN_FRONTEND=noninteractive
1111

1212
RUN apt-get update && apt-get install -y ssh make gcc git g++ gfortran libopenmpi-dev openmpi-bin libgsl-dev libgsl23 gsl-bin libgsl-dbg libnetcdf-dev libnetcdff-dev nco netcdf-bin python3 python3-pip python-is-python3
13-
14-
RUN pip install numpy==1.21 && pip install spacepy==0.4.1 && pip install netCDF4
13+
RUN pip install --upgrade pip
14+
RUN pip install numpy==1.21 && pip install spacepy==0.6.0 && pip install netCDF4
1515

1616
COPY flux-model /SHIELDS/flux-model
1717
WORKDIR /SHIELDS/flux-model

Makefile

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ default : RAM_SCB
44
include Makefile.def
55

66
srcDir = src
7+
GlowDir= srcGlow
8+
79
INSTALLFILES = ${srcDir}/Makefile.DEPEND \
810
${srcDir}/Makefile.RULES \
911
srcInterface/Makefile.DEPEND \
10-
srcExternal/Makefile.DEPEND
11-
12+
srcExternal/Makefile.DEPEND \
13+
${GlowDir}/Makefile.DEPEND
1214
help:
1315
@echo ' '
1416
@echo ' You can "make" the following:'
@@ -30,6 +32,7 @@ PDF:
3032
RAM_SCB:
3133
@cd ${SHAREDIR}; make LIB
3234
@cd srcExternal; make LIB
35+
@cd ${GlowDir}; make LIB
3336
@cd ${srcDir}; make LIB
3437
@cd ${srcDir}; make RAM_SCB
3538

@@ -41,12 +44,14 @@ LIB:
4144
cd ${srcDir}; make LIB
4245
cd srcInterface; make LIB
4346
cd srcExternal; make LIB
47+
cd ${GlowDir}; make LIB
4448

4549
clean:
4650
@touch ${INSTALLFILES}
4751
@cd ${srcDir}; make clean
4852
@cd srcInterface; make clean
4953
@cd srcExternal; make clean
54+
@cd ${GlowDir}; make clean
5055
@(if [ -d util ]; then cd util; make clean; fi);
5156
@(if [ -d share ]; then cd share; make clean; fi);
5257

@@ -59,6 +64,7 @@ allclean:
5964
@(if [ -d srcPspline ]; then rm -rf srcPspline; fi);
6065
@cd ${srcDir}; make distclean
6166
@cd srcInterface; make distclean
67+
@cd ${GlowDir}; make distclean
6268
rm -f *~
6369

6470
rundir:
@@ -75,9 +81,9 @@ rundir:
7581
cd ${RUNDIR}; \
7682
ln -s ../input/bav_diffcoef_chorus_rpa_Kp*.PAonly.dat .
7783
cd ${RUNDIR}/IM/output; \
78-
mkdir -p ram/Dsbnd scb/Day00
84+
mkdir -p ram/Dsbnd scb/Day00 sce/
7985
cd ${RUNDIR}/IM; \
80-
mkdir input_ram input_scb output_swmf; \
86+
mkdir input_ram input_scb input_sce output_swmf; \
8187
mkdir restartIN restartOUT; \
8288
tar xzf ${IMDIR}/input/ramscb_inputs.tgz; \
8389
mv Input_git/EMIC_model input_ram/; \
@@ -89,7 +95,8 @@ rundir:
8995
mv Input_git/*geomlt*.txt input_ram/; \
9096
mv initialization.nc input_ram/; \
9197
mv QinDenton_20130317_1min.txt input_scb/; \
92-
mv NitrogenCrossSections.dat input_ram/;
98+
mv NitrogenCrossSections.dat input_ram/; \
99+
cp -r ${IMDIR}/input/glow_data input_sce/;
93100
@(if [ "$(STANDALONE)" != "NO" ]; then \
94101
cd ${RUNDIR} ; \
95102
cp ${IMDIR}/Param/PARAM.in.default ./PARAM.in; \
@@ -98,6 +105,7 @@ rundir:
98105
rm -f output; \
99106
ln -s IM/output/ram output_ram; \
100107
ln -s IM/output/scb output_scb; \
108+
ln -s IM/output/sce output_sce;\
101109
fi)
102110

103111

@@ -438,7 +446,6 @@ testEMIC_check:
438446
>> testEMIC.diff
439447
@echo "Test Successful!"
440448

441-
#TEST EMIC----------------------------------
442449
testSpecies:
443450
@echo "starting..." > testSpecies.diff
444451
@echo "testSpecies_compile..." >> testSpecies.diff
@@ -471,4 +478,39 @@ testSpecies_check:
471478
${TESTDIRC}/output_ram/pressure_d20130317_t001500.dat \
472479
${IMDIR}/output/testSpecies/pressure.ref \
473480
>> testSpecies.diff
481+
482+
#TEST SCE----------------------------------
483+
testSCE:
484+
@echo "starting..." > testSCE.diff
485+
@echo "testSCE_compile..." >> testSCE.diff
486+
make testSCE_compile
487+
@echo "testSCE_rundir..." >> testSCE.diff
488+
make testSCE_rundir PARAMFILE=PARAM.in.testSCE
489+
@echo "testSCE_run..." >> testSCE.diff
490+
make testSCE_run MPIRUN=
491+
@echo "testSCE_check..." >> testSCE.diff
492+
make testSCE_check
493+
494+
testSCE_compile:
495+
make
496+
497+
testSCE_rundir:
498+
rm -rf ${TESTDIRC}
499+
make rundir RUNDIR=${TESTDIRC} STANDALONE="YES"
500+
cp Param/${PARAMFILE} ${TESTDIRC}/PARAM.in
501+
cp -r input/glow_data ${TESTDIRC}/=
502+
503+
testSCE_run:
504+
cd ${TESTDIRC}; ${MPIRUN} ./ram_scb.exe | tee runlog;
505+
506+
testSCE_check:
507+
${SCRIPTDIR}/DiffNum.pl -b -a=1e-9 \
508+
${TESTDIRC}/output_ram/log_d20130317_t000000.log \
509+
${IMDIR}/output/testSCE/log.ref \
510+
> testSCE.diff
511+
${SCRIPTDIR}/DiffNum.pl -b -a=1e-9 \
512+
${TESTDIRC}/output_ram/pressure_d20130317_t001000.dat \
513+
${IMDIR}/output/testSCE/pressure.ref \
514+
>> testSCE.diff
515+
474516
@echo "Test Successful!"

PARAM.XML

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,15 @@ If using nitrogen in the species this command will convert a percent of the oxyg
137137
<parameter name="DoUseBASdiff" type="logical" default="F"/>
138138
<parameter name="DoUseKpdiff" type="logical" default="F"/>
139139
<parameter name="DoUseEMIC" type="logical" default="F"/>
140+
<parameter name="DoSaveLwgr" type="logical" default="F"/>
140141
#USEWPI
141142
F DoUseWPI
142143
F DoUseBASdiff
143144
F DoUseKpdiff
144145
F DoUseEMIC
146+
F DoSaveLwgr
145147

146-
Flag to turn on pitch angle diffusion. The default setting for the Kp-based version uses Kp=0 coefficients. Turning this flag on interpolates Kp-dependent diffusion coefficents for Kp in the range (0-4). Different options are available if selecting DoUseBASDiff. EMIC wave pitch angle diffusion is used for ions wave-particle interaction.
148+
Flag to turn on pitch angle diffusion. The default setting for the Kp-based version uses Kp=0 coefficients. Turning this flag on interpolates Kp-dependent diffusion coefficents for Kp in the range (0-4). Different options are available if selecting DoUseBASDiff. EMIC wave pitch angle diffusion is used for ions wave-particle interaction. DoSaveLwgr is used to save hourly output for linear wave growth calculations.
147149
</command>
148150

149151
<command name="USEFLC">
@@ -339,6 +341,69 @@ F PressureDetail
339341

340342
</commandgroup>
341343

344+
<commandgroup name="SCE">
345+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
346+
!!!!!!!!!!!SCE group!!!!!!!!!!!!!
347+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
348+
349+
<command name="IONOSPHERE">
350+
<parameter name="iConductanceModel" type="integer" default="7"/>
351+
<parameter name="StarLightPedConductance" type="float" default="2.5"/>
352+
<parameter name="DoUseFullSpec" type="logical" default="F"/>
353+
<parameter name="DoSaveGLOWConductivity" type="logical" default="F"/>
354+
#IONOSPHERE
355+
7 iConductanceModel
356+
2.5 StarLightPedConductance
357+
F DoUseFullSpec
358+
F DoSaveGLOWConductivity
359+
360+
\begin{itemize}
361+
\item iConductanceModel: 7 uses Robinson's statistical conductance model; 9 uses S. Solomon's GLOW model. If "9" is used, the last two commands are needed. When the GLOW model is used, parallelizing is recommended.
362+
\item StarLightPedConductance: the background conductance due to star light
363+
\item DoUseFullSpec: only needed when iConductanceModel=9; It uses full precipitating spectrum as input to the GLOW
364+
\item DoSaveGLOWConductivity: only needed when iConductanceModel=9; It saves height-dependent conductivity from GLOW
365+
</command>
366+
367+
<command name="BOUNDARY">
368+
<parameter name="LatBoundary" type="float" default="50"/>
369+
#BOUNDARY
370+
50 LatBoundary
371+
372+
Specify the low latitudinal boundary for the ionospheric potential solver. Default is set at 50 degree magnetic latitude.
373+
</command>
374+
375+
<command name="SOLVER">
376+
<parameter name="NameSolver" type="string" default="GMRES"/>
377+
#SOLVER
378+
GMRES NameSolver (gmres or bicgstab)
379+
380+
Specify the scheme for the ionospheric potential solver.
381+
</command>
382+
383+
<command name="KRYLOV">
384+
<parameter name="UsePreconditioner" type="logical" default="T"/>
385+
<parameter name="UseInitialGuess" type="logical" default="T"/>
386+
<parameter name="Tolerance" type="real" min="0" default="0.01"/>
387+
<parameter name="MaxIteration" type="integer" min="1" default="100"/>
388+
389+
#KRYLOV
390+
T UsePreconditioner
391+
T UseInitialGuess
392+
0.01 Tolerance
393+
100 MaxIteration
394+
395+
This command controls the parameters for the Krylov solver used to
396+
solve the Poisson type equation for the electric potential.
397+
If UsePreconditioner is true the solver uses a preconditioner.
398+
If UseInitialGuess is true, the previous solution is used as an
399+
initial guess. The Tolerance parameter sets the second norm of
400+
the final (preconditioned) residual. The MaxIteration parameter sets the
401+
maximum number of iterations before the linear solver gives up.
402+
In most cases the default values should work fine.
403+
404+
The default values are shown above.
405+
</command>
406+
342407
<commandgroup name="COMPONENTS">
343408
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
344409
!!!!!!!!Components group!!!!!!!!!
@@ -476,6 +541,7 @@ Set the source for the convective electric field in RAM-SCB. The choice made wi
476541
\item \textbf{VOLS}: $K_{P}$-based Volland-Stern empirical electric field (internal VS calculation).
477542
\item \textbf{WESC}: Weimer 2001 empirical electric field mapped to the equatorial plane via RAM-SCB field lines (internal W01 calculation).
478543
\item \textbf{W5SC}: Weimer 2005 empirical electric field mapped to the equatorial plane via RAM-SCB field lines (internal W05 calculation).
544+
\item \textbf{RSCE}: self-consistently calculated electric field mapped to the equatorial plane via RAM-SCB field lines. If this option is chosen, the following commands are needed: IONOSPHERE, BOUNDARY, SOLVER, KRYLOV. The description of these commands are provided below.
479545
\end{enumerate}
480546

481547
The parameter UseEfInd turns the use of induced electric field on or off. Default is no induced electric field.

Param/PARAM.in.testEMIC

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ F DoUseWPI ! Whether to use wave particle interactions or not (Note, wave par
3636
F DoUseBASDiff ! Whether to use BAS diffusion coefficients for wave particle interactions
3737
F doUseKpDiff ! Whether to use KP based diffusion coefficients for wave particle interactions
3838
T DoUseEMIC ! Whether to turn on AE based EMIC wave pitch angle diffusion
39+
F DoSaveLwgr
3940

4041
*************************************************
4142

0 commit comments

Comments
 (0)