Skip to content

Commit

Permalink
assertions rechecked and updated
Browse files Browse the repository at this point in the history
  • Loading branch information
ArkenCh committed Dec 11, 2023
1 parent b3806af commit 327a005
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 39 deletions.
4 changes: 2 additions & 2 deletions tests/test_GravityCov.pf
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ contains
tolerance = 1e-10_dp

! Check if outputs match expected values
@assertRelativelyEqual(cov, expected_cov, tolerance)
@assertRelativelyEqual(expected_cov, cov, tolerance)

! Test 2
call gravity_model%initGravityPotential('../../work/data')
Expand All @@ -95,7 +95,7 @@ contains
tolerance = 1e-10_dp

! Check if outputs match expected values
@assertRelativelyEqual(cov, expected_cov, tolerance)
@assertRelativelyEqual(expected_cov, cov, tolerance)


! Test 3 :
Expand Down
6 changes: 3 additions & 3 deletions tests/test_atmosphere_Exponential.pf
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ contains
call atmosphere_model%initAtmosphere('../../work/data')

! test #1
@assertRelativelyEqual(atmosphere_model%getDensityExponential(25.d0), 38990000.0d0, tolerance=0.01)
@assertRelativelyEqual(38990000.0d0, atmosphere_model%getDensityExponential(25.d0), tolerance=0.01)
! test #2
@assertRelativelyEqual(atmosphere_model%getDensityExponential(0.4688d3), 0.11635971694422577d-2, tolerance=0.01)
@assertRelativelyEqual(0.11635971694422577d-2, atmosphere_model%getDensityExponential(0.4688d3), tolerance=0.01)
! test #3
@assertRelativelyEqual(atmosphere_model%getDensityExponential(0.65d1), 499706396.76297361d0, tolerance=0.01)
@assertRelativelyEqual(499706396.76297361d0, atmosphere_model%getDensityExponential(0.65d1), tolerance=0.01)
end subroutine test_getDensityExponential

end module test_atmosphere_Exponential
4 changes: 2 additions & 2 deletions tests/test_atmosphere_JB2008.pf
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ contains
call atmosphere_model%initAtmosphere('../../work/data')

! test #1
@assertRelativelyEqual(atmosphere_model%getDensityJB2008(500.d0, 0.d0, 0.d0, 51544.d0), 0.12405204124422383d-002, tolerance=0.01)
@assertRelativelyEqual(0.12405204124422383d-002, atmosphere_model%getDensityJB2008(500.d0, 0.d0, 0.d0, 51544.d0), tolerance=0.01)
! ! test #2
@assertRelativelyEqual(atmosphere_model%getDensityJB2008(150.d0, 0.d0, 0.446d2, 58600.d0), 0.79968484021225802d+27, tolerance=0.01)
@assertRelativelyEqual(0.79968484021225802d+27, atmosphere_model%getDensityJB2008(150.d0, 0.d0, 0.446d2, 58600.d0), tolerance=0.01)

end subroutine test_getDensityJB2008

Expand Down
4 changes: 2 additions & 2 deletions tests/test_atmosphere_msis2.pf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ module test_atmosphere_msis2
call atmosphere_model%initAtmosphere('../../work/data')

! test #1
@assertRelativelyEqual(atmosphere_model%getDensityNRLMSISv2(500.d0, 0.65d1, 96.d0, 0.5276739668d5), 0.10168617826293667d-002, tolerance=0.01)
@assertRelativelyEqual(0.10168617826293667d-002, atmosphere_model%getDensityNRLMSISv2(500.d0, 0.65d1, 96.d0, 0.5276739668d5), tolerance=0.01)
! test #2
@assertRelativelyEqual(atmosphere_model%getDensityNRLMSISv2(0.4688d3, -0.195d2, 0.446d2, 0.4389981823d5), 0.20788356929965501d-002, tolerance=0.01)
@assertRelativelyEqual(0.20788356929965501d-002, atmosphere_model%getDensityNRLMSISv2(0.4688d3, -0.195d2, 0.446d2, 0.4389981823d5), tolerance=0.01)

end subroutine test_getDensityNRLMSISv2

