From 14b6813e931f7a4622c5175ca007d9c371ea76d7 Mon Sep 17 00:00:00 2001 From: Lizzie Lundgren Date: Thu, 18 Jan 2024 14:37:19 -0700 Subject: [PATCH] Clean up GEOS-Chem code in configure based on suggestions from Brian Easton Signed-off-by: Lizzie Lundgren --- bld/configure | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/bld/configure b/bld/configure index 5e9fb96d6a..c44ea94669 100755 --- a/bld/configure +++ b/bld/configure @@ -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$/) { @@ -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) } @@ -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"; } @@ -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