Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concatenate CICE daily output #31

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,13 @@ env:
platform:
nodesize: 48

# sweep and resubmit on specific errors - see https://github.com/payu-org/payu/issues/241#issuecomment-610739771
userscripts:
# sweep and resubmit on specific errors - see https://github.com/payu-org/payu/issues/241#issuecomment-610739771
error: tools/resub.sh
run: rm -f resubmit.count
# combine cice daily history files into one file per month
archive: tools/concat_ice_daily.sh

modules:
load:
- nco/5.0.5
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- nco/5.0.5

18 changes: 18 additions & 0 deletions tools/concat_ice_daily.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/bash
#concatenate sea-ice daily output
#script inspired from https://github.com/COSIMA/1deg_jra55_ryf/blob/master/sync_data.sh#L87-L108

out_dir=$(ls -td archive/output??? | head -1)/ice/OUTPUT #latest output dir only
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
out_dir=$(ls -td archive/output??? | head -1)/ice/OUTPUT #latest output dir only
out_dir=$(ls -dr archive/output??? | head -1)/ice/OUTPUT #latest output dir only


for f in $out_dir/iceh.????-??-01.nc; do
#concat daily files for this month
echo "doing ncrcat -O -L 5 -4 ${f/-01.nc/-??.nc} ${f/-01.nc/-daily.nc}"
ncrcat -O -L 5 -4 ${f/-01.nc/-??.nc} ${f/-01.nc/-daily.nc}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ncrcat -O -L 5 -4 ${f/-01.nc/-??.nc} ${f/-01.nc/-daily.nc}
{PAYU_PATH}/ncrcat -O -L 5 -4 ${f/-01.nc/-??.nc} ${f/-01.nc/-daily.nc}


if [[ $? == 0 ]]; # ncrcat succeeded
then
#set permissions and delete indidual dailys
chmod g+r ${f/-01.nc/-daily.nc}
rm ${f/-01.nc/-??.nc}
fi
done
Loading