Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make --closedcontourcmd resolution specific #824

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions auxiliary_tools/run_tc_analysis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import os
from e3sm_diags.parameter.core_parameter import CoreParameter
from e3sm_diags.parameter.tc_analysis_parameter import TCAnalysisParameter
from e3sm_diags.run import runner

param = CoreParameter()

#param.test_data_path = '/Users/zhang40/Documents/ACME_simulations/E3SM_v1_H1_6hourly_TC/test'
param.test_data_path = '/global/cfs/cdirs/e3sm/e3sm_diags/postprocessed_e3sm_v2_data_for_e3sm_diags/20210528.v2rc3e.piControl.ne30pg2_EC30to60E2r2.chrysalis/1_2/1_2'
param.test_name = '20210528.v2rc3e.piControl.ne30pg2_EC30to60E2r2.chrysalis'
param.test_data_path = '/global/cfs/cdirs/e3sm/e3sm_diags/postprocessed_e3sm_v2_data_for_e3sm_diags/extendedOutput.v3.LR.historical_0101/tc-analysis'
param.test_name = 'extendedOutput.v3.LR.historical_0101'
param.short_test_name = 'v3.LR.historical_threshold_1.0'
param.reference_data_path = '/global/cfs/cdirs/e3sm/e3sm_diags/postprocessed_e3sm_v2_data_for_e3sm_diags/20210528.v2rc3e.piControl.ne30pg2_EC30to60E2r2.chrysalis/0_3/0_3'
param.ref_name = '20210528.v2rc3e.piControl.ne30pg2_EC30to60E2r2.chrysalis'
param.short_ref_name = 'threshold_0.3'
param.run_type = 'model_vs_model'
prefix = '/Users/zhang40/Downloads'
prefix = '/global/cfs/cdirs/e3sm/www/zhang40/tests'
#param.multiprocessing = True
#param.num_workers = 4
param.results_dir = os.path.join(prefix, 'tc_anlasis_model_model')
#param.test_timeseries_input = True
#param.ref_timeseries_input = True
param.test_start_yr = '0051'
param.test_end_yr = '0060'
param.test_start_yr = '2000'
param.test_end_yr = '2014'
param.ref_start_yr = '0051'
param.ref_end_yr = '0060'

runner.sets_to_run = ['tc_analysis']
runner.run_diags([param])

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# $ screen

# Active e3sm_unified to use zstash
source /global/common/software/e3sm/anaconda_envs/load_latest_e3sm_unified_cori-haswell.sh
source /global/common/software/e3sm/anaconda_envs/load_latest_e3sm_unified_pm-cpu.sh

# Make a new folder to recieve extracted datasets.
mkdir -p /global/cfs/cdirs/e3smpub/E3SM_simulations/v2.LR.historical_0101
Expand All @@ -18,6 +18,8 @@ cd /global/cfs/cdirs/e3smpub/E3SM_simulations/v2.LR.historical_0101

# retrive h0(monthly) atmospheric data, size = 821 G
zstash extract --hpss=/home/projects/e3sm/www/WaterCycle/E3SMv2/LR/v2.LR.historical_0101 "archive/atm/hist/*h0*"
# retrive h1(daily) atmospheric data
zstash extract --hpss=/home/projects/e3sm/www/WaterCycle/E3SMv2/LR/v2.LR.historical_0101 "archive/atm/hist/*h1*"
# retrive h2(6 hourly) atmospheric data, size = 195 G [Optional] only needed for Tropical Cycle Analysis
zstash extract --hpss=/home/projects/e3sm/www/WaterCycle/E3SMv2/LR/v2.LR.historical_0101 "archive/atm/hist/*h2*"
# retrive h4(3 hourly) atmospheric data, size = 195 G [Optional] only needed for Diurnal Cycle of Precipitation
Expand Down
21 changes: 18 additions & 3 deletions model_data_preprocess/postprocessing_E3SM_data_for_TC_analysis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@

