Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mkexp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esmenv
mkexp
Commits
509c278b
Commit
509c278b
authored
3 years ago
by
Karl-Hermann Wieners
Browse files
Options
Downloads
Patches
Plain Diff
Global: changed import scripts to also handle new style run scripts
parent
323bd211
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
files2config
+1
-0
1 addition, 0 deletions
files2config
importexp
+22
-8
22 additions, 8 deletions
importexp
namelist2config
+1
-0
1 addition, 0 deletions
namelist2config
with
24 additions
and
8 deletions
files2config
+
1
−
0
View file @
509c278b
...
...
@@ -28,6 +28,7 @@ exists $opts{x} and $xlog = '\+';
my
%file_info
=
();
while
(
<>
)
{
s/^\d{4,}-\d\d-\d\dT\d\d:\d\d:\d\d: //
;
# Remove log time stamps
if
(
my
(
$mtd
,
undef
,
$src
,
$dst
)
=
m{^$xlog\s*((cdo|cp|ln)\s.*)\s+(\S+)\s+(\S+)\s*$}
)
{
#DEBUG# warn($_, join(':', $mtd, $src, $dst), "\n"); #DEBUG#
...
...
This diff is collapsed.
Click to expand it.
importexp
+
22
−
8
View file @
509c278b
...
...
@@ -20,11 +20,12 @@ then
TMPDIR
=
.
export
TMPDIR
fi
trap
'rm -f $RUN_FILE $LOG_FILE'
0
### trap 'rm -f $RUN_FILE' 0 ###
trap
'rm -rf $RUN_FILE $LOG_FILE $WORK_DIR'
0
RUN_FILE
=
$(
mktemp
)
LOG_FILE
=
$(
mktemp
)
### echo "Log file is '$LOG_FILE'" >&2 ###
WORK_DIR
=
$(
mktemp
-d
)
WORK_DIR
=
${
WORK_DIR
/.\//
$PWD
/
}
for
RUN_SCRIPT
do
...
...
@@ -34,9 +35,19 @@ do
echo
"Analyzing '
$RUN_SCRIPT
'"
>
&2
sed
-r
's:^(\s*)(set\s+\+x\s*$|(set\s+\+\w+)x):\1\3:'
"
$RUN_SCRIPT
"
>
$RUN_FILE
sed
-r
'
s:^(\s*)(set\s+\+x\s*$|(set\s+\+\w+)x):\1\3:
s:^(\s*)SCRIPT_DIR=.*$:\1SCRIPT_DIR='
$WORK_DIR
':
s:^(\s*)EXPDIR=.*$:\1EXPDIR='
$WORK_DIR
':
'
"
$RUN_SCRIPT
"
>
$RUN_FILE
COMMAND
=
$(
perl
-ne
'/^#!\s*(\/\S+)(\s+\+x\s*$|(\s+\+\w+)x|\s*$)/ and print($1, $3); exit'
$RUN_FILE
)
COMMAND
=
$(
perl
-ne
'
/^\#!\s*(\/\S+)(
\s+\+x\s*$|
(\s+\+\w+)x|
\s*$
)/x and print($1, $3); exit
'
$RUN_FILE
)
SLURM_JOB_NUM_NODES
=
$(
perl
-ne
'if(/^\s*#SBATCH\s+(--nodes|-N)(=|\s+)(\d+)/) {print($3); exit}'
$RUN_FILE
)
export
SLURM_JOB_NUM_NODES
...
...
@@ -46,13 +57,16 @@ do
SLURM_JOB_CPUS_PER_NODE
=
72
${
COMMAND
:-
/bin/sh
}
-x
$RUN_FILE
>
$LOG_FILE
2>&1
echo
"Generating configuration"
>
&2
eval
"
$(
perl
-lne
'/^\+ \s*(
eval
"
$(
perl
-lne
'/^
(?:\d{4,}-\d\d-\d\dT\d\d:\d\d:\d\d:\ )?
\+
\
\s*(
EXPNAME|
(start|end)_date|
(
?:
start|end)_date|
restart_interval|
atmos_gridID|
atmos_refinement
)(=.*)$/x and print($1, $3, "\n")'
$LOG_FILE
)
"
)(=.*)$/x and print($1, $2)'
$LOG_FILE
)
"
eval
"
$(
perl
-lne
'/_(\d{4})_(R\d\dB\d\d)_.* icon_grid_G.nc$/ and
print("atmos_gridID=$1\natmos_refinement=$2")'
$LOG_FILE
)
"
cat
<<
EOF
###
\\
...
...
This diff is collapsed.
Click to expand it.
namelist2config
+
1
−
0
View file @
509c278b
...
...
@@ -92,6 +92,7 @@ my $namelist_group = {};
my
$namelist_variable
=
[]
;
while
(
<>
)
{
s/^\d{4,}-\d\d-\d\dT\d\d:\d\d:\d\d: //
;
# Remove log time stamps
if
(
$in_doc
&&
m/^EOF/
)
{
if
(
$open_value
)
{
$direct
and
print
("
\n
");
...
...
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