Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .github/workflows/Format-and-Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,20 @@ jobs:
run: |
brew update
brew install gcc open-mpi
ln -s $(brew --prefix)/bin/gfortran-15 $(brew --prefix)/bin/gfortran
# ln -s $(brew --prefix)/bin/gfortran-15 $(brew --prefix)/bin/gfortran
- name: Clone GITM repository
uses: actions/checkout@v4
- name: Run tests on MacOS (no output checking, only one test)
- name: Run tests on MacOS (compile, clean, run one test, no output checking)
if: runner.os == 'macOS'
run: |
./Config.pl -install -earth -compiler=gfortran10 -debug
# First do a compile & clean. This catches a lot of bugs :)
# MacOS only because the linux runner is testing other things
./Config.pl -install -earth -compiler=gfortran -O0
make -j
make clean
cd srcTests/auto_test
./run_all_tests.sh --oversubscribe --nocompare -o UAM.in.00.default.test
# Adding a '-u' to `make distclean` and re-configure without -O0
./run_all_tests.sh -u --oversubscribe --nocompare -o UAM.in.00.default.test
- name: Run tests on Linux
if: runner.os == 'Linux'
run: |
Expand Down
10 changes: 10 additions & 0 deletions Config.pl
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,16 @@
my $command = "touch ext/Electrodynamics/src/Makefile.DEPEND";
print "creating DEPEND file in electrodynamics:\n\t $command\n";
my $exit_status = `$command`;

# Write Makefile.local for ext/* libraries so they can find GITM's build
# config: Makefile.dirs for paths, Makefile.conf for compiler rules
my $GitMDir = `pwd`; chomp $GitMDir;
open(my $fh, ">", "ext/Electrodynamics/build/Makefile.local")
or die "Cannot write ext/Electrodynamics/build/Makefile.local: $!";
print $fh "DIRSFILE := $GitMDir/Makefile.def\n";
print $fh "BUILDDIR := $GitMDir\n";
close($fh);
print "Created ext/Electrodynamics/build/Makefile.local\n";
}

&modify_utilities if $NoFlush;
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on Linux and MacOS as well as ifort on NASA's Pleiades computer.

