Skip to content

Commit

Permalink
Use a class to deliver elemental procedures for EOS
Browse files Browse the repository at this point in the history
- Added a base class in MOM_EOS_base_type.F90
- All EOS modules now extend this base class
  - This reduces replicated code between the EOS modules
- All existing APIs in MOM_EOS now avoid branching for the type of
  EOS and ultimately pass through to a low-level elemental function
  implementation of the actual EOS
- Added a new elemental function exposed by MOM_EOS
  (currently not used in the main model)
- There is a speed up over the previous form of EOS due to the
  reduced branching
  - For some functions, a local implementation of the base class member is
    needed to gain performance. I deliberately did not implement this
    optimization for UNESCO or Jackett06 so that the generic implementation
    of the base class is utilized and we have code coverage.
  • Loading branch information
adcroft authored and marshallward committed Nov 22, 2023
1 parent cce4b3d commit d8579d2
Show file tree
Hide file tree
Showing 12 changed files with 3,446 additions and 3,848 deletions.
594 changes: 165 additions & 429 deletions src/equation_of_state/MOM_EOS.F90

Large diffs are not rendered by default.

736 changes: 327 additions & 409 deletions src/equation_of_state/MOM_EOS_Jackett06.F90

Large diffs are not rendered by default.

925 changes: 443 additions & 482 deletions src/equation_of_state/MOM_EOS_Roquet_SpV.F90

Large diffs are not rendered by default.

788 changes: 422 additions & 366 deletions src/equation_of_state/MOM_EOS_Roquet_rho.F90

Large diffs are not rendered by default.

504 changes: 195 additions & 309 deletions src/equation_of_state/MOM_EOS_TEOS10.F90

Large diffs are not rendered by default.

814 changes: 378 additions & 436 deletions src/equation_of_state/MOM_EOS_UNESCO.F90

Large diffs are not rendered by default.

718 changes: 270 additions & 448 deletions src/equation_of_state/MOM_EOS_Wright.F90

Large diffs are not rendered by default.

632 changes: 282 additions & 350 deletions src/equation_of_state/MOM_EOS_Wright_full.F90

Large diffs are not rendered by default.

610 changes: 272 additions & 338 deletions src/equation_of_state/MOM_EOS_Wright_red.F90

Large diffs are not rendered by default.

464 changes: 464 additions & 0 deletions src/equation_of_state/MOM_EOS_base_type.F90

Large diffs are not rendered by default.

507 changes: 227 additions & 280 deletions src/equation_of_state/MOM_EOS_linear.F90

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/tracer/MOM_neutral_diffusion.F90
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module MOM_neutral_diffusion
use MOM_diag_mediator, only : post_data, register_diag_field
use MOM_EOS, only : EOS_type, EOS_manual_init, EOS_domain
use MOM_EOS, only : calculate_density, calculate_density_derivs
use MOM_EOS, only : extract_member_EOS, EOS_LINEAR, EOS_TEOS10, EOS_WRIGHT
use MOM_EOS, only : EOS_LINEAR
use MOM_error_handler, only : MOM_error, FATAL, WARNING, MOM_mesg, is_root_pe
use MOM_file_parser, only : get_param, log_version, param_file_type
use MOM_file_parser, only : openParameterBlock, closeParameterBlock
Expand Down

0 comments on commit d8579d2

Please sign in to comment.