1 | #MSUB -r moistc_land-hist |
---|
2 | #MSUB -o moistc_land-hist.out_%I |
---|
3 | #MSUB -e moistc_land-hist.out_%I |
---|
4 | #MSUB -n 1 |
---|
5 | #MSUB -T 36000 |
---|
6 | #MSUB -q xlarge |
---|
7 | #MSUB -c 8 |
---|
8 | #MSUB -Q normal |
---|
9 | #MSUB -A gen0239 |
---|
10 | #MSUB -m store,work,scratch |
---|
11 | ##MSUB -A ls3cmip6 |
---|
12 | set +vx |
---|
13 | |
---|
14 | # Script to create nudging file for soil moisture. |
---|
15 | # This extracts moistc variable from sechiba_out_2.nc output files from a previsous simulation. |
---|
16 | # The moistc variable is separated into 3 variables depending on the soiltiles moistc_1, |
---|
17 | # moistc_2 and moistc_3. |
---|
18 | # |
---|
19 | # $HeadURL$ |
---|
20 | # $Date$ |
---|
21 | # $Revision$ |
---|
22 | ####################################################################################################################### |
---|
23 | date |
---|
24 | JobName=CM61-LR-land-hist-02 |
---|
25 | mkdir run_moistc_${JobName} |
---|
26 | cd run_moistc_${JobName} |
---|
27 | |
---|
28 | echo Start |
---|
29 | # 1. Path to simulation land-hist |
---|
30 | # Note: the files are daily output frequency even if the folder and file name contain HF |
---|
31 | simulpath=/ccc/store/cont003/gencmip6/p529vui/IGCM_OUT//PROD/land-hist/CM61-LR-land-hist-02/SRF/Output/HF |
---|
32 | |
---|
33 | # 2. Extract moistc |
---|
34 | echo Extract variable moistc from yearly files |
---|
35 | # float moistc(time_counter, soiltyp, solay, lat, lon) |
---|
36 | year=1850 |
---|
37 | lastyear=2014 |
---|
38 | while [ ${year} -le ${lastyear} ] ; do |
---|
39 | pack=${year}0101_${year}1231 |
---|
40 | echo Treat file ${simulpath}/${JobName}_${pack}_HF_sechiba_out_2.nc |
---|
41 | |
---|
42 | # Extract the variable moistc |
---|
43 | ncks -v moistc ${simulpath}/${JobName}_${pack}_HF_sechiba_out_2.nc moistc_${year}_sechiba_out_2.nc |
---|
44 | |
---|
45 | # Separate into variables per soiltile |
---|
46 | ncks -d soiltyp,0,0 moistc_${year}_sechiba_out_2.nc moistc1_${year}_sechiba_out_2.nc |
---|
47 | ncks -d soiltyp,1,1 moistc_${year}_sechiba_out_2.nc moistc2_${year}_sechiba_out_2.nc |
---|
48 | ncks -d soiltyp,2,2 moistc_${year}_sechiba_out_2.nc moistc3_${year}_sechiba_out_2.nc |
---|
49 | |
---|
50 | ncrename -v moistc,moistc_1 moistc1_${year}_sechiba_out_2.nc |
---|
51 | ncrename -v moistc,moistc_2 moistc2_${year}_sechiba_out_2.nc |
---|
52 | ncrename -v moistc,moistc_3 moistc3_${year}_sechiba_out_2.nc |
---|
53 | |
---|
54 | # Remove dimension soiltyp (which is now 1) by averaging over the dimension. Put all variables in the same file. |
---|
55 | for soiltyp in 1 2 3 ; do |
---|
56 | ncwa -A -a soiltyp moistc${soiltyp}_${year}_sechiba_out_2.nc moistc_${year}.nc |
---|
57 | done |
---|
58 | ncatted -a long_name,moistc_1,m,c,"Soil Moisture profile for soil tile 1" moistc_${year}.nc |
---|
59 | ncatted -a long_name,moistc_2,m,c,"Soil Moisture profile for soil tile 2" moistc_${year}.nc |
---|
60 | ncatted -a long_name,moistc_3,m,c,"Soil Moisture profile for soil tile 3" moistc_${year}.nc |
---|
61 | |
---|
62 | let year=${year}+1 |
---|
63 | |
---|
64 | done |
---|
65 | |
---|
66 | |
---|
67 | echo End |
---|
68 | |
---|