#!/bin/bash #clear # 8/18 to run this script on E3SM v1 on CORI at NERSC # alter parameters below to match desired settings in the section with machine you are using # Key settings: # job case, location (path), year start and end, # location of output (outpath), does not need to exist yet, it will be created below if its not already # variables to postprocess (are not yet) set to those needed for LIVV postprocessing tools # update specialty files used for masking and regridding # total area of GrIS in model is 1.719e6 if [[ $(hostname -s) = rhea* ]]; then project=cli115 case=20180215.DECKv1b_H1.ne30_oEC.edison year_start=1979 year_end=2005 base=/lustre/atlas1/$project/proj-shared/salil/archive path=$base/$case/archive obspath=/lustre/atlas1/$project/world-shared/$USER/obs_data outpath=/lustre/atlas1/$project/world-shared/$USER/$case/postproc area_file=/lustre/atlas1/$project/world-shared/$USER/surfdata_0.9x1.25_simyr1850_c110725.nc map_file=/ccs/home/zender/data/maps/map_ne30np4_to_fv129x256_aave.20150901.nc mask_file=/lustre/atlas1/$project/world-shared/4ue/$case/postproc/mask_ne30np4_notime.nc elif [[ $(hostname -s) = cori* ]]; then project=piscees case=20180612.B_case.T62_oEC60to30v3wLI.modified_runoff_mapping.edison year_start=0070 year_end=0075 base=/global/cscratch1/sd/dcomeau/acme_scratch/edison/archive path=$base/$case/run obspath=/project/projectdirs/piscees/postproc/obs_data outpath=/global/cscratch1/sd/$USER/$case/postproc area_file=/project/projectdirs/piscees/postproc/surfdata_0.9x1.25_simyr1850_c110725.nc map_file=/project/projectdirs/piscees/postproc/map_ne30np4_to_fv129x256_aave.20150901.nc #mask_file=/project/projectdirs/piscees/postproc/mask_ne30np4_notime.nc else echo "machine not recognized" fi version=e3sm atm_vars=("PSL" "CLDLOW" "CLDHGH" "CLDMED" "CLDTOT" "TREFHT" "TS" "TSMX" "TSMN" "PRECC" "PRECL") lnd_h0_vars=("FSDS" "QRUNOFF" "QSOIL" "TSA" "RAIN" "SNOW" "FIRA" "FLDS" "FSH" "QSNOMELT") #glc_vars=("acab" "thk") postprocess=true postprocess_obs=false make_plots=true mkdir -p $outpath echo "$version" #postprocess all components of coupled model glc=cism lnd=clm2 atm=cam #run a check, is the requested data directory there? if test -d $path; then echo "Directory $path exists" else echo "Target directory $path does not exist" exit fi #run a check, do you have the software to perform the postprocessing? if [[ $(hostname -s) = rhea* ]]; then export MODULEPATH=$HOME/.modulefiles:$MODULEPATH module unload PE-pgi PE-gnu PE-intel module unload nco ncl netcdf module load PE-gnu/4.8.2 module load netcdf/4.4.1 module load gsl hdf5-parallel module unload gcc module load gcc module load nco/4.6.9 module load ncl/6.3.0 module load anaconda-cli106/rhea source deactivate && source activate LIVVpy2 module list elif [[ $(hostname -s) = cori* ]]; then module unload PrgEnv-pgi PrgEnv-gnu PrgEnv-intel module load PrgEnv-gnu/6.0.4 module unload nco ncl netcdf gcc module load gcc module load cray-netcdf/4.4.1.1.6 module load gsl # module load hdf5-parallel/1.10.1 conflit with netcdf module load nco/4.7.4 module load python/2.7-anaconda-4.4 module list # load the conda environment source /global/homes/k/kennedyj/LIVVkit/conda/etc/profile.d/conda.sh # For python 3 conda activate lex_py3 # For python 2 # conda activate lex_py2 # . deactivate && . activate LIVVpy2 module list elif [[ $(hostname -s) = titan* ]]; then module load netcdf/cray module load nco/4.6.9 module load ncl/6.3.0 else echo "machine not recognized, make sure your path: $PATH points to a version of nco/4.6.9 or later" exit fi # this is a hack- all files from E3SM runs we care about should have a gris_mask in the data #if [ "$version" == "cesm1" ]; then # #if test -a $outpath/masks/${case}.$lnd.gris_mask.nc; then # echo "already created gris_mask and area file, moving on" #else # echo "gris_mask file does not exist, creating" # # mkdir -p $outpath/masks # ncks -O -v gris_mask,area $path/lnd/hist/${case}.${lnd}.h0.${year_start}-01.nc $outpath/masks/${case}.${lnd}.gris_mask_time.nc # ncwa -a time $outpath/masks/${case}.${lnd}.gris_mask_time.nc $outpath/masks/${case}.${lnd}.gris_mask.nc # #fi # if mask file needs to be created #fi # CESM if [ "$postprocess_obs" = "true" ]; then echo "process and remap cloud obs" ../obs/atm_obs.sh echo "process RACMO" ../obs/lnd_obs.sh ./remap_RACMO_to_CESM2_inline.sh fi echo "executing post processing of atm data for validation" . atm.sh echo "executing post processing of lnd data for validation" . lnd.sh if [ "$make_plots" = "true" ]; then echo "make the atmosphere plots" mkdir -p "$outpath/atm/plots" python plot_files/E3SM_cldhgh_ANN.py python plot_files/E3SM_cldtot_ANN.py python plot_files/yearly_cycle_CLDTOT_e3sm.py python plot_files/yearly_cycle_CLDHGH_e3sm.py python plot_files/yearly_cycle_CLDLOW_e3sm.py echo "Areal annual avgd values of radiation vars: E3SM" python e3sm_rad_aavg.py echo "Areal annual avgd values of radiation vars: RACMO" python racmo_rad_aavg.py echo "make the land plots" mkdir -p "$outpath/lnd/plots" if [ "$version" = "cesm1" ]; then python plot_files/CESM_RACMO23_t2m_JJA.py python plot_files/CESM_RACMO23_t2m_DJF.py python plot_files/CESM_RACMO23_t2m_ANN.py python plot_files/CESM_RACMO23_albedo.py python plot_files/CESM_RACMO23_latf.py python plot_files/CESM_RACMO23_senf.py python plot_files/CESM_RACMO23_rnet.py python plot_files/CESM_RACMO23_swsn.py python plot_files/CESM_RACMO23_swsd.py python plot_files/CESM_RACMO23_lwsn.py python plot_files/CESM_RACMO23_lwsd.py python plot_files/CESM_RACMO23_smb.py python plot_files/TimeSeries_QICE.py elif [ "$version" = "e3sm" ]; then python plot_files/E3SM_RACMO23_t2m_JJA.py python plot_files/E3SM_RACMO23_t2m_DJF.py python plot_files/E3SM_RACMO23_albedo.py python plot_files/E3SM_RACMO23_rnet.py python plot_files/E3SM_RACMO23_smb.py python plot_files/TimeSeries_smblike.py fi fi # to make plots or not