Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Méso-NH code
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
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
Méso-NH
Méso-NH code
Commits
f95ce1f1
Commit
f95ce1f1
authored
2 years ago
by
RIETTE Sébastien
Browse files
Options
Downloads
Patches
Plain Diff
Allow the simulation to be run in the user pack
parent
213b8aa0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
check_commit_mesonh.sh
+58
-17
58 additions, 17 deletions
check_commit_mesonh.sh
compare.py
+2
-10
2 additions, 10 deletions
compare.py
with
60 additions
and
27 deletions
check_commit_mesonh.sh
+
58
−
17
View file @
f95ce1f1
...
@@ -71,7 +71,6 @@ fi
...
@@ -71,7 +71,6 @@ fi
# exit 3
# exit 3
#fi
#fi
fromdir
=
$commit
if
echo
$commit
|
grep
'/'
>
/dev/null
;
then
if
echo
$commit
|
grep
'/'
>
/dev/null
;
then
name
=
MNH-V5-5-0-
$(
echo
$commit
|
sed
's/\//_/g'
)
name
=
MNH-V5-5-0-
$(
echo
$commit
|
sed
's/\//_/g'
)
[
$suppress
-eq
1
-a
-d
$MNHPACK
/
$name
]
&&
rm
-rf
$MNHPACK
/
$name
[
$suppress
-eq
1
-a
-d
$MNHPACK
/
$name
]
&&
rm
-rf
$MNHPACK
/
$name
...
@@ -80,6 +79,32 @@ else
...
@@ -80,6 +79,32 @@ else
[
$suppress
-eq
1
-a
-d
$MNHPACK
/
$name
]
&&
rm
-rf
$MNHPACK
/
$name
[
$suppress
-eq
1
-a
-d
$MNHPACK
/
$name
]
&&
rm
-rf
$MNHPACK
/
$name
fi
fi
#Two possibilities are supported for the simulations
# - they can be done in the the pack we are currently checking
# - they can be done in the reference pack
#They are done in the current pack except if the reference pack
#already contains a tested simulation
run_in_ref
=
$(
ls
-d
$REFDIR
/MNH-V5-5-0/MY_RUN/KTEST/007_16janvier/008_run2_
*
|
tail
-1
|wc
-l
)
if
[
$run_in_ref
-eq
1
]
;
then
path_user_beg
=
$REFDIR
/MNH-V5-5-0
path_user_end
=
_
$commit
path_ref_beg
=
$REFDIR
/MNH-V5-5-0
if
[
"
$reference
"
==
""
]
;
then
path_ref_end
=
else
path_ref_end
=
_
$reference
fi
else
path_user_beg
=
$MNHPACK
/
$name
path_user_end
=
path_ref_end
=
if
[
"
$reference
"
==
""
]
;
then
path_ref_beg
=
$REFDIR
/MNH-V5-5-0
else
path_ref_beg
=
$MNHPACK
/MNH-V5-5-0-
$reference
fi
fi
if
[
$compilation
-eq
1
]
;
then
if
[
$compilation
-eq
1
]
;
then
echo
"### Compilation of commit
$commit
"
echo
"### Compilation of commit
$commit
"
...
@@ -174,9 +199,22 @@ if [ $run -ge 1 ]; then
...
@@ -174,9 +199,22 @@ if [ $run -ge 1 ]; then
exit
6
exit
6
fi
fi
cd
$REFDIR
/MNH-V5-5-0/MY_RUN/KTEST/007_16janvier/
if
[
$run_in_ref
-eq
1
]
;
then
[
!
-d
008_run2_
$commit
]
&&
cp
-R
008_run2 008_run2_
$commit
cd
$REFDIR
/MNH-V5-5-0/MY_RUN/KTEST/007_16janvier/
cd
$REFDIR
/MNH-V5-5-0/MY_RUN/KTEST/007_16janvier/008_run2_
$commit
[
!
-d
008_run2_
$commit
]
&&
cp
-R
008_run2 008_run2_
$commit
cd
$REFDIR
/MNH-V5-5-0/MY_RUN/KTEST/007_16janvier/008_run2_
$commit
else
cd
$MNHPACK
/
$name
/MY_RUN/KTEST/007_16janvier/
for
rep
in
???_
*
;
do
if
[
$rep
!=
008_run2
]
;
then
rm
-rf
$rep
ln
-s
$REFDIR
/MNH-V5-5-0/MY_RUN/KTEST/007_16janvier/
$rep
.
fi
done
[
-d
008_run2
]
&&
rm
-rf
008_run2
cp
-R
$REFDIR
/MNH-V5-5-0/MY_RUN/KTEST/007_16janvier/008_run2
.
cd
008_run2
fi
set
+e
#file ends with a test that can return false
set
+e
#file ends with a test that can return false
[
$compilation
-eq
0
]
&&
.
$MNHPACK
/
$name
/conf/profile_mesonh-LXgfortran-R8I4-MNH-V5-5-0-MPIAUTO-DEBUG
[
$compilation
-eq
0
]
&&
.
$MNHPACK
/
$name
/conf/profile_mesonh-LXgfortran-R8I4-MNH-V5-5-0-MPIAUTO-DEBUG
...
@@ -188,32 +226,35 @@ fi
...
@@ -188,32 +226,35 @@ fi
if
[
$check
-eq
1
]
;
then
if
[
$check
-eq
1
]
;
then
allt
=
0
allt
=
0
echo
"### Check commit
$commit
against commit
$reference
"
echo
"### Check commit
$commit
against commit
$reference
"
path_user
=
$path_user_beg
/MY_RUN/KTEST/007_16janvier/008_run2
$path_user_end
path_ref
=
$path_ref_beg
/MY_RUN/KTEST/007_16janvier/008_run2
$path_ref_end
if
[
!
-d
$path_user
]
;
then
echo
"
$path_user
is missing, please run the simulation"
exit
7
fi
if
[
!
-d
$path_ref
]
;
then
echo
"
$path_ref
is missing, please run the reference simulation"
exit
8
fi
echo
"Compare with python..."
echo
"Compare with python..."
# Compare variable of both Synchronous and Diachronic files with printing difference
# Compare variable of both Synchronous and Diachronic files with printing difference
set
+e
set
+e
if
[
"
$reference
"
==
""
]
;
then
$PHYEXTOOLSDIR
/compare.py
$path_user
$path_ref
$PHYEXTOOLSDIR
/compare.py
$commit
ref
else
$PHYEXTOOLSDIR
/compare.py
$commit
$reference
fi
t
=
$?
t
=
$?
set
-e
set
-e
allt
=
$((
$allt
+
$t
))
allt
=
$((
$allt
+
$t
))
#Check bit-repro after date of creation of Synchronous file from ncdump of all values (pb with direct .nc file checks)
#Check bit-repro before date of creation of Synchronous file from ncdump of all values (pb with direct .nc file checks)
file1
=
$REFDIR
/MNH-V5-5-0/MY_RUN/KTEST/007_16janvier/008_run2_
$commit
/16JAN.1.12B18.001.nc
file1
=
$path_user
/16JAN.1.12B18.001.nc
if
[
"
$reference
"
==
""
]
;
then
file2
=
$path_ref
/16JAN.1.12B18.001.nc
file2
=
"
$REFDIR
/MNH-V5-5-0/MY_RUN/KTEST/007_16janvier/008_run2/16JAN.1.12B18.001.nc"
else
file2
=
$REFDIR
/MNH-V5-5-0/MY_RUN/KTEST/007_16janvier/008_run2_
$reference
/16JAN.1.12B18.001.nc
fi
echo
"Compare with ncdump..."
echo
"Compare with ncdump..."
set
+e
set
+e
diff <
(
ncdump
$file1
|
head
-c
62889
)
<
(
ncdump
$file2
|
head
-c
62889
)
diff <
(
ncdump
$file1
|
head
-c
62889
)
<
(
ncdump
$file2
|
head
-c
62889
)
t
=
$?
t
=
$?
set
-e
set
-e
allt
=
$((
$allt
+
$t
))
allt
=
$((
$allt
+
$t
))
#rm -f dump_$commit dump_$reference
if
[
$allt
-eq
0
]
;
then
if
[
$allt
-eq
0
]
;
then
status
=
"OK"
status
=
"OK"
...
...
This diff is collapsed.
Click to expand it.
compare.py
+
2
−
10
View file @
f95ce1f1
#!/usr/bin/env python3
#!/usr/bin/env python3
import
xarray
as
xr
import
xarray
as
xr
import
os
REFDIR
=
os
.
environ
[
'
REFDIR
'
]
def
compareFiles
(
path_user
,
path_ref
):
def
compareFiles
(
file1
,
file2
):
status
=
0
status
=
0
path_user
=
REFDIR
+
'
MNH-V5-5-0/MY_RUN/KTEST/007_16janvier/008_run2_
'
+
file1
if
file2
==
"
ref
"
:
path_ref
=
REFDIR
+
'
MNH-V5-5-0/MY_RUN/KTEST/007_16janvier/008_run2
'
else
:
path_ref
=
REFDIR
+
'
MNH-V5-5-0/MY_RUN/KTEST/007_16janvier/008_run2_
'
+
file2
filen
=
'
16JAN.1.12B18.001.nc
'
filen
=
'
16JAN.1.12B18.001.nc
'
da
=
xr
.
open_dataset
(
path_user
+
'
/
'
+
filen
)
da
=
xr
.
open_dataset
(
path_user
+
'
/
'
+
filen
)
...
@@ -51,7 +43,7 @@ if __name__ == "__main__":
...
@@ -51,7 +43,7 @@ if __name__ == "__main__":
parser
=
argparse
.
ArgumentParser
(
description
=
'
Compare toutes les variables si trouvées dans les deux fichiers
'
)
parser
=
argparse
.
ArgumentParser
(
description
=
'
Compare toutes les variables si trouvées dans les deux fichiers
'
)
value
=
argparse
.
ArgumentParser
()
value
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'
file1
'
,
metavar
=
'
file1
'
,
type
=
str
,
help
=
"
file1 user
"
)
parser
.
add_argument
(
'
file1
'
,
metavar
=
'
file1
'
,
type
=
str
,
help
=
"
file1 user
"
)
parser
.
add_argument
(
'
file2
'
,
metavar
=
'
file2
'
,
type
=
str
,
help
=
"
file2
reference; ref for MNH-V5-5-0
reference
"
)
parser
.
add_argument
(
'
file2
'
,
metavar
=
'
file2
'
,
type
=
str
,
help
=
"
file2 reference
"
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
sys
.
exit
(
compareFiles
(
args
.
file1
,
args
.
file2
))
sys
.
exit
(
compareFiles
(
args
.
file1
,
args
.
file2
))
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