Expand Down
2 changes: 1 addition & 1 deletion tests/test_atmosphere_nrlmsis00.pf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module test_atmosphere_nrlmsis00
call atmosphere_model%setAtmosphereInitFlag()
call atmosphere_model%initAtmosphere('../../work/data')
! @assertRelativelyEqual(atmosphere_model%getDensityMSIS2000(500.d0, 0.d0, 0.d0, 51544.d0), 0.5712d-003, tolerance=0.01)
@assertRelativelyEqual(atmosphere_model%getDensityMSIS2000(500.d0, 0.d0, 0.d0, 51544.d0), 0.79964653605310576d-003, tolerance=0.01)
@assertRelativelyEqual(0.79964653605310576d-003, atmosphere_model%getDensityMSIS2000(500.d0, 0.d0, 0.d0, 51544.d0), tolerance=0.01)

end subroutine test_getDensityMSIS2000

Expand Down
8 changes: 4 additions & 4 deletions tests/test_gravity.pf
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ contains
tolerance = 1e-6_dp

! Check if outputs match expected values
@assertRelativelyEqual(accel, expected_accel, tolerance)
@assertRelativelyEqual(expected_accel, accel, tolerance)

! Test 2
r_itrf = (/31986.08889084533, 3886.249797563777, -17606.478382491812/)
Expand All @@ -81,7 +81,7 @@ contains
tolerance = 1e-6_dp

! Check if outputs match expected values
@assertRelativelyEqual(accel, expected_accel, tolerance)
@assertRelativelyEqual(expected_accel, accel, tolerance)

! Test 2
r_itrf = (/-42044.21889179173, -3193.6719204189853, 105.63094940415252/)
Expand All @@ -97,7 +97,7 @@ contains
tolerance = 1e-6_dp

! Check if outputs match expected values
@assertRelativelyEqual(accel, expected_accel, tolerance)
@assertRelativelyEqual(expected_accel, accel, tolerance)

! Test 3 :
r_itrf = (/-3485.799126707284, -5898.652976745232, 835.9701786284777/)
Expand All @@ -113,7 +113,7 @@ contains
tolerance = 1e-6_dp

! Check if outputs match expected values
@assertRelativelyEqual(accel, expected_accel, tolerance)
@assertRelativelyEqual(expected_accel, accel, tolerance)

end subroutine test_getGravityAccelaration

Expand Down
36 changes: 18 additions & 18 deletions tests/test_radiation.pf
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ contains
tolerance = 1e-6_dp

! Check if outputs match expected values
@assertRelativelyEqual(acc_srp(1), expected_srp(1),tolerance)
@assertRelativelyEqual(acc_srp(2), expected_srp(2),tolerance)
@assertRelativelyEqual(acc_srp(3), expected_srp(3),tolerance)
@assertRelativelyEqual(expected_srp(1), acc_srp(1), tolerance)
@assertRelativelyEqual(expected_srp(2), acc_srp(2), tolerance)
@assertRelativelyEqual(expected_srp(3), acc_srp(3), tolerance)

!** init solarsystem & satellite model
! Test 2
Expand Down Expand Up @@ -122,9 +122,9 @@ contains
tolerance = 1e-6_dp

! Check if outputs match expected values
@assertRelativelyEqual(acc_srp(1), expected_srp(1),tolerance)
@assertRelativelyEqual(acc_srp(2), expected_srp(2),tolerance)
@assertRelativelyEqual(acc_srp(3), expected_srp(3),tolerance)
@assertRelativelyEqual(expected_srp(1), acc_srp(1), tolerance)
@assertRelativelyEqual(expected_srp(2), acc_srp(2), tolerance)
@assertRelativelyEqual(expected_srp(3), acc_srp(3), tolerance)


! Test 3 :
Expand Down Expand Up @@ -162,9 +162,9 @@ contains
tolerance = 1e-6_dp

! Check if outputs match expected values
@assertRelativelyEqual(acc_srp(1), expected_srp(1),tolerance)
@assertRelativelyEqual(acc_srp(2), expected_srp(2),tolerance)
@assertRelativelyEqual(acc_srp(3), expected_srp(3),tolerance)
@assertRelativelyEqual(expected_srp(1), acc_srp(1), tolerance)
@assertRelativelyEqual(expected_srp(2), acc_srp(2), tolerance)
@assertRelativelyEqual(expected_srp(3), acc_srp(3), tolerance)

end subroutine test_getSrpAcceleration

