From b74bc1e46c7861804a8040eed3714da2f1bef98d Mon Sep 17 00:00:00 2001 From: shahramn Date: Tue, 10 Sep 2024 18:14:35 +0100 Subject: [PATCH] Definitions: Simplify IF statements --- definitions/mars/grib.mmam.fcmean.def | 5 +++-- definitions/mars/grib.msmm.em.def | 7 +++---- definitions/mars/grib.msmm.fcmax.def | 7 +++---- definitions/mars/grib.msmm.fcmean.def | 8 +++----- definitions/mars/grib.msmm.fcmin.def | 8 +++----- definitions/mars/grib.msmm.fcstdev.def | 7 +++---- definitions/mars/grib.msmm.hcmean.def | 7 +++---- definitions/mars/grib.ocea.an.def | 7 ++++--- definitions/mars/grib.ocea.ff.def | 6 +++--- definitions/mars/grib.ocea.fx.def | 6 +++--- definitions/mars/grib.ocea.of.def | 6 +++--- definitions/mars/grib.ocea.or.def | 6 +++--- definitions/mars/grib.swmm.fcmax.def | 6 +++--- definitions/mars/grib.swmm.fcmean.def | 6 +++--- definitions/mars/grib.swmm.fcmin.def | 6 +++--- definitions/mars/grib.swmm.fcstdev.def | 6 +++--- 16 files changed, 49 insertions(+), 55 deletions(-) diff --git a/definitions/mars/grib.mmam.fcmean.def b/definitions/mars/grib.mmam.fcmean.def index a2ece7923..84c4cce2f 100644 --- a/definitions/mars/grib.mmam.fcmean.def +++ b/definitions/mars/grib.mmam.fcmean.def @@ -4,5 +4,6 @@ alias mars.fcmonth = marsForecastMonth; unalias mars.step; alias mars.method = methodNumber; -if (class is "od") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } +if (class is "od" || class is "en") { + alias mars.system = systemNumber; +} diff --git a/definitions/mars/grib.msmm.em.def b/definitions/mars/grib.msmm.em.def index 86376c834..cce87213b 100644 --- a/definitions/mars/grib.msmm.em.def +++ b/definitions/mars/grib.msmm.em.def @@ -5,10 +5,9 @@ unalias mars.step; alias mars.origin = centre; alias mars.method = methodNumber; -if (class is "od") { alias mars.system = systemNumber; } -if (class is "me") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } -if (class is "c3") { alias mars.system = systemNumber; } +if (class is "od" || class is "me" || class is "en" || class is "c3") { + alias mars.system = systemNumber; +} # See ECC-624 if (centre == 80 && subCentre == 98 && (class is "c3" || class is "ci")) { diff --git a/definitions/mars/grib.msmm.fcmax.def b/definitions/mars/grib.msmm.fcmax.def index b64b923a1..52eecab7d 100644 --- a/definitions/mars/grib.msmm.fcmax.def +++ b/definitions/mars/grib.msmm.fcmax.def @@ -6,10 +6,9 @@ alias mars.number = perturbationNumber; alias mars.origin = centre; alias mars.method = methodNumber; -if (class is "od") { alias mars.system = systemNumber; } -if (class is "me") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } -if (class is "c3") { alias mars.system = systemNumber; } +if (class is "od" || class is "me" || class is "en" || class is "c3") { + alias mars.system = systemNumber; +} # See ECC-624 if (centre == 80 && subCentre == 98 && (class is "c3" || class is "ci")) { diff --git a/definitions/mars/grib.msmm.fcmean.def b/definitions/mars/grib.msmm.fcmean.def index c532f33fd..7a7ff8e66 100644 --- a/definitions/mars/grib.msmm.fcmean.def +++ b/definitions/mars/grib.msmm.fcmean.def @@ -6,11 +6,9 @@ alias mars.method = methodNumber; unalias mars.step; -if (class is "od") { alias mars.system = systemNumber; } -if (class is "me") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } -if (class is "c3") { alias mars.system = systemNumber; } -if (class is "ci") { alias mars.system = systemNumber; } +if (class is "od" || class is "me" || class is "en" || class is "c3" || class is "ci") { + alias mars.system = systemNumber; +} # See ECC-624 if (centre == 80 && subCentre == 98 && (class is "c3" || class is "ci")) { diff --git a/definitions/mars/grib.msmm.fcmin.def b/definitions/mars/grib.msmm.fcmin.def index 158383e2c..0c3d347d0 100644 --- a/definitions/mars/grib.msmm.fcmin.def +++ b/definitions/mars/grib.msmm.fcmin.def @@ -5,11 +5,9 @@ alias mars.number = perturbationNumber; alias mars.origin = centre; alias mars.method = methodNumber; - -if (class is "od") { alias mars.system = systemNumber; } -if (class is "me") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } -if (class is "c3") { alias mars.system = systemNumber; } +if (class is "od" || class is "me" || class is "en" || class is "c3") { + alias mars.system = systemNumber; +} # See ECC-624 if (centre == 80 && subCentre == 98 && (class is "c3" || class is "ci")) { diff --git a/definitions/mars/grib.msmm.fcstdev.def b/definitions/mars/grib.msmm.fcstdev.def index 3a563515b..86ac736a4 100644 --- a/definitions/mars/grib.msmm.fcstdev.def +++ b/definitions/mars/grib.msmm.fcstdev.def @@ -7,10 +7,9 @@ unalias mars.step; alias mars.method = methodNumber; -if (class is "od") { alias mars.system = systemNumber; } -if (class is "me") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } -if (class is "c3") { alias mars.system = systemNumber; } +if (class is "od" || class is "me" || class is "en" || class is "c3") { + alias mars.system = systemNumber; +} # See ECC-624 if (centre == 80 && subCentre == 98 && (class is "c3" || class is "ci")) { diff --git a/definitions/mars/grib.msmm.hcmean.def b/definitions/mars/grib.msmm.hcmean.def index cbdd6704a..9fd3f4b70 100644 --- a/definitions/mars/grib.msmm.hcmean.def +++ b/definitions/mars/grib.msmm.hcmean.def @@ -5,10 +5,9 @@ unalias mars.step; alias mars.origin = centre; alias mars.method = methodNumber; -if (class is "od") { alias mars.system = systemNumber; } -if (class is "me") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } -if (class is "c3") { alias mars.system = systemNumber; } +if (class is "od" || class is "me" || class is "en" || class is "c3") { + alias mars.system = systemNumber; +} # See ECC-624 if (centre == 80 && subCentre == 98 && (class is "c3" || class is "ci")) { diff --git a/definitions/mars/grib.ocea.an.def b/definitions/mars/grib.ocea.an.def index d682c50bd..13ff8360e 100644 --- a/definitions/mars/grib.ocea.an.def +++ b/definitions/mars/grib.ocea.an.def @@ -1,5 +1,6 @@ alias mars.number = perturbationNumber; alias mars.method = methodNumber; -if (class is "od") { alias mars.system = systemNumber; } -if (class is "me") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } + +if (class is "od" || class is "me" || class is "en") { + alias mars.system = systemNumber; +} diff --git a/definitions/mars/grib.ocea.ff.def b/definitions/mars/grib.ocea.ff.def index d682c50bd..5a03a2e58 100644 --- a/definitions/mars/grib.ocea.ff.def +++ b/definitions/mars/grib.ocea.ff.def @@ -1,5 +1,5 @@ alias mars.number = perturbationNumber; alias mars.method = methodNumber; -if (class is "od") { alias mars.system = systemNumber; } -if (class is "me") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } +if (class is "od" || class is "me" || class is "en") { + alias mars.system = systemNumber; +} diff --git a/definitions/mars/grib.ocea.fx.def b/definitions/mars/grib.ocea.fx.def index d682c50bd..5a03a2e58 100644 --- a/definitions/mars/grib.ocea.fx.def +++ b/definitions/mars/grib.ocea.fx.def @@ -1,5 +1,5 @@ alias mars.number = perturbationNumber; alias mars.method = methodNumber; -if (class is "od") { alias mars.system = systemNumber; } -if (class is "me") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } +if (class is "od" || class is "me" || class is "en") { + alias mars.system = systemNumber; +} diff --git a/definitions/mars/grib.ocea.of.def b/definitions/mars/grib.ocea.of.def index d682c50bd..5a03a2e58 100644 --- a/definitions/mars/grib.ocea.of.def +++ b/definitions/mars/grib.ocea.of.def @@ -1,5 +1,5 @@ alias mars.number = perturbationNumber; alias mars.method = methodNumber; -if (class is "od") { alias mars.system = systemNumber; } -if (class is "me") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } +if (class is "od" || class is "me" || class is "en") { + alias mars.system = systemNumber; +} diff --git a/definitions/mars/grib.ocea.or.def b/definitions/mars/grib.ocea.or.def index d682c50bd..5a03a2e58 100644 --- a/definitions/mars/grib.ocea.or.def +++ b/definitions/mars/grib.ocea.or.def @@ -1,5 +1,5 @@ alias mars.number = perturbationNumber; alias mars.method = methodNumber; -if (class is "od") { alias mars.system = systemNumber; } -if (class is "me") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } +if (class is "od" || class is "me" || class is "en") { + alias mars.system = systemNumber; +} diff --git a/definitions/mars/grib.swmm.fcmax.def b/definitions/mars/grib.swmm.fcmax.def index a628fb1a2..864aed20f 100644 --- a/definitions/mars/grib.swmm.fcmax.def +++ b/definitions/mars/grib.swmm.fcmax.def @@ -4,6 +4,6 @@ alias mars.number = perturbationNumber; unalias mars.step; alias mars.method = methodNumber; -if (class is "od") { alias mars.system = systemNumber; } -if (class is "me") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } +if (class is "od" || class is "me" || class is "en") { + alias mars.system = systemNumber; +} diff --git a/definitions/mars/grib.swmm.fcmean.def b/definitions/mars/grib.swmm.fcmean.def index a628fb1a2..864aed20f 100644 --- a/definitions/mars/grib.swmm.fcmean.def +++ b/definitions/mars/grib.swmm.fcmean.def @@ -4,6 +4,6 @@ alias mars.number = perturbationNumber; unalias mars.step; alias mars.method = methodNumber; -if (class is "od") { alias mars.system = systemNumber; } -if (class is "me") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } +if (class is "od" || class is "me" || class is "en") { + alias mars.system = systemNumber; +} diff --git a/definitions/mars/grib.swmm.fcmin.def b/definitions/mars/grib.swmm.fcmin.def index a628fb1a2..864aed20f 100644 --- a/definitions/mars/grib.swmm.fcmin.def +++ b/definitions/mars/grib.swmm.fcmin.def @@ -4,6 +4,6 @@ alias mars.number = perturbationNumber; unalias mars.step; alias mars.method = methodNumber; -if (class is "od") { alias mars.system = systemNumber; } -if (class is "me") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } +if (class is "od" || class is "me" || class is "en") { + alias mars.system = systemNumber; +} diff --git a/definitions/mars/grib.swmm.fcstdev.def b/definitions/mars/grib.swmm.fcstdev.def index a628fb1a2..864aed20f 100644 --- a/definitions/mars/grib.swmm.fcstdev.def +++ b/definitions/mars/grib.swmm.fcstdev.def @@ -4,6 +4,6 @@ alias mars.number = perturbationNumber; unalias mars.step; alias mars.method = methodNumber; -if (class is "od") { alias mars.system = systemNumber; } -if (class is "me") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } +if (class is "od" || class is "me" || class is "en") { + alias mars.system = systemNumber; +}