#!/usr/bin/env bash ################################## # POST ANALYSIS OF ECHAM MODEL OUTPUT # ################################## # # # ABOUT THIS SCRIPT # ================= # bash script doing post analysis of echam raw output. This scrip sets I/O paths and passes options for NCL scripts that: # 1. Average 6houly or daily echam raw outputs to monthly mean # 2. Calculate lterm mean (lterm Jan-Dec, and lterm annual mean) from the monthly mean data # 3. Calculate lterm U V wind for wind plotting # 4. Calculate 6 hourly or daily U V wind for trajectory analysis # # # # ================= # # USER DECLARATIONS # # ================= # # # CALCULATE OPTIONS # ------------------- cal1=2 # average 6houly or daily output raw to monthly mean , 1=yes, 2=no cal2=2 # calculate lterm mean from monthly mean data, 1=yes, 2=no NOTE:monthly mean need be first created cal3=2 # calculate U V wind lterm mean, 1=yes, 2=no NOTE: lterm data need to be first created cal4=1 # calculate 6 houly or daily U V wind from output raw data, 1=yes, 2=no NOTE:trajectory analysis required at least daily outputs # # # # # SIMULATION INFORMATION # ---------------------- # simulation description (may be used in plot title by NCL script) shPATH="/esd/docs/jingmin/src/echam_post_analysis_scripts" #post analysis scripts path sPATH="/esd/data/climate_models/echam/echam_output/ESD/e012_hpc-bw_e5w2.3_Mio9ma_t159l31.1d" # simulation data path simNm="e012" # simulation number as shown in the raw output before the year. #e.g. simNm = "e012' in e012_100301.01.nc #e.g. simNm="e007_2" in e007_2_100301.01.nc YRI=1003 # starting year for analysis in output YRF=1018 # last year for analysis in output YRP=16 # total number of years for analysis ySPS=6 # start position of year string in the output raw file name #e.g. ySPS = 6 in 'e012_100301.01.nc' #e.g. ySPS = 8 in 'e007_2_100301.01.nc' # # #================= # # END OF USER DECLARATIONS # # ================= # # # # # # # # # ============ # # CREAT DATA PATH & FILE NAMES # # ============ # # # generate paths and filenames rPATH=$sPATH/output_raw #output_raw path pPATH=$sPATH/output_processed #output_processed path mPATH=$pPATH/monthly_mean #monthly mean path lPATH=$pPATH/lterm #lterm data path wPATH=$pPATH/wind #wind data path wlPATH=$wPATH/wind_lterm #wind lterm path wdPATH=$wPATH/wind_raw_timestep #wind data in output_raw timestep path mlFILE=$simNm"_echam_lterm.nc" alFILE=$simNm"_echam_alterm.nc" wmlFILE=$simNm"_wind_lterm.nc" walFILE=$simNm"_wind_alterm.nc" # # export general options and names export rPATH export pPATH export mPATH export lPATH export wPATH export wlPATH export wdPATH export simNm export YRI export YRF export YRP export ySPS export shPATH export mlFILE export alFILE export wmlFILE export walFILE # #echo $rPATH #echo $pPATH #echo $mPATH #echo $lPATH #echo $wPATH #echo $wlPATH #echo $wdPATH #echo $simNm #echo $YRI #echo $YRF #echo $YRP #echo $shPATH #echo $ySPS #echo $mlFILE #echo $alFILE #echo $wmlFILE #echo $walFILE # # # # creat data folder if not exited if [ ! -d "$mPATH" ] then mkdir $mPATH fi # if [ ! -d "$lPATH" ] then mkdir $lPATH fi # if [ ! -d "$wPATH" ] then mkdir $wPATH fi # if [ ! -d "$wlPATH" ] then mkdir $wlPATH fi # if [ ! -d "$wdPATH" ] then mkdir $wdPATH fi # # # # # # # # 1. average 6houly or daily model outputs to monthly mean # -------------- # ## -------------- if [ $cal1 = "1" ]; then echo echo '>> Calculate monthly mean' echo ' --------------' chmod +x echam_avg_raw_to_mm.sh ./echam_avg_raw_to_mm.sh echo ' monthly mean data created' echo ' ----------------' fi # # # 2. calculate lterm mean # ---------------- if [ $cal2 = "1" ]; then echo echo '>> Calculate lterm mean from monthly mean data' echo ' --------------' chmod +x echam_lterm.sh ./echam_lterm.sh echo ' lterm mean data created' echo ' ----------------' fi # # # 3. calculate U V wind lterm mean # ---------------- # # if [ $cal3 = "1" ]; then echo echo '>> Calculate U V lterm' echo ' --------------' chmod +x u_v_lterm.sh ./u_v_lterm.sh echo ' U V lterm mean data created' echo ' ----------------' fi # # # 4. calculate 6-houly or daily U V wind for trajectory analysis # --------------------- # if [ $cal4 = "1" ]; then echo echo '>> Calculate U V wind from output_raw data' echo ' --------------' chmod +x u_v_raw_timestep.sh ./u_v_raw_timestep.sh echo ' U V wind in output raw timestep created' echo ' ----------------' fi # # # # #end of schell scripts