Skip to content

Commit 6afcd0a

Browse files
Fcm make retirement from rose-stem (#35)
1 parent 50bb7e8 commit 6afcd0a

19 files changed

Lines changed: 471 additions & 156 deletions

File tree

Coupled_Drivers/run_model

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,21 @@ L_MCT_VALIDATE=${L_MCT_VALIDATE:=false}
3939

4040
# Copy scripts to work directory so they can be found. We use the dependency
4141
# checker script so we only copy the files we need.
42-
FILES_TO_INSTALL=$($DRIVER_EXTRACT_DIR/extract/drivers/Coupled_Drivers/driver_dependencies.py --extract-directory $DRIVER_EXTRACT_DIR/extract/drivers/Coupled_Drivers)
42+
if [[ $DRIVER_EXTRACT_DIR == *"fcm_make"* ]] ; then
43+
# fcm_make infrastructure
44+
extract_path=extract/drivers
45+
else
46+
extract_path=
47+
fi
48+
FILES_TO_INSTALL=$($DRIVER_EXTRACT_DIR/$extract_path/Coupled_Drivers/driver_dependencies.py --extract-directory $DRIVER_EXTRACT_DIR/$extract_path/Coupled_Drivers)
4349
for file in $FILES_TO_INSTALL; do
4450
# handle any packages
4551
package_name=$(dirname "${file}")
4652
if [[ $package_name != '.' && ! -d $package_name ]]; then
4753
mkdir $package_name
4854
fi
4955
# as package_name will default to . then this will handle all cases
50-
cp $DRIVER_EXTRACT_DIR/extract/drivers/Coupled_Drivers/$file $package_name
56+
cp $DRIVER_EXTRACT_DIR/$extract_path/Coupled_Drivers/$file $package_name
5157
done
5258

5359
# If the run uses LFRic, and environment variable NAMCOUPLE_STATIC is .false.
@@ -56,8 +62,8 @@ done
5662
# compatibility
5763
NAMCOUPLE_STATIC=${NAMCOUPLE_STATIC:=True}
5864
if [[ "$models" == *lfric* && "$NAMCOUPLE_STATIC" == .false. ]]; then
59-
cp $DRIVER_EXTRACT_DIR/extract/drivers/Utilities/NGMS_utils/ngms_namcouple_gen/*py ./
60-
cp $DRIVER_EXTRACT_DIR/extract/drivers/Utilities/NGMS_utils/ngms_suite_lib/*py ./
65+
cp $DRIVER_EXTRACT_DIR/$extract_path/Utilities/NGMS_utils/ngms_namcouple_gen/*py ./
66+
cp $DRIVER_EXTRACT_DIR/$extract_path/Utilities/NGMS_utils/ngms_suite_lib/*py ./
6167
fi
6268

6369
EXTRA_LINK_DRIVERS_INFO=$( echo ${EXTRA_LINK_DRIVERS_INFO:-} | tr '[:upper:]' '[:lower:]')
@@ -80,7 +86,7 @@ echo '[DRIVER_TEST_SCRIPT] Drivers successfully linked'
8086
# had been completed
8187
if [ "$L_MCT_VALIDATE" = True ]; then
8288
echo "Running MCT validate"
83-
cp $DRIVER_EXTRACT_DIR/extract/drivers/Coupled_Drivers/driver_utilities/mct_validate/mct_validate.py ./
89+
cp $DRIVER_EXTRACT_DIR/$extract_path/Coupled_Drivers/driver_utilities/mct_validate/mct_validate.py ./
8490
./mct_validate.py
8591
fi
8692

Postprocessing/build/build_pp.sh

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#!/usr/bin/env bash
2+
# -----------------------------------------------------------------------------
3+
# (C) Crown copyright Met Office. All rights reserved.
4+
# The file LICENCE, distributed with this code, contains details of the terms
5+
# under which the code may be used.
6+
# -----------------------------------------------------------------------------
7+
# NAME
8+
# build_pp
9+
#
10+
# DESCRIPTION
11+
# Move PostProc application code to executable location within a rose suite
12+
#
13+
# -----------------------------------------------------------------------------
14+
15+
# Fail if environment variables are unset
16+
set -eu
17+
18+
# Required environment
19+
PP_SOURCE_DIR=${PP_SOURCE_DIR:=$CYLC_WORKFLOW_RUN_DIR/share/source/moci_postproc}
20+
PP_TARGET_DIR=${PP_TARGET_DIR:-$CYLC_WORKFLOW_SHARE_DIR/bin}
21+
22+
MOCILIB=${MOCILIB:=true}
23+
MOCILIB_PATH=${MOCILIB_PATH:=$CYLC_WORKFLOW_RUN_DIR/share/moci/mocilib}
24+
25+
PP_COMPONENTS="atmos nemocice unicicles archive_verify"
26+
PP_TESTS=${PP_TESTS:=false}
27+
28+
echo [INFO] Building PostProc application from $PP_SOURCE_DIR
29+
echo [INFO] -- Build location: $PP_TARGET_DIR
30+
31+
if [[ ! -d $PP_SOURCE_DIR ]] ; then
32+
echo [ERROR] $PP_SOURCE_DIR does not exist >&2
33+
exit 1
34+
fi
35+
if [[ ! -d $PP_TARGET_DIR ]] ; then
36+
echo [INFO] Creating build directory...
37+
mkdir -p $PP_TARGET_DIR
38+
fi
39+
40+
# Copy mocilib
41+
if [[ "$MOCILIB" != true ]] ; then
42+
echo [INFO] MOCIlib library not installed
43+
elif [[ -d "$MOCILIB_PATH" ]] ; then
44+
cp -r $MOCILIB $PP_TARGET_DIR
45+
else
46+
echo [ERROR] Failed to find the required \"mocilib\" library >&2
47+
exit 1
48+
fi
49+
50+
# Copy NEMO tools
51+
if [[ -d "$PP_SOURCE_DIR/../nemotools" ]] ; then
52+
cp $PP_SOURCE_DIR/../nemotools/* $PP_TARGET_DIR
53+
else
54+
echo [INFO] NEMO iceberg rebuilding tools not available
55+
fi
56+
57+
# Copy main_pp executable
58+
mainscr=$PP_SOURCE_DIR/Postprocessing/main_pp.py
59+
if [[ -f "$mainscr" ]] ; then
60+
cp $mainscr $PP_TARGET_DIR
61+
else
62+
echo [ERROR] Source for PostProc executable $mainscr does not exist >&2
63+
exit 1
64+
fi
65+
66+
# Copy component directory contents
67+
src_dirs="common platforms $PP_COMPONENTS"
68+
if [[ "$PP_TESTS" = true ]] ; then
69+
src_dirs="$src_dirs unittests"
70+
fi
71+
for directory in $src_dirs; do
72+
if [[ -d $PP_SOURCE_DIR/Postprocessing/$directory ]] ; then
73+
cp $PP_SOURCE_DIR/Postprocessing/$directory/* $PP_TARGET_DIR
74+
else
75+
echo [ERROR] Source for PostProc component $directory does not exist >&2
76+
exit 1
77+
fi
78+
done

dependencies.yaml

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,7 @@
2020
moci:
2121
source:
2222
ref:
23-
24-
casim:
25-
source: git@github.com:MetOffice/casim.git
26-
ref: um13.1
27-
28-
jules:
29-
source: git@github.com:MetOffice/jules-internal.git
30-
ref: um13.1
31-
32-
shumlib:
33-
source: git@github.com:MetOffice/shumlib.git
34-
ref: um13.1
35-
36-
socrates:
37-
source: git@github.com:MetOffice/socrates.git
38-
ref: um13.1
39-
40-
ukca:
41-
source: git@github.com:MetOffice/ukca.git
42-
ref: um13.1
43-
44-
um:
45-
source: git@github.com:MetOffice/um.git
46-
ref: vn13.1
4723

24+
SimSys_Scripts:
25+
source: git@github.com:MetOffice/SimSys_Scripts.git
26+
ref: main

rose-stem/.cylcignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
bin/suite_report_git.py
2+
bin/suite_data.py
3+
bin/git_bdiff.py
4+
bin/get_git_sources.py
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[command]
2+
default=$SOURCE_DIRECTORY/moci/Postprocessing/build/build_pp.sh
3+
4+
[env]
5+
# MOCIlib doesn't exist yet! Default is true.
6+
MOCILIB=false
7+
NEMO_TOOLS=fcm:nemo.xm/utils/tools_r4.0-HEAD
8+
NEMO_TOOLS_REV=@16016
9+
!PP_COMPONENTS=atmos nemocice unicicles archive_verify
10+
# Default name for extracted repository source = "moci_postproc"
11+
PP_SOURCE_DIR=$SOURCE_DIRECTORY/moci
12+
!PP_TARGET_DIR=$CYLC_WORKFLOW_SHARE_DIR/bin
13+
# Unit tests not copied by default
14+
PP_TESTS=true
15+
16+
# Icebergs not currently used in rose-stem - nemotools not required
17+
[file:$SOURCE_DIRECTORY/nemotools/icb_combrest.py]
18+
source=$NEMO_TOOLS/REBUILD_NEMO/icb_combrest.py$NEMO_TOOLS_REV
19+
20+
[!file:$SOURCE_DIRECTORY/nemotools/icb_pp.py]
21+
source=$NEMO_TOOLS/MISCELLANEOUS/icb_pp.py$NEMO_TOOLS_REV
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[command]
2+
default=echo "[INFO] Extracting UM and related repositories"
3+
4+
[file:$SOURCE_DIRECTORY/casim]
5+
source=git:${GIT_LOC}MetOffice/casim.git::./::2025.12.1
6+
7+
[file:$SOURCE_DIRECTORY/jules]
8+
source=git:${GIT_LOC}/MetOffice/jules.git::./::2025.12.1
9+
10+
[file:$SOURCE_DIRECTORY/shumlib]
11+
source=git:${GIT_LOC}MetOffice/shumlib.git::./::2025.10.1
12+
13+
[file:$SOURCE_DIRECTORY/socrates]
14+
source=git:${GIT_LOC}MetOffice/socrates.git::./::2025.12.1
15+
16+
[file:$SOURCE_DIRECTORY/ukca]
17+
source=git:${GIT_LOC}MetOffice/ukca.git::./::2025.12.1
18+
19+
[file:$SOURCE_DIRECTORY/um]
20+
# UM repository is private - Use local mirror
21+
source=git:${GIT_LOC}MetOffice/um.git::./::vn14.0

rose-stem/app/fcm_make_um/file/fcm-make_main.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use = $prebuild
33
$flags_coupling = -I$prism_path/build/lib/psmile.MPI1
44
$ldflags_coupling = -L$prism_path/lib -lpsmile.MPI1 -lmct -lmpeu -lscrip
55

6-
include = $config_root_path/fcm-make/$platform_config_dir/um-$config_type-$optimisation_level.cfg$config_revision
6+
include = $config_root_path/fcm-make/$platform_config_dir/um-$config_type-$optimisation_level.cfg
77

88
extract.location{diff}[um] = $source_directory_um
99
extract.location{diff}[casim] = $source_directory_casim
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
meta=coupled_drivers/plot_loadbalance/drivers_2.0.1
22

33
[command]
4-
default=run_python_env.sh $CYLC_SUITE_SHARE_DIR/fcm_make_drivers/extract/drivers/Coupled_Drivers/driver_utilities/plot_cpmip_summary/plot_cpmip_summary.py --input-file cpmip.output --filename plot_out.png
4+
default=run_python_env.sh $SOURCE_DIRECTORY/moci/Coupled_Drivers/driver_utilities/plot_cpmip_summary/plot_cpmip_summary.py --input-file cpmip.output --filename plot_out.png

0 commit comments

Comments
 (0)