# A Bash script to post-process E3SM 6 hourly (h2) instantaneous output to generate a text file storing Tropical Cyclone tracks
# tempestremap and tempestextremes are built in e3sm-unified from version 1.5.0. This script has been tested using Cori login node.
# To request an interactive session as follows: salloc --nodes=1 --partition=debug --time=30:00 -C haswell
# To request an interactive session as follows: salloc --nodes=1 --partition=debug --time=30:00 -C cpu

source /global/common/software/e3sm/anaconda_envs/load_latest_e3sm_unified_cori-haswell.sh
source /global/common/software/e3sm/anaconda_envs/load_latest_e3sm_unified_pm-cpu.sh

#For typical EAM v2 ne gp2 grids.
start="0051"
end="0060"
caseid="20210528.v2rc3e.piControl.ne30pg2_EC30to60E2r2.chrysalis"
drc_in=/global/cfs/cdirs/e3smdata/zppy_complete_run_nersc_output/${caseid}/archive/atm/hist

start="2000"
end="2014"
caseid="extendedOutput.v3.LR.historical_0101"
drc_in=/global/cfs/cdirs/e3sm/www/Tutorials/2024/simulations/extendedOutput.v3.LR.historical_0101/archive/atm/hist
# Warning: because somehow tempest-remap only can writes grid file on SCRATCH space. The resulted files will be moved to another path at the end.
result_dir_fin=/global/cfs/cdirs/e3sm/e3sm_diags/postprocessed_e3sm_v2_data_for_e3sm_diags/${caseid}/
mkdir -p $result_dir_fin
Expand Down Expand Up @@ -64,7 +69,17 @@ cd ${result_dir}
# Detection threshold including:
# The sea-level pressure (SLP) must be a local minimum; SLP must have a sufficient decrease (300 Pa) compared to surrounding nodes within 4 degree radius; The average of the 200 hPa and 500 hPa level temperature decreases by 0.6 K in all directions within a 4 degree radius from the location to fSLP minima
#/global/homes/p/paullric/tempestextremes/bin/DetectNodes --verbosity 0 --in_connect ${result_dir}connect_CSne${res}_v2.dat --closedcontourcmd "PSL,300.0,4.0,0;_AVG(T200,T500),-0.6,4,0.30" --mergedist 6.0 --searchbymin PSL --outputcmd "PSL,min,0;_VECMAG(UBOT,VBOT),max,2" --timestride 1 --in_data_list ${result_dir}inputfile_${file_name}.txt --out ${result_dir}out.dat
DetectNodes --verbosity 0 --in_connect ${result_dir}connect_CSne${res}_v2.dat --closedcontourcmd "PSL,300.0,4.0,0;_AVG(T200,T500),-0.6,4,0.30" --mergedist 6.0 --searchbymin PSL --outputcmd "PSL,min,0;_VECMAG(UBOT,VBOT),max,2" --timestride 1 --in_data_list ${result_dir}inputfile_${file_name}.txt --out ${result_dir}out.dat

# --closedcontourcmd threshold is resolution depended.
if [ $res == 120 ]; then
echo $res
DetectNodes --verbosity 0 --in_connect ${result_dir}connect_CSne${res}_v2.dat --closedcontourcmd "PSL,300.0,4.0,0;_AVG(T200,T500),-0.6,4,0.30" --mergedist 6.0 --searchbymin PSL --outputcmd "PSL,min,0;_VECMAG(UBOT,VBOT),max,2" --timestride 1 --in_data_list ${result_dir}inputfile_${file_name}.txt --out ${result_dir}out.dat
elif [ $res == 30 ]; then
echo $res
DetectNodes --verbosity 0 --in_connect ${result_dir}connect_CSne${res}_v2.dat --closedcontourcmd "PSL,300.0,4.0,0;_AVG(T200,T500),-0.6,4,1.0" --mergedist 6.0 --searchbymin PSL --outputcmd "PSL,min,0;_VECMAG(UBOT,VBOT),max,2" --timestride 1 --in_data_list ${result_dir}inputfile_${file_name}.txt --out ${result_dir}out.dat
else
echo “$res value not supported”
fi

cat ${result_dir}out.dat0* > ${result_dir}cyclones_${file_name}.txt

Expand Down