For the complete documentation, see [GITM's Read the Docs Page](https://gitm.readthedocs.io).

GITM's stable version is the main branch, which is downloaded by default. If you want the latest changes, but are ok with possibly unstable code, you can use the 'develop' version, which is described below. If you don't know what you are doing, please just use the main version (i.e., don't checkout a different branch).
GITM's stable version is the main branch, which is downloaded by default. If you want the latest changes, you can use the 'develop' version, which is described below. If you don't know what you are doing, please just use the main version (i.e., don't checkout a different branch).

## Quick Start

Expand All @@ -30,11 +30,11 @@ Substitute the URL with the `https` link from the "Code" button above if you do
cd GITM
```

(if you want/need to change to a different branch, do that here with the command:
If you want/need to change to a different branch, do that now with the command:
```shell
git checkout develop
```
but, again, we don't recommend this unless you know what you are doing!)
but, again, we don't recommend this unless you know what you are doing!

3\. Configure the Fortran compiler and download the external electrodynamics library (the install should do this automagically):

Expand All @@ -46,18 +46,18 @@ The above command is that it assumes that you have a working gfortran compiler a
things like mpif90 work ok. If you don't have gfortran and mpif90, then you need
to get these things for your computer.

> `Config.pl` should automatically determine your gfortran version since gfortran>=10 needs
> to use different compilation commands than versions 9 and below.
> `Config.pl` should automatically determine your gfortran version.
> If you notice that `Config.pl` does not detect the correct gfortran version, set
> `-compiler=gfortran` if you have gfortran <10 or `-compiler=gfortran10` for
> gfortran>=10
> gfortran>=10. This is nexessary because gfortran>=10 uses different compilation
> commands than versions 9 and below.

In theory, Mars, Venus, Titan, and LV-426 should work. These are in
various states of completion, so I wouldn't count on them being
perfect. To configure with one of these, simple use the planet as
an option (like '-venus', instead of '-earth)'.

If running on Pleiades, you need to have these
If running on a NASA HECC system, you may need to have these
in your start-up script (.cshrc, .bashrc, etc):

```
Expand Down
2 changes: 1 addition & 1 deletion share/Scripts/Config.pl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@



if ($Machine='athfe' and $Compiler='crayftn'){
if ($Machine eq 'athfe' and $Compiler eq 'crayftn'){
print "
====================================================
On athena we recommend using -compiler=ifortmpif90
Expand Down
79 changes: 58 additions & 21 deletions src/apex_more.f90
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ subroutine cofrm(date)
integer, parameter :: n1 = 120, n2 = 195, isv = 0
integer, parameter :: &
ncn1 = 19, & ! number of coefficients dimensioned n1
ncn2 = 7 ! number of coefficients dimensioned n2: increase with each IGRF update
ncn2 = 8 ! number of coefficients dimensioned n2: increase with each IGRF update
integer, parameter :: ngh = n1*ncn1 + n2*ncn2 + 1 ! not sure why the extra +1
real, save :: g1(n1, ncn1), g2(n2, ncn2), gh(ngh)
real, parameter :: alt = 0.

if (date < 1900. .or. date > 2030.) then
write(6, "('>>> cofrm: date=',f8.2,' Date must be >= 1900 and <= 2030')") date
if (date < 1900. .or. date > 2035.) then
write(6, "('>>> cofrm: date=',f8.2,' Date must be >= 1900 and <= 2035')") date
stop 'cofrm'
endif
if (date > 2025.) then
if (date > 2030.) then
write(6, "('>>> WARNING cofrm:')")
write(6, "(/,' This version of IGRF is intended for use up to ')")
write(6, "(' 2025. Values for ',f9.3,' will be computed but')") date
write(6, "(' 2030. Values for ',f9.3,' will be computed but')") date
write(6, "(' may be of reduced accuracy.',/)")
endif

Expand Down Expand Up @@ -554,22 +554,59 @@ subroutine cofrm(date)
0.5, 0.1, 0.5, 0.5, -0.4, -0.5, &
-0.3, -0.4, -0.6/)
!
g2(1:80, 7) = (/ & ! 2022
5.7, 7.4, -25.9, -11.0, -7.0, -30.2, &
-2.1, -22.4, 2.2, -5.9, 6.0, 3.1, &
-1.1, -12.0, 0.5, -1.2, -1.5, -0.1, &
-5.9, 6.5, 5.2, 3.5, -5.1, -5.0, &
-0.3, 0.5, -0.0, -0.6, 2.5, 0.2, &
-0.6, 1.3, 3.0, 0.9, 0.3, -0.5, &
-0.3, 0.0, 0.4, -1.6, 1.3, -1.3, &
-1.4, 0.8, -0.0, 0.0, 0.9, 1.0, &
-0.1, -0.2, 0.6, -0.0, 0.6, 0.7, &
-0.8, 0.1, -0.2, -0.5, -1.1, -0.8, &
0.1, 0.8, 0.3, -0.0, 0.1, -0.2, &
-0.1, 0.6, 0.4, -0.2, -0.1, 0.5, &
0.4, -0.3, 0.3, -0.4, -0.1, 0.5, &
0.4, 0.0/)
g2(81:n2, 7) = 0.0
g2(:, 7) = (/ & ! 2025
-29350.0, -1410.3, 4545.5, -2556.2, 2950.9, -3133.6, &
1648.7, -814.2, 1360.9, -2404.2, -56.9, 1243.8, &
237.6, 453.4, -549.6, 894.7, 799.6, 278.6, &
55.8, -134.0, -281.1, 212.0, 12.0, -375.4, &
-232.9, 369.0, 45.3, 187.2, 220.0, -138.7, &
-122.9, -141.9, 42.9, 20.9, 106.2, 64.3, &
63.8, -18.4, 76.7, 16.8, -115.7, 48.9, &
-40.9, -59.8, 14.9, 10.9, -60.8, 72.8, &
79.6, -76.9, -48.9, -8.8, -14.4, 59.3, &
-1.0, 15.8, 23.5, 2.5, -7.4, -11.2, &
-25.1, 14.3, -2.2, 23.1, 10.9, 7.2, &
-17.5, -12.6, 2.0, 11.5, -21.8, -9.7, &
16.9, 12.7, 14.9, 0.7, -16.8, -5.2, &
1.0, 3.9, 4.7, 8.0, -24.8, 3.0, &
12.1, -0.2, 8.3, -2.5, -3.4, -13.1, &
-5.3, 2.4, 7.2, 8.6, -0.6, -8.7, &
0.8, -12.8, 9.8, -1.3, -6.4, 3.3, &
0.2, 0.1, 2.0, 2.5, -1.0, 5.4, &
-0.5, -9.0, -0.9, 0.4, 1.5, -4.2, &
0.9, -3.8, -2.6, 0.9, -3.9, -9.0, &
3.0, -1.4, 0.0, -2.5, 2.8, 2.4, &
-0.6, -0.6, 0.1, 0.0, 0.5, -0.6, &
-0.3, -0.1, -1.2, 1.1, -1.7, -1.0, &
-2.9, -0.1, -1.8, 2.6, -2.3, -2.0, &
-0.1, -1.2, 0.4, 0.6, 1.2, 1.0, &
-1.2, -1.5, 0.6, 0.0, 0.5, 0.6, &
0.5, -0.2, -0.1, 0.8, -0.5, 0.1, &
-0.2, -0.9, -1.2, 0.1, -0.7, 0.2, &
0.2, -0.9, -0.9, 0.6, 0.7, 0.7, &
1.2, -0.2, -0.3, 0.5, -1.3, 0.1, &
-0.1, 0.7, 0.2, 0.0, -0.2, 0.3, &
0.5, 0.2, 0.6, 0.4, -0.6, -0.5, &
-0.3, -0.4, -0.5/)

!
g2(1:80, 8) = (/ & ! 2026
12.6, 10.0, -21.5, -11.2, -5.3, -27.3, &
-8.3, -11.1, -1.5, -4.4, 3.8, 0.4, &
-0.2, -15.6, -3.9, -1.7, -2.3, -1.3, &
-5.8, 4.1, 5.4, 1.6, -6.8, -4.1, &
0.6, 1.3, -0.5, 0.0, 2.1, 0.7, &
0.5, 2.3, 1.7, 1.0, 1.9, -0.2, &
-0.3, 0.3, 0.8, -1.6, 1.2, -0.4, &
-0.8, 0.8, 0.4, 0.7, 0.9, 0.9, &
-0.1, -0.1, 0.6, -0.1, 0.5, 0.5, &
-0.7, -0.1, 0.0, -0.8, -0.9, -0.8, &
0.5, 0.9, -0.3, -0.1, 0.2, -0.3, &
0.0, 0.4, 0.4, -0.3, -0.1, 0.4, &
0.3, -0.5, 0.1, -0.6, 0.0, 0.3, &
0.3, 0.2/)
g2(81:n2, 8) = 0.0

!
! Set gh from g1,g2:
!
Expand Down
Loading
Loading