Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactors the EOS modules to use classes #522

Merged
merged 2 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/perfmon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,36 @@ jobs:
sudo sysctl -w kernel.perf_event_paranoid=2
make perf DO_REGRESSION_TESTS=true
# This job assumes that build/target_codebase was cloned above
- name: Compile timing tests for reference code
if: ${{ github.event_name == 'pull_request' }}
run: >-
make -j build.timing_target
MOM_TARGET_SLUG=$GITHUB_REPOSITORY
MOM_TARGET_LOCAL_BRANCH=$GITHUB_BASE_REF
DO_REGRESSION_TESTS=true
- name: Compile timing tests
run: |
make -j build.timing
# DO_REGERESSION_TESTS=true is needed here to set the internal macro TARGET_CODEBASE
- name: Run timing tests for reference code
if: ${{ github.event_name == 'pull_request' }}
run: >-
make -j run.timing_target
DO_REGRESSION_TESTS=true
- name: Run timing tests
run: |
make -j run.timing
- name: Display timing results
run: |
make -j show.timing
- name: Display comparison of timing results
if: ${{ github.event_name == 'pull_request' }}
run: >-
make -j compare.timing
DO_REGRESSION_TESTS=true
19 changes: 18 additions & 1 deletion .testing/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ endif

FMS_SOURCE = $(call SOURCE,deps/fms/src)


#---
# Rules

Expand Down Expand Up @@ -684,6 +683,24 @@ show.timing: $(foreach f, $(TIMING_EXECS), work/timing/$(f).show)
$(WORKSPACE)/work/timing/%.show:
./tools/disp_timing.py $(@:.show=.out)

# Invoke the above unit/timing rules for a "target" code
# Invoke with appropriate macros defines, i.e.
# make build.timing_target MOM_TARGET_URL=... MOM_TARGET_BRANCH=... TARGET_CODEBASE=build/target_codebase
# make run.timing_target TARGET_CODEBASE=build/target_codebase

TIMING_TARGET_EXECS ?= $(basename $(notdir $(wildcard $(TARGET_CODEBASE)/config_src/drivers/timing_tests/*.F90) ) )

.PHONY: build.timing_target
build.timing_target: $(foreach f, $(TIMING_TARGET_EXECS), $(TARGET_CODEBASE)/.testing/build/timing/$(f))
.PHONY: run.timing_target
run.timing_target: $(foreach f, $(TIMING_TARGET_EXECS), $(TARGET_CODEBASE)/.testing/work/timing/$(f).out)
.PHONY: compare.timing
compare.timing: $(foreach f, $(filter $(TIMING_EXECS),$(TIMING_TARGET_EXECS)), work/timing/$(f).compare)
$(WORKSPACE)/work/timing/%.compare: $(TARGET_CODEBASE)
./tools/disp_timing.py -r $(TARGET_CODEBASE)/.testing/$(@:.compare=.out) $(@:.compare=.out)
$(TARGET_CODEBASE)/.testing/%: | $(TARGET_CODEBASE)
cd $(TARGET_CODEBASE)/.testing && make $*

# General rule to run a unit test executable
# Pattern is to run build/unit/executable and direct output to executable.out
$(WORKSPACE)/work/unit/%.out: build/unit/%
Expand Down
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