source:
LMDZ6/branches/contrails/libf/phylmd/ecrad/test/i3rc/duplicate_profiles.sh
Last change on this file was 4773, checked in by , 12 months ago | |
---|---|
|
|
File size: 1.4 KB |
Line | |
---|---|
1 | #!/bin/bash -e |
2 | # |
3 | # (C) Copyright 2014- ECMWF. |
4 | # |
5 | # This software is licensed under the terms of the Apache Licence Version 2.0 |
6 | # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. |
7 | # |
8 | # In applying this licence, ECMWF does not waive the privileges and immunities |
9 | # granted to it by virtue of its status as an intergovernmental organisation |
10 | # nor does it submit to any jurisdiction. |
11 | |
12 | # Duplicate profiles with solar zenith angles varying from 0 to 90 degrees |
13 | # You need to have the nco netcdf tools in your PATH |
14 | |
15 | INPUT=$1 |
16 | OUTPUT=$2 |
17 | |
18 | NSZA=46 |
19 | COS_SZA='1.0,0.999391,0.997564,0.994522,0.990268,0.984808,0.978148,0.970296,0.961262,0.951057,0.939693,0.927184,0.913545,0.898794,0.882948,0.866025,0.848048,0.829038,0.809017,0.788011,0.766044,0.743145,0.71934,0.694658,0.669131,0.642788,0.615661,0.587785,0.559193,0.529919,0.5,0.469472,0.438371,0.406737,0.374607,0.34202,0.309017,0.275637,0.241922,0.207912,0.173648,0.139173,0.104528,0.0697565,0.0348995,0.01' |
20 | #NSZA=2 |
21 | #COS_SZA='1,0.1' |
22 | |
23 | # Check for existence of NCO commands |
24 | command -v ncks >/dev/null 2>&1 || { \ |
25 | echo "###########################################################" ; \ |
26 | echo "### Error: NCO commands (ncks etc) needed but not found ###" ; \ |
27 | echo "###########################################################" ; \ |
28 | exit 1; } |
29 | |
30 | ncks -O --mk_rec_dmn column $INPUT tmp0.nc |
31 | ncrcat -O -n $NSZA,1,0 tmp0.nc tmp_$OUTPUT |
32 | ncap2 -O -s "cos_solar_zenith_angle(:)={$COS_SZA}" tmp_$OUTPUT $OUTPUT |
33 | rm tmp0.nc tmp_$OUTPUT |
Note: See TracBrowser
for help on using the repository browser.