Skip to content

Commit

Permalink
bug fixes to work with 2x2.5, parallelization of
Browse files Browse the repository at this point in the history
jacobian and faster calc_sensi
  • Loading branch information
megan-he committed Aug 24, 2023
1 parent d7255a4 commit a2c00a6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
7 changes: 5 additions & 2 deletions run_imi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
#SBATCH -N 1
#SBATCH -n 1
#SBATCH -o "imi_output.log"
#SBATCH -t 0-16:00
#SBATCH --mem=20000
#SBATCH -t 0-16:00
#SBATCH --mem=20000


# This script will run the Integrated Methane Inversion (IMI) with GEOS-Chem.
Expand Down Expand Up @@ -197,7 +201,6 @@ cd $InversionPath
cp $ConfigFile "${RunDirs}/config_${RunName}.yml"

# Upload output to S3 if specified
cd $InversionPath
python src/utilities/s3_upload.py $ConfigFile
# python src/utilities/s3_upload.py $ConfigFile

exit 0
11 changes: 8 additions & 3 deletions src/components/statevector_component/aggregation.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ def get_max_aggregation_level(config, sensitivities, desired_element_num):
desired_element_num int : desired number of state vector elements
Returns: int : max gridcells per cluster
"""
if config["Res"] == "0.25x0.3125":
if config["Res"] == "2x2.5":
max_aggregation_level = 4 # confirm
elif config["Res"] == "0.25x0.3125":
max_aggregation_level = 256
elif config["Res"] == "0.5x0.625":
max_aggregation_level = 64
Expand All @@ -238,7 +240,7 @@ def get_max_aggregation_level(config, sensitivities, desired_element_num):
# if there are too few clusters then we set the max aggregation level
# to either total_native_elements/8 or total_native_elements
denominator = 8 if desired_element_num > 8 else 1
max_aggregation_level = np.ceil(len(sensitivities) / denominator)
max_aggregation_level = np.ceil(len(sensitivities) / denominator).astype(int)
print(
f"Max aggregation level set to: {max_aggregation_level} elements in a cluster"
)
Expand Down Expand Up @@ -316,7 +318,10 @@ def force_native_res_pixels(config, clusters, sensitivities):
)
return sensitivities

if config["Res"] == "0.25x0.3125":
if config["Res"] == "2x2.5":
lat_step = 2
lon_step = 2.5
elif config["Res"] == "0.25x0.3125":
lat_step = 0.25
lon_step = 0.3125
elif config["Res"] == "0.5x0.625":
Expand Down
2 changes: 0 additions & 2 deletions src/components/template_component/template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ setup_template() {
sed -i -e "s:GEOS_0.25x0.3125\/GEOS_FP:GEOS_${native}_${RegionID}\/${metDir}:g" HEMCO_Config.rc
sed -i -e "s:GEOS_0.25x0.3125\/GEOS_FP:GEOS_${native}_${RegionID}\/${metDir}:g" HEMCO_Config.rc.gmao_metfields
sed -i -e "s:\$RES:\$RES.${RegionID}:g" HEMCO_Config.rc.gmao_metfields
# else
# sed -i -e "s:GEOS_4x5:GEOS_${Res}:g" HEMCO_Config.rc
fi

# Determine length of inversion period in days
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ echo "running {END} jacobian simulations" >> {InversionPath}/imi_output.log
# remove error status file if present
rm -f .error_status_file.txt

sbatch --array={START}-{END} --mem $JacobianMemory \
sbatch --array={START}-{END}%50 --mem $JacobianMemory \
-c $JacobianCPUs \
-t $RequestedTime \
-p $SchedulerPartition \
Expand Down
2 changes: 1 addition & 1 deletion src/write_BCs/GC_config_files/HEMCO_Config.rc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
###############################################################################

ROOT: /n/holyscratch01/external_repos/GEOS-CHEM/gcgrid/gcdata/ExtData/HEMCO
METDIR: /n/holyscratch01/external_repos/GEOS-CHEM/gcgrid/gcdata/ExtData/GEOS_4x5/GEOS_FP
METDIR: /n/holyscratch01/external_repos/GEOS-CHEM/gcgrid/gcdata/ExtData/GEOS_2x2.5/GEOS_FP
GCAPSCENARIO: not_used
Logfile: *
DiagnFile: HEMCO_Diagn.rc
Expand Down

0 comments on commit a2c00a6

Please sign in to comment.