Skip to content
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
49 changes: 0 additions & 49 deletions .github/inactive_workflows/fesom2_icepack.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/fesom2_icepack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

name: FESOM2 Icepack

# Controls when the action will run. Triggers the workflow on push or pull request.

on: [push, pull_request]


# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
icepack_test:
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
# Docker Hub image that `container-job` executes in
container: koldunovn/fesom2_test:refactoring2

# Service containers to run with `gfortran_ubuntu`
steps:
# NK: this changes working directory to fesom2
- uses: actions/checkout@v2

- name: prepeare FESOM2_icepack
run: |
cd ./src/icepack_drivers/
./download_icepack.sh
cd ../../

- name: Compile model
run: |
bash -l configure.sh ubuntu -DUSE_ICEPACK=ON

- name: Create global test run with ICEPACK
run: |
mkrun pi test_pi_icepack -m docker
- name: FESOM2 global test run with ICEPACK
run: |
cd work_pi
chmod +x job_docker_new
./job_docker_new
- name: Check global results
run: |
cd work_pi
fcheck .
- name: Check restarts
run: |
cd work_pi
./job_docker_new
16 changes: 7 additions & 9 deletions setups/test_pi_icepack/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ namelist.icepack:
prec: 8

namelist.io:
diag_list:
ldiag_energy: False
nml_list:
io_list:
"sst ":
Expand Down Expand Up @@ -70,13 +68,13 @@ namelist.io:
prec: 8

fcheck:
a_ice: 0.30599544390558286
aicen: 0.061199088781116566
salt: 23.866195697592563
sst: 8.725992728181598
temp: 1.717206734648259
u: -0.001444895079544947
v: 0.00018599946919795504
a_ice: 0.7342713917324206
aicen: 0.14963770060211143
salt: 34.72907250369024
sst: 8.82781788569422
temp: 2.4794607969603955
u: -0.0021068982998579183
v: 0.00021513911122768571



Expand Down
27 changes: 18 additions & 9 deletions setups/update_truth_values.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ if [ ! -f "$SETUP_FILE" ]; then
fi

# Parse and update values
declare -A updates
updates_keys=()
updates_vals=()
count=0

while IFS= read -r line; do
Expand All @@ -66,31 +67,39 @@ while IFS= read -r line; do
var_name=$(echo "$var_name" | xargs) # trim whitespace
current_val="${BASH_REMATCH[2]}"
current_val=$(echo "$current_val" | xargs) # trim whitespace

updates["$var_name"]="$current_val"

updates_keys+=("$var_name")
updates_vals+=("$current_val")
((count++))
fi
done <<< "$INPUT"

if [ $count -eq 0 ]; then
echo "Error: No variable updates found in input"
echo "Expected format: Variable: <name>, current_value: <value>, master_value: ..."
rm "$BACKUP_FILE"
exit 1
fi

echo "Found $count variable(s) to update:"
for var in "${!updates[@]}"; do
echo " $var: ${updates[$var]}"
for i in "${!updates_keys[@]}"; do
echo " ${updates_keys[$i]}: ${updates_vals[$i]}"
done
echo ""

# Apply updates to setup.yml
for var in "${!updates[@]}"; do
value="${updates[$var]}"
uname_s=$(uname -s)
for i in "${!updates_keys[@]}"; do
var="${updates_keys[$i]}"
value="${updates_vals[$i]}"
# Escape special characters in value for sed
escaped_value=$(echo "$value" | sed 's/[\/&]/\\&/g')
sed -i "s/^\\([ ]*${var}:\\).*/\\1 ${escaped_value}/" "$SETUP_FILE"

if [ "$uname_s" = "Darwin" ]; then
sed -i '' -e "s/^\\([ ]*${var}:\\).*/\\1 ${escaped_value}/" "$SETUP_FILE"
else
sed -i -e "s/^\\([ ]*${var}:\\).*/\\1 ${escaped_value}/" "$SETUP_FILE"
fi
done

echo "✓ Truth values updated successfully in $SETUP_FILE"

10 changes: 7 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -384,12 +384,16 @@ elseif(${CMAKE_Fortran_COMPILER_ID} STREQUAL GNU )
# target_compile_options(${PROJECT_NAME} PRIVATE -O3 -finit-local-zero -finline-functions -fimplicit-none -fdefault-real-8 -ffree-line-length-none)
if(${FESOM_PLATFORM_STRATEGY} STREQUAL ubuntu )
message(STATUS "Allowing type mismatches on Ubuntu for CI Testing" ) # NOTE(PG): Would be nicer to grab the CI=True from the env variable
target_compile_options(${PROJECT_NAME} PRIVATE -O2 -g -fbacktrace -ffloat-store -finit-local-zero -finline-functions -fimplicit-none -fdefault-real-8 -fdefault-double-8 -ffree-line-length-none -fallow-argument-mismatch -cpp)
target_compile_options(${PROJECT_NAME} PRIVATE -O2 -g -fbacktrace -ffloat-store -finit-local-zero -finline-functions -fimplicit-none -fdefault-real-8 -fdefault-double-8 -ffree-line-length-none -cpp)
else()
target_compile_options(${PROJECT_NAME} PRIVATE -O3 -ffloat-store -finit-local-zero -finline-functions -fimplicit-none -fdefault-real-8 -fdefault-double-8 -ffree-line-length-none -cpp)
endif()
if(CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 10 )
target_compile_options(${PROJECT_NAME} PRIVATE -fallow-argument-mismatch) # gfortran v10 is strict about erroneous API calls: "Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)"
if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
if(CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 10)
target_compile_options(${PROJECT_NAME} PRIVATE -fallow-argument-mismatch) # gfortran v10 is strict about erroneous API calls: "Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)"
else()
target_compile_options(${PROJECT_NAME} PRIVATE -Wno-argument-mismatch)
endif()
endif()

# platform specific compiler flags
Expand Down
Loading