Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rose_fvcom_setup
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PML-modelling
rose_fvcom_setup
Commits
dbeb97ae
Commit
dbeb97ae
authored
May 20, 2019
by
Modellers Operational
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update get wrf archive to cope with multiple day hindcasts
parent
4a4cf291
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
107 additions
and
3 deletions
+107
-3
app/get_archive_wrf_file/file/get_wrf_files.sh
app/get_archive_wrf_file/file/get_wrf_files.sh
+33
-0
app/get_archive_wrf_file/file/merge_files.slurm
app/get_archive_wrf_file/file/merge_files.slurm
+71
-0
app/get_archive_wrf_file/rose-app.conf
app/get_archive_wrf_file/rose-app.conf
+2
-1
rose-suite_TAMAR.conf
rose-suite_TAMAR.conf
+1
-2
No files found.
app/get_archive_wrf_file/file/get_wrf_files.sh
0 → 100644
View file @
dbeb97ae
#!/bin/bash
START_DAY
=
$1
END_DAY
=
$2
WRF_ARCHIVE_DATEFMT
=
$3
WRF_ARCHIVE_DIR
=
$4
ROSE_DATAC
=
$5
echo
1
echo
${
START_DAY
}
echo
2
echo
${
END_DAY
}
echo
3
echo
${
WRF_ARCHIVE_DATEFMT
}
echo
4
echo
${
WRF_ARCHIVE_DIR
}
echo
5
echo
${
ROSE_DATAC
}
d
=
n
=
0
until
[
"
$d_comp
"
=
"
$END_DAY
"
]
do
((
n++
))
d
=
$(
date
-d
"
$START_DAY
+
$n
days"
+
${
WRF_ARCHIVE_DATEFMT
}
)
d_comp
=
$(
date
-d
"
$START_DAY
+
$n
days"
+%Y-%m-%d
)
cp
/pml
${
WRF_ARCHIVE_DIR
}
/
*${
d
}*
/wrfout_d03_
*
${
ROSE_DATAC
}
/raw_wrf_file_
${
n
}
.nc
done
app/get_archive_wrf_file/file/merge_files.slurm
0 → 100755
View file @
dbeb97ae
#!/bin/bash --login
# Script to merge the individual runs into month long chunks ready for
# conversion with wrf_to_fvcom.
module purge
module load nco
set
-eu
# Make sure any symbolic links are resolved to absolute path.
PBS_O_WORKDIR
=
$(
pwd
)
export
PBS_O_WORKDIR
=
$(
readlink
-f
$PBS_O_WORKDIR
)
# Change to the directory from which the job was submitted.
cd
$PBS_O_WORKDIR
year
=
${
year
:-
2017
}
srcdir
=
$(
readlink
-f
$PBS_O_WORKDIR
/output/
)
binary
=
$PBS_O_WORKDIR
/bin/wrf_to_fvcom_ceto
start_hour
=
18
# hour at which the outputs are generated
wrfnest
=
${
wrfnest
:-
d03
}
for
rawmonth
in
{
1..12
}
;
do
# Sort out our time bracket.
yearbefore
=
$year
yearafter
=
$year
before
=
$(
printf
%02d
$((
rawmonth
-
1
))
)
month
=
$(
printf
%02d
$rawmonth
)
after
=
$(
printf
%02d
$((
rawmonth
+
1
))
)
# If we're in January or December, reset the before and after month and
# year to the appropriate values.
if
[
$rawmonth
-eq
1
]
;
then
yearbefore
=
$((
year
-
1
))
before
=
12
elif
[
$rawmonth
-eq
12
]
;
then
yearafter
=
$((
year
+
1
))
after
=
01
fi
# We need all the files from the current month plus a couple of days either
# side for the FVCOM runs. We need to use an extra pattern of
# $year/wrfout_${wrfnest}_$yearbefore-$before* for the start of a given year as
# that may have actually been run as the last day of the previous year. In
# that instance, the output file will be in the $year directory but will
# actually be named $yearbefore. Limit that search to the last few days to
# not include the whole month in a non-year-boundary month (i.e. not
# January).
files
=(
$(
\l
s
-1
$srcdir
/
$yearbefore
/wrfout_
${
wrfnest
}
_
$yearbefore
-
$before
-
{
26,27,28,29,30,31
}
_
${
start_hour
}
?00?00
\
$srcdir
/
$year
/wrfout_
${
wrfnest
}
_
$yearbefore
-
$before
-
{
26,27,28,29,30,31
}
_
${
start_hour
}
?00?00
\
$srcdir
/
$year
/wrfout_
${
wrfnest
}
_
$year
-
$month
-??_
${
start_hour
}
?00?00
\
$srcdir
/
$yearafter
/wrfout_
${
wrfnest
}
_
$year
-
$month
-??_
${
start_hour
}
?00?00
\
$srcdir
/
$yearafter
/wrfout_
${
wrfnest
}
_
$yearafter
-
$after
-
{
01,02,03
}
_
${
start_hour
}
?00?00 2> /dev/null |
sort
-u
)
)
# Now convert to FVCOM forcing files. These files have all had their first
# time step removed as that's just the initial condition. So, you'd need to
# add a -dTime,1,, to the ncrcat command to drop the first time step if
# that's not been done. Once they're all converted, ncrcat them all
# together into a single file for this month.
parallel
\(
ln
-s
{}
current_
{
/.
}
.nc
\|\|
true
\)
\&\&
$binary
-i
current_
{
/.
}
.nc
-o
/var/tmp/out_
{
/.
}
.nc
-latitude
50.0
-hindcast
\>
\/
dev
\/
null :::
"
${
files
[@]
}
"
parallel
rm
current_
{
/.
}
.nc :::
"
${
files
[@]
}
"
parallel ncrcat
-O
-h
/var/tmp/out_
{
/.
}
.nc /var/tmp/trim_
{
/.
}
.nc :::
"
${
files
[@]
}
"
parallel
rm
/var/tmp/out_
{
/.
}
.nc :::
"
${
files
[@]
}
"
rm
$srcdir
/
$year
/wrfout_
${
wrfnest
}
_
${
year
}
-
${
month
}
.nc
||
true
ncrcat
-O
-h
$(
\l
s
-1
/var/tmp/trim_wrfout_
${
wrfnest
}
_
{
${
yearbefore
}
,
${
year
}
,
${
yearafter
}
}
-
{
${
before
}
,
${
month
}
,
${
after
}
}
-??_
*
.nc |
sort
-u
)
$srcdir
/
$year
/wrfout_
${
wrfnest
}
_
${
year
}
-
${
month
}
.nc
parallel
rm
/var/tmp/trim_
{
/.
}
.nc :::
"
${
files
[@]
}
"
done
app/get_archive_wrf_file/rose-app.conf
View file @
dbeb97ae
[
command
]
default
=
cp
/
pml
${
WRF_ARCHIVE_DIR
}/*${
WRF_ARCHIVE_DATESTR
}*/
wrfout_d03_
* ${
ROSE_DATAC
}/
raw_wrf_file
.
nc
default
=
bash
./
get_wrf_files
.
sh
${
START_DAY
} ${
END_DAY
} ${
WRF_ARCHIVE_DATEFMT
} ${
WRF_ARCHIVE_DIR
} ${
ROSE_DATAC
}
rose-suite_TAMAR.conf
View file @
dbeb97ae
...
...
@@ -18,7 +18,6 @@ MAIL_TO='mbe@pml.ac.uk'
GRID_NAME
=
'tamar_v2'
COMMON_FILES_PATH
=
'/users/modellers/modop/Models/FVCOM_tamar_common/'
ARCHIVE_DIR
=
'data/sthenno1/scratch/modop/Model/FVCOM_tamar/output'
PLOT_DIR
=
'data/sthenno1/scratch/modop/Model/FVCOM_tamar/plots'
TEMP_ACTIVE
=
'T'
SALT_ACTIVE
=
'T'
...
...
@@ -31,7 +30,7 @@ AIR_PRESSURE_ON='T'
## WRF suite settings if any of the above are on
WRF_RUN_SUITE
=
'wrf'
WRF_FORECAST_FILE_DIR
=
'/gpfs1/users/modellers/modop/Models/WRF_transfer_dir/'
WRF_ARCHIVE_DIR
=
'
/data/sthenno1/scratch/modop/Model/WRF
/output'
WRF_ARCHIVE_DIR
=
'
data/sthenno1/backup/pica/models/WRF/wrf-preprocess-gfs
/output'
WRF_ARCHIVE_DATEFMT
=
'%Y%m%d'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment