#!/bin/bash #--- AMOC_3D_Structure, diagnosis Q(T,S) at one latitude, version: 2.0 #--- Strongly recommand Seeing README for more details ######################################################################################### PART 1: PACKAGE SETTING #--- absolute directory of this package. WARNING: `pwd` doesn't work. MODIFY ACCORDINGLY. DIAG_HOME="/nexsan/people/fwang/CMIP5/historical/AMOC_3D_Structure" #--- directory for codes. DO NOT MODIFY DIR_CODE="${DIAG_HOME}/var_code" #--- directory for outputs. DO NOT MODIFY DIR_DIAG="${DIAG_HOME}/diag" #--- directory for logs. DO NOT MODIFY DIR_LOGS="${DIAG_HOME}/logs" #--- directory for obs, High-res model. DO NOT MODIFY DIR_REFS="${DIAG_HOME}/ref_data" #--- directory for figures. DO NOT MODIFY DIR_FIGS="${DIAG_HOME}/figs" #--- directory for html. DO NOT MODIFY DIR_HTML="${DIAG_HOME}/html" ######################################################################################### PART2: DATA SETTING #--- /nexsan/people/fwang/CMIP5/historical/CCSM4/r1i1p1/thetao_Omon_CCSM4_historical_r1i1p1_200301-200512.nc #--- ---------DIR_CMIP---------|---exp----|model-|-run-|thetao|----|model|---exp----|-run--|---------------- #--- There are 4 directory tree acceptable by default by set DIR_TREE_TYPE to 0, 1, 2, 3. #--- 0: ${DIR_CMIP}/${exp}/${model}/${run}/ #--- 1: ${DIR_CMIP}/${exp}/${model}/ #--- 2: ${DIR_CMIP}/${model}/${exp}/${run}/ #--- 3: ${DIR_CMIP}/${model}/${exp}/ #--- other: USER DEFINED DIRECTORY #--- If NOT, users might modify sub-scripts var_code/trans_lats_yearly_env.sh accordingly after setting DIR_TREE_TYPE=4. DO NOT RECOMMAND. #--- Modify direcoies: #--- export DIR_THETAO="${DIR_CMIP}/${exp}/${model}/run1/" ---> export DIR_THETAO="${DIR_CMIP}/${model}/${exp}/" #--- YET, users could alternatively mkdir suitable directory (one of those 4 kinds of default directory tree) and link orginal data there. DIR_TREE_TYPE=0 #--- absolute directory of CMIP datasets DIR_CMIP="/nexsan/people/fwang/CMIP5" #--- experiment names: historical, rcp85, ssp585, hist-1950, etc. export exps=(historical) #--- model lists #models=(bccr_bcm2_0 cccma_cgcm3_1 cccma_cgcm3_1_t63 cnrm_cm3 csiro_mk3_0 csiro_mk3_5 gfdl_cm2_0 giss_aom giss_model_e_r iap_fgoals1_0_g ingv_echam4 miroc3_2_hires miroc3_2_medres miub_echo_g mpi_echam5 mri_cgcm2_3_2a ncar_ccsm3_0 ukmo_hadgem1) #models=(ACCESS1-0 ACCESS1-3 bcc-csm1-1 bcc-csm1-1-m CanESM2 CCSM4 CESM1-BGC CESM1-CAM5 CESM1-CAM5-1-FV2 CESM1-FASTCHEM CESM1-WACCM CMCC-CESM CMCC-CM CMCC-CMS CNRM-CM5 CNRM-CM5-2 CSIRO-Mk3-6-0 CSIRO-Mk3L-1-2 EC-EARTH FGOALS-g2 FGOALS-s2 FIO-ESM GFDL-CM2p1 GFDL-CM3 GFDL-ESM2G GFDL-ESM2M GISS-E2-H-CC GISS-E2-R GISS-E2-R-CC HadCM3 HadGEM2-AO HadGEM2-CC HadGEM2-ES IPSL-CM5A-LR IPSL-CM5A-MR MIROC4h MIROC5 MIROC-ESM MIROC-ESM-CHEM MPI-ESM-LR MPI-ESM-MR MPI-ESM-P MRI-CGCM3 MRI-ESM1 NorESM1-M NorESM1-ME) models=(CCSM4 CNRM-CM5 CSIRO-Mk3-6-0 EC-EARTH GFDL-CM2p1 GISS-E2-R HadCM3 IPSL-CM5A-LR) #models=(BCC-CSM2-MR BCC-ESM1 CAMS-CSM1-0 CanESM5 CESM2 CESM2-FV2 CESM2-WACCM CESM2-WACCM-FV2 EC-Earth3 EC-Earth3-Veg FGOALS-f3-L FIO-ESM-2-0 GFDL-CM4 GISS-E2-1-G GISS-E2-1-G-CC GISS-E2-1-H INM-CM4-8 INM-CM5-0 IPSL-CM6A-LR MCM-UA-1-0 MIROC6 MRI-ESM2-0 NESM3 SAM0-UNICON) #--- ensemble members: r1i1p1, r2i1p1, r1i2p1, r1i1p2, r1i1p1f1, etc. #--- list all members, package will skill if model doen't have that memebr #runs=(run1) runs=(r1i1p1 r2i1p1 r3i1p1 r4i1p1 r5i1p1 r6i1p1 r7i1p1 r8i1p1 r9i1p1 r10i1p1 r11i1p1 r12i1p1 r13i1p1 r14i1p1) #runs=(r1i1p1f1) ######################################################################################### PART3: DIAGNOSIS SETTING #--- specify your latitude: -90<=lat0<=90 ---- and its west and east boundaries of Atlantic at LAT0, it's ok to include some land points. 00 with units: meter export LAT0=26.5 export LON_WEST=255 #--- 105W export LON_EAST=360 #--- 360 export LEV_BOT=5400 #--- meter #export LAT0=60 #--- NOT 60.0 #export LON_WEST=286 #--- 74W #export LON_EAST=10 #--- 10E #export LEV_BOT=4000 #--- meter #--- variable names: ocean temperature, salinity, northward velocity, and northward volume transport #--- Eigther no or vmo should be available. Use vmo when both present. #--- Vertical boundries are required to recover vmo by vo. Here, lev & lev_bnds, depth & depth_bnds, olevel & olevel_bounds are acceptable. #--- make sure your variable export thetao="thetao" export so="so" export vo="vo" export vmo="vmo" #--- default T range is [-2 32], T range is [32 38], Modify if necessary export Tmin=-2 export Tmax=32 export Smin=32 export Smax=38 #--- dT dS in pairs ---- define your bin size of temperature and salinity for T-S diaggram or select in below. #export dTs=(0.5 0.2 0.1 0.05) #export dSs=(0.1 0.04 0.02 0.01) #export resols=(low mid high most) export dTs=(0.1) export dSs=(0.02) export resols=(high) ######################################################################################### PART3: OTHER SETTING (processing, plotting, webpage etc.) #--- run package by sever node (use_node=1) or by backstage (otherwise) #use_node=1 use_node=0 #--- If use sever note (use_node=1), select/modify according to your sever's job system. #--- For Slurm Workload Manage: sbatch *.slurm #--- more features will be tested/added below in the future: Load Sharing Facility, Sun Grid Engine myjob="myjob.slurm" #--- CPU load & info. job number <= $CPU to keep sever not too busy. DO NOT MODIFY uptime CPU=`cat /proc/cpuinfo |grep 'core id'|sort -u|tail -n 1|cut -d ':' -f2` ((CPU++)) #--- figure type. DO NOT MODIFY #export figs_type=ps export figs_type=pdf #--- resolution images. pixels/inch (default is 85) export DENSITY=85 #--- compare: 1 2 3 #--- 1: RUN COMPARISION, usually for internal variability. every model with all its runs (>=1) into one panel #--- 2: MODEL COMPARISION, all models with its first run into one figure. #--- 3: All models and all runs into one panel. Will be too crowd if too many models with runs. #--- If each model has only one run, then plot_type=2 equals plot_type=3, and plot_type=3 shows each model respectively. compare=(1 2 3) #compare=(1) #--- MODIFY by your favor. If you want to use models' full name, COMMENT IT OUT #--- Especially for scatter figures, the legend would be too crowd|long when models|runs are too many, then it's recommand use alias #--- If run name is too long, like r1i1p1f1, then it will be too long for legends in plot_type=2, i.e., MODEL_RUN, for example BCC-CSM2-MR_r1i1p1f1. #--- Then it's recommand to use BCC-CSM2-MR_R1 (turn on runs_alias) or simply M1_R1 (turn on both models_alias and runs_alias) #--- Therefore, it is always RECOMMANDED to turn on runs_alias, turn off models_alias unless MODEL_RUN is too many (for example, more than 50). #export models_alias=(M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 M12 M13 M14 M15 M16 M17 M18 M19 M20 M21 M22 M23 M24 M25 M26 M27 M28 M29 M30 M31 M32 M33 M34 M35 M36 M37 M38 M39 M40 M41 M42 M43 M44 M45 M46 M47 M48 M49 M50 M51 M52 M53 M54 M55 M56 M57 M58 M59 M60 M61 M62 M63 M64 M65 M66 M67 M68 M69 M70 M71 M72 M73 M74 M75 M76 M77 M78 M79 M80 M81 M82 M83 M84 M85 M86 M87 M88 M89 M90 M91 M92 M93 M94 M95 M96 M97 M98 M99) export runs_alias=(R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 R14 R15 R16 R17 R18 R19 R20 R21 R22 R23 R24 R25 R26 R27 R28 R29 R30 R31 R32 R33 R34 R35 R36 R37 R38 R39 R40 R41 R42 R43 R44 R45 R46 R47 R48 R49 R50 R51 R52 R53 R54 R55 R56 R57 R58 R59 R60 R61 R62 R63 R64 R65 R66 R67 R68 R69 R70 R71 R72 R73 R74 R75 R76 R77 R78 R79 R80 R81 R82 R83 R84 R85 R86 R87 R88 R89 R90 R91 R92 R93 R94 R95 R96 R97 R98 R99) #--- tar figs/htmls or not. Default: tar_figs=1 for tar (default), otherwise not. tar_figs=1 #tar_figs=0 #--- whether clean diagnosis logs, 1 for clean, 0 for no (default). export CLEAN_LOG=0 #export CLEAN_LOG=1