1. 05 Apr, 2018 1 commit
    • David Deepwell's avatar
      Update map_iwave case to use new diagnostics · e6b803fd
      David Deepwell authored
      This case has uncovered that the BPE calculation returns
      incorrect values when a Chebyshev grid is used on a field scale.
      The BPE calculation uses the quadrature weights as the volumes
      of each cell. This is true when the grid is regular, but incorrect
      for Chebyshev grids.
      
      To first approximation the Cheb quadrature weights are close to
      the volumes of the cells. This leads to the BPE calculation
      being accurate to 8 significant figures. 8 sig figs is not enough
      on fields scales since the magnitude of the PE can be very, very
      large. The difference of the BPE from the PE can thus be smaller
      than these 8 sig figs.
      e6b803fd
  2. 23 Mar, 2018 1 commit
  3. 22 Mar, 2018 1 commit
  4. 13 Mar, 2018 1 commit
    • David Deepwell's avatar
      Update gravity_current to only use full zgrid · e938e1be
      David Deepwell authored
      The full xgrid and ygrid are unnecessary since x and y only
      depend on a single variable (or index - ii for x, and jj for y).
      The variables xx and yy can be used instead of xgrid and ygrid,
      respectively. Creating the full grids for these fields is a
      waste of memory.
      e938e1be
  5. 30 Jan, 2018 1 commit
  6. 28 Jan, 2018 3 commits
  7. 10 Jan, 2018 1 commit
    • David Deepwell's avatar
      Explicitly set dt_max value · 7f238e06
      David Deepwell authored
      If dt_max is not given in the spins.conf, it is now explicitly
      set to 0 so as to be adjusted later to use the buoyancy frequency.
      The dt_max is also printed in the initialization for clarity.
      7f238e06
  8. 06 Nov, 2017 1 commit
  9. 02 Nov, 2017 2 commits
    • David Deepwell's avatar
      Make BPE_from_internal an optional argument · ba41b112
      David Deepwell authored
      Also reorganize how some diagnostics are added to the file.
      This is now a little clearer to read since similar diagnostics
      are placed near each other.
      ba41b112
    • Christopher Subich's avatar
      Small fixes for broken build · f69389d7
      Christopher Subich authored
      In the previous merge, compilation of Sorter.o went missing from the
      Makefile, and a typo was introduced in the gravity_current case file;
      each would prevent a build from finishing.  These are fixed.
      f69389d7
  10. 01 Nov, 2017 2 commits
    • Christopher Subich's avatar
      Keep checks consistent between compute/write diagnostic · c2b83a9b
      Christopher Subich authored
      In certain cases, diagnostic computation required Nx/y/z > 1, but this
      check was not repeated for adding the diagnostic output to the
      respective file; this could result in unexpectedly writing 0 or
      meaningless data to the file.
      c2b83a9b
    • Christopher Subich's avatar
      Gravity_current: compute v^2 KE if f != 0 · ae19aedf
      Christopher Subich authored
      This change allows the gravity_current case to compute the v^2 component
      of the kinetic energy term even if NY=1 when rot_f != 0; in that case
      the solution can still develop a 2D geostrophic balance where v-velocity
      balances a pressure gradient.
      
      Additionally, the respective component sums are explicitly initialized to
      0.
      ae19aedf
  11. 24 Oct, 2017 1 commit
  12. 18 Oct, 2017 1 commit
  13. 17 Oct, 2017 1 commit
  14. 04 Oct, 2017 1 commit
    • David Deepwell's avatar
      Add all blitz indices in declaration of rank 3 matrix · 1df50bf9
      David Deepwell authored
      Creating a rank 3 matrix requires all three indices in the declaration
      statement. This is only necessary when debugging, but should be explicit
      wherever possible. Otherwise, too much time will be spent trying to
      remember this fact when it matters.
      1df50bf9
  15. 04 Aug, 2017 1 commit
  16. 05 May, 2017 1 commit
    • David Deepwell's avatar
      Create BPE calculator · 8701eded
      David Deepwell authored
      The background Potential Energy (BPE) is calculated in
      compute_Background_PE in Science.cpp. The APE can
      be calculated afterwards from the BPE and PE from the
      diagnostic file.
      8701eded
  17. 04 May, 2017 1 commit
    • David Deepwell's avatar
      Create mechanism to easily output diagnostic values · 8b9ecf2c
      David Deepwell authored
      Diagnostic values (like total KE/ total enstrophy/ mass/ etc)
      are often desired outputs at each time-step. These values
      are easily printed to a txt file using two functions:
      add_diagnostic and write_diagnostics.
      
      add_diagnostic adds the name and value of a diagnostic into a
      pair of strings which will be written into diagnostics.txt
      which the function write_diagnostics.
      
      Usage of add_diagnostic is as follows:
      add_diagnostic(name, value, header, line);
      This will add the string, 'name', onto the string, 'header', which
      will be the header of the diagnostics.txt file. The double (or
      int), 'value', will be added onto the string, 'line', which will
      be a row (or line) in the diagnostics.txt file.
      
      write_diagnostics will write these lines (header and line) into
      diagnostics.txt.
      8b9ecf2c
  18. 04 Feb, 2017 3 commits
    • David Deepwell's avatar
      Move time step checker to BaseCase · 428b5399
      David Deepwell authored
      The empty shell of check_timestep in BaseCase has been filled
      with what was essentially the same thing in each case file.
      Again, this is just more case file house cleaning.
      
      A few ancillary functions have also been written to help.
      The most important might be get_dt_max() which returns dt_max.
      dt_max can either be specified in spins.conf or defined in the
      case file based on the buoyancy frequency. Currently, if
      dt_max > 0 and in spins.conf, then that value is used. Otherwise,
      0.5/sqrt(N2_max) is used.
      
      The re-definition of check_timestep in each case file can now be
      removed so long as the associated ancillary functions and
      parameters are included.
      428b5399
    • David Deepwell's avatar
      Move restart sequence checking into Options.cpp · 25b5d62f
      David Deepwell authored
      The generic code block to check the restart sequence is not needed
      in the case file and has been moved into Options.cpp. This
      streamlines the case file and makes a single copy for all other
      case files to use.
      25b5d62f
    • David Deepwell's avatar
      Properly initialize get_restart_sequence() in case file · a1a18e74
      David Deepwell authored
      The re-definition of get_restart_sequence() was missing in
      gravity_current.cpp. This resulted in all restarts to read output
      zero (*.0). Restarting will now properly read the output number
      specified by restart_sequence.
      a1a18e74
  19. 27 Jan, 2017 2 commits
    • David Deepwell's avatar
      Add filter parameters to case options · b5470525
      David Deepwell authored
      gravity_current.cpp accepts filter parameters (f_cutoff, f_order,
      f_strength) as optional input arguments. Easy adjustment of the
      filter is useful when the flow become suddenly becomes too chaotic.
      b5470525
    • David Deepwell's avatar
      Move expansion parsing into Options.cpp · 3035b35a
      David Deepwell authored
      Parsing of expansion types in gravity_current.cpp moved to
      Options.cpp. This is a general procedure that other case files
      will and should make use of. It also simplifies the case file
      to the specific set-up of that case.
      3035b35a
  20. 24 Jan, 2017 2 commits
  21. 16 Jan, 2017 1 commit
    • David Deepwell's avatar
      Creation of a new case file and associated configuration file. · 4a8d478c
      David Deepwell authored
      This case file is restartable and will dump all variables at the end of the requested computation time (stated in spins.conf) when run on SCINET or SHARCNET. The spins.conf enables the quick set-up of a parameter sweep as parameters are set within it and not within the case file which would need to be re-compiled.
      This file will be used as a basis for the upcoming additions and changes to BaseCase.cpp and Science.cpp.
      4a8d478c