From af7a4bd2f336a2f8fea2790c52cbc83d73a1b9c2 Mon Sep 17 00:00:00 2001 From: Benjamin Auer Date: Mon, 15 Nov 2021 16:22:14 -0500 Subject: [PATCH 1/3] modify regrid.pl to handle gocart2g restarts as well as use the new split netcdf/binary interp_restarts.x program --- GEOS_Util/post/regrid.pl | 50 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/GEOS_Util/post/regrid.pl b/GEOS_Util/post/regrid.pl index c3199429..bda317fa 100755 --- a/GEOS_Util/post/regrid.pl +++ b/GEOS_Util/post/regrid.pl @@ -35,6 +35,7 @@ my ($rst_templateB, $scale_catchX, $scale_catchcnX, $slurmjob); my ($surfFLG, $surflay, $surflayIN, $tagIN, $tagOUT, $tarFLG); my ($upairFLG, $verbose, $wemIN, $wemOUT, $workdir); +my ($binRST); my ($year, $ymd, $zoom, $zoom_); my ($qcmd, $qwaitFLG); my (%CS, %CSo, %IN, %OUT, %SURFACE, %UPPERAIR_OPT, %UPPERAIR_REQ); @@ -164,10 +165,18 @@ "geoschemchem_internal_rst" => 1, "gmichem_internal_rst" => 1, "gocart_internal_rst" => 1, + "hemco_internal_rst" => 1, "mam_internal_rst" => 1, "matrix_internal_rst" => 1, "pchem_internal_rst" => 1, "stratchem_internal_rst" => 1, + "ss_internal_rst" => 1, + "du_internal_rst" => 1, + "cabr_internal_rst" => 1, + "cabc_internal_rst" => 1, + "caoc_internal_rst" => 1, + "ni_internal_rst" => 1, + "su_internal_rst" => 1, "tr_internal_rst" => 1); %SURFACE = ("catch_internal_rst" => 1, @@ -1291,6 +1300,11 @@ sub get_fvrst { #----------------------------- $ext = ftype($fvrst); die "Error. $fvrst not 'bin' or 'nc4';" if $ext ne "bin" and $ext ne "nc4"; + if ($ext eq 'bin') { + $binRST = 1; + } else { + $binRST = 0; + } $rst_template = "%s.%s.${ymd}_${hr}z.$ext"; $rst_templateB = "%s.%s.${ymd}_${hr}z.bin"; @@ -1489,12 +1503,13 @@ sub check_programs { die "Error. Program not found: $rs_scaleX;" unless -x $rs_scaleX; } if ($CS{$grOUT}) { - $interp_restartsX = "$ESMABIN/interp_restarts.x"; + + if ($binRST) { + $interp_restartsX = "$ESMABIN/interp_restarts_bin.x"; + } else { + $interp_restartsX = "$ESMABIN/interp_restarts.x"; + } $g5modules = "$ESMABIN/g5_modules"; - $c2cX = "$ESMABIN/c2c.x"; - die "Error. $interp_restartsX not found;" unless -e $interp_restartsX; - die "Error. $g5modules not found;" unless -e $g5modules; - die "Error. $c2cX not found;" unless -x $c2cX; } } @@ -2315,6 +2330,7 @@ sub regrid_upperair_rsts_CS { my ($type, $src, $dest, $input_nml, $FH); my ($DYN, $MOIST, $ACHEM, $CCHEM, $CARMA, $AGCM, $AGCMout, $GMICHEM, $GOCART); my ($MAM, $MATRIX, $PCHEM, $STRATCHEM, $TR); + my ($HEMCO, $SSCHEM, $DUCHEM, $NICHEM, $SUCHEM, $CABRCHEM, $CABCCHEM, $CAOCCHEM); my ($moist, $newrst, $rst, $status); my ($mynodes); @@ -2391,6 +2407,14 @@ sub regrid_upperair_rsts_CS { $PCHEM = rstname($expid, "pchem_internal_rst", $rstIN_template); $STRATCHEM = rstname($expid, "stratchem_internal_rst", $rstIN_template); $TR = rstname($expid, "tr_internal_rst", $rstIN_template); + $HEMCO = rstname($expid, "hemco_internal_rst", $rstIN_template); + $SSCHEM = rstname($expid, "ss_internal_rst", $rstIN_template); + $DUCHEM = rstname($expid, "du_internal_rst", $rstIN_template); + $NICHEM = rstname($expid, "ni_internal_rst", $rstIN_template); + $SUCHEM = rstname($expid, "su_internal_rst", $rstIN_template); + $CABRCHEM = rstname($expid, "cabr_internal_rst", $rstIN_template); + $CABCCHEM = rstname($expid, "cabc_internal_rst", $rstIN_template); + $CAOCCHEM = rstname($expid, "caoc_internal_rst", $rstIN_template); chdir_($workdir, $verbose); $ACHEM = "" unless -e $ACHEM; @@ -2404,6 +2428,14 @@ sub regrid_upperair_rsts_CS { $PCHEM = "" unless -e $PCHEM; $STRATCHEM = "" unless -e $STRATCHEM; $TR = "" unless -e $TR; + $HEMCO = "" unless -e $HEMCO; + $DUCHEM = "" unless -e $DUCHEM; + $SSCHEM = "" unless -e $SSCHEM; + $NICHEM = "" unless -e $NICHEM; + $SUCHEM = "" unless -e $SUCHEM; + $CABRCHEM = "" unless -e $CABRCHEM; + $CABCCHEM = "" unless -e $CABCCHEM; + $CAOCCHEM = "" unless -e $CAOCCHEM; $AGCMout = rstnameI(".", "agcm_import_rst"); @@ -2469,6 +2501,14 @@ sub regrid_upperair_rsts_CS { if( ".$PCHEM" != . ) /bin/ln -s $PCHEM pchem_internal_restart_in if( ".$STRATCHEM" != . ) /bin/ln -s $STRATCHEM stratchem_internal_restart_in if( ".$TR" != . ) /bin/ln -s $TR tr_internal_restart_in +if( ".$HEMCO" != . ) /bin/ln -s $HEMCO hemco_internal_restart_in +if( ".$DUCHEM" != . ) /bin/ln -s $DUCHEM du_internal_restart_in +if( ".$SSCHEM" != . ) /bin/ln -s $SSCHEM ss_internal_restart_in +if( ".$NICHEM" != . ) /bin/ln -s $NICHEM ni_internal_restart_in +if( ".$SUCHEM" != . ) /bin/ln -s $SUCHEM su_internal_restart_in +if( ".$CABRCHEM" != . ) /bin/ln -s $CABRCHEM cabr_internal_restart_in +if( ".$CABCCHEM" != . ) /bin/ln -s $CABCCHEM cabc_internal_restart_in +if( ".$CAOCCHEM" != . ) /bin/ln -s $CAOCCHEM caoc_internal_restart_in # The MERRA fvcore_internal_restarts don't include W or DZ, but we can add them by setting # HYDROSTATIC = 0 which means HYDROSTATIC = FALSE From e4a988f2056616717405954767b81f53b17f3c5d Mon Sep 17 00:00:00 2001 From: Benjamin Auer Date: Mon, 15 Nov 2021 16:27:54 -0500 Subject: [PATCH 2/3] update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1de4c733..e404034b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Ad support for gocart2g restars in regrid.pl + ### Fixed ### Changed From 56e56a8a84744ee5193087d3386b81e0ed2d37b6 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Wed, 8 Dec 2021 16:54:02 -0500 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 42dd3fe3..bf585c3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- Ad support for gocart2g restars in regrid.pl +- Add support for gocart2g restarts in regrid.pl ### Fixed