Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MLAir
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
Container Registry
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esde
machine-learning
MLAir
Commits
3ebc2b91
Commit
3ebc2b91
authored
3 years ago
by
Felix Kleinert
Browse files
Options
Downloads
Patches
Plain Diff
cdo helper script
parent
804a0994
No related branches found
No related tags found
No related merge requests found
Pipeline
#91867
failed
3 years ago
Stage: test
Stage: docs
Stage: pages
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mlair/helpers/mergetime_cdo_files.sh
+59
-0
59 additions, 0 deletions
mlair/helpers/mergetime_cdo_files.sh
with
59 additions
and
0 deletions
mlair/helpers/mergetime_cdo_files.sh
0 → 100644
+
59
−
0
View file @
3ebc2b91
#!/bin/sh
# This scipt uses cdo mergetime to combine hourly files into two files per month
# example file: wrfout_d01_2009-02-03_07:00:00.nc
for
i
in
"
$@
"
;
do
case
$i
in
-s
=
*
|
--startyear
=
*
)
startyear
=
"
${
i
#*=
}
"
shift
# past argument=value
;;
-e
=
*
|
--endyear
=
*
)
endyear
=
"
${
i
#*=
}
"
shift
# past argument=value
;;
-f
=
*
|
--filestarter
=
*
)
filestarter
=
"
${
i
#*=
}
"
shift
# past argument=value
;;
-p
=
*
|
--datapath
=
*
)
datapath
=
"
${
i
#*=
}
"
shift
# past argument=value
;;
-n
=
*
|
--newpath
=
*
)
newpath
=
"
${
i
#*=
}
"
shift
# past argument=value
;;
--default
)
DEFAULT
=
YES
shift
# past argument with no value
;;
*
)
# unknown option
;;
esac
done
# source mergetime_cdo_files.sh -s=2009 -e=2009 -f=wrfout_d01_
# source mergetime_cdo_files.sh -s=2009 -e=2009 -f=wrfout_d01_ -p=hourly/ -n=monthly/
for
year
in
$(
seq
"
$startyear
"
"
$endyear
"
)
do
echo
"
$year
"
for
month
in
$(
seq
-w
1 12
)
do
echo
"##########################################"
echo
"Processing: cdo mergetime
${
datapath
}${
filestarter
}${
year
}
-
${
month
}
-[0-1][0-9]_??:??:??.nc
${
newpath
}${
filestarter
}${
year
}
-
${
month
}
_first_part.nc &"
# cdo mergetime ${datapath}${filestarter}${year}-${month}-[0-1][0-9]_??:??:??.nc ${newpath}${filestarter}${year}-${month}_first_part.nc &
echo
"Processing: cdo mergetime
${
datapath
}${
filestarter
}${
year
}
-
${
month
}
-[2-3][0-9]_??:??:??.nc
${
newpath
}${
filestarter
}${
year
}
-
${
month
}
_second_part.nc &"
# cdo mergetime ${datapath}${filestarter}${year}-${month}-[2-3][0-9]_??:??:??.nc ${newpath}${filestarter}${year}-${month}_second_part.nc &
done
done
echo
"############ YOUR OPTIONS ############"
echo
"startyear:
$startyear
"
echo
"endyear:
$endyear
"
echo
"filestarter:
$filestarter
"
echo
"datapath:
$datapath
"
echo
"newpath:
$newpath
"
\ No newline at end of file
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