Skip to content

Commit

Permalink
changes to make MGITM compliant with SWMF
Browse files Browse the repository at this point in the history
  • Loading branch information
bartvand committed May 23, 2024
1 parent 8915134 commit 7615edf
Show file tree
Hide file tree
Showing 574 changed files with 233 additions and 184,606 deletions.
128 changes: 9 additions & 119 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
default : GITM

include Makefile.def
include Makefile.test

ABDIR = srcSphereAB
EIEDIR = ${EMPIRICALIEDIR}
EUADIR = ${EMPIRICALUADIR}
IODIR = ${DATAREADINDICESDIR}
MAINDIR = src
GLDIR = srcGlow

Expand All @@ -16,6 +14,7 @@ src/ModSize.f90:
cp src/ModSize.f90.orig src/ModSize.f90

install: src/ModSize.f90
@(if [ ! -d srcData ]; then ln -s data/input srcData; fi)

NOMPI:
@echo "will make NOMPI"
Expand All @@ -24,17 +23,17 @@ NOMPI:

GITM:
@cd ${SHAREDIR}; make LIB
@cd $(ABDIR); make LIB
@cd $(EIEDIR); make LIB
@cd ${EUADIR}; make LIB
@cd $(IODIR); make LIB
@cd $(GLDIR); make LIB
@cd $(ABDIR); make -j1 LIB
@cd $(EMPIRICALIEDIR); make LIB
@cd ${EMPIRICALUADIR}; make LIB
@cd $(DATAREADINDICESDIR); make LIB
@cd $(GLDIR); make -j1 LIB
@cd $(MAINDIR); make GITM

POST:
@cd $(MAINDIR); make POST

MGITM = ${DIR}/UA/MGITM
MGITM = ${MYDIR}

