Skip to content

Commit

Permalink
*Fix uninitialized variable in salt redistribution
Browse files Browse the repository at this point in the history
In commit d16ebde I added code to redistribute the salt forcing
to avoid negative salinities under forming sea-ice. Unfortunately I introduced
an uninitialized variable in the process that was the real reason that the
answers changed fro MOM6z_SIS_025.

- Bug fixed.
- Answers changed BACK for MOM6z_SIS_025.
  • Loading branch information
adcroft committed Apr 17, 2014
1 parent 827d70f commit 573507d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions examples/ocean_SIS/MOM6z_SIS_025/timestats.gnu
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Step, Day, Truncs, Energy/Mass, Maximum CFL, Mean Sea Level, Total Mass, Mean Salin, Mean Temp, Frac Mass Err, Salin Err, Temp Err
[days] [m2 s-2] [Nondim] [m] [kg] [PSU] [degC] [Nondim] [PSU] [degC]
0, 693135.000, 0, En 6.782368272983E-05, CFL 0.00000, SL 2.1648E-02, M 1.38184E+21, S 34.7199, T 3.6046, Me 0.00E+00, Se 0.00E+00, Te 0.00E+00
6, 693135.250, 0, En 7.856994566803E-04, CFL 0.19271, SL 2.2895E-02, M 1.38184E+21, S 34.7199, T 3.6047, Me 2.02E-19, Se 4.42E-16, Te 4.41E-17
12, 693135.500, 0, En 8.381802722151E-04, CFL 0.13789, SL 2.3193E-02, M 1.38184E+21, S 34.7199, T 3.6046, Me 8.41E-21, Se 3.27E-18, Te -6.76E-19
18, 693135.750, 0, En 8.965862863412E-04, CFL 0.15262, SL 2.3476E-02, M 1.38184E+21, S 34.7199, T 3.6046, Me 6.58E-20, Se 6.40E-18, Te -5.90E-19
24, 693136.000, 0, En 1.066274578793E-03, CFL 0.23326, SL 2.3736E-02, M 1.38184E+21, S 34.7199, T 3.6047, Me -3.88E-20, Se -8.16E-18, Te -3.84E-19
6, 693135.250, 0, En 7.857006423516E-04, CFL 0.19271, SL 2.2895E-02, M 1.38184E+21, S 34.7199, T 3.6047, Me 5.80E-20, Se 4.38E-16, Te 4.34E-17
12, 693135.500, 0, En 8.381849596654E-04, CFL 0.13807, SL 2.3193E-02, M 1.38184E+21, S 34.7199, T 3.6046, Me -4.12E-20, Se 4.85E-18, Te 1.10E-18
18, 693135.750, 0, En 8.965893891807E-04, CFL 0.15273, SL 2.3476E-02, M 1.38184E+21, S 34.7199, T 3.6046, Me -2.07E-20, Se -1.19E-17, Te -9.76E-19
24, 693136.000, 0, En 1.066280525498E-03, CFL 0.23521, SL 2.3736E-02, M 1.38184E+21, S 34.7199, T 3.6047, Me 1.61E-19, Se 8.53E-18, Te 3.11E-18
8 changes: 4 additions & 4 deletions examples/ocean_SIS/MOM6z_SIS_025/timestats.intel
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Step, Day, Truncs, Energy/Mass, Maximum CFL, Mean Sea Level, Total Mass, Mean Salin, Mean Temp, Frac Mass Err, Salin Err, Temp Err
[days] [m2 s-2] [Nondim] [m] [kg] [PSU] [degC] [Nondim] [PSU] [degC]
0, 693135.000, 0, En 6.782368272983E-05, CFL 0.00000, SL 2.1648E-02, M 1.38184E+21, S 34.7199, T 3.6046, Me 0.00E+00, Se 0.00E+00, Te 0.00E+00
6, 693135.250, 0, En 7.857006895668E-04, CFL 0.19271, SL 2.2895E-02, M 1.38184E+21, S 34.7199, T 3.6047, Me 7.88E-20, Se 4.33E-16, Te 4.37E-17
12, 693135.500, 0, En 8.381831788345E-04, CFL 0.13811, SL 2.3193E-02, M 1.38184E+21, S 34.7199, T 3.6046, Me 1.12E-20, Se 1.66E-19, Te -4.91E-20
18, 693135.750, 0, En 8.965857249487E-04, CFL 0.15273, SL 2.3476E-02, M 1.38184E+21, S 34.7199, T 3.6046, Me 2.49E-21, Se -1.51E-17, Te -1.16E-18
24, 693136.000, 0, En 1.066279942575E-03, CFL 0.23505, SL 2.3736E-02, M 1.38184E+21, S 34.7199, T 3.6047, Me 1.09E-19, Se 1.17E-17, Te 3.88E-19
6, 693135.250, 0, En 7.856993862382E-04, CFL 0.19271, SL 2.2895E-02, M 1.38184E+21, S 34.7199, T 3.6047, Me 1.01E-19, Se 4.36E-16, Te 4.49E-17
12, 693135.500, 0, En 8.381806218882E-04, CFL 0.13792, SL 2.3193E-02, M 1.38184E+21, S 34.7199, T 3.6046, Me -3.43E-20, Se -1.30E-17, Te 5.68E-19
18, 693135.750, 0, En 8.965863195486E-04, CFL 0.15356, SL 2.3476E-02, M 1.38184E+21, S 34.7199, T 3.6046, Me -8.45E-20, Se 1.26E-18, Te -3.07E-18
24, 693136.000, 0, En 1.066273152921E-03, CFL 0.23519, SL 2.3736E-02, M 1.38184E+21, S 34.7199, T 3.6047, Me -5.32E-20, Se 2.09E-17, Te 2.02E-20
8 changes: 4 additions & 4 deletions examples/ocean_SIS/MOM6z_SIS_025/timestats.pgi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Step, Day, Truncs, Energy/Mass, Maximum CFL, Mean Sea Level, Total Mass, Mean Salin, Mean Temp, Frac Mass Err, Salin Err, Temp Err
[days] [m2 s-2] [Nondim] [m] [kg] [PSU] [degC] [Nondim] [PSU] [degC]
0, 693135.000, 0, En 6.782368272983E-05, CFL 0.00000, SL 2.1648E-02, M 1.38184E+21, S 34.7199, T 3.6046, Me 0.00E+00, Se 0.00E+00, Te 0.00E+00
6, 693135.250, 0, En 7.856991233171E-04, CFL 0.19271, SL 2.2895E-02, M 1.38184E+21, S 34.7199, T 3.6047, Me 1.93E-19, Se 4.50E-16, Te 4.51E-17
12, 693135.500, 0, En 8.381806744784E-04, CFL 0.13783, SL 2.3193E-02, M 1.38184E+21, S 34.7199, T 3.6046, Me -1.14E-19, Se -2.72E-17, Te 1.20E-18
18, 693135.750, 0, En 8.965881286134E-04, CFL 0.15247, SL 2.3476E-02, M 1.38184E+21, S 34.7199, T 3.6046, Me -8.07E-20, Se 5.15E-18, Te -2.17E-18
24, 693136.000, 0, En 1.066278076725E-03, CFL 0.23489, SL 2.3736E-02, M 1.38184E+21, S 34.7199, T 3.6047, Me 7.10E-20, Se 3.55E-19, Te -2.34E-18
6, 693135.250, 0, En 7.856992770531E-04, CFL 0.19271, SL 2.2895E-02, M 1.38184E+21, S 34.7199, T 3.6047, Me 1.78E-19, Se 4.32E-16, Te 4.26E-17
12, 693135.500, 0, En 8.381804207780E-04, CFL 0.13788, SL 2.3193E-02, M 1.38184E+21, S 34.7199, T 3.6046, Me -6.88E-20, Se -2.01E-18, Te -5.34E-19
18, 693135.750, 0, En 8.965864933564E-04, CFL 0.15262, SL 2.3476E-02, M 1.38184E+21, S 34.7199, T 3.6046, Me -4.03E-20, Se 1.10E-17, Te 1.03E-18
24, 693136.000, 0, En 1.066279872379E-03, CFL 0.23553, SL 2.3736E-02, M 1.38184E+21, S 34.7199, T 3.6047, Me 8.94E-20, Se -1.61E-17, Te 2.38E-18
2 changes: 1 addition & 1 deletion src/parameterizations/vertical/MOM_diabatic_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1996,7 +1996,7 @@ subroutine applyBoundaryFluxes(CS, G, dt, fluxes, optics, ea, h, tv)
dThickness = max( fractionOfForcing*netThickness(i), -h2d(i,k) )
dTemp = fractionOfForcing*netHeat(i)
! The following max avoids taking out more salt than is in the layer
dSalt = max( fractionOfForcing*netSalt(i), -0.9999*hOld*tv%S(i,j,k))
dSalt = max( fractionOfForcing*netSalt(i), -0.9999*h2d(i,k)*tv%S(i,j,k))

! Update the forcing by the part to be consumed
netThickness(i) = netThickness(i) - dThickness
Expand Down

0 comments on commit 573507d

Please sign in to comment.