Skip to content

Commit

Permalink
Clean up GEOS-Chem code in configure based on suggestions from Brian …
Browse files Browse the repository at this point in the history
…Easton

Signed-off-by: Lizzie Lundgren <[email protected]>
  • Loading branch information
lizziel committed Jan 18, 2024
1 parent 3558a95 commit 14b6813
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions bld/configure
Original file line number Diff line number Diff line change
Expand Up @@ -592,10 +592,9 @@ if (defined $opts{'chem'}) {

# If the user has specified a simple physics package...
if ($simple_phys) {
# the only valid chemistry options are 'none', 'terminator' and 'geoschem'
if (($chem_pkg ne 'none') and ($chem_pkg ne 'terminator') and !($chem_pkg =~ 'geoschem')) {
if (($chem_pkg ne 'none') and ($chem_pkg ne 'terminator')) {
die "configure ERROR: -phys=$phys_pkg -chem=$chem_pkg\n".
" -chem can only be set to 'none', 'terminator' or 'geoschem'.\n";
" -chem can only be set to 'none' or 'terminator'.\n";
}
}
elsif ($phys_pkg =~ m/^cam3$|^cam4$|^spcam_sam1mom$/) {
Expand Down Expand Up @@ -1408,9 +1407,8 @@ if ($chem_pkg =~ '_mam3') {
$chem_cppdefs = ' -DMODAL_AERO -DMODAL_AERO_7MODE ';
}

# Set GEOS-Chem CPP definitions here
# Customize GEOS-Chem advected species
if ($chem_pkg =~ 'geoschem') {
$chem_cppdefs .= ' -DEXTERNAL_GRID -DEXTERNAL_FORCING';
if ($chem_pkg eq 'geoschem_mam4') {
$chem_nadv = 267; # includes GC advected species (233), CO2 (1), and MAM aerosols (33)
}
Expand Down Expand Up @@ -1684,7 +1682,7 @@ elsif ($fc =~ /nvfor/) { $fc_type = 'nvhpc'; }

# User override for Fortran compiler type
if (defined $opts{'fc_type'}) { $fc_type = $opts{'fc_type'}; }
if ($fc_type == "oneapi") {$fc_type = 'intel'; }
if ($fc_type eq "oneapi") {$fc_type = 'intel'; }
if ($fc_type) {
$cfg_ref->set('fc_type', $fc_type);
if ($print>=2) { print "Fortran compiler type: $fc_type$eol"; }
Expand Down Expand Up @@ -1950,6 +1948,13 @@ if ($unicon) { $cfg_cppdefs .= ' -DUSE_UNICON'; }
# HEMCO_CESM - indicates CESM model environment. Deprecated, will be removed soon.
$cfg_cppdefs .= ' -DMODEL_ -DMODEL_CESM -DHEMCO_CESM -DUSE_REAL8 ';

# Compiler CPP definitions for GEOS-Chem
if ($chem_pkg =~ 'geoschem') {
$chem_cppdefs .= ' -DEXTERNAL_GRID -DEXTERNAL_FORCING';
if ($fc_type eq 'intel') { $cfg_cppdefs .= ' -DLINUX_IFORT'; }
elsif ($fc_type eq 'gnu') { $cfg_cppdefs .= ' -DLINUX_GFORTRAN'; }
}

#-----------------------------------------------------------------------------------------------
# CPP defines to put on Makefile

Expand Down

0 comments on commit 14b6813

Please sign in to comment.