source: TOOLS/CMIP6_FORCING/SOLAR/reduc_TSI_G6solar.sh @ 6650

Last change on this file since 6650 was 4308, checked in by tlurton, 5 years ago

Added script for preparation of G6solar solar irradiance files (diminution every decade).

  • Property svn:executable set to *
File size: 1.3 KB
Line 
1# Th. Lurton, Feb. 2019
2
3# This script operates on Future TSI netcdf files
4# and aims at decreasing the TSI (offset)
5# over the whole of a decade (as specified by the GeoMIP protocol).
6
7# Work directory
8### TO BE CUSTOMISED ###
9here=/ccc/work/cont003/gencmip6/lurtont/TSI_G6/
10
11# Input directory
12repin=/ccc/work/cont003/igcmg/igcmg/IGCM/ATM/SOLAR/CMIP6/v3.1corr/Future/
13
14### TO BE CUSTOMISED ###
15# Parameters
16# Absolute-value diminution wanted (W.m-2)
17dimin="24.0"
18# This will appear as a suffix in the names of the reduced-TSI files created
19
20# Period considered
21yr0=2091
22yr1=2100
23# These years are included, i.e. the period considered is yr0-01-01 to yr1-12-31
24
25
26for (( year=${yr0}; year<=${yr1}; year++ ))
27do
28
29fileout=${here}solarforcing_v3.1_daily_6bands_${year}-${dimin}Wperm2.nc
30
31tsireduced=${here}tsireduced_${year}.nc
32ssireduced=${here}ssireduced_${year}.nc
33
34filein=${repin}solarforcing_v3.1_daily_6bands_${year}.nc
35
36cdo subc,${dimin} -selvar,tsi ${filein} ${tsireduced}
37cdo subc,${dimin} -selvar,ssi ${filein} ${ssireduced}
38
39ncrename -d bnds,nbd ${tsireduced}
40ncrename -d bnds,nbd ${ssireduced}
41
42ncks -x -v tsi,ssi ${filein} ${here}temp_${year}.nc
43
44cdo merge ${here}temp_${year}.nc ${tsireduced} ${ssireduced} ${fileout}
45
46rm -f ${here}temp_${year}.nc ${tsireduced} ${ssireduced}
47
48done
49
Note: See TracBrowser for help on using the repository browser.