diff --git a/.fprettify.rc b/.fprettify.rc index 8052f7ca..c425893d 100644 --- a/.fprettify.rc +++ b/.fprettify.rc @@ -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 diff --git a/.github/workflows/Format-Doc-Test.yml b/.github/workflows/Format-Doc-Test.yml index 42cfacfd..ecea3328 100644 --- a/.github/workflows/Format-Doc-Test.yml +++ b/.github/workflows/Format-Doc-Test.yml @@ -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 @@ -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 diff --git a/src/read_MHDIMF_Indices_new.f90 b/src/read_MHDIMF_Indices_new.f90 index 207333ff..81b075ef 100644 --- a/src/read_MHDIMF_Indices_new.f90 +++ b/src/read_MHDIMF_Indices_new.f90 @@ -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 @@ -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 diff --git a/src/read_sme.f90 b/src/read_sme.f90 index 3586a7ac..f542ba04 100644 --- a/src/read_sme.f90 +++ b/src/read_sme.f90 @@ -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, diff --git a/src/set_inputs.f90 b/src/set_inputs.f90 index cbb59756..48db4b58 100644 --- a/src/set_inputs.f90 +++ b/src/set_inputs.f90 @@ -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 diff --git a/src/set_vertical_bcs.Earth.f90 b/src/set_vertical_bcs.Earth.f90 index 0407f611..a80a618a 100644 --- a/src/set_vertical_bcs.Earth.f90 +++ b/src/set_vertical_bcs.Earth.f90 @@ -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 diff --git a/srcTests/auto_test/run_all_tests.sh b/srcTests/auto_test/run_all_tests.sh index 1dc93e69..fc537863 100755 --- a/srcTests/auto_test/run_all_tests.sh +++ b/srcTests/auto_test/run_all_tests.sh @@ -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 @@ -164,6 +164,7 @@ while [[ $# -gt 0 ]]; do done +lscpu do_tests -done \ No newline at end of file +done diff --git a/util/DATAREAD/srcIndices/indices_library.f90 b/util/DATAREAD/srcIndices/indices_library.f90 index 577c2902..48cca910 100644 --- a/util/DATAREAD/srcIndices/indices_library.f90 +++ b/util/DATAREAD/srcIndices/indices_library.f90 @@ -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