Skip to content
Open
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
4 changes: 2 additions & 2 deletions src/components/inversion_component/inversion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ setup_inversion() {
cp ${InversionPath}/src/inversion_scripts/jacobian.py inversion/
cp ${InversionPath}/src/inversion_scripts/operators/*.py inversion/operators/
cp ${InversionPath}/src/inversion_scripts/make_gridded_posterior.py inversion/
cp ${InversionPath}/src/inversion_scripts/postproc_diags.py inversion/
cp ${InversionPath}/src/inversion_scripts/setup_gc_cache.py inversion/
cp ${InversionPath}/src/inversion_scripts/utils.py inversion/
cp ${InversionPath}/src/inversion_scripts/merge_partial_k.py inversion/
Expand Down Expand Up @@ -84,11 +83,12 @@ run_inversion() {
InvMem="${InversionMemory:-$RequestedMemory}"
InvCPU="${InversionCPUs:-$RequestedCPUs}"
InvTime="${InversionTime:-$RequestedTime}"
InvPartition="${InvSchedulerPartition:-$SchedulerPartition}"
# Execute inversion driver script
sbatch --mem $InvMem \
-c $InvCPU \
-t $InvTime \
-p $SchedulerPartition \
-p $InvPartition \
-W run_inversion.sh $FirstSimSwitch
wait

Expand Down
2 changes: 1 addition & 1 deletion src/components/jacobian_component/jacobian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ create_simulation_dir() {
-e 's/#'\''LevelEdgeDiags/'\''LevelEdgeDiags/g' \
-e 's/LevelEdgeDiags.frequency: 00000100 000000/LevelEdgeDiags.frequency: 00000000 010000/g' \
-e 's/LevelEdgeDiags.duration: 00000100 000000/LevelEdgeDiags.duration: 00000001 000000/g' \
-e 's/LevelEdgeDiags.mode: '\''time-averaged/LevelEdgeDiags.mode: '\''instantaneous/g' HISTORY.rc
HISTORY.rc
fi
# For all other runs, just disable Restarts
else
Expand Down
6 changes: 0 additions & 6 deletions src/components/kalman_component/kalman.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,6 @@ run_period() {

run_posterior

# Make a copy of the posterior output/diags files for postproc_diags.py
copydir="${PosteriorRunDir}/OutputDir"
cp ${copydir}/GEOSChem.SpeciesConc.${EndDate_i}_0000z.nc4 ${copydir}/GEOSChem.SpeciesConc.Copy.${EndDate_i}_0000z.nc4
cp ${copydir}/GEOSChem.LevelEdgeDiags.${EndDate_i}_0000z.nc4 ${copydir}/GEOSChem.LevelEdgeDiags.Copy.${EndDate_i}_0000z.nc4
echo "Made a copy of the final posterior SpeciesConc and LevelEdgeDiags files"

# Make link to restart file from posterior run directory in prior, OH, and background simulation
# and link to 1ppb restart file for perturbations
python ${InversionPath}/src/components/jacobian_component/make_jacobian_icbc.py ${PosteriorRunDir}/Restarts/GEOSChem.Restart.${EndDate_i}_0000z.nc4 ${RunDirs}/jacobian_1ppb_ics_bcs/Restarts $EndDate_i
Expand Down
13 changes: 0 additions & 13 deletions src/components/posterior_component/posterior.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ setup_posterior() {
sed -i -e 's/#'\''LevelEdgeDiags/'\''LevelEdgeDiags/g' \
-e 's/LevelEdgeDiags.frequency: 00000100 000000/LevelEdgeDiags.frequency: 00000000 010000/g' \
-e 's/LevelEdgeDiags.duration: 00000100 000000/LevelEdgeDiags.duration: 00000001 000000/g' \
-e 's/LevelEdgeDiags.mode: '\''time-averaged/LevelEdgeDiags.mode: '\''instantaneous/g' \
-e 's/Restart.frequency: '\''End'\''/Restart.frequency: 00000001 000000/g' \
-e 's/Restart.duration: '\''End'\''/Restart.duration: 00000001 000000/g' HISTORY.rc
fi
Expand Down Expand Up @@ -186,25 +185,13 @@ run_posterior() {
printf "\n=== DONE POSTERIOR SIMULATION ===\n"
if "$KalmanMode"; then
cd ${RunDirs}/kf_inversions/period${period_i}
if ((period_i == 1)); then
PrevDir="${RunDirs}/spinup_run"
else
PrevDir="${RunDirs}/posterior_run"
fi
else
StartDate_i=$StartDate
EndDate_i=$EndDate
cd ${RunDirs}/inversion
PrevDir="${RunDirs}/spinup_run"
fi

# Fill missing data (first hour of simulation) in posterior output
PosteriorRunDir="${RunDirs}/posterior_run"
printf "\n=== Calling postproc_diags.py for posterior ===\n"
python ${InversionPath}/src/inversion_scripts/postproc_diags.py $RunName $PosteriorRunDir $PrevDir $StartDate_i $Res
wait
printf "\n=== DONE -- postproc_diags.py ===\n"

# Build directory for hourly posterior GEOS-Chem output data
mkdir -p data_converted_posterior
mkdir -p data_visualization_posterior
Expand Down
64 changes: 0 additions & 64 deletions src/components/posterior_component/update_prior_emis.py

This file was deleted.

11 changes: 4 additions & 7 deletions src/components/spinup_component/spinup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,10 @@ setup_spinup() {
sed -i -e "s|${StartDate}|${SpinupStart}|g" \
-e "s|${EndDate}|${SpinupEnd}|g" geoschem_config.yml

# Turn on LevelEdgeDiags output
if "$HourlyCH4"; then
sed -i -e 's/#'\''LevelEdgeDiags/'\''LevelEdgeDiags/g' \
-e 's/LevelEdgeDiags.frequency: 00000100 000000/LevelEdgeDiags.frequency: 00000000 010000/g' \
-e 's/LevelEdgeDiags.duration: 00000100 000000/LevelEdgeDiags.duration: 00000001 000000/g' \
-e 's/LevelEdgeDiags.mode: '\''time-averaged/LevelEdgeDiags.mode: '\''instantaneous/g' HISTORY.rc
fi
# Disable diagnostic outputs from spinup (we only need restart file from spin up)
sed -i -e 's/'\''LevelEdgeDiags/#'\''LevelEdgeDiags/g' \
-e 's/'\''SpeciesConc/#'\''SpeciesConc/g' \
HISTORY.rc

# Create run script from template
sed -e "s:namename:${SpinupName}:g" \
Expand Down
2 changes: 1 addition & 1 deletion src/components/template_component/template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ setup_template() {
if "$HourlyCH4"; then
sed -i -e 's/SpeciesConc.frequency: 00000100 000000/SpeciesConc.frequency: 00000000 010000/g' \
-e 's/SpeciesConc.duration: 00000100 000000/SpeciesConc.duration: 00000001 000000/g' \
-e 's/SpeciesConc.mode: '\''time-averaged/SpeciesConc.mode: '\''instantaneous/g' HISTORY.rc
HISTORY.rc
fi

# Remove sample restart file
Expand Down
37 changes: 0 additions & 37 deletions src/inversion_scripts/run_inversion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ nElements={STATE_VECTOR_ELEMENTS}
nTracers={NUM_JACOBIAN_TRACERS}
OutputPath={OUTPUT_PATH}
Res={RES}
SpinupDir="${OutputPath}/${RunName}/spinup_run"
JacobianRunsDir="${OutputPath}/${RunName}/jacobian_runs"
PriorRunDir="${JacobianRunsDir}/${RunName}_0000"
BackgroundRunDir="${JacobianRunsDir}/${RunName}_background"
Expand Down Expand Up @@ -80,42 +79,6 @@ if [[ ! -f ${StateVectorFile} ]]; then
exit 1
fi

#=======================================================================
# Postprocess the SpeciesConc and LevelEdgeDiags files from GEOS-Chem
#=======================================================================

printf "Calling postproc_diags.py, FSS=$FirstSimSwitch\n"
if "$FirstSimSwitch"; then
if [[ ! -d ${SpinupDir} ]]; then
printf "${SpinupDir} does not exist. Please fix SpinupDir or set FirstSimSwitch to False in run_inversion.sh.\n"
exit 1
fi
PrevDir=$SpinupDir
else
PrevDir=$PosteriorRunDir
if [[ ! -d ${PosteriorRunDir} ]]; then
printf "${PosteriorRunDir} does not exist. Please fix PosteriorRunDir in run_inversion.sh.\n"
exit 1
fi
fi
printf " - Hour 0 for ${StartDate} will be obtained from ${PrevDir}\n"

if ! "$PrecomputedJacobian"; then

# Postprocess all the Jacobian simulations
python postproc_diags.py $RunName $JacobianRunsDir $PrevDir $StartDate $Res; wait

else

# Only postprocess the Prior simulation
python postproc_diags.py $RunName $PriorRunDir $PrevDir $StartDate $Res; wait
if "$LognormalErrors"; then
# for lognormal errors we need to postprocess the background run too
python postproc_diags.py $RunName $BackgroundRunDir $PrevDir $StartDate $Res; wait
fi
fi
printf "DONE -- postproc_diags.py\n\n"

#=======================================================================
# Setup GC data directory in workdir
#=======================================================================
Expand Down