Expand Down Expand Up @@ -225,9 +225,9 @@ end subroutine test_getSrpAcceleration
tolerance = 1e-6_dp

! Check if outputs match expected values
@assertRelativelyEqual(acc_alb(1), expected_alb(1),tolerance)
@assertRelativelyEqual(acc_alb(2), expected_alb(2),tolerance)
@assertRelativelyEqual(acc_alb(3), expected_alb(3),tolerance)
@assertRelativelyEqual(expected_alb(1), acc_alb(1), tolerance)
@assertRelativelyEqual(expected_alb(2), acc_alb(2), tolerance)
@assertRelativelyEqual(expected_alb(3), acc_alb(3), tolerance)

! Test 2 :
epoch%mjd = 58600.d0
Expand Down Expand Up @@ -264,9 +264,9 @@ end subroutine test_getSrpAcceleration
tolerance = 1e-6_dp

! Check if outputs match expected values
@assertRelativelyEqual(acc_alb(1), expected_alb(1),tolerance)
@assertRelativelyEqual(acc_alb(2), expected_alb(2),tolerance)
@assertRelativelyEqual(acc_alb(3), expected_alb(3),tolerance)
@assertRelativelyEqual(expected_alb(1), acc_alb(1), tolerance)
@assertRelativelyEqual(expected_alb(2), acc_alb(2), tolerance)
@assertRelativelyEqual(expected_alb(3), acc_alb(3), tolerance)

! Test 3 :
epoch%mjd = 58600.d0
Expand Down Expand Up @@ -303,9 +303,9 @@ end subroutine test_getSrpAcceleration
tolerance = 1e-6_dp

! Check if outputs match expected values
@assertRelativelyEqual(acc_alb(1), expected_alb(1),tolerance)
@assertRelativelyEqual(acc_alb(2), expected_alb(2),tolerance)
@assertRelativelyEqual(acc_alb(3), expected_alb(3),tolerance)
@assertRelativelyEqual(expected_alb(1), acc_alb(1), tolerance)
@assertRelativelyEqual(expected_alb(2), acc_alb(2), tolerance)
@assertRelativelyEqual(expected_alb(3), acc_alb(3), tolerance)

end subroutine test_getAlbedoAcceleration

Expand Down
6 changes: 3 additions & 3 deletions tests/test_solarsystem.pf
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module test_solarsystem
tolerance = 1e-6_dp

! Check if outputs match expected values
@assertRelativelyEqual(obtained_position, expected_position, tolerance)
@assertRelativelyEqual(expected_position, obtained_position, tolerance)


! Test 2 :
Expand All @@ -78,7 +78,7 @@ module test_solarsystem
tolerance = 1e-6_dp

! Check if outputs match expected values
@assertRelativelyEqual(obtained_position, expected_position, tolerance)
@assertRelativelyEqual(expected_position, obtained_position, tolerance)

! Test 3 :
epoch%mjd = 58600
Expand All @@ -102,7 +102,7 @@ module test_solarsystem
tolerance = 1e-6_dp

! Check if outputs match expected values
@assertRelativelyEqual(obtained_position, expected_position, tolerance)
@assertRelativelyEqual(expected_position, obtained_position, tolerance)



Expand Down
7 changes: 3 additions & 4 deletions tests/test_thirdbody.pf
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ contains
tolerance = 1e-6_dp

! Check if outputs match expected values
@assertRelativelyEqual(acc_thirdbody, expected_acc, tolerance)
@assertRelativelyEqual(expected_acc, acc_thirdbody, tolerance)


! Test 2 :
Expand All @@ -88,7 +88,7 @@ contains
tolerance = 1e-6_dp

! Check if outputs match expected values
@assertRelativelyEqual(acc_thirdbody, expected_acc, tolerance)
@assertRelativelyEqual(expected_acc, acc_thirdbody, tolerance)

! Test 2 :
epoch%mjd = 58600.d0
Expand All @@ -114,9 +114,8 @@ contains
tolerance = 1e-6_dp

! Check if outputs match expected values
@assertRelativelyEqual(acc_thirdbody, expected_acc, tolerance)
@assertRelativelyEqual(expected_acc, acc_thirdbody, tolerance)


end subroutine test_getThirdBodyAccelaration


Expand Down

0 comments on commit 327a005

Please sign in to comment.