Skip to content

Commit f5fb6e4

Browse files
Merge branch 'main' into refactor-wet-model
2 parents 6a2e88e + 17516f6 commit f5fb6e4

45 files changed

Lines changed: 100420 additions & 684 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Handle line endings automatically for files detected as text
2+
# and leave all files detected as binary untouched.
3+
* text=auto
4+
5+
# Binaries
6+
*.nc binary
7+
*.png binary
8+
9+
# Fortran namelist file identification
10+
*.nl text diff=fortran-free-form
11+
*.nl linguist-language=fortran-free-form

CONTRIBUTORS.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@
55
| james-bruten-mo | James Bruten | Met Office | 2025-12-09 |
66
| Pierre-siddall | Pierre Siddall | Met Office | 2025-01-19 |
77
| ericaneininger | Erica Neininger | Met Office | 2026-02-04 |
8-
| dcalve | Daley Calvert | Met Office | 2026-02-04 |
8+
| dcalve | Daley Calvert | Met Office | 2026-02-04 |
9+
| harry-shepherd | Harry Shepherd | Met Office | 2026-02-27 |
10+
| marcstring | Marc Stringer | NCAS | 2026-04-01 |
11+

Coupled_Drivers/cice_driver.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import re
2727
import datetime
2828
import time
29-
import subprocess
3029
import time2days
3130
import inc_days
3231
import common

Coupled_Drivers/common.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,10 @@ def exec_subproc_timeout(cmd, timeout_sec=10):
254254
the commands to be run, and an integer timeout_sec for how long to
255255
wait for the command to run. Returns the return code from the process
256256
and the standard out from the command or 'None' if the command times out.
257+
258+
This function is now DEPRECATED in favour of the exec_shellout function in
259+
mocilib
260+
257261
'''
258262
process = subprocess.Popen(cmd, shell=False,
259263
stdin=subprocess.PIPE,
@@ -280,6 +284,10 @@ def exec_subproc(cmd, verbose=True):
280284
Execute given shell command. Takes a list containing the commands to be
281285
run, and a logical verbose which if set to true will write the output of
282286
the command to stdout.
287+
288+
This function is now DEPRECATED in favour of the exec_shellout function in
289+
mocilib
290+
283291
'''
284292
process = subprocess.Popen(cmd, shell=False,
285293
stdin=subprocess.PIPE,
@@ -301,6 +309,10 @@ def __exec_subproc_true_shell(cmd, verbose=True):
301309
exec_subproc does not work correctly. Takes a list containing the commands
302310
to be run, and a logical verbose which if set to true will write the
303311
output of the command to stdout.
312+
313+
This function is now DEPRECATED in favour of the exec_shellout function in
314+
mocilib
315+
304316
'''
305317
process = subprocess.Popen(cmd, shell=True,
306318
stdin=subprocess.PIPE,

Coupled_Drivers/mct_driver.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import dr_env_lib.mct_def
2929
import dr_env_lib.env_lib
3030
import cpmip_controller
31+
3132
try:
3233
import f90nml
3334
except ImportError:

Coupled_Drivers/rivers_driver.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import error
2727
import dr_env_lib.rivers_def
2828
import dr_env_lib.env_lib
29+
2930
try:
3031
import f90nml
3132
except ImportError:

Documentation/mocilib/mocilib.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# MOCIlib
2+
3+
MOCIlib is intended as a library to hold an assorted range on utility functions that can be used throughout new development and maintainance of MOCI along with their associated unit tests to ensure robust and unified approach to MOCI's functionality.
4+
5+
## shellout
6+
7+
The shelllout module contains the relevant functions to execute and handle shell commands in a safe manner.
8+
9+
exec_subprocess is a function to execute a shell subprocess and takes the several parameters as follows:
10+
11+
```python
12+
def exec_subprocess(cmd, verbose=False, timeout=None, current_working_directory=os.getcwd())
13+
```
14+
15+
cmd - the command to be executed by exec_subprocess given as a string.
16+
17+
verbose - a boolean (True or False) to determine if the standard output (stdout) stream is output during the execution of the shell command.
18+
19+
timeout - an integer number determining the number of seconds a shell command can run for before a TimeoutExpired error is raised.
20+
21+
current_working_directory - The working directory which the shell command will be executed in given as a string.

Infrastructure_Builds/infrastructure_suite/bin/create_oasis_module.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ if [ -z "$SUITE_REVISION" ]; then
3131
SUITE_REVISION='Revision: undefined'
3232
revision='undefined'
3333
else
34-
revision=$(echo $SUITE_REVISION | grep -oP '\d+')
34+
revision=$SUITE_REVISION
3535
fi
3636

3737
oasis_mod_version_path=$OASIS_MOD_NAME/$OASIS_MOD_VERSION/$revision

Infrastructure_Builds/infrastructure_suite/bin/create_prgenv_module.sh

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if [ -z "$SUITE_REVISION" ]; then
2828
SUITE_REVISION='Revision: undefined'
2929
revision='undefined'
3030
else
31-
revision=$(echo $SUITE_REVISION | grep -oP '\d+')
31+
revision=$SUITE_REVISION
3232
fi
3333

3434
module_file_path=$MODULE_BASE/modules/$PRG_ENV_NAME/$PRG_ENV_VERSION
@@ -73,17 +73,6 @@ set version $PRG_ENV_VERSION
7373
7474
EOF
7575

76-
for mod in $MODULE_STR; do
77-
if [[ $mod == *'PrgEnv'* ]]; then
78-
line="module swap PrgEnv-cray $mod"
79-
else
80-
line="module load $mod"
81-
fi
82-
cat <<EOF >>$module_file
83-
$line
84-
EOF
85-
done
86-
8776
# now do the oasis and xios modules
8877
if [ "XIOS_ONLY" = "True" ]; then
8978
line="module load $XIOS_MODULE_PATH";

Infrastructure_Builds/infrastructure_suite/bin/create_xios_module.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ if [ -z "$SUITE_REVISION" ]; then
3131
SUITE_REVISION='Revision: undefined'
3232
revision='undefined'
3333
else
34-
revision=$(echo $SUITE_REVISION | grep -oP '\d+')
34+
revision=$SUITE_REVISION
3535
fi
3636

3737
xios_mod_version_path=$XIOS_MOD_NAME/$XIOS_MOD_VERSION/$revision

0 commit comments

Comments
 (0)