From 739fef88eb4fb0be1a2f5ff11f05e9115d3c42dd Mon Sep 17 00:00:00 2001 From: Steve Goldhaber Date: Wed, 23 Aug 2023 15:47:48 +0200 Subject: [PATCH] Modifications to 'noresm_v4_cam6_3_112-12-g15769ddf' for merging with CAM-Nor - Configuration and code changes from ESCOMP between cam6_3_112 and cam6_3_123 - Adjust compsets, tests, and externals to be compatible with cam6_3_123 settings. --- .gitignore | 4 +- Externals.cfg | 113 +- Externals_CAM.cfg | 56 +- bld/config_files/definition.xml | 15 +- bld/configure | 152 +- bld/namelist_files/namelist_defaults_cam.xml | 38 +- bld/namelist_files/namelist_definition.xml | 6 +- cime_config/config_component.xml | 22 +- cime_config/config_compsets.xml | 74 +- cime_config/testdefs/testlist_cam.xml | 2583 +----------------- test/system/run_noresm_tests.sh | 402 +++ test/system/test_driver.sh | 665 ----- 12 files changed, 643 insertions(+), 3487 deletions(-) create mode 100755 test/system/run_noresm_tests.sh delete mode 100755 test/system/test_driver.sh diff --git a/.gitignore b/.gitignore index ae916806c6..6beb06fc54 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ cime components manage_externals.log src/physics/ali_arms/ +src/physics/camnor_phys src/physics/carma/base src/physics/clubb src/physics/cosp2/src @@ -12,13 +13,14 @@ src/physics/silhs src/physics/pumas src/physics/pumas-frozen src/dynamics/fv3/atmos_cubed_sphere +src/hemco libraries/FMS libraries/mct libraries/parallelio src/atmos_phys src/dynamics/mpas/dycore share -src/hemco + # Ignore compiled python buildnmlc buildcppc diff --git a/Externals.cfg b/Externals.cfg index fcc9322e56..45d8422403 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -1,73 +1,75 @@ -[ccs_config] -tag = ccs_config_cesm0.0.72 -protocol = git -repo_url = https://github.com/ESMCI/ccs_config_cesm -local_path = ccs_config -required = True +#----------------------------- +# Libraries +#----------------------------- -[cice5] -tag = cice5_20220204 +[parallelio] protocol = git -repo_url = https://github.com/ESCOMP/CESM_CICE5 -local_path = components/cice5 +tag = pio2_5_10 +repo_url = https://github.com/NCAR/ParallelIO +local_path = libraries/parallelio required = True -[cice6] -tag = cesm_cice6_4_1_8 +[mct] protocol = git -repo_url = https://github.com/ESCOMP/CESM_CICE -local_path = components/cice -externals = Externals.cfg +tag = MCT_2.11.0 +repo_url = https://github.com/MCSclimate/MCT +local_path = libraries/mct required = True -[cmeps] -tag = cmeps0.14.34 -protocol = git -repo_url = https://github.com/ESCOMP/CMEPS.git -local_path = components/cmeps -required = True +#----------------------------- +# Configuration/CCS +#----------------------------- -[cdeps] -tag = cdeps1.0.14 +[ccs_config] protocol = git -repo_url = https://github.com/ESCOMP/CDEPS.git -local_path = components/cdeps -externals = Externals_CDEPS.cfg +tag = ccs_config_noresm0.0.14 +repo_url = https://github.com/NorESMhub/ccs_config_noresm.git +local_path = ccs_config required = True -[cpl7] -tag = cpl77.0.5 +[cime] protocol = git -repo_url = https://github.com/ESCOMP/CESM_CPL7andDataComps -local_path = components/cpl7 +tag = cime6.0.105_noresm_v4 +repo_url = https://github.com/NorESMhub/cime.git +local_path = cime required = True +#----------------------------- +# Share +#----------------------------- + [share] -tag = share1.0.17 protocol = git -repo_url = https://github.com/ESCOMP/CESM_share +tag = share1.0.17_noresm_v1 +repo_url = https://github.com/NorESMHub/NorESM_share local_path = share required = True -[mct] -tag = MCT_2.11.0 +#----------------------------- +# Components +#----------------------------- + +[cice6] protocol = git -repo_url = https://github.com/MCSclimate/MCT -local_path = libraries/mct +tag = cesm_cice6_4_1_7_noresm_v1 +repo_url = https://github.com/NorESMhub/NorESM_CICE +local_path = components/cice +externals = Externals.cfg required = True -[parallelio] -tag = pio2_5_10 +[cdeps] protocol = git -repo_url = https://github.com/NCAR/ParallelIO -local_path = libraries/parallelio +tag = cdeps1.0.10 +repo_url = https://github.com/NorESMhub/CDEPS.git +local_path = components/cdeps +externals = Externals_CDEPS.cfg required = True -[cime] -tag = cime6.0.125 +[cmeps] protocol = git -repo_url = https://github.com/ESMCI/cime -local_path = cime +tag = cmeps0.14.32_noresm_v2 +repo_url = https://github.com/NorESMhub/CMEPS.git +local_path = components/cmeps required = True [cism] @@ -79,41 +81,32 @@ externals = Externals_CISM.cfg required = True [clm] -tag = ctsm5.1.dev124 protocol = git -repo_url = https://github.com/ESCOMP/CTSM +tag = ctsm5.1dev130-noresm_v1 +repo_url = https://github.com/NorESMhub/CTSM local_path = components/clm externals = Externals_CLM.cfg required = True -[fms] -# Older tag than CESM as there is a compilation error mismatch -tag = fi_20211011 -protocol = git -repo_url = https://github.com/ESCOMP/FMS_interface -local_path = libraries/FMS -externals = Externals_FMS.cfg -required = True - [mosart] -tag = mosart1_0_48 protocol = git -repo_url = https://github.com/ESCOMP/MOSART +tag = mosart1_0_48_noresm_v1 +repo_url = https://github.com/NorESMhub/MOSART local_path = components/mosart required = True [rtm] -tag = rtm1_0_78 protocol = git +tag = rtm1_0_78 repo_url = https://github.com/ESCOMP/RTM local_path = components/rtm required = True [cam] -local_path = . protocol = externals_only +local_path = . externals = Externals_CAM.cfg required = True [externals_description] -schema_version = 1.0.0 +schema_version = 1.0.01 diff --git a/Externals_CAM.cfg b/Externals_CAM.cfg index cc99360e56..4a43ae2d5d 100644 --- a/Externals_CAM.cfg +++ b/Externals_CAM.cfg @@ -1,88 +1,80 @@ [chem_proc] -local_path = chem_proc protocol = git -repo_url = https://github.com/ESCOMP/CHEM_PREPROCESSOR.git tag = chem_proc5_0_05 +repo_url = https://github.com/ESCOMP/CHEM_PREPROCESSOR.git +local_path = chem_proc required = True [carma] -local_path = src/physics/carma/base protocol = git -repo_url = https://github.com/ESCOMP/CARMA_base.git tag = carma4_00 +repo_url = https://github.com/ESCOMP/CARMA_base.git +local_path = src/physics/carma/base required = True [cosp2] -local_path = src/physics/cosp2/src protocol = svn -repo_url = https://github.com/CFMIP/COSPv2.0/tags/ tag = v2.1.4cesm/src +repo_url = https://github.com/CFMIP/COSPv2.0/tags/ +local_path = src/physics/cosp2/src required = True [clubb] -local_path = src/physics/clubb protocol = svn -repo_url = https://github.com/larson-group/clubb_release/tags/ tag = clubb_4ncar_20221129_59cb19f_20230330_branchtag/src/CLUBB_core +repo_url = https://github.com/larson-group/clubb_release/tags/ +local_path = src/physics/clubb required = True [silhs] -local_path = src/physics/silhs protocol = svn -repo_url = https://github.com/larson-group/clubb_release/tags/ tag = clubb_4ncar_20221129_59cb19f_20230330_branchtag/src/SILHS +repo_url = https://github.com/larson-group/clubb_release/tags/ +local_path = src/physics/silhs required = True [pumas] -local_path = src/physics/pumas protocol = git -repo_url = https://github.com/ESCOMP/PUMAS tag = pumas_cam-release_v1.29 +repo_url = https://github.com/ESCOMP/PUMAS +local_path = src/physics/pumas required = True [pumas-frozen] -local_path = src/physics/pumas-frozen protocol = git -repo_url = https://github.com/ESCOMP/PUMAS tag = pumas_cam-release_v1.17_rename +repo_url = https://github.com/ESCOMP/PUMAS +local_path = src/physics/pumas-frozen required = True [ali_arms] -local_path = src/physics/ali_arms protocol = git -repo_url = https://github.com/ESCOMP/ALI-ARMS tag = ALI_ARMS_v1.0.1 +repo_url = https://github.com/ESCOMP/ALI-ARMS +local_path = src/physics/ali_arms required = True [atmos_phys] -tag = atmos_phys0_00_011 protocol = git +tag = atmos_phys0_00_011 repo_url = https://github.com/NCAR/atmospheric_physics -required = True local_path = src/atmos_phys - -[atmos_cubed_sphere] -tag = fv3_cesm.04 -protocol = git -repo_url = https://github.com/ESCOMP/FV3_CESM.git -local_path = src/dynamics/fv3/atmos_cubed_sphere required = True -[mpas] -local_path = src/dynamics/mpas/dycore +[camnor_phys] protocol = git -repo_url = https://github.com/MPAS-Dev/MPAS-Model.git -sparse = ../.mpas_sparse_checkout -hash = ff76a231 +tag = camnor_noresm_v0.0.3 +repo_url = https://github.com/NorESMhub/CAM-Nor-physics +local_path = src/physics/camnor_phys required = True [hemco] -local_path = src/hemco -tag = hemco-cesm1_2_0_hemco3_6_2_cesm protocol = git +tag = hemco-cesm1_2_0_hemco3_6_2_cesm repo_url = https://github.com/ESCOMP/HEMCO_CESM.git +local_path = src/hemco required = True externals = Externals_HCO.cfg [externals_description] -schema_version = 1.0.0 +schema_version = 1.0.01 diff --git a/bld/config_files/definition.xml b/bld/config_files/definition.xml index 3c61ba691d..251669792a 100644 --- a/bld/config_files/definition.xml +++ b/bld/config_files/definition.xml @@ -26,8 +26,8 @@ Switch specifies whether CAM is being built by the CCSM sequential scripts. 0 = Coupling framework: mct or nuopc. Default: mct. - -Dynamics package: eul, fv, fv3, se, or mpas. + +Dynamics package: eul, fv, or se. Switch to turn on waccm physics: 0 => no, 1 => yes. @@ -63,6 +63,9 @@ Physics package: cam3, cam4, cam5, cam6, cam_dev, held_suarez, adiabatic, kessle Switch to turn on Harmonized Emissions Component (HEMCO) for chemistry: 0 => no, 1 => yes. + +Option to turn on NorESM modifications to baseline CESM/CAM physics and dynamics + Microphysics package: rk (Rasch and Kristjansson), mg1 (Morrison and Gettelman two moment scheme CAM5.1), mg2 (Morrison and Gettelman second @@ -127,7 +130,7 @@ Chemistry source directory generated by the chemistry preprocessor; contains F90 Chemistry source directory; contains F90 files. - + Use data ocean model (docn or dom), stub ocean (socn), or aqua planet ocean (aquaplanet) in cam build. When built from the CESM scripts the value of ocn may be set to pop. This doesn't impact how CAM is built, only how @@ -297,12 +300,6 @@ Switch to enable building COSP simulator package. 1 => build COSP. Directory containing COSP library. - -Directory containing FV3CORE library. - - -Directory containing MPAS library. - OS for which CAM is being built. The default value is the name contained in Perl's $OSNAME variable. This parameter allows the user to override diff --git a/bld/configure b/bld/configure index 262ac38e6d..dce056db30 100755 --- a/bld/configure +++ b/bld/configure @@ -56,6 +56,7 @@ OPTIONS -analytic_ic Enables the (namelist controlled) dycore testing infrastructure -aquaplanet Switch on aqua-planet mode. -build_chem_proc Switch forces the build of the chemistry preprocessor (primarily for testing). + -camnor Build CAM with CAM-Nor modifications -carma Build CAM with specified CARMA microphysics model [ none | bc_strat | cirrus | cirrus_dust | dust | meteor_impact | meteor_smoke | mixed_sulfate | pmc | pmc_sulfate | sea_salt | sulfate | tholin | @@ -78,7 +79,7 @@ OPTIONS -cppdefs A string of user specified CPP defines. Appended to Makefile defaults. E.g. -cppdefs '-DVAR1 -DVAR2' -cpl Coupling framework [mct | nuopc]. Default: mct. - -dyn Dynamical core option: [eul | fv | se | fv3 | mpas]. Default: fv. + -dyn Dynamical core option: [eul | fv | se ]. Default: fv. -edit_chem_mech Invokes CAMCHEM_EDITOR to allow the user to edit the chemistry mechanism file -hgrid Specify horizontal grid. Use nlatxnlon for spectral grids; dlatxdlon for fv grids (dlat and dlon are the grid cell size @@ -98,7 +99,7 @@ OPTIONS -pcols Set maximum number of columns in a chunk to . -pergro Switch enables building CAM for perturbation growth tests. -phys Physics option [cam3 | cam4 | cam5 | cam6 | cam_dev | - held_suarez | adiabatic | kessler | tj2016 | grayrad + held_suarez | adiabatic | kessler | tj2016 | grayrad | spcam_sam1mom | spcam_m2005]. Default: cam6 -prog_species Comma-separate list of prognostic mozart species packages. Currently available: DST,SSLT,SO4,GHG,OC,BC,CARBON16 @@ -152,7 +153,6 @@ OPTIONS -debug Switch to turn on building CAM with debugging compiler options. -cosp_libdir Directory containing COSP library. -esmf_libdir Directory containing ESMF library and esmf.mk file. - -fv3core_libdir Directory containing FV3 library. -fc User specified Fortran compiler. Overrides Makefile default. -fc_type Type of Fortran compiler [pgi | intel | gnu | pathscale | ibm | nag]. This argument is used in conjunction @@ -172,7 +172,6 @@ OPTIONS -ldflags A string of user specified load options. Appended to Makefile defaults. -linker User specified linker. Overrides Makefile default of \$(FC). - -mpas_libdir Directory containing MPAS library. -mct_libdir Directory containing MCT library. Default: build the library from source in a subdirectory of \$cam_bld. -mpi_inc Directory containing MPI include files. @@ -241,6 +240,7 @@ GetOptions( "cam_exe=s" => \$opts{'cam_exe'}, "cam_exedir=s" => \$opts{'cam_exedir'}, "camiop" => \$opts{'camiop'}, + "camnor!" => \$opts{'camnor'}, "cc=s" => \$opts{'cc'}, "cflags=s" => \$opts{'cflags'}, "chem=s" => \$opts{'chem'}, @@ -260,7 +260,6 @@ GetOptions( "fc_type=s" => \$opts{'fc_type'}, "fflags=s" => \$opts{'fflags'}, "fopt=s" => \$opts{'fopt'}, - "fv3core_libdir=s" => \$opts{'fv3core_libdir'}, "gmake=s" => \$opts{'gmake'}, "h|help" => \$opts{'help'}, "hgrid=s" => \$opts{'hgrid'}, @@ -273,7 +272,6 @@ GetOptions( "mct_libdir=s" => \$opts{'mct_libdir'}, "microphys=s" => \$opts{'microphys'}, "model_top=s" => \$opts{'model_top'}, - "mpas_libdir=s" => \$opts{'mpas_libdir'}, "mpi_inc=s" => \$opts{'mpi_inc'}, "mpi_lib=s" => \$opts{'mpi_lib'}, "nadv=s" => \$opts{'nadv'}, @@ -551,11 +549,30 @@ if (defined $opts{'phys'}) { $phys_pkg = lc($opts{'phys'}); } +# Special configuration for CAM-Nor options +# Currently, each CAM-Nor selection only works with the CAM6 or CAM_DEV +# ESCOMP/CAM physics suites +my $camnor = 0; +# user or compset override is only way to turn on this feature +if (defined $opts{'camnor'}) { + $camnor = $opts{'camnor'}; +} +# Check supported physics suite +if ($phys_pkg ne 'cam6' and $phys_pkg ne 'cam_dev') { + die "ERROR: CAM-Nor (-camnor) is only available for CAM6 and cam_dev.$eol"; +} + # Add to the config object. $cfg_ref->set('phys', $phys_pkg); +$cfg_ref->set('camnor', $camnor); -if ($print>=2) { print "Physics package: $phys_pkg$eol"; } - +if ($print>=2) { + if ($camnor) { + print "Physics package: $phys_pkg with CAM-Nor modifications$eol"; + } else { + print "Physics package: $phys_pkg$eol"; + } +} # Set flag to indicate a simple physics option my $simple_phys = 0; @@ -636,10 +653,6 @@ if (defined $opts{'dyn'}) { } my $dyn_pkg = $cfg_ref->get('dyn'); -if ($dyn_pkg eq 'fv3' and $spmd eq 'OFF') { - die "configure: FATAL: the fv3 dycore requires at least 6 tasks SPMD must not be switched off.$eol"; -} - if ($print>=2) { print "Dynamics package: $dyn_pkg$eol"; } $cfg_ref->set('analytic_ic', (defined $opts{'analytic_ic'}) ? $opts{'analytic_ic'} : 0); @@ -687,6 +700,7 @@ if (defined $opts{'model_top'}) { } if ($print>=2) { print "model_top: $model_top$eol"; } + #----------------------------------------------------------------------------------------------- # waccm physics my $waccm_phys = 0; @@ -704,7 +718,7 @@ $waccm_phys = $cfg_ref->get('waccm_phys'); if ($print>=2) { print "WACCM physics: $waccm_phys$eol"; } -# WACCM physics only runs with FV, SE and FV3 dycores +# WACCM physics only runs with FV and SEdycores if ( ($waccm_phys) and ($dyn_pkg eq 'eul') ) { die <<"EOF"; ** ERROR: WACCM physics does not run with the Eulerian spectral dycore. @@ -1230,9 +1244,6 @@ elsif ($dyn_pkg eq 'eul') { elsif ($dyn_pkg eq 'se') { $hgrid = 'ne16np4'; } -elsif ($dyn_pkg eq 'mpas') { - $hgrid = 'mpasa480'; -} $cfg_ref->set('hgrid', $hgrid); # User override. @@ -1563,7 +1574,7 @@ if ($print>=2) { print "Total advected constituents: $nadv$eol"; } #----------------------------------------------------------------------------------------------- -#----------------------------------------------------------------------------------------------- +##----------------------------------------------------------------------------------------------- # Makefile configuration ####################################################################### #----------------------------------------------------------------------------------------------- @@ -1863,11 +1874,6 @@ if ($dyn_pkg eq 'se') { } } -# FV3 preprocessor symbols to use FMS decomposition functionality and more accurate FV3 thermodynamics. -if ($dyn_pkg eq 'fv3') { - $cfg_cppdefs .= " -Duse_libMPI -Duse_netCDF -DUSE_COND -DMOIST_CAPPA"; -} - # Resolution parameters for vertical grid, number of constituents, chunk size my $nlev = $cfg_ref->get('nlev'); my $nadv = $cfg_ref->get('nadv'); @@ -1976,39 +1982,6 @@ if ($cosp) { write_cosp_makefile("$cfgdir/../src/physics/cosp2/Makefile.in", "$cosp_libdir/Makefile"); } -#----------------------------------------------------------------------------------------------- -# FV3CORE library. -if ($dyn_pkg eq 'fv3') { - # Set the directory used to build fv3core. Add location and library name - # to the user specified load flags. - my $fv3core_libdir = ''; - if (defined $opts{'fv3core_libdir'}) { - $fv3core_libdir = $opts{'fv3core_libdir'}; - } else - { - $fv3core_libdir = "$cam_bld/atmos_cubed_sphere"; - } - - $cfg_ref->set('fv3core_libdir', "$fv3core_libdir"); - - my $ldflags = $cfg_ref->get('ldflags'); - $ldflags .= " -L$fv3core_libdir -lfv3core "; - $cfg_ref->set('ldflags', $ldflags); - - # create the build directory for fv3core - unless (-d $fv3core_libdir or mkdirp($fv3core_libdir)) { - die "** Could not create the fv3core build directory: $fv3core_libdir\n"; - } - - # Write the filepath file. - if ($print) { print "creating $fv3core_libdir/Filepath\n"; } - write_fv3core_filepath("$fv3core_libdir/Filepath", $cfg_ref); - - # Create the FV3CORE Makefile from a template and copy it into the fv3core bld directory - if ($print) { print "creating $fv3core_libdir/Makefile\n"; } - write_fv3_makefile("$cam_dir/src/dynamics/fv3/Makefile.in.fv3", "$fv3core_libdir/Makefile"); -} - #----------------------------------------------------------------------------------------------- # MPAS library. if ($dyn_pkg eq 'mpas') { @@ -2061,22 +2034,6 @@ $cfg_ref->write_file($config_cache_file, $commandline); #------------------------------------------------------------------------------- -sub write_fv3core_filepath -{ - my ($file, $cfg_ref) = @_; - my $fh = new IO::File; - - $fh->open(">$file") or die "** can't open filepath file: $file\n"; - my $camsrcdir = $cfg_ref->get('cam_dir'); - my $CASEROOT = "$ENV{'CASEROOT'}"; - print $fh "$CASEROOT/SourceMods/src.cam\n"; - print $fh "$camsrcdir/src/dynamics/fv3/microphys\n"; - print $fh "$camsrcdir/src/dynamics/fv3/atmos_cubed_sphere/model\n"; - print $fh "$camsrcdir/src/dynamics/fv3/atmos_cubed_sphere/tools\n"; - - $fh->close; -} -#------------------------------------------------------------------------------- sub write_filepath { my ($file, $cfg_ref) = @_; @@ -2101,6 +2058,7 @@ sub write_filepath my $spmd = $cfg_ref->get('spmd'); my $offline_drv = $cfg_ref->get('offline_drv'); my $inic_val = $cfg_ref->get('analytic_ic'); + my $camnor = $cfg_ref->get('camnor'); # Root directory my $camsrcdir = $cfg_ref->get('cam_dir'); @@ -2121,6 +2079,21 @@ sub write_filepath my $CASEROOT = "$ENV{'CASEROOT'}"; print $fh "$CASEROOT/SourceMods/src.cam\n"; + # CAM-Nor has precedence over everything except SourceMods + # Only active in NF or NB compsets + if ($camnor) { + if ($phys_pkg eq 'cam_dev') { + print $fh "$camsrcdir/src/physics/camnor_phys/physics\n"; + } else { + print $fh "$camsrcdir/src/physics/camnor_phys/physics_cam6\n"; + die "CAM6 not currently supported for NorESM configurations.\n"; + } + print $fh "$camsrcdir/src/physics/camnor_phys/control\n"; + if ($dyn eq 'fv') { + print $fh "$camsrcdir/src/physics/camnor_phys/fv\n"; + } + } + # offline unit driver (defaults to stub) print $fh "$camsrcdir/src/unit_drivers\n"; print $fh "$camsrcdir/src/unit_drivers/${offline_drv}\n"; @@ -2137,7 +2110,7 @@ sub write_filepath # Weak scaling fix. This has to come before physics/cam and before dycores # It also has to come before utils (which is already near the end). - if ($dyn eq 'se' or $dyn eq 'mpas') { + if ($dyn eq 'se') { print $fh "$camsrcdir/src/infrastructure\n"; } @@ -2193,6 +2166,7 @@ sub write_filepath print $fh "$camsrcdir/src/hemco/HEMCO/src/Extensions\n"; print $fh "$camsrcdir/src/hemco/HEMCO/src/Interfaces/Shared\n"; + print $fh "$camsrcdir/src/chemistry/utils\n"; if ($rad eq 'rrtmg') { @@ -2324,34 +2298,6 @@ EOF $fh_in->close; } - -#------------------------------------------------------------------------------- -sub write_fv3_makefile -{ - - my ($file_in, $file_out) = @_; - my $fh_in = new IO::File; - my $fh_out = new IO::File; - - $fh_out->open(">$file_out") or die "** can't open file: $file_out\n"; - - print $fh_out <<"EOF"; - -CAM_BLD := $cam_bld - -EOF - - # Copy the "template" makefile to the new makefile. - $fh_in->open("<$file_in") or die "** can't open file: $file_in\n"; - while (<$fh_in>) { - print $fh_out $_; - } - - $fh_out->close; - $fh_in->close; -} - - #------------------------------------------------------------------------------- sub write_mpas_makefile @@ -2380,7 +2326,6 @@ EOF $fh_in->close; } - #------------------------------------------------------------------------------- sub write_config_h @@ -2438,11 +2383,6 @@ sub set_horiz_grid $hgrid =~ s/\.pg\d+//; # strip the '.pgN' extension $cfg_ref->set('hgrid', $hgrid); } - elsif ( $dyn_pkg eq 'fv3') { - # For FV3 dycore parse the parameters out of the grid specifier string. - $hgrid =~ m/C(\d+)/; - $cfg_ref->set('hgrid', $hgrid); - } elsif ($dyn_pkg =~ m/^eul$|^fv/) { # For EUL and FV dycores the parameters are read from an input file, diff --git a/bld/namelist_files/namelist_defaults_cam.xml b/bld/namelist_files/namelist_defaults_cam.xml index 6b583ff69d..dbeae32f17 100644 --- a/bld/namelist_files/namelist_defaults_cam.xml +++ b/bld/namelist_files/namelist_defaults_cam.xml @@ -157,6 +157,10 @@ atm/waccm/ic/FC6X2000_f05_spinup01.cam.i.0002-01-01-00000_c190711.nc atm/waccm/ic/waccmx_mam4_aqua_4x5_L130_c180803.nc atm/waccm/ic/waccmx_mam4_aqua_1.9x2.5_L130_c180803.nc +atm/cam/inic/se/cam6_QPC6_aqua_ne3pg3_mg37_L32_01-01-31_c221214.nc +atm/cam/inic/se/cam6_QPC6_aqua_ne3pg3_mg37_L58_01-01-31_c221214.nc +atm/cam/inic/se/cam6_QPC6_topo_ne3pg3_mg37_L32_01-01-31_c221214.nc +atm/cam/inic/se/cam6_QPC6_topo_ne3pg3_mg37_L58_01-01-31_c221214.nc atm/waccm/ic/waccmx_aqua_ne5np4_126L_c210304.nc atm/waccm/ic/waccmx_ne16np4_126L_c200108.nc atm/waccm/ic/fx2000_phys-ionos-cpl_ne16_spinup03.cam.i.0002-01-01-00000_c201005.nc @@ -216,9 +220,9 @@ atm/cam/inic/se/cam6_QPC6_topo_ne3pg3_mg37_L32_01-01-31_c221214.nc atm/cam/inic/se/cam6_QPC6_topo_ne3pg3_mg37_L58_01-01-31_c221214.nc atm/cam/inic/se/cam6_QPC6_topo_ne3pg3_mg37_L93_01-01-31_c221214.nc -atm/cam/inic/homme/cami-mam3_0000-01_ne5np4_L30.140707.nc atm/cam/inic/se/F2000climo_ne5pg3_mg37_L32_01-01-31_c230520.nc atm/cam/inic/se/F2000climo_ne5pg3_mg37_L58_01-01-31_c230520.nc + atm/cam/inic/se/ape_topo_cam4_ne16np4_L26_c171020.nc atm/cam/inic/se/ape_topo_cam4_ne16np4_L30_c171020.nc atm/cam/inic/se/ape_topo_cam4_ne16np4_L32_c171020.nc @@ -236,6 +240,9 @@ atm/cam/inic/homme/cami-mam3_0000-01-ne240np4_L30_c111004.nc +atm/cam/inic/se/cam6_QPC6_aqua_ne3pg3_mg37_L32_01-01-31_c221214.nc +atm/cam/inic/se/cam6_QPC6_aqua_ne3pg3_mg37_L58_01-01-31_c221214.nc +atm/cam/inic/se/cam6_QPC6_aqua_ne3pg3_mg37_L93_01-01-31_c221214.nc atm/cam/inic/se/ape_cam4_ne5np4_L26_c170517.nc atm/cam/inic/se/ape_cam4_ne16np4_L26_c170417.nc atm/cam/inic/se/ape_cam4_ne30np4_L26_c170417.nc @@ -248,9 +255,6 @@ atm/cam/inic/se/ape_cam5_ne30np4_L30_c170417.nc atm/cam/inic/se/ape_cam5_ne120np4_L30_c170419.nc -atm/cam/inic/se/cam6_QPC6_aqua_ne3pg3_mg37_L32_01-01-31_c221214.nc -atm/cam/inic/se/cam6_QPC6_aqua_ne3pg3_mg37_L58_01-01-31_c221214.nc -atm/cam/inic/se/cam6_QPC6_aqua_ne3pg3_mg37_L93_01-01-31_c221214.nc atm/cam/inic/se/ape_cam6_ne5np4_L32_c170517.nc atm/cam/inic/se/ape_cam6_ne16np4_L32_c170509.nc atm/cam/inic/se/ape_cam6_ne30np4_L32_c170509.nc @@ -304,13 +308,13 @@ atm/cam/topo/se/ne120np4_nc3000_Co015_Fi001_PF_nullRR_Nsw010_20171011.nc atm/cam/topo/se/ne240np4_nc3000_Co008_Fi001_PF_nullRR_Nsw005_20171014.nc +atm/cam/topo/se/ne3pg3_gmted2010_modis_bedmachine_nc0540_Laplace1000_noleak_20230209.nc atm/cam/topo/se/ne5pg2_nc3000_Co360_Fi001_MulG_PF_nullRR_Nsw060_20170706.nc atm/cam/topo/se/ne30pg2_nc3000_Co060_Fi001_PF_nullRR_Nsw042_20171014.nc atm/cam/topo/se/ne60pg2_nc3000_Co030_Fi001_PF_nullRR_Nsw021_20171014.nc atm/cam/topo/se/ne120pg2_nc3000_Co015_Fi001_PF_nullRR_Nsw010_20171012.nc atm/cam/topo/se/ne240pg2_nc3000_Co008_Fi001_PF_nullRR_Nsw005_20171014.nc -atm/cam/topo/se/ne3pg3_gmted2010_modis_bedmachine_nc0540_Laplace1000_noleak_20230209.nc atm/cam/topo/se/ne5pg3_nc3000_Co360_Fi001_MulG_PF_nullRR_Nsw064_20170516.nc atm/cam/topo/se/ne16pg3_nc3000_Co120_Fi001_PF_nullRR_Nsw084_20171012.nc atm/cam/topo/se/ne30pg3_gmted2010_modis_bedmachine_nc3000_Laplace0100_20230105.nc @@ -1890,18 +1894,16 @@ OFF -atm/cam/chem/trop_mam/atmsrf_ne3np4.pg3_c221214.nc -atm/cam/chem/trop_mam/atmsrf_ne5np4_110920.nc +atm/cam/chem/trop_mam/atmsrf_ne3np4.pg3_cdf5_c221214.nc atm/cam/chem/trop_mam/atmsrf_ne5pg3_201105.nc -atm/cam/chem/trop_mam/atmsrf_ne16np4_110920.nc +atm/cam/chem/trop_mam/atmsrf_ne5np4_cdf5_110920.nc +atm/cam/chem/trop_mam/atmsrf_ne16np4_cdf5_110920.nc atm/cam/chem/trop_mam/atmsrf_ne16pg3_c230520.nc -atm/cam/chem/trop_mam/atmsrf_ne30np4_110920.nc -atm/cam/chem/trop_mam/atmsrf_ne30np4.pg2_200108.nc -atm/cam/chem/trop_mam/atmsrf_ne30pg3_180522.nc +atm/cam/chem/trop_mam/atmsrf_ne30np4_cdf5_110920.nc +atm/cam/chem/trop_mam/atmsrf_ne30pg3_cdf5_180522.nc atm/cam/chem/trop_mam/atmsrf_ne60np4_110920.nc -atm/cam/chem/trop_mam/atmsrf_ne120np4_110920.nc -atm/cam/chem/trop_mam/atmsrf_ne120np4.pg2_200109.nc -atm/cam/chem/trop_mam/atmsrf_ne240np4_110920.nc +atm/cam/chem/trop_mam/atmsrf_ne120np4_cdf5_110920.nc +atm/cam/chem/trop_mam/atmsrf_ne240np4_cdf5_110920.nc atm/cam/chem/trop_mam/atmsrf_ne0np4conus30x8_161116.nc atm/cam/chem/trop_mam/atmsrf_ne30x4_ARCTIC_191011.nc @@ -2184,7 +2186,6 @@ 1 0 1 - 2 0 1 @@ -2959,7 +2960,6 @@ 1 3 1 - 1 0 0 -10 @@ -3177,14 +3177,15 @@ 'O3S_Loss = 2.0*O_O3 + O1D_H2O + HO2_O + HO2_O3 + OH_O + OH_O3 + H_O3 + 2.0*NO2_O + 2.0*jno3_b + 2.0*CLO_O + 2.0*jcl2o2 + ', - '2.0*CLO_CLOa + 2.0*CLO_CLOb + 2.0*BRO_CLOb + 2.0*BRO_CLOc + 2.0*BRO_BRO + 2.0*BRO_O + CLO_HO2 + BRO_HO2 + S_O3' + '2.0*CLO_CLOa + 2.0*CLO_CLOb + 2.0*BRO_CLOb + 2.0*BRO_CLOc + 2.0*BRO_BRO + 2.0*BRO_O + CLO_HO2 + BRO_HO2 + S_O3' 'O3S_Loss = 2.0*O_O3 + O1D_H2O + HO2_O + HO2_O3 + OH_O + OH_O3 + H_O3 + 2.0*NO2_O + 2.0*jno3_b + 2.0*CLO_O + 2.0*jcl2o2 + ', - '2.0*CLO_CLOa + 2.0*CLO_CLOb + 2.0*BRO_CLOb + 2.0*BRO_CLOc + 2.0*BRO_BRO + 2.0*BRO_O + CLO_HO2 + BRO_HO2 + S_O3', + '2.0*CLO_CLOa + 2.0*CLO_CLOb + 2.0*BRO_CLOb + 2.0*BRO_CLOc + 2.0*BRO_BRO + 2.0*BRO_O + CLO_HO2 + BRO_HO2 + S_O3', 'SolIonRate_Tot = jeuv_1 + jeuv_2 + jeuv_3 + jeuv_4 + jeuv_5 + jeuv_6 + jeuv_7 + jeuv_8 + jeuv_9 + jeuv_10 + jeuv_11 + ', 'jeuv_14 + jeuv_15 + jeuv_16 + jeuv_17 + jeuv_18 + jeuv_19 + jeuv_20 + jeuv_21 + jeuv_22 + jeuv_23', + 'O3_Prod = NO_HO2 + CH3O2_NO + HOCH2OO_NO + C2H5O2_NO + CH3CO3_NO + EO2_NO + C3H7O2_NO + PO2_NO + ', 'RO2_NO + ENEO2_NO + MACRO2_NOa + jhonitr + ', @@ -3362,4 +3363,5 @@ 144 91 + diff --git a/bld/namelist_files/namelist_definition.xml b/bld/namelist_files/namelist_definition.xml index 98364b80fe..01775aca60 100644 --- a/bld/namelist_files/namelist_definition.xml +++ b/bld/namelist_files/namelist_definition.xml @@ -53,7 +53,6 @@ This is an optional attribute that is mainly useful for variables that have only a small number of allowed values. --> - + @@ -2952,7 +2951,7 @@ Default: .false. Heterogeneous freezing scaling factor for black carbon aerosols. -Default: 0.01 +Default: 0.0 - - CAM cam6 physics: + CAM cam6 physics: CAM cam5 physics: CAM cam4 physics: CAM cam3 physics: CAM simplified and non-versioned physics : - CAM7 development physics: + CAM7 development physics: + + + CAM-Nor physics and dynamics differences : + =============== + --> With Harmonized Emissions Component (HEMCO) for chemistry: -phys adiabatic diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml index 23aada6520..eb6e345561 100644 --- a/cime_config/config_compsets.xml +++ b/cime_config/config_compsets.xml @@ -36,34 +36,57 @@ - grid (optional regular expression match for grid to work with the compset) - - - + + + - F2000Nuopc - 2000_CAM40_CLM50%SP_CICE%PRES_DOCN%DOM_SROF_SGLC_SWAV + NF2000climo + 2000_CAM60%NORESM_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV - - - + + NF2000dev + 2000_CAM%DEV%NORESM_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV + + + + NF1850 + 1850_CAM60%NORESM_CLM51%FATES-SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV + + + + NFLTHIST_v0d + HIST_CAM%DEV%LT%NORESM%GHGMAM4_CLM51%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV + + + + NQPC6 + 2000_CAM60%NORESM_SLND_SICE_DOCN%AQP3_SROF_SGLC_SWAV + + + + NQPC2000climo + 2000_CAM60%NORESM%CCTS1_SLND_SICE_DOCN%AQP3_SROF_SGLC_SWAV + + + + + F2000climo 2000_CAM60_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV - FHIST HIST_CAM60_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV - FLTHIST_v0d - HIST_CAM%DEV%LT%GHGMAM4_CLM51%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV + HIST_CAM%DEV%GHGMAM4_CLM51%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV @@ -84,7 +107,6 @@ FHIST_BGC HIST_CAM60_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV - @@ -92,17 +114,11 @@ FDABIP04 2000_CAM%DABIP04_SLND_SICE_SOCN_SROF_SGLC_SWAV - - - FHS94 2000_CAM%HS94_SLND_SICE_SOCN_SROF_SGLC_SWAV - - - @@ -123,13 +139,11 @@ FSCAM 2000_CAM60%SCAM_CLM50%SP_CICE%PRES_DOCN%DOM_SROF_SGLC_SWAV - FCSCAM 2000_CAM60%SCAM%CCTS1_CLM50%SP_CICE%PRES_DOCN%DOM_SROF_SGLC_SWAV - @@ -202,8 +216,6 @@ QPC6 2000_CAM60_SLND_SICE_DOCN%AQP3_SROF_SGLC_SWAV - - @@ -237,8 +249,6 @@ QSC6 2000_CAM60_SLND_SICE_DOCN%SOMAQP_SROF_SGLC_SWAV - - @@ -398,6 +408,11 @@ HIST_CAM60%SDYN_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV + + FGRAYRAD + 2000_CAM%GRAYRAD_SLND_SICE_SOCN_SROF_SGLC_SWAV + + FMOZ 2000_CAM40%TMOZ_CLM45%SP_CICE%PRES_DOCN%DOM_RTM_SGLC_SWAV @@ -413,10 +428,6 @@ HIST_CAM60_CLM50%SP_CICE%PRES_DOCN%DOM_SROF_SGLC_SWAV - - FGRAYRAD - 2000_CAM%GRAYRAD_SLND_SICE_SOCN_SROF_SGLC_SWAV - @@ -425,43 +436,36 @@ FWHIST HIST_CAM60%WCTS_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV - FWHIST_BGC HIST_CAM60%WCTS_CLM50%BGC-CROP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV - FWsc2010climo 2010_CAM60%WCSC_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV - FWsc2000climo 2000_CAM60%WCSC_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV - FWsc1850 1850_CAM60%WCSC_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV - FWscHIST HIST_CAM60%WCSC_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV - FW1850 1850_CAM60%WCTS_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV - diff --git a/cime_config/testdefs/testlist_cam.xml b/cime_config/testdefs/testlist_cam.xml index 73219c0c07..3149a3f9d4 100644 --- a/cime_config/testdefs/testlist_cam.xml +++ b/cime_config/testdefs/testlist_cam.xml @@ -5,2625 +5,108 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - + - + - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + - - - - - - - - - - - - - - - - - - + - + - - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/system/run_noresm_tests.sh b/test/system/run_noresm_tests.sh new file mode 100755 index 0000000000..887f641ef0 --- /dev/null +++ b/test/system/run_noresm_tests.sh @@ -0,0 +1,402 @@ +#! /bin/bash + +## +## General syntax help function +## Usage: help +## +help () { + local hname="Usage: $( basename ${0} )" + local hprefix="$( echo ${hname} | tr '[!-~]' ' ' )" + echo "${hname} --root " + echo "${hprefix} [ --project ]" + echo "${hprefix} [ --compare ]" + echo "${hprefix} [ --compiler ]" + echo "${hprefix} [ --generate ]" + echo "Less common options" + echo "${hprefix} [ --rerun ]" + echo "${hprefix} [ --baselinedir ]" + echo "${hprefix} [ --testdir ]" + echo "${hprefix} [ --clean ]" + echo "${hprefix} [ --cleanall ]" + echo "${hprefix} [ --dryrun ]" + echo "${hprefix} [ --rm-testdir ]" + exit $1 +} + +perr() { +## +## Output an error message <$2> if error code <$1> is non-zero +## + if [ $1 -ne 0 ]; then + echo -e "\nERROR ${1}: ${2}\n" + exit $1 + fi +} + +lastCamTag () { + local taglist + local tag + local currdir + currdir="$( pwd -P 2> /dev/null )" + if [ -d "${CAM_ROOT}/components/cam" ]; then + cd ${CAM_ROOT}/components/cam + elif [ -d "${CAM_ROOT}/models/atm/cam" ]; then + perr 1 "lastCamTag does not work with old directory structure" + elif [ -d "${CAM_ROOT}/test/system" ]; then + cd ${CAM_ROOT} + else + perr 1 "Cannot find CAM source at, \"${CAM_ROOT}\"" + fi + tag="$( git describe | sed -e 's/[-][0-9]*[-][0-9a-g]*$//' )" + cd ${currdir} + echo $tag +} + +extract_testtype () { + # extract_testtype testdir + local IFS + local dcomps + local ftype + local addtype + IFS=. + dcomps=(${1}) + shift + ftype="${dcomps[1]}" + addtype="yes" + for item in ${@}; do + if [ "${item}" == "${ftype}" ]; then + addtype="no" + fi + done + if [ "${addtype}" == "yes" ]; then + echo "${ftype}" + else + echo "" + fi +} + +clean_testdir () { + # clean_testdir CAM_TESTDIR cleanall [] + local cam_tdir # $1 + local cleanall # $2 + local cscmd + local ctest + local currdir + local test_id # $3 + local testdir + local tname + cam_tdir="${1}" + cleanall="${2}" + test_id="${3}" + currdir="$( pwd -P )" + # To clean tests, we need to find the proper test directory + if [ -n "${scratch}" -a -n "${test_id}" ]; then + testdir="${scratch}/${test_id}" + cscmd="${testdir}/cs.status.${test_id}" + if [ -f "${cscmd}" ]; then + fails="$( ${cscmd} | grep Overall | grep FAIL | cut -d' ' -f3 )" + else + fails="" + fi + for tname in ${fails}; do + ctest="${tname}.GC.${test_id}" + if [ "${cleanall}" == "yes" ]; then + rm -rf ${testdir}/${ctest} + else + cd ${testdir}/${ctest} + perr $? "Cannot enter ctest dir = '${testdir}/${ctest}'" + rm -f TestStatus* run/*.log* + rm -rf bld + ./.case.test --reset + ./case.setup --reset + fi + cd ${currdir} + done + fi + # Clean up old log files + # Do not remove the aux_cam_noresm_xxx files as those are reused. + rm -rf ${cam_tdir}/cime-tests.o* +} + +################################################## +## +## Beginning of script +## +################################################## + +# Make sure we are starting off in a valid directory +if [ ! -d "." ]; then + perr 1 "The current directory does not exist!!" +fi + +if [ -z "${currdir}" ]; then + currdir="$( pwd -P )" +fi +if [ -z "${scriptdir}" ]; then + scriptdir="$( cd $( dirname $0 ); pwd -P )" + perr $? "Line ${LINENO}: Cannot enter scriptdir = '${scriptdir}'" +fi + +# By default, let the machine set the baseline root +BL_ROOT="" +# Default baseline version for compare will be latest tag (from git describe) +bl_version="" +# Let machine set default compiler +CAM_FC="" +# No default for CAM_ROOT but env value allowed +CAM_ROOT=${CAM_ROOT:-""} +# Clean all test status +cleanall="no" +# Clean failures for successful rebuild +doclean="no" +# Dry run, print out the command but do not run it. +dryrun="no" +# Generate new baselines with this tag +new_tag="" +# Most test machines require a project code +project="" +# Remove test directory before beginning +removeall="no" +# Rerun an existing aux_cam_noresm suite +rerun="" + +## Process our input arguments +while [ $# -gt 0 ]; do + case $1 in + --h | -h | --help | -help) + help 0 + ;; + --baselinedir) + if [ ! -d "${2}" ]; then + perr 1 "Baseline root (${2}) must be an existing directory" + fi + BL_ROOT=${2} + shift + ;; + --compare) + if [ $# -lt 2 ]; then + perr 1 "${1} requires a CAM tag for baseline tests" + fi + bl_version=${2} + shift + ;; + --clean) + doclean="yes" + ;; + --cleanall) + cleanall="yes" + ;; + --compiler) + if [ $# -lt 2 ]; then + perr 1 "${1} requires a compiler name (e.g., INTEL)" + fi + CAM_FC="${2^^}" + shift + ;; + --dryrun) + dryrun="yes" + ;; + --generate) + if [ $# -lt 2 ]; then + perr 1 "${1} requires a new CAM tag name" + fi + new_tag=${2} + shift + ;; + --project) + if [ $# -lt 2 ]; then + perr 1 "${1} requires a project or accounting code" + fi + project=${2} + shift + ;; + --rerun) + rerun="--rerun-cesm" + ;; + --rm-testdir) + removeall="yes" + ;; + --root | -root) + if [ $# -lt 2 ]; then + perr 1 "${1} requires a CAM root directory" + fi +# We need to make sure that the install directory is a full path +# First, we see if it looks like a full path (not sure Windows will like this) + case $1 in + /*) + CAM_ROOT=$2 + ;; + *) + if [ ! -d "${2}" ]; then + perr 1 "CAM root (${2}) must be an existing directory" + fi + CAM_ROOT="$( cd $2; pwd -P )" + perr $? "CAM root must exist" + esac + if [ ! -d "${CAM_ROOT}" ]; then + perr 1 "The specified CAM directory, \"${2}\", does not exist." + exit 1 + fi + shift + ;; + --testdir | -testdir) + if [ $# -lt 2 ]; then + perr 1 "${1} requires a test directory name" + fi + CAM_TESTDIR=${2} + shift + ;; + *) + perr 1 "Unrecognized option, \"${1}\"" + ;; + esac + shift +done + +if [ ! -d "${CAM_ROOT}" ]; then + perr 1 "Must specify CAM root with --root switch" +fi + +#################################### +## +## Load machine-dependent settings +## +#################################### + +if [ -z "${HOST}" -o "${HOST:0:5}" == "login" ]; then + export HOST="$( hostname )" +fi +if [ "$( echo ${HOST} | sed -e 's/^[^.]*[.]//' -e 's/[.].*$//' )" == "betzy" ]; then + machname="betzy" + CESMDATAROOT="/cluster/shared/noresm/inputdata" + if [ -z "${BL_ROOT}" ]; then + BL_ROOT="/cluster/shared/noresm/noresm_baselines" + fi + if [ -z "${CAM_FC}" ]; then + export CAM_FC="intel" + fi + scratch="/cluster/work/users/${USER}" +else + echo "ERROR: Unsupported host, \"${HOST}\"." + exit 3 +fi + +## We are running NorESM but that is not yet +## installed in the system as a separate model option. +export CIME_MODEL=cesm + +## If a baseline tag was specified, make sure it exists +if [ -n "${bl_version}" ]; then + if [ ! -d "${BL_ROOT}/${bl_version}" ]; then + perr "Baseline directory, '${BL_ROOT}/${bl_version}', must exist" + fi +fi + +## Create a test directory if necessary +if [ -z "${CAM_TESTDIR}" ]; then + CAM_TESTDIR="${scratch}/camtest_${CAM_FC,,}" +fi + +# Find the test_id if this is a rerun +if [ -n "${rerun}" ]; then + # We are doing a rerun, find the last test directory + # We should be in the place to look + logfile="$( ls ${CAM_TESTDIR}/aux_cam_noresm_${CAM_FC,,}_*.log | tail -n 1 )" + scriptdir=$( cd $( dirname ${0}); pwd -P ) + perr $? "Cannot enter old run dir = '${scriptdir}'" + test_info="$( ${scriptdir}/findTestInfo.py ${logfile} )" + test_tokens=( $test_info ) + if [ ${#test_tokens[@]} -eq 2 ]; then + CAM_TESTDIR=${test_tokens[0]} + test_id=${test_tokens[1]} + else + perr 1 "Cannot find test info, \"${test_info}\"" + fi + export CAM_TESTDIR + rerun="${rerun} ${test_id}" +else + test_id="" +fi + +# If this is a rerun, we may have to do a clean +if [ -n "${CAM_TESTDIR}" ]; then + if [ -d "${CAM_TESTDIR}" ]; then + if [ "${removeall}" == "yes" ]; then + if [ "${dryrun}" == "yes" ]; then + echo "Dryrun: Remove old test dir, '${CAM_TESTDIR}'" + else + rm -rf "${CAM_TESTDIR}" + fi + elif [ "${doclean}" == "yes" -o "${cleanall}" == "yes" ]; then + if [ "${dryrun}" == "yes" ]; then + echo "Dryrun: Clean test dir, '${CAM_TESTDIR}', test ID = '${test_id}'" + else + clean_testdir "${CAM_TESTDIR}" "${cleanall}" "${test_id}" + fi + fi + fi + if [ "${dryrun}" != "yes" ]; then + if [ ! -d "${CAM_TESTDIR}" ]; then + mkdir -p $CAM_TESTDIR + fi + CAM_TESTDIR="$( cd ${CAM_TESTDIR}; pwd -P )" + perr $? "Line ${LINENO}: Cannot enter CAM_TESTDIR = '${CAM_TESTDIR}'" + fi +fi + +# Export variables which might have been changed +export CAM_ROOT +if [ -d "${CAM_ROOT}/components/cam/test/system" ]; then + export CAM_STEST="${CAM_ROOT}/components/cam/test/system" +elif [ -d "${CAM_ROOT}/models/atm/cam/test/system" ]; then + export CAM_STEST="${CAM_ROOT}/models/atm/cam/test/system" +elif [ -d "${CAM_ROOT}/test/system" ]; then + export CAM_STEST="${CAM_ROOT}/test/system" +else + perr 1 "Cannot find system test directory from root, \"${CAM_ROOT}\"" +fi +export CAM_FC +if [ -n "${CAM_TESTDIR}" ]; then + export CAM_TESTDIR +fi + +#########################################3 + +if [ -n "${CAM_TESTDIR}" ]; then + if [ "${dryrun}" != "yes" ]; then + cd $CAM_TESTDIR + perr $? "Line ${LINENO}: Cannot enter CAM_TESTDIR = '${CAM_TESTDIR}'" + fi + echo "CAM_TESTDIR = ${CAM_TESTDIR}" +else + perr 1 "No value for CAM_TESTDIR" +fi +if [ -n "${CAM_ROOT}" ]; then + echo "CAM_ROOT = ${CAM_ROOT}" +fi +if [ -n "${CAM_FC}" ]; then + echo "Tests using the '${CAM_FC}' compiler" +fi + +command="${CAM_ROOT}/cime/scripts/create_test --xml-category aux_cam_noresm" +command="${command} --machine ${machname}" +command="${command} --test-root ${CAM_TESTDIR} --output-root ${CAM_TESTDIR}" +if [ -n "${project}" ]; then + command="${command} --project nn9560k" +fi +if [ -n "${bl_version}" -o -n "${new_tag}" ]; then + # We will generate and/or compare so enter a baseline root + command="${command} --baseline-root ${BL_ROOT}" +fi +if [ -n "${new_tag}" ]; then + command="${command} --test-id ${new_tag} --generate ${new_tag}" +fi +if [ -n "${bl_version}" ]; then + command="${command} --compare ${bl_version}" +fi + +if [ "${dryrun}" == "yes" ]; then + echo "Running: ${command}" +else + ${command} +fi diff --git a/test/system/test_driver.sh b/test/system/test_driver.sh deleted file mode 100755 index 964f647793..0000000000 --- a/test/system/test_driver.sh +++ /dev/null @@ -1,665 +0,0 @@ -#!/bin/sh -# -# test_driver.sh: driver for the testing of CAM with standalone scripts -# -# usage on hobart, izumi, leehill, cheyenne -# ./test_driver.sh -# -# **more details in the CAM testing user's guide, accessible -# from the CAM developers web page - -## -## General syntax help function -## Usage: help -## - -help () { - local hname="Usage: `basename ${0}` [ OPTION [ OPTION ... ] ]" - local hprefix="`echo ${hname} | tr '[!-~]' ' '`" - hprefix=" " - echo "${hname} " - echo "${hprefix} [ -b ] (support baseline scripts for cam5_2_12 and earlier)" - echo "${hprefix} [ -e ] (email summary to $USER)" - echo "${hprefix} [ -f ] (force batch submission -- avoids user prompt)" - echo "${hprefix} [ -h ] (displays this help message)" - echo "${hprefix} [ -i ] (interactive usage)" - echo "${hprefix} [ -j ] (number of jobs for gmake)" - echo "${hprefix} [ --baseline-dir ] (directory for saving baselines of cime tests)" - echo "${hprefix} [ --no-baseline] (baselines of cime tests are not saved)" - echo "${hprefix} [ --xml-driver ] (mct or nuopc)" - echo "${hprefix} [ --cesm ] (default aux_cam)" - echo "${hprefix} [ --rerun-cesm ] (rerun the cesm tests with the --use-existing-flag)" - echo "${hprefix} [ --namelists-only ] (Only perform namelist actions for tests. Incompatible with --rerun-cesm.)" - echo "${hprefix} [ --batch ] (Allow cime tests to run in parallel.)" - echo "" - echo "${hprefix} **pass environment variables by preceding above commands with:" - echo "${hprefix} 'env var1=setting var2=setting '" - echo "" - echo "Supported ENVIRONMENT variables" - echo "BL_TESTDIR: Default = none (used to set baseline compare dir)" - echo "CAM_ACCOUNT: Default = none" - echo "CAM_BATCHQ: Default = machine dependent" - echo "CAM_FC: Default = machine dependent" - echo "CAM_INPUT_TESTS: Default = tests_pretag_[_]" - echo "CAM_RESTART_TASKS: Default = 64" - echo "CAM_RETAIN_FILES: Default = FALSE" - echo "CAM_ROOT: Default = set relative to CAM_SCRIPTDIR" - echo "NB: If script is not called as ./`basename ${0}`, CAM_ROOT must be specified" - echo "CAM_SCRIPTDIR: Default = " - echo "CAM_TAG: Default = none (used to set CESM baseline dir)" - echo "CAM_TASKS: Default = (depends on system)" - echo "CAM_TESTDIR: Default = /test-driver." - echo "" - echo "Less common ENVIRONMENT variables" - echo "CALDERA_BATCHQ: Default = caldera" - echo "CAM_RBOPTIONS: Default = build_only" - echo "CAM_SOFF: Default = none (stop of first test fail if TRUE)" - echo "CIME_MODEL: Default = none (should be set to cesm)" - echo "EMAIL: Default = $USER@ucar.edu" - echo "SUMMARY_FILE: Default = `pwd -P`/cam_test_summaries}" - exit $1 -} - -## -## Error output function (should be handed a string) -## -perr() { - echo -e "\nERROR: ${@}\n" - help 1 -} - -## These variables may be overridden from the user's environment -EMAIL=${EMAIL:-"${USER}@ucar.edu"} - -# These variables may be modified by script switches (./test_driver.sh -h) -cam_email_summary=false -cesm_test_suite="aux_cam" -force=false -gmake_j=0 -interactive=false -use_existing='' -namelists_only=false -batch=false - -# Understand where we are and where the CAM root and CIME reside -if [ -n "${CAM_ROOT}" ]; then - # The user specified a CAM_ROOT, make sure it exists and that this - # script was called from its test directory. - if [ -d "${CAM_ROOT}" ]; then - test_dir="${CAM_ROOT}/test/system" - if [ -f "${test_dir}/test_driver.sh" ]; then - # Check against this script. - script_dir="$( cd $( dirname $0 ); pwd -P )" - script_file="${script_dir}/test_driver.sh" - if [ "${test_dir}/test_driver.sh" != "${script_file}" ]; then - perr "CAM_ROOT test dir is ${test_dir} but script is ${script_file}" - fi # Else, everything is fine - else - perr "No test_driver.sh found in ${test_dir}" - fi - else - perr "CAM_ROOT, '${CAM_ROOT}', does not exist" - fi -else - # The user did not specify CAM_ROOT, find it relative to this script - test_dir="$( dirname $0 )" - export CAM_ROOT="$(dirname $(dirname $( cd ${test_dir}; pwd -P )))" -fi -# Now, find CIME_ROOT, first try a CAM standalone checkout -if [ -d "${CAM_ROOT}/cime/scripts" ]; then - export CIME_ROOT="${CAM_ROOT}/cime" -else - export CIME_ROOT="$( dirname $( dirname ${CAM_ROOT} ) )/cime" - if [ ! -d "${CIME_ROOT}/scripts" ]; then - perr "No CIME found from CAM_ROOT = '${CAM_ROOT}'" - fi -fi - -# Initialize variables which may not be set -submit_script_cime='' - -while [ "${1:0:1}" == "-" ]; do - case $1 in - - --baseline-dir ) - if [ $# -lt 2 ]; then - perr "${1} requires a directory name)" - fi - baseline_dir="${2}" - shift - ;; - - --no-baseline ) no_baseline=false - ;; - - -b ) export CAM_BASEBACK="YES" - ;; - - --cesm ) - if [ $# -lt 2 ]; then - perr "${1} requires a CESM test name or test suite name (e.g., aux_cam)" - fi - if [ "${2:0:1}" == "-" ]; then - perr "Invalid CESM test name, '${2}'" - fi - cesm_test_suite="${2}" - shift - ;; - - -e ) cam_email_summary=true - ;; - - -f ) force=true - if $interactive ; then - echo "test_driver.sh: FATAL ERROR: -i and -f were set" - exit 1 - fi - ;; - - -h | --help ) - help 0 - ;; - - -i ) interactive=true - if $force ; then - echo "test_driver.sh: FATAL ERROR: -i and -f were set" - exit 1 - fi - ;; - - -j ) shift; gmake_j=$1 - ;; - - --rerun-cesm ) - if [ $# -lt 2 ]; then - perr "${1} requires a test_id from a previous run)" - fi - use_existing="${2}" - shift - if $namelists_only ; then - echo "test_driver.sh: FATAL ERROR: --rerun-cesm and --namelists-only were set" - exit 1 - fi - ;; - - --xml-driver ) - if [ $# -lt 2 ]; then - perr "${1} specify mct or nuopc)" - fi - xml_driver="${2}" - shift - ;; - - --namelists-only ) - namelists_only=true - if [ "${use_existing}" != "" ]; then - echo "test_driver.sh: FATAL ERROR: --namelists-only and --rerun-cesm were set" - exit 1 - fi - ;; - - --batch ) - batch=true - ;; - - esac - shift -done - -# Currently, we don't support non-options, should we? -if [ $# -gt 0 ]; then - perr "Unrecognized arguments: '$*'" -fi - -#will attach timestamp onto end of script name to prevent overwriting -start_date="`date --iso-8601=seconds`" -cur_time=`date '+%H%M%S'` -date_str="`date '+%Y%m%d%H%M%S'`" - -hostname=`hostname` - -case $hostname in - - ##cheyenne - ch* | r* ) - submit_script_cime="`pwd -P`/test_driver_cheyenne_cime_${cur_time}.sh" - - if [ -z "$CAM_ACCOUNT" ]; then - echo "ERROR: Must set the environment variable CAM_ACCOUNT" - exit 2 - fi - - if [ -z "$CAM_BATCHQ" ]; then - export CAM_BATCHQ="regular" - fi - - # wallclock for run job - wallclock_limit="5:00:00" - - if [ $gmake_j = 0 ]; then - gmake_j=36 - fi - - # run tests on 2 nodes using 18 tasks/node, 2 threads/task - CAM_TASKS=36 - CAM_THREADS=2 - - # change parallel configuration on 2 nodes using 32 tasks, 1 threads/task - CAM_RESTART_TASKS=32 - CAM_RESTART_THREADS=1 - - mach_workspace="/glade/scratch" - - # Check for CESM baseline directory - if [ -n "${BL_TESTDIR}" ] && [ ! -d "${BL_TESTDIR}" ]; then - echo "CESM_BASELINE ${BL_TESTDIR} not found. Check BL_TESTDIR for correct tag name." - exit - fi - -#------------------------------------------- - -cat > ${submit_script_cime} << EOF -#!/bin/bash -# -#PBS -N cime-tests -#PBS -q $CAM_BATCHQ -#PBS -A $CAM_ACCOUNT -#PBS -l walltime=4:00:00 -#PBS -l select=1:ncpus=36:mpiprocs=36 -#PBS -j oe -#PBS -l inception=login - -EOF - -##^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to batch script ^^^^^^^^^^^^^^^^^^^ - ;; - - ##hobart - hob* | h[[:digit:]]* ) - submit_script_cime="`pwd -P`/test_driver_hobart_cime_${cur_time}.sh" - export PATH=/cluster/torque/bin:${PATH} - - # Default setting is 12 hr in the long queue; the short queue only - # allows 1 hr runs. - wallclock_limit="12:00:00" - gmake_j=24 - if [ -z "$CAM_BATCHQ" ]; then - export CAM_BATCHQ="long" - elif [[ "$CAM_BATCHQ" == short ]]; then - wallclock_limit="1:00:00" - fi - - if [ $gmake_j = 0 ]; then - gmake_j=24 - fi - - if [ -z "$CAM_TASKS" ]; then - CAM_TASKS=24 - fi - if [ -z "$CAM_RESTART_TASKS" ]; then - CAM_RESTART_TASKS=$(( $CAM_TASKS / 2)) - fi - - mach_workspace="/scratch/cluster" - - # Check for CESM baseline directory - if [ -n "{$BL_TESTDIR}" ] && [ ! -d "${BL_TESTDIR}" ]; then - echo "CESM_BASELINE ${BL_TESTDIR} not found. Check BL_TESTDIR for correct tag name." - exit - fi - -#------------------------------------------- - -cat > ${submit_script_cime} << EOF -#!/bin/bash -# -# Name of the queue (CHANGE THIS if needed) -#PBS -q $CAM_BATCHQ -# Number of nodes (CHANGE THIS if needed) -#PBS -l walltime=$wallclock_limit,nodes=1:ppn=24 -# output file base name -#PBS -N cime-tests -# Put standard error and standard out in same file -#PBS -j oe -# Export all Environment variables -#PBS -V -# End of options - -EOF - -##^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to batch script ^^^^^^^^^^^^^^^^^^^ - ;; - - ##izumi - izu* | i[[:digit:]]* ) - - submit_script_cime="`pwd -P`/test_driver_izumi_cime_${cur_time}.sh" - export PATH=/cluster/torque/bin:${PATH} - - # Default setting is 12 hr in the long queue; the short queue only - # allows 1 hr runs. - wallclock_limit="12:00:00" - gmake_j=24 - if [ -z "$CAM_BATCHQ" ]; then - export CAM_BATCHQ="long" - elif [[ "$CAM_BATCHQ" == short ]]; then - wallclock_limit="1:00:00" - fi - - if [ $gmake_j = 0 ]; then - gmake_j=24 - fi - - if [ -z "$CAM_TASKS" ]; then - CAM_TASKS=24 - fi - if [ -z "$CAM_RESTART_TASKS" ]; then - CAM_RESTART_TASKS=$(( $CAM_TASKS / 2)) - fi - - mach_workspace="/scratch/cluster" - - # Check for CESM baseline directory - if [ -n "{$BL_TESTDIR}" ] && [ ! -d "${BL_TESTDIR}" ]; then - echo "CESM_BASELINE ${BL_TESTDIR} not found. Check BL_TESTDIR for correct tag name." - exit - fi - -#------------------------------------------- - -cat > ${submit_script_cime} << EOF -#!/bin/bash -# -# Name of the queue (CHANGE THIS if needed) -#PBS -q $CAM_BATCHQ -# Number of nodes (CHANGE THIS if needed) -#PBS -l walltime=$wallclock_limit,nodes=1:ppn=24 -# output file base name -#PBS -N cime-tests -# Put standard error and standard out in same file -#PBS -j oe -# Export all Environment variables -#PBS -V -# End of options - -EOF - -##^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to batch script ^^^^^^^^^^^^^^^^^^^ - ;; - - ##casper - casper* | crhtc* ) - submit_script_cime="`pwd -P`/test_driver_casper_cime_${cur_time}.sh" - - if [ -z "$CAM_ACCOUNT" ]; then - echo "ERROR: Must set the environment variable CAM_ACCOUNT" - exit 2 - fi - - if [ -z "$CAM_BATCHQ" ]; then - export CAM_BATCHQ="casper" - fi - - # wallclock for run job - wallclock_limit="00:59:00" - - if [ $gmake_j = 0 ]; then - gmake_j=36 - fi - - # run tests on 1 nodes using 18 tasks/node, 2 threads/task - CAM_TASKS=18 - CAM_THREADS=2 - - # change parallel configuration on 1 nodes using 32 tasks, 1 threads/task - CAM_RESTART_TASKS=32 - CAM_RESTART_THREADS=1 - - mach_workspace="/glade/scratch" - - # Check for CESM baseline directory - if [ -n "${BL_TESTDIR}" ] && [ ! -d "${BL_TESTDIR}" ]; then - echo "CESM_BASELINE ${BL_TESTDIR} not found. Check BL_TESTDIR for correct tag name." - exit - fi - -#------------------------------------------- - -cat > ${submit_script_cime} << EOF -#!/bin/bash -# -#PBS -N cime-tests -#PBS -q $CAM_BATCHQ -#PBS -A $CAM_ACCOUNT -#PBS -l walltime=2:00:00 -#PBS -l select=1:ncpus=36:mpiprocs=36:mem=300GB -#PBS -j oe -#PBS -V -EOF - -##^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to batch script ^^^^^^^^^^^^^^^^^^^ - ;; - - * ) echo "ERROR: machine $hostname not currently supported"; exit 1 ;; -esac - - -##vvvvvvvvvvvvvvvvvvvvvv start CAM aux test suite vvvvvvvvvvvvvvvvvvvvvvvvvvvv - -cesm_test_mach="" -comp="" -if [ "${hostname:0:4}" == "chey" ]; then - cesm_test_mach="cheyenne" -fi -if [ "${hostname:0:6}" == "hobart" ]; then - cesm_test_mach="hobart" -fi -if [ "${hostname:0:5}" == "izumi" ]; then - cesm_test_mach="izumi" -fi -if [ "${hostname:0:6}" == "casper" ] || [ "${hostname:0:5}" == "crhtc" ]; then - cesm_test_mach="casper" -fi -if [ -n "${CAM_FC}" ]; then - comp="_${CAM_FC,,}" -fi - -if [ "${cesm_test_suite}" != "none" -a -n "${cesm_test_mach}" ]; then - if [ "${hostname:0:5}" != "izumi" ]; then - module load python - fi - - - for cesm_test in ${cesm_test_suite}; do - testargs="--xml-category ${cesm_test} --xml-machine ${cesm_test_mach} --retry 2" - - if [ -n "${use_existing}" ]; then - test_id="${use_existing}" - else - test_id=${cesm_test}${comp}"_"${date_str} - fi - currdir="`pwd -P`" - logfile="${currdir}/${test_id}.log" - # Create an empty logfile so that other tasks can append to it - if [ -f "${logfile}" ]; then - rm -f ${logfile} - fi - touch ${logfile} - script_dir="${CIME_ROOT}/scripts" - if [ ! -d "${script_dir}" ]; then - echo "ERROR: CIME scripts dir not found at ${script_dir}" - exit 1 - fi - if [ ! -x "${script_dir}/create_test" ]; then - echo "ERROR: create_test script dir not found in ${script_dir}" - exit 1 - fi - - ## If this is a Nag test, run the r8 and git tests - if [ "${comp}" == "_nag" ]; then - sepstr="################################################################" - echo "${sepstr}" | tee -a ${logfile} - ark_file="/fs/cgd/csm/tools/addrealkind/addrealkind" - tr8_script="${CAM_ROOT}/test/system/TR8.sh" - export ADDREALKIND_EXE="${ark_file}"; ${tr8_script} | tee -a ${logfile} - res=${PIPESTATUS[0]} - if [ $res -eq 0 ]; then - echo "TR8 test PASS" | tee -a ${logfile} - else - echo "TR8 test FAIL, rc = $res" | tee -a ${logfile} - fi - echo "${sepstr}" | tee -a ${logfile} - ${CAM_ROOT}/test/system/TGIT.sh | tee -a ${logfile} - res=${PIPESTATUS[0]} - if [ $res -eq 0 ]; then - echo "TGIT test PASS" | tee -a ${logfile} - else - echo "TGIT test FAIL, rc = $res" | tee -a ${logfile} - fi - echo "${sepstr}" | tee -a ${logfile} - fi - - ## Setup CESM work directory - if [ "${hostname:0:6}" == "casper" ] || [ "${hostname:0:5}" == "crhtc" ]; then - ## Would fail to compile on Casper with long folder name - cesm_testdir=$mach_workspace/$LOGNAME/$cesm_test - else - cesm_testdir=$mach_workspace/$LOGNAME/$test_id - fi - - if [ -e ${cesm_testdir} ]; then - if [ -n "${use_existing}" ]; then - echo " Using existing tests in ${cesm_testdir}" - else - echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! " - echo "!! ERROR: ${cesm_testdir} already exists and << --rerun-cesm >> was not specified " - echo "!! Either remove ${cesm_testdir} or specify << --rerun-cesm >> " - echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! " - exit 1 - fi - else - mkdir $cesm_testdir - fi - - if [ -n "${CAM_FC}" ]; then - testargs="${testargs} --xml-compiler ${CAM_FC,,}" - else - testargs="${testargs} --xml-compiler intel" - fi - case $hostname in - # cheyenne - chey* | r* ) - testargs="${testargs} --queue ${CAM_BATCHQ} --test-root ${cesm_testdir} --output-root ${cesm_testdir}" - ;; - # casper - casper* | crhtc* ) - testargs="${testargs} --queue ${CAM_BATCHQ} --test-root ${cesm_testdir} --output-root ${cesm_testdir}" - ;; - *) - if $batch; then - testargs="${testargs} --queue ${CAM_BATCHQ} --test-root ${cesm_testdir} --output-root ${cesm_testdir}" - else - testargs="${testargs} --test-root ${cesm_testdir} --output-root ${cesm_testdir}" - testargs="${testargs} --no-batch" - fi - esac - if [ -n "${CAM_ACCOUNT}" ]; then - testargs="${testargs} --project ${CAM_ACCOUNT}" - fi - testargs="${testargs} --test-id ${test_id}" - if [ -n "${BL_TESTDIR}" ]; then - testargs="${testargs} --compare ${BL_TESTDIR} " - fi - if [ -n "${use_existing}" ]; then - testargs="${testargs} --use-existing -o " - fi - if $namelists_only ; then - testargs="${testargs} --namelists-only " - fi - # Check for a change in BL_TESTDIR # - if [ -n "${BL_TESTDIR}" ] && [ "${use_existing}" != "" ]; then - #Check if BL_TESTDIR changed - cmd="query_testlists --xml-category $cesm_test --xml-machine ${cesm_test_mach}" - if [ -n "${CAM_FC}" ]; then - cmd="${cmd} --xml-compiler ${CAM_FC,,}" - else - cmd="${cmd} --xml-compiler intel" - fi - cmd="${CIME_ROOT}/scripts/"$cmd - cime_testlist=`$cmd` - for i in $(echo $cime_testlist | tr " " "\n") - do - if [[ $i =~ ${cesm_test_mach} ]]; then - orig_baseline=`cd $cesm_testdir/$i*$test_id && ./xmlquery BASELINE_NAME_CMP --value` - if [ $orig_baseline != ${BL_TESTDIR} ]; then - echo "Changing BL_TESTDIR for $i." - `cd $cesm_testdir/$i*$test_id && ./xmlchange BASELINE_NAME_CMP=$BL_TESTDIR` - if [[ $i == ERI* ]]; then #Need to do special stuff to get ERI to rerun with new baseline. - `cd $cesm_testdir/$i*$test_id && sed -i '/RUN/c\FAIL '$i' RUN' TestStatus` - result=`cd $cesm_testdir/$i*$test_id && pwd && ./.case.test --reset -s` - else - `cd $cesm_testdir/$i*$test_id && sed -i '/RUN/c\PEND '$i' RUN' TestStatus` - fi - else - echo "Checking for changed BL_TESTDIR for $i." - fi - fi - done - fi - - if [ "$no_baseline" != false ]; then - if [ -n "${baseline_dir}" ]; then - testargs="${testargs} --generate ${baseline_dir}" - else - testargs="${testargs} --generate ${cesm_testdir}/baselines" - fi - fi - - if [ -n "${xml_driver}" ]; then - testargs="${testargs} --xml-driver ${xml_driver}" - fi - - echo "" - echo "CESM test results will be in: ${cesm_testdir}" | tee -a ${logfile} - echo "Running ./create_test ${testargs}" | tee -a ${logfile} - - if [ "${hostname:0:2}" == "ch" ]; then - echo "cd ${script_dir}" >> ${submit_script_cime} - echo "module load python" >> ${submit_script_cime} - echo './create_test' ${testargs} >> ${submit_script_cime} - chmod u+x ${submit_script_cime} - qsub ${submit_script_cime} - fi - - if [ "${hostname:0:6}" == "hobart" ]; then - echo "cd ${script_dir}" >> ${submit_script_cime} - echo './create_test' ${testargs} >> ${submit_script_cime} - if [ "${submit_script}" != "${submit_script_cime}" ]; then - chmod u+x ${submit_script_cime} - qsub ${submit_script_cime} - fi - fi - - if [ "${hostname:0:5}" == "izumi" ]; then - echo "cd ${script_dir}" >> ${submit_script_cime} - echo './create_test' ${testargs} >> ${submit_script_cime} - if [ "${submit_script}" != "${submit_script_cime}" ]; then - chmod u+x ${submit_script_cime} - qsub ${submit_script_cime} - fi - fi - - if [ "${hostname:0:6}" == "casper" ] || [ "${hostname:0:5}" == "crhtc" ]; then - echo "cd ${script_dir}" >> ${submit_script_cime} - echo "module load python" >> ${submit_script_cime} - echo './create_test' ${testargs} >> ${submit_script_cime} - chmod u+x ${submit_script_cime} - qsub ${submit_script_cime} - fi - - done -fi - -##^^^^^^^^^^^^^^^^^^^^^^ start CAM aux test suite ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -exit 0