LIB:
cd $(ABDIR) ; make LIB
Expand Down Expand Up @@ -76,8 +75,7 @@ rundir:
mkdir restartOUT data DataIn; \
ln -s restartOUT restartIN; \
ln -s ${BINDIR}/pGITM .; \
ln -s ${UADIR}/srcData/* DataIn; rm -f DataIn/CVS; \
ln -s ${UADIR}/data/* DataIn; rm -f DataIn/CVS
ln -s ${MYDIR}/srcData/* DataIn; rm -f DataIn/CVS;
@(if [ "$(STANDALONE)" != "NO" ]; then \
cd ${RUNDIR} ; \
ln -s ${BINDIR}/GITM.exe . ; \
Expand All @@ -86,114 +84,6 @@ rundir:
ln -s UA/* .; \
fi);


TESTDIR = run_test

MPIRUN = mpirun -np 2

test:
echo "MGITM is not tested nightly" > notest.diff

test_ignored:
-@(make test_earth)
-@(make test_mars)
ls -l *.diff

test_earth:
@echo "test_earth_compile..." > test_earth.diff
make test_earth_compile
@echo "test_earth_rundir..." >> test_earth.diff
make test_earth_rundir
@echo "test_earth_run..." >> test_earth.diff
make test_earth_run
@echo "test_earth_check..." >> test_earth.diff
make test_earth_check

test_earth_compile:
./Config.pl -Earth
./Config.pl -g=9,9,50,4
make GITM

test_earth_rundir:
rm -rf ${TESTDIR}
make rundir RUNDIR=${TESTDIR} STANDALONE=YES UADIR=`pwd`
cd ${TESTDIR}; cp UA/DataIn/UAM.in.test.noAPEX UAM.in

test_earth_run:
cd ${TESTDIR}; ${MPIRUN} ./GITM.exe > runlog

test_earth_check:
-(${SCRIPTDIR}/DiffNum.pl -b -r=1e-5 \
${TESTDIR}/UA/data/log00000002.dat \
srcData/log00000002.dat.noAPEX >& test_earth.diff)
ls -l test_earth.diff

#-----------------------------------------------------------------------------
# AGB: Two tests to verify GITM compilation with RCMR data assimilation.
# One tests whether compilation occured correctly by comparing the logfile
# after a low-resolution, 5 minute run. The second runs a longer test
# case to ensure that the RCMR routine is behaving as expected.

# Test proper RCMR compilation. Test was run on Earth.
test_rcmr_quick:
@echo "test_earth_compile..." > test_rcmr_quick.diff
make test_earth_compile
@echo "test_rcmr_quick_rundir..." >> test_rcmr_quick.diff
make test_rcmr_quick_rundir
@echo "test_rcmr_quick_run..." >> test_rcmr_quick.diff
make test_rcmr_quick_run
@echo "test_rcmr_quick_check..." >> test_rcmr_quick.diff
make test_rcmr_quick_check

test_rcmr_quick_rundir:
rm -rf ${TESTDIR}
make rundir RUNDIR=${TESTDIR} STANDALONE=YES UADIR=`pwd`
cp ${TESTDIR}/UA/DataIn/UAM.in.test.rcmr_quick ${TESTDIR}/UAM.in
cp ${TESTDIR}/UA/DataIn/grace.test.rcmr_quick ${TESTDIR}/grace.dat
cp ${TESTDIR}/UA/DataIn/champ.test.rcmr_quick ${TESTDIR}/champ.dat
cp ${TESTDIR}/UA/DataIn/power.test.rcmr_quick ${TESTDIR}/power.dat
cp ${TESTDIR}/UA/DataIn/imf.test.rcmr_quick ${TESTDIR}/imf.dat

test_rcmr_quick_run:
cd ${TESTDIR}; ${MPIRUN} ./GITM.exe > runlog

test_rcmr_quick_check:
-(${SCRIPTDIR}/DiffNum.pl -b -r=1e-5 \
${TESTDIR}/UA/data/log00000002.dat \
srcData/log00000002.dat.rcmr_quick >& test_rcmr_quick.diff)
ls -l test_rcmr_quick.diff

# End RCMR tests

test_mars:
@echo "test_mars_compile..." > test_mars.diff
make test_mars_compile
@echo "test_mars_rundir..." >> test_mars.diff
make test_mars_rundir
@echo "test_mars_run..." >> test_mars.diff
make test_mars_run
@echo "test_mars_check..." >> test_mars.diff
make test_mars_check

test_mars_compile:
./Config.pl -Mars
./Config.pl -g=1,1,90,1
make GITM

test_mars_rundir:
rm -rf ${TESTDIR}
make rundir RUNDIR=${TESTDIR} STANDALONE=YES UADIR=`pwd`
cd ${TESTDIR}; cp UA/DataIn/UAM.in.Mars UAM.in

test_mars_run:
cd ${TESTDIR}; ${MPIRUN} ./GITM.exe > runlog

test_mars_check:
-(${SCRIPTDIR}/DiffNum.pl -b -r=1e-5 \
${TESTDIR}/UA/data/log00000002.dat \
srcData/log00000002.dat.Mars >& test_mars.diff)
ls -l test_mars.diff

dist:
make distclean
tar cvzf gitm_`date "+%y%m%d"`.tgz Makefile* Config.pl get_info.pl \
Expand Down
206 changes: 206 additions & 0 deletions Makefile.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
#^CFG FILE TESTING

### TESTS FOR THE STAND-ALONE GITM ###

TIMINGFILE =./.test_file_timing.txt
STARTTIME =rm $(TIMINGFILE); date +%s |xargs printf >$(TIMINGFILE);printf "*-1+">>$(TIMINGFILE);
ENDTIME = date +%s >>$(TIMINGFILE); cat $(TIMINGFILE) | bc;

timing:
-@if([ "${TIMING}" ]); then $(STARTTIME) fi
-@if([ "${TIMING}" ]); then $(ENDTIME) fi

test:
echo "Tests do not work currently"
@rm -f *.diff
-@($(MAKE) test_gitm_earth)
-@($(MAKE) test_gitm_mars)
@ls -l *.diff

# All tests are done in this directory:
TESTDIR = run_test

# Reference solution is put into this directory when needed:
REFDIR = run_test_ref

test_help:
@echo " test (run all tests)"
@echo " test KEEP=y (run tests and keep run directories)"
@echo " test MPIRUN= (run tests serially)"
@echo " test NPFLAG=-n NP=3 (run tests with ${PARALLEL} -n 3)"
@echo " test PARALLEL='ibrun' (run tests with ibrun)"
@echo " test_gitm_earth (run Earth GITM test)"
@echo " test_gitm_mars (run Mars GITM test)"

test_rundir:
rm -rf ${TESTDIR}
$(MAKE) rundir RUNDIR=${TESTDIR} STANDALONE=YES

### EARTH GITM TEST ###

test_gitm_earth:
$(MAKE) test_gitm_earth_1d
# $(MAKE) test_gitm_earth_eclipse
# $(MAKE) test_gitm_earth_3d

test_gitm_earth_1d:
@echo "test_gitm_earth_1d_compile..." > test_gitm_earth_1d.diff
$(MAKE) test_gitm_earth_1d_compile
@echo "test_gitm_earth_1d_rundir..." >> test_gitm_earth_1d.diff
$(MAKE) test_gitm_earth_1d_rundir
@echo "test_gitm_earth_1d_run..." >> test_gitm_earth_1d.diff
$(MAKE) test_gitm_earth_1d_run
@echo "test_gitm_earth_1d_check..." >> test_gitm_earth_1d.diff
$(MAKE) test_gitm_earth_1d_check
@if([ "${KEEP}" ]); then rm -rf run_$@; mv ${TESTDIR} run_$@; fi

test_gitm_earth_eclipse:
@echo "test_gitm_earth_eclipse_compile..." > test_gitm_earth_eclipse.diff
$(MAKE) test_gitm_earth_eclipse_compile
@echo "test_gitm_earth_eclipse_rundir..." >> test_gitm_earth_eclipse.diff
$(MAKE) test_gitm_earth_eclipse_rundir
@echo "test_gitm_earth_eclipse_run..." >> test_gitm_earth_eclipse.diff
$(MAKE) test_gitm_earth_eclipse_run
@echo "test_gitm_earth_eclipse_check..." >> test_gitm_earth_eclipse.diff
$(MAKE) test_gitm_earth_eclipse_check
@if([ "${KEEP}" ]); then rm -rf run_$@; mv ${TESTDIR} run_$@; fi

test_gitm_earth_3d:
@echo "test_gitm_earth_3d_compile..." > test_gitm_earth_3d.diff
$(MAKE) test_gitm_earth_3d_compile
@echo "test_gitm_earth_3d_rundir..." >> test_gitm_earth_3d.diff
$(MAKE) test_gitm_earth_3d_rundir
@echo "test_gitm_earth_3d_run..." >> test_gitm_earth_3d.diff
$(MAKE) test_gitm_earth_3d_run
@echo "test_gitm_earth_3d_check..." >> test_gitm_earth_3d.diff
$(MAKE) test_gitm_earth_3d_check
@if([ "${KEEP}" ]); then rm -rf run_$@; mv ${TESTDIR} run_$@; fi

# ----------------------------------------------------
# 1D tests
# ----------------------------------------------------

# Plain 1D
test_gitm_earth_1d_compile:
./Config.pl -Earth -g=1,1,50,4
$(MAKE) GITM

test_gitm_earth_1d_rundir: test_rundir
cd ${TESTDIR}; cp UA/DataIn/UAM.in.1d ./UAM.in

test_gitm_earth_1d_run:
cd ${TESTDIR}; ${PARALLEL} ${NPFLAG} 1 ./GITM.exe > runlog_earth_1d

test_gitm_earth_1d_check:
@(${SCRIPTDIR}/DiffNum.pl -b -r=1e-5 \
${TESTDIR}/UA/data/log0000000?.dat ${TESTDIR}/UA/DataIn/log00000004.1d.dat \
> test_gitm_earth_1d.diff)
ls -l test_gitm_earth_1d.diff

# Eclipse 1D
test_gitm_earth_eclipse_compile:
./Config.pl -Earth -g=1,1,50,4
$(MAKE) GITM

test_gitm_earth_eclipse_rundir: test_rundir
cd ${TESTDIR}; cp UA/DataIn/UAM.in.eclipse ./UAM.in

test_gitm_earth_eclipse_run:
cd ${TESTDIR}; ${PARALLEL} ${NPFLAG} 1 ./GITM.exe > runlog_earth_eclipse

test_gitm_earth_eclipse_check:
@(${SCRIPTDIR}/DiffNum.pl -b -r=1e-5 \
${TESTDIR}/UA/data/log0000000?.dat ${TESTDIR}/UA/DataIn/log00000002.eclipse.dat \
> test_gitm_earth_eclipse.diff)
ls -l test_gitm_earth_eclipse.diff

# ----------------------------------------------------
# 3D tests
# ----------------------------------------------------

test_gitm_earth_3d_compile:
./Config.pl -Earth -g=9,9,50,4
$(MAKE) GITM

test_gitm_earth_3d_rundir: test_rundir
cd ${TESTDIR}; cp UA/DataIn/UAM.in.3d ./UAM.in

test_gitm_earth_3d_run:
cd ${TESTDIR}; ${PARALLEL} ${NPFLAG} 4 ./GITM.exe

test_gitm_earth_3d_check:
(${SCRIPTDIR}/DiffNum.pl -b -r=1e-5 \
${TESTDIR}/UA/data/log00000002.dat ${TESTDIR}/UA/DataIn/log00000002.3d.dat \
> test_gitm_earth_3d.diff)
ls -l test_gitm_earth_3d.diff

### MARS GITM TEST ###

test_gitm_mars:
make test_gitm_mars_1d
make test_gitm_mars_3d

test_gitm_mars_1d:
@echo "test_gitm_mars_1d_compile..." > test_gitm_mars_1d.diff
$(MAKE) test_gitm_mars_1d_compile
@echo "test_gitm_mars_1d_rundir..." >> test_gitm_mars_1d.diff
$(MAKE) test_gitm_mars_1d_rundir
@echo "test_gitm_mars_1d_run..." >> test_gitm_mars_1d.diff
$(MAKE) test_gitm_mars_1d_run
@echo "test_gitm_mars_1d_check..." >> test_gitm_mars_1d.diff
$(MAKE) test_gitm_mars_1d_check
@if([ "${KEEP}" ]); then rm -rf run_$@; mv ${TESTDIR} run_$@; fi

test_gitm_mars_3d:
@echo "test_gitm_mars_3d_compile..." > test_gitm_mars_3d.diff
$(MAKE) test_gitm_mars_3d_compile
@echo "test_gitm_mars_3d_rundir..." >> test_gitm_mars_3d.diff
$(MAKE) test_gitm_mars_3d_rundir
@echo "test_gitm_mars_3d_run..." >> test_gitm_mars_3d.diff
$(MAKE) test_gitm_mars_3d_run
@echo "test_gitm_mars_3d_check..." >> test_gitm_mars_3d.diff
$(MAKE) test_gitm_mars_3d_check
@if([ "${KEEP}" ]); then rm -rf run_$@; mv ${TESTDIR} run_$@; fi

# ----------------------------------------------------
# 1D tests
# ----------------------------------------------------

test_gitm_mars_1d_compile:
./Config.pl -Mars
./Config.pl -g=1,1,120,4
$(MAKE) GITM

test_gitm_mars_1d_rundir: test_rundir
cd ${TESTDIR}; cp UA/DataIn/UAM.mars.in.1d ./UAM.in

test_gitm_mars_1d_run:
cd ${TESTDIR}; ${PARALLEL} ${NPFLAG} 1 ./GITM.exe > runlog_mars_1d

test_gitm_mars_1d_check:
@(${SCRIPTDIR}/DiffNum.pl -b -r=1e-5 \
${TESTDIR}/UA/data/log0000000?.dat ${TESTDIR}/UA/DataIn/log00000002.1d.dat.mars \
> test_gitm_mars_1d.diff)
ls -l test_gitm_mars_1d.diff

# ----------------------------------------------------
# 3D tests
# ----------------------------------------------------

test_gitm_mars_3d_compile:
./Config.pl -Mars
./Config.pl -g=8,4,120,4
$(MAKE) GITM

test_gitm_mars_3d_rundir: test_rundir
cd ${TESTDIR}; cp UA/DataIn/UAM.mars.in.3d ./UAM.in

test_gitm_mars_3d_run:
cd ${TESTDIR}; ${PARALLEL} ${NPFLAG} 4 ./GITM.exe > runlog_mars_3d

test_gitm_mars_3d_check:
(${SCRIPTDIR}/DiffNum.pl -b -r=1e-5 \
${TESTDIR}/UA/data/log0000000?.dat ${TESTDIR}/UA/DataIn/log00000002.3d.dat.mars \
> test_gitm_mars_3d.diff)
ls -l test_gitm_mars_3d.diff

2 changes: 0 additions & 2 deletions share/CVS/Entries

This file was deleted.

6 changes: 0 additions & 6 deletions share/CVS/Entries.Log

This file was deleted.

1 change: 0 additions & 1 deletion share/CVS/Repository

This file was deleted.

1 change: 0 additions & 1 deletion share/CVS/Root

This file was deleted.

Loading

0 comments on commit 7615edf

Please sign in to comment.