Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
GOSI9esm
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Consortium Members
UKMO
GOSI
GOSI9esm
Commits
59ab3d22
Commit
59ab3d22
authored
2 years ago
by
Sebastien Masson
Browse files
Options
Downloads
Patches
Plain Diff
further cleaning of makenemo
parent
0b9e2937
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
makenemo
+42
-53
42 additions, 53 deletions
makenemo
tests/rmt_cfgs.txt
+0
-3
0 additions, 3 deletions
tests/rmt_cfgs.txt
with
42 additions
and
56 deletions
makenemo
+
42
−
53
View file @
59ab3d22
...
...
@@ -101,7 +101,7 @@ MAIN_DIR=${MAIN_DIR%/ext*}
MAIN_DIR
=
${
MAIN_DIR
%/arch*
}
export
MAIN_DIR
#
export
C
ONFIG
_DIR
=
${
MAIN_DIR
}
/cfgs
export
C
FGS
_DIR
=
${
MAIN_DIR
}
/cfgs
export
TESTS_DIR
=
${
MAIN_DIR
}
/tests
export
TOOLS_DIR
=
${
MAIN_DIR
}
/tools
export
COMPIL_DIR
=
${
MAIN_DIR
}
/mk
...
...
@@ -109,7 +109,6 @@ export NEMO_DIR=${MAIN_DIR}/${x_s}
export
AGRIFUSE
=
'10'
list_key
=
'0'
;
chk_key
=
'1'
list_add_key
=
''
;
list_def_key
=
''
;
list_del_key
=
''
conf_file
=
ref_cfgs.txt
#-
#- FCM and functions location ---
export
PATH
=
${
MAIN_DIR
}
/ext/FCM/bin:
$PATH
...
...
@@ -224,7 +223,7 @@ done
if
[
-n
"
$x_name
"
]
# is the configuration existing in cfgs or tests? or is it a new conf?
then
incfg
=
$(
find
$C
ONFIG
_DIR
-type
d
-name
$x_name
|
wc
-l
)
# this configuration exists in C
ONFIG
_DIR
incfg
=
$(
find
$C
FGS
_DIR
-type
d
-name
$x_name
|
wc
-l
)
# this configuration exists in C
FGS
_DIR
intst
=
$(
find
$TESTS_DIR
-type
d
-name
$x_name
|
wc
-l
)
# this configuration exists in TESTS_DIR
[[
$incfg
-eq
0
&&
$intst
-eq
0
]]
&&
x_n
=
$x_name
# this is a new configuration -> dedine/overwrite x_n
[[
$incfg
-eq
1
&&
-z
"
$x_r
"
]]
&&
x_r
=
$x_name
# this is a reference configuration -> dedine/overwrite x_r
...
...
@@ -237,20 +236,19 @@ CMP_NAM=${x_m}
NEM_SUBDIR
=
${
x_d
}
REF_CONF
=
${
x_r
}
DEMO_CONF
=
${
x_a
}
TML_CONF
=
${
REF_CONF
}
export
NEMO_DIR
=
${
MAIN_DIR
}
/
${
x_s
}
NEMO_DBG
=
${
x_b
}
[
"
${
CMP_NAM
}
"
==
'all'
]
&&
.
${
COMPIL_DIR
}
/Flist_archfile.sh all
&&
exit
## No ref. cfg
, demo case, n
or
r
emo
te cfg
selected
## No ref. cfg
or
d
emo selected
if
[[
-z
"
${
REF_CONF
}
"
&&
-z
"
${
DEMO_CONF
}
"
]]
;
then
## Reuse last configuration compiled if any (existing 'work_cfgs.txt')
# if [[ $( find ./cfgs ./tests -name work_cfgs.txt ) ]]; then
# C
ONFIG
_DIR=${MAIN_DIR}/$( ls -rt */work_cfgs.txt | awk -F/ 'END{ print $1}' )
# TML_CONF=$( tail -1 ${C
ONFIG
_DIR}/work_cfgs.txt | awk '{ print $1 }' )
# C
FGS
_DIR=${MAIN_DIR}/$( ls -rt */work_cfgs.txt | awk -F/ 'END{ print $1}' )
# TML_CONF=$( tail -1 ${C
FGS
_DIR}/work_cfgs.txt | awk '{ print $1 }' )
# else
## No ${REF_CONF}, ${DEMO_CONF} nor ${NEM_SUBDIR} and 1st compilation => exit
# echo -e "\033[0;33m\nNo previous build found!"
...
...
@@ -259,52 +257,51 @@ if [[ -z "${REF_CONF}" && -z "${DEMO_CONF}" ]]; then
${
COMPIL_DIR
}
/Flist_cfgs.sh
exit
2
# fi
fi
## At least one config has been requested
else
## 'all' arg: list all available configurations
if
[[
"
${
REF_CONF
}
"
==
'all'
||
"
${
DEMO_CONF
}
"
==
'all'
]]
;
then
${
COMPIL_DIR
}
/Flist_cfgs.sh
exit
2
## Probably useless but who knows?
elif
[[
-n
"
${
REF_CONF
}
"
&&
-n
"
${
DEMO_CONF
}
"
]]
;
then
echo
-e
"
\0
33[0;31m
\n
You have to choose whether you work with:"
echo
-e
" - LTS configurations in ./cfgs ('-r') or"
echo
-e
" - Unsupported cases in ./tests ('-a')
\0
33[0m
\n
"
exit
2
fi
## Demo case
if
[
-n
"
${
DEMO_CONF
}
"
]
;
then
conf_file
=
demo_cfgs.txt
;
CONFIG_DIR
=
${
MAIN_DIR
}
/tests
;
TML_CONF
=
${
DEMO_CONF
}
fi
## 'all' arg: list all available configurations
if
[[
"
${
REF_CONF
}
"
==
'all'
||
"
${
DEMO_CONF
}
"
==
'all'
]]
;
then
${
COMPIL_DIR
}
/Flist_cfgs.sh
exit
2
## Probably useless but who knows?
elif
[[
-n
"
${
REF_CONF
}
"
&&
-n
"
${
DEMO_CONF
}
"
]]
;
then
echo
-e
"
\0
33[0;31m
\n
You have to choose whether you work with:"
echo
-e
" - LTS configurations in ./cfgs ('-r') or"
echo
-e
" - Unsupported cases in ./tests ('-a')
\0
33[0m
\n
"
exit
2
elif
[
-n
"
${
REF_CONF
}
"
]
;
then
conf_file
=
ref_cfgs.txt
;
export
CONFIG_DIR
=
${
CFGS_DIR
}
;
TML_CONF
=
${
REF_CONF
}
elif
[
-n
"
${
DEMO_CONF
}
"
]
;
then
conf_file
=
demo_cfgs.txt
;
export
CONFIG_DIR
=
${
TESTS_DIR
}
;
TML_CONF
=
${
DEMO_CONF
}
fi
## Reuse a working cfg
grep
-q
"
${
TML_CONF
}
"
${
CONFIG_DIR
}
/work_cfgs.txt 2>/dev/null
&&
conf_file
=
work_cfgs.txt
## Test if ref. cfg or demo case does exist
if
[[
!
$(
grep
"
${
TML_CONF
}
"
${
CONFIG_DIR
}
/
*
_cfgs.txt
)
]]
;
then
echo
-e
"
\0
33[0;31m
\n
The reference configuration ('-r'), demonstration case ('-a') or "
echo
-e
"remote configuration ('-u') selected is not available!!!"
echo
-e
"Check the option used and the available items in .txt files
\0
33[0m"
${
COMPIL_DIR
}
/Flist_cfgs.sh
exit
2
if
(!
grep
-q
"
${
TML_CONF
}
"
${
CONFIG_DIR
}
/
$conf_file
)
;
then
echo
-e
"
\0
33[0;31m
\n
The reference configuration ('-r') or "
echo
-e
"demonstration case ('-a') selected is not available!!!"
echo
-e
"Check the option used and the available items in .txt files
\0
33[0m"
${
COMPIL_DIR
}
/Flist_cfgs.sh
exit
2
fi
## If new cfg exists, work in it
if
[
-n
"
${
NEW_CONF
}
"
]
then
echo
printf
"
\n
You are installing a new configuration %s from %s "
${
NEW_CONF
}
${
TML_CONF
}
printf
"with sub-components: %s
\n
"
"
${
NEM_SUBDIR
}
"
echo
else
NEW_CONF
=
${
TML_CONF
}
fi
## Reuse a working cfg
if
[[
-f
${
CONFIG_DIR
}
/work_cfgs.txt
&&
$(
grep
"
${
TML_CONF
}
"
${
CONFIG_DIR
}
/work_cfgs.txt
)
]]
;
then
conf_file
=
work_cfgs.txt
fi
## If new cfg exists, work in it
[
-z
"
${
NEW_CONF
}
"
]
&&
NEW_CONF
=
${
TML_CONF
}
## Update sub-comps if needed
if
[
-z
"
${
NEM_SUBDIR
}
"
]
;
then
NEM_SUBDIR
=
$(
grep
"
${
TML_CONF
}
"
${
CONFIG_DIR
}
/
${
conf_file
}
|
awk
'{$1 = ""; print $0}'
)
fi
## Update sub-comps if needed
if
[
-z
"
${
NEM_SUBDIR
}
"
]
;
then
NEM_SUBDIR
=
$(
grep
"
${
TML_CONF
}
"
${
CONFIG_DIR
}
/
${
conf_file
}
|
awk
'{$1 = ""; print $0}'
)
fi
export
NEMO_TDIR
=
${
x_t
:-
$CONFIG_DIR
}
...
...
@@ -316,14 +313,6 @@ echo ${NEW_CONF} "${NEM_SUBDIR}" >> ${CONFIG_DIR}/work_cfgs.txt
cd
${
CONFIG_DIR
}
if
[
-n
"
${
NEW_CONF
}
"
]
then
echo
printf
"
\n
You are installing a new configuration %s from %s "
${
NEW_CONF
}
${
TML_CONF
}
printf
"with sub-components: %s
\n
"
"
${
NEM_SUBDIR
}
"
echo
fi
## Create new config even in existing one (mkdir with -p option, cp with -n)
${
COMPIL_DIR
}
/Fmake_config.sh
${
NEW_CONF
}
${
TML_CONF
}
...
...
This diff is collapsed.
Click to expand it.
tests/rmt_cfgs.txt
deleted
100644 → 0
+
0
−
3
View file @
0b9e2937
ORCA1_CICE # ORCA2_LIM # OCE TOP # http://gws-access.ceda.ac.uk/public/nemo/uspconfigs/ORCA1_CICE/v3.6.0/ORCA1_CICE_ctl.txt
ISOMIP # GYRE # OCE # http://gws-access.ceda.ac.uk/public/nemo/uspconfigs/ISOMIP/trunk/ISOMIP_ctl.txt
IRISHSEA # GYRE # OCE # http://gws-access.ceda.ac.uk/public/nemo/uspconfigs/IRISHSEA/v3.7.0/IRISHSEA_ctl.txt
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment