Skip to content
Closed
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
2 changes: 1 addition & 1 deletion .fprettify.rc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ i: 2
recursive
# Excluded files:
# Anything compiled, src/venus.f90 (it's incomplete), old fortran files, makefiles, template files
exclude: ["*.exe","*.o","Venus.f90","*.f","Makef*","*emplate.f90"]
exclude: ["*.exe","*.o","Venus.f90","*.f","Makef*","*emplate.f90","*Msis*"]

# Whitespace option 2 (check fprettify -h for info):
whitespace: 2
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/Format-Doc-Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
- name: Clone GITM
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
path:
GITM
- name: Format check entire GITM repository
Expand Down Expand Up @@ -74,7 +75,7 @@ jobs:
needs: [Format, Documentation]
steps:
- name: Install MPI (mpich)
run: sudo apt update && sudo apt install -y mpich
run: sudo apt update && sudo apt install -y libopenmpi-dev
- name: Clone GITM repository
uses: actions/checkout@v4
- name: Run tests in srcTests/auto_test
Expand Down
57 changes: 28 additions & 29 deletions src/read_MHDIMF_Indices_new.f90
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ subroutine read_MHDIMF_Indices_new(iOutputError, StartTime, EndTime)
! This means that the GITM time is all BEFORE the first
! line in the file!
if (EndTime < IndexTimes_TV(iIMF, imf_bx_) .and. iIMF == 1) then
iIMF = iIMF + 1
iSW = iSW + 1
iIMF = iIMF + 1
iSW = iSW + 1
endif

endif
Expand All @@ -176,38 +176,37 @@ subroutine read_MHDIMF_Indices_new(iOutputError, StartTime, EndTime)

iIMF = iIMF - 2
iSW = iSW - 2

! There is sometimes a problem where the end time is in the middle of
! a data gap. Let's check this:
if (iIMF > 2) then
if (IndexTimes_TV(iIMF, imf_bx_) < EndTime) then
! Copy the last index into the next index and assign times
iIMF = iIMF + 1
IndexTimes_TV(iIMF, imf_bx_) = EndTime
IndexTimes_TV(iIMF, imf_by_) = EndTime
IndexTimes_TV(iIMF, imf_bz_) = EndTime
Indices_TV(iIMF, imf_bx_) = Indices_TV(iIMF - 1, imf_bx_)
Indices_TV(iIMF, imf_by_) = Indices_TV(iIMF - 1, imf_by_)
Indices_TV(iIMF, imf_bz_) = Indices_TV(iIMF - 1, imf_bz_)

IndexTimes_TV(iSW, sw_vx_) = EndTime
IndexTimes_TV(iSW, sw_vy_) = EndTime
IndexTimes_TV(iSW, sw_vz_) = EndTime
IndexTimes_TV(iSW, sw_v_) = EndTime
IndexTimes_TV(iSW, sw_n_) = EndTime
IndexTimes_TV(iSW, sw_t_) = EndTime

Indices_TV(iSW, sw_vx_) = Indices_TV(iSW - 1, sw_vx_)
Indices_TV(iSW, sw_vy_) = Indices_TV(iSW - 1, sw_vy_)
Indices_TV(iSW, sw_vz_) = Indices_TV(iSW - 1, sw_vz_)
Indices_TV(iSW, sw_v_) = Indices_TV(iSW - 1, sw_v_)
Indices_TV(iSW, sw_n_) = Indices_TV(iSW - 1, sw_n_)
Indices_TV(iSW, sw_t_) = Indices_TV(iSW - 1, sw_t_)
endif
if (IndexTimes_TV(iIMF, imf_bx_) < EndTime) then
! Copy the last index into the next index and assign times
iIMF = iIMF + 1
IndexTimes_TV(iIMF, imf_bx_) = EndTime
IndexTimes_TV(iIMF, imf_by_) = EndTime
IndexTimes_TV(iIMF, imf_bz_) = EndTime
Indices_TV(iIMF, imf_bx_) = Indices_TV(iIMF - 1, imf_bx_)
Indices_TV(iIMF, imf_by_) = Indices_TV(iIMF - 1, imf_by_)
Indices_TV(iIMF, imf_bz_) = Indices_TV(iIMF - 1, imf_bz_)

IndexTimes_TV(iSW, sw_vx_) = EndTime
IndexTimes_TV(iSW, sw_vy_) = EndTime
IndexTimes_TV(iSW, sw_vz_) = EndTime
IndexTimes_TV(iSW, sw_v_) = EndTime
IndexTimes_TV(iSW, sw_n_) = EndTime
IndexTimes_TV(iSW, sw_t_) = EndTime

Indices_TV(iSW, sw_vx_) = Indices_TV(iSW - 1, sw_vx_)
Indices_TV(iSW, sw_vy_) = Indices_TV(iSW - 1, sw_vy_)
Indices_TV(iSW, sw_vz_) = Indices_TV(iSW - 1, sw_vz_)
Indices_TV(iSW, sw_v_) = Indices_TV(iSW - 1, sw_v_)
Indices_TV(iSW, sw_n_) = Indices_TV(iSW - 1, sw_n_)
Indices_TV(iSW, sw_t_) = Indices_TV(iSW - 1, sw_t_)

