Changeset 6073 for trunk/TOOLS
- Timestamp:
- 2019-06-27T17:11:27+02:00 (5 years ago)
- Location:
- trunk/TOOLS/NUDGING_FILE
- Files:
-
- 1 added
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/TOOLS/NUDGING_FILE/Job_moistc_yearly_files.sh
r6029 r6073 1 #MSUB -r moistc r12 #MSUB -o moistc .out_%I3 #MSUB -e moistc .out_%I1 #MSUB -r moistc_land-hist 2 #MSUB -o moistc_land-hist.out_%I 3 #MSUB -e moistc_land-hist.out_%I 4 4 #MSUB -n 1 5 5 #MSUB -T 36000 … … 13 13 14 14 # Script to create nudging file for soil moisture. 15 # This creates a climatology of the soil moisture over 1980-2014 with daily frequency. 16 # 17 # 1. Daily output for the years 1980-2014 from the simulation CM61-LR-hist-03.1910 are used. 18 # 2. The variable moistc is first splitted into moistc_1, moistc_2, moistc_3 to remove the axes on soiltiles. 19 # 3. For years with 366 days, the 31 of decembre is removed to enable making the median over all years. 20 # 4. The median is calculated over the whole period 1980-2014 to obtain one year climatologie file with daily frequency. 21 # 5. The last day is duplicated to have 366 days in the file. 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. 22 18 # 23 19 # $HeadURL$ … … 26 22 ####################################################################################################################### 27 23 date 28 JobName=CM61-LR- hist-03.191024 JobName=CM61-LR-land-hist-02 29 25 mkdir run_moistc_${JobName} 30 26 cd run_moistc_${JobName} 31 27 32 28 echo Start 33 # 1. historical r1: CM61-LR-hist-03.191034 simulpath=/ccc/store/cont003/gencmip6/p86caub/IGCM_OUT/IPSLCM6/PROD/historical/CM61-LR-hist-03.1910/SRF/Output/DA 35 allpack=" 19800101_19891231 19900101_19991231 20000101_20091231 20100101_20141231 " 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 36 32 37 33 # 2. Extract moistc 38 echo Extract variable moistc from packfiles34 echo Extract variable moistc from yearly files 39 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 40 41 41 for pack in ${allpack} ; do 42 echo Treat file ${simulpath}/${JobName}_${pack}_DA_sechiba_out_2.nc 43 ncks -v moistc ${simulpath}/${JobName}_${pack}_DA_sechiba_out_2.nc moistc_${pack}_DA_sechiba_out_2.nc 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_allsoil_${year}_sechiba_out_2.nc 57 done 58 ncatted -a long_name,moistc_1,m,c,"Soil Moisture profile for soil tile 1" moistc_daily_${year}.nc 59 ncatted -a long_name,moistc_2,m,c,"Soil Moisture profile for soil tile 2" moistc_daily_${year}.nc 60 ncatted -a long_name,moistc_3,m,c,"Soil Moisture profile for soil tile 3" moistc_daily_${year}.nc 44 61 done 45 62 46 echo Separate into variables per soiltile47 for pack in ${allpack} ; do48 ncks -d soiltyp,0,0 moistc_${pack}_DA_sechiba_out_2.nc moistc1_${pack}_DA_sechiba_out_2.nc49 ncks -d soiltyp,1,1 moistc_${pack}_DA_sechiba_out_2.nc moistc2_${pack}_DA_sechiba_out_2.nc50 ncks -d soiltyp,2,2 moistc_${pack}_DA_sechiba_out_2.nc moistc3_${pack}_DA_sechiba_out_2.nc51 52 ncrename -v moistc,moistc_1 moistc1_${pack}_DA_sechiba_out_2.nc53 ncrename -v moistc,moistc_2 moistc2_${pack}_DA_sechiba_out_2.nc54 ncrename -v moistc,moistc_3 moistc3_${pack}_DA_sechiba_out_2.nc55 done56 57 echo Remove dimension soiltyp (which is now 1) by averaging over the dimension. Put all variables in the same file.58 for pack in ${allpack} ; do59 for soiltyp in 1 2 3 ; do60 ncwa -A -a soiltyp moistc${soiltyp}_${pack}_DA_sechiba_out_2.nc moistc_allsoil_${pack}_DA_sechiba_out_2.nc61 done62 ncatted -a long_name,moistc_1,m,c,"Soil Moisture profile for soil tile 1" moistc_allsoil_${pack}_DA_sechiba_out_2.nc63 ncatted -a long_name,moistc_2,m,c,"Soil Moisture profile for soil tile 2" moistc_allsoil_${pack}_DA_sechiba_out_2.nc64 ncatted -a long_name,moistc_3,m,c,"Soil Moisture profile for soil tile 3" moistc_allsoil_${pack}_DA_sechiba_out_2.nc65 done66 67 echo Separate per year68 for pack in ${allpack} ; do69 cdo splityear moistc_allsoil_${pack}_DA_sechiba_out_2.nc moistc_70 done71 72 # 3. Remove one time step in leap years73 echo Remove last time step 31 of december from leap years74 allleap=" 1980 1984 1988 1992 1996 2000 2004 2008 2012 "75 for year in $allleap ; do76 mv moistc_${year}.nc moistc_${year}.leap.nc77 ncks -d time_counter,0,364 moistc_${year}.leap.nc moistc_${year}.365.nc78 cp moistc_${year}.365.nc moistc_${year}.nc79 done80 81 # 4. Calculate the median82 echo Calculate median83 cdo enspctl,50 moistc_????.nc moistc_clim_1980_2014.nc84 85 # 5. Duplicate last day to make a file with 366days86 echo Duplicate last day to make a file with 366days87 # Extract last day88 cdo seltimestep,365 moistc_clim_1980_2014.nc moistc_clim_365.nc89 # Switch time axis one day ahead90 ncatted -O -a units,time_counter,m,c,"seconds since 1850-01-02 00:00:00" moistc_clim_365.nc91 # Merge with clim file92 ncrcat moistc_clim_1980_2014.nc moistc_clim_365.nc moistc_clim_1980_2014_366d.nc93 63 94 64 echo End
Note: See TracChangeset
for help on using the changeset viewer.