forked from ESMCI/cime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig_comply.yml
83 lines (65 loc) · 4.7 KB
/
config_comply.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# In this initial version of config_comply.yml, the constraints are to test
# the infrastructure and the GUI only. These constraints will not necessarily be
# included in the final version of this file to be released in a stable version.
# SECTION 1: COMPONENT dependencies
# Invariants ------------------------------------------------------------
True:
- assert not ($COMP_ICE=="sice") or ($COMP_LND=="slnd" and $COMP_OCN=="socn" and $COMP_ROF=="srof" and $COMP_GLC=="sglc"),
"If COMP_ICE is stub, all other components must be stub (except for ATM)"
- assert not ($COMP_OCN=="mom") or ($COMP_WAV not in ["dwav"]),
"MOM6 cannot be coupled with data wave component."
- assert not ($COMP_ATM=="cam") or ($COMP_ICE !="dice"),
"CAM cannot be coupled with Data ICE"
- assert not ($COMP_WAV=="ww3") or ($COMP_OCN in ['pop', 'mom']),
"WW3 can only be selected if either POP2 or MOM6 is the ocean component."
- assert not ($COMP_ROF in ['rtm', 'mosart']) or $COMP_LND=="clm",
"If running with RTM|MOSART, CLM must be selected as the land component."
- assert not ($COMP_OCN in ["pop","mom"] and $COMP_ATM=="datm") or ($COMP_LND=="slnd"),
"When MOM|POP is forced with DATM, LND must be stub."
- assert not ($COMP_OCN=="mom") or ($COMP_LND != "slnd" or $COMP_ICE != "sice"),
"LND or ICE must be present to hide MOM6 grid poles."
# Note: we need to divide below assertion into two (as done below). This is because a restriction
# takes affect only after N-1 variables are selected for an assertion with N variables. In this
# assertion (with N=4), waiting for the user to select N-1=3 variables is too late. For instance,
# if user select COMP_ATM and COMP_LND, COMP_ICE and COMP_OCN is still not restricted to be
# set to stub, because, one of them must also be selected. If we divide the below assertion into
# two assertions with 3 variables, however, setting COMP_ATM and COMP_LND is sufficient to
# restrict both COMP_ICE and COMP_OCN
#- assert not ($COMP_ATM=="datm" and $COMP_LND=="clm" ) or ($COMP_ICE=="sice" and $COMP_OCN=="socn"),
# "If CLM is coupled with DATM, then both ICE and OCN must be stub"
- assert not ($COMP_ATM=="datm" and $COMP_LND=="clm" ) or ($COMP_ICE=="sice"),
"If CLM is coupled with DATM, then ICE must be stub"
- assert not ($COMP_ATM=="datm" and $COMP_LND=="clm" ) or ($COMP_OCN=="socn"),
"If CLM is coupled with DATM, then OCN must be stub"
# Preconditioned assertions ---------------------------------------------
$COMP_ATM=="datm" and $COMP_LND=="clm":
assert $COMP_ICE!="sice" and $COMP_OCN=="socn", "If CLM is coupled with DATM, then both ICE and OCN must be stub"
$COMP_ICE=="cice" and $COMP_OCN == "docn":
assert $COMP_OCN_OPTION=="SOM", "When DOCN is coupled with CICE, DOCN option must be set to SOM."
$COMP_ICE == 'dice':
assert $COMP_ICE_OPTION != "(none)", "Must pick a valid DICE option."
$COMP_ATM == 'datm':
assert $COMP_ATM_OPTION != "(none)", "Must pick a valid DATM option."
$COMP_ROF == 'drof':
assert $COMP_ROF_OPTION != "(none)", "Must pick a valid DROF option."
$COMP_WAV == 'dwav':
assert $COMP_WAV_OPTION != "(none)", "Must pick a valid DWAV option."
$COMP_LND == 'clm':
assert $COMP_LND_OPTION != "(none)", "Must pick a valid CLM option."
$COMP_GLC == 'cism':
assert $COMP_GLC_OPTION != "(none)", "Must pick a valid CISM option."
# the below compliance rule is specified for testing the logic solver only. In practice, this assertion rather be a warning.
#$COMP_LND == 'clm' and $COMP_OCN == 'pop' and ('BGC' in $COMP_LND_OPTION or 'ECO' in $COMP_OCN_OPTION):
# assert ('BGC' in $COMP_LND_OPTION) == ('ECO' in $COMP_OCN_OPTION), "POP must be in BGC mode if land is too, and vice versa."
# the below compliance rule is specified for testing the logic solver only. In practice, this assertion should rather be a warning
$COMP_ATM == 'datm' and $COMP_ROF == 'drof' and ($COMP_ROF_OPTION .startswith('JRA') or $COMP_ATM_OPTION .startswith('JRA')):
assert ($COMP_ROF_OPTION .startswith('JRA')) == ($COMP_ATM_OPTION .startswith('JRA')), "IF DROF is set to be JRA, then DATM must be too."
# Grids ---------------------------------------------
$COMP_ATM=="cam":
assert "SCAM" in $COMP_ATM_PHYS or $ATM_GRID != "T42", "T42 grid can only be used with SCAM option."
$COMP_OCN=="mom":
assert $OCN_GRID in ["tx0.66v1", "gx1v6", "tx0.25v1"], "Not a valid MOM6 grid."
### Safety and liveness rules to be checked:
# (1) Each option must eventually be eligible.
# (2) At least one option of a particular eligible variable must be eligible at any time.
# (3) No deadlocks. The user must be able to change (or *recover* from) a selection.