endif
endif


nIndices_V(imf_bx_) = iIMF
nIndices_V(imf_by_) = iIMF
nIndices_V(imf_bz_) = iIMF
Expand Down
4 changes: 2 additions & 2 deletions src/read_sme.f90
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ subroutine read_sme(iOutputError, StartTime, EndTime, doUseAeForHp)

! Need to update the number of hemispheric power indices:
if (doUseAeForHp) then
nIndices_V(hpi_) = iAE - 2
nIndices_V(hpi_norm_) = iAE - 2
nIndices_V(hpi_) = iAE - 2
nIndices_V(hpi_norm_) = iAE - 2
endif

! If we have gotten to this point and we have no data,
Expand Down
2 changes: 1 addition & 1 deletion src/set_inputs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1968,7 +1968,7 @@ subroutine set_inputs
if (iError == 0) then
call check_all_indices(EndTime, iError)
if (iError /= 0) &
write(*, *) 'Error with End Time and check_all_indices'
write(*, *) 'Error with End Time and check_all_indices'
else
write(*, *) 'Error with Current Time and check_all_indices'
endif
Expand Down
4 changes: 2 additions & 2 deletions src/set_vertical_bcs.Earth.f90
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ subroutine set_vertical_bcs(LogRho, LogNS, Vel_GD, Temp, LogINS, iVel, VertVel)
! run (i.e. MSIS-flat). So, we can then assume that we can simply
! perturb the MSIS density.
NS(0, 1:nSpecies) = &
NS(0, 1:nSpecies) * &
TidesRhoRat(iLon1D, iLat1D, 2, iBlock1D)
NS(0, 1:nSpecies)* &
TidesRhoRat(iLon1D, iLat1D, 2, iBlock1D)
LogNS(0, 1:nSpecies) = alog(NS(0, 1:nSpecies))

endif
Expand Down
5 changes: 3 additions & 2 deletions srcTests/auto_test/run_all_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ do_tests(){
cp $test_uam UAM.in

# Run GITM, stop if error.
mpirun -np 4 ./GITM.exe
mpirun -np 4 --oversubscribe ./GITM.exe
if [ $? -eq 0 ]; then
printf "\n\n>>> $test_uam ran successfully! <<< \n\n"
mv $test_uam $test_uam.success
Expand Down Expand Up @@ -164,6 +164,7 @@ while [[ $# -gt 0 ]]; do

done

lscpu

do_tests
done
done
40 changes: 20 additions & 20 deletions util/DATAREAD/srcIndices/indices_library.f90
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,30 @@ subroutine check_all_indices(TimeIn, iOutputError)
if (nIndices_V(iIndex) > 1) then
if ((IndexTimes_TV(1, iIndex) - TimeIn) > &
5.0*(IndexTimes_TV(2, iIndex) - IndexTimes_TV(1, iIndex))) then
iOutputError = 3
write(*, *) 'Error in index file times, before start :'
write(*, *) 'index, first time, time in : '
write(*, *) iIndex, IndexTimes_TV(1, iIndex), TimeIn
call time_real_to_int(IndexTimes_TV(1, iIndex), iTime)
write(*, *) 'First Index Time : ', iTime
call time_real_to_int(TimeIn, iTime)
write(*, *) 'TimeIn : ', iTime
end if
iOutputError = 3
write(*, *) 'Error in index file times, before start :'
write(*, *) 'index, first time, time in : '
write(*, *) iIndex, IndexTimes_TV(1, iIndex), TimeIn
call time_real_to_int(IndexTimes_TV(1, iIndex), iTime)
write(*, *) 'First Index Time : ', iTime
call time_real_to_int(TimeIn, iTime)
write(*, *) 'TimeIn : ', iTime
endif

if ((TimeIn - IndexTimes_TV(nIndices_V(iIndex), iIndex)) > &
5.0*(IndexTimes_TV(2, iIndex) - IndexTimes_TV(1, iIndex))) then
iOutputError = 4
write(*, *) 'Error in index file times, after end :'
write(*, *) 'index, last time, time in : '
write(*, *) iIndex, IndexTimes_TV(nIndices_V(iIndex), iIndex), TimeIn
write(*, *) 'Number of values : ', nIndices_V(iIndex)
call time_real_to_int(IndexTimes_TV(nIndices_V(iIndex), iIndex), iTime)
write(*, *) 'Last Index Time : ', iTime
call time_real_to_int(TimeIn, iTime)
write(*, *) 'TimeIn : ', iTime
end if
end if
end do
write(*, *) 'Error in index file times, after end :'
write(*, *) 'index, last time, time in : '
write(*, *) iIndex, IndexTimes_TV(nIndices_V(iIndex), iIndex), TimeIn
write(*, *) 'Number of values : ', nIndices_V(iIndex)
call time_real_to_int(IndexTimes_TV(nIndices_V(iIndex), iIndex), iTime)
write(*, *) 'Last Index Time : ', iTime
call time_real_to_int(TimeIn, iTime)
write(*, *) 'TimeIn : ', iTime
endif
endif
enddo

return
end subroutine check_all_indices
Expand Down