From b98e65d54e1cded5e7c91d96d8f2a5c04bf7c8ed Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 7 Oct 2021 13:47:28 -0400 Subject: [PATCH 01/16] WIP: Update regrid.pl for more options --- GEOS_Util/post/regrid.pl | 98 +++++++++++++++++++++++++++++++--------- 1 file changed, 76 insertions(+), 22 deletions(-) diff --git a/GEOS_Util/post/regrid.pl b/GEOS_Util/post/regrid.pl index c3199429..ef9389fa 100755 --- a/GEOS_Util/post/regrid.pl +++ b/GEOS_Util/post/regrid.pl @@ -23,10 +23,10 @@ # global variables #----------------- my ($ESMABIN, $ESMATAG, $bcsHEAD, $bcsHEAD_ops, $bcsTagIN, $bcsTagOUT); -my ($bkgFLG, $bkg_regrid_FLG, $c2cX, $capture, $coupled_model_dir); +my ($bkgFLG, $bkg_regrid_FLG, $c2cX, $capture, $coupled_model_dir, $new_coupled_model_dir); my ($dbHash, $debug, $drymassFLG, $dyn2dynX, $expid); -my ($g5modules, $gcmFLG, $getinput, $grIN, $grINocean, $grINocean_); -my ($grOUT, $grOUTocean, $grouplist, $grpID, $hr, $interactive); +my ($g5modules, $gcmFLG, $getinput, $grIN, $grINocean, $grINocean_, $mdlINocean); +my ($grOUT, $grOUTocean, $mdlOUTocean, $grouplist, $grpID, $hr, $interactive); my ($interp_restartsX, $landIceDT, $lblFLG, $lcvFLG, $levsIN, $levsOUT); my ($logfile, $merra, $mk_RestartsX, $mk_catch, $mk_catchcn, $mk_route); my ($mkdrstdateX, $month, $newid, $node, $noprompt, $outdir, $outdir_save); @@ -46,7 +46,7 @@ # global tag variables #--------------------- my $former_tag = "Ganymed-4_0"; # default for input restarts -my $current_tag = "Ganymed-4_0"; # default for output restarts +my $current_tag = "Icarus-NLv3"; # default for output restarts my (@GCMtags, @DAStags); my (@F14, @F20, @F21, @G10, @G10p, @G20, @G30, @G40, @INL, @ICA); @@ -90,14 +90,16 @@ # coupled ocean grids #-------------------- -%coupledFLG = ( "cc" => 1, "dd" => 1, "ee" => 1 ); -$imo{"cc"} = "360"; $jmo{"cc"} = "200"; -$imo{"dd"} = "720"; $jmo{"dd"} = "410"; +%coupledFLG = ( "aa" => 1, "cc" => 1, "dd" => 1, "ee" => 1 ); +$imo{"aa"} = "72"; $jmo{"aa"} = "36"; +$imo{"cc"} = "360"; $jmo{"cc"} = "200"; +$imo{"dd"} = "720"; $jmo{"dd"} = "410"; $imo{"ee"} = "1440"; $jmo{"ee"} = "1080"; # until an official location for coupled-model tiles is created #-------------------------------------------------------------- $coupled_model_dir = "/discover/nobackup/yvikhlia/coupled/Forcings"; +$new_coupled_model_dir = "/discover/nobackup/projects/gmao/ssd/aogcm/atmosphere_bcs"; $coupled_model_tile{"CF0048x6C_TM0360xTM0200-Pfafstetter.til"} = "${coupled_model_dir}/Ganymed/a48x288_o360x200/"; @@ -261,7 +263,9 @@ sub init { "np|noprompt" => \$noprompt, "levsout=s" => \$levsOUT, "oceanin=s" => \$grINocean, + "ocnmdlin=s" => \$mdlINocean, "oceanout=s" => \$grOUTocean, + "ocnmdlout=s" => \$mdlOUTocean, "esmabin=s" => \$ESMABIN, "iceDT=s" => \$landIceDT, "newid=s" => \$newid, @@ -535,6 +539,7 @@ sub init_tag_arrays_and_hashes { sub check_inputs { my ($ans, $arcdir, $bkg_dflt, $dflt, $fname, $fvrst); my ($grINocean_dflt, $grOUTocean_dflt, $ii); + my ($mdlINocean_dflt, $mdlOUTocean_dflt); my ($label, $landIceVERin, $landIceVERout, $lbl_dflt); my ($lcv_dflt, $len, $levsOUTdflt, $msg, $newid_dflt); my ($prompt, $rstlcvIN, $warnFLG, $wemINdflt, $wemOUTdflt); @@ -636,6 +641,7 @@ sub check_inputs { $tagIN = "Fortuna-1_4"; $grIN = "d"; $grINocean = "c"; + $mdlINocean = "data"; if ($year < 1979) { die "Error. MERRA data < 1979 not available\n" } elsif ($year < 1989) { $expid = "d5_merra_jan79" } @@ -648,6 +654,7 @@ sub check_inputs { $tagIN = "Ganymed-4_0"; $grIN = "C180"; $grINocean = "e"; + $mdlINocean = "data"; if ("$year$month" < 197901) { die "Error. MERRA-2 data < 1979 not available\n" @@ -736,8 +743,12 @@ sub check_inputs { # # For non-cubed-sphere grids, $grINocean_ = $grINocean #--------------------------------------------------------------------------- - $grINocean_dflt = "c"; - $grOUTocean_dflt = "c"; + $grINocean_dflt = "c"; + $grOUTocean_dflt = "c"; + + # These are the defaults for ocean models + $mdlINocean = "data"; + $mdlOUTocean = "data"; unless ($grINocean and ($imo{$grINocean}) and $grOUTocean and $imo{$grOUTocean}) { @@ -750,6 +761,7 @@ sub check_inputs { . "\n" . "Coupled Ocean Grids\n" . "-------------------\n" + . "aa = 72x36\n" . "cc = 360x200\n" . "dd = 720x410\n" . "ee = 1440x1080\n\n"; @@ -771,6 +783,13 @@ sub check_inputs { $grINocean_ = $grINocean unless $grINocean_; print "INPUT ocean grid: $grINocean_\n"; + if (($grINocean eq "aa") or ($grINocean eq "cc") or + ($grINocean eq "dd") or ($grINocean eq "ee")) { + until (($mdlINocean eq "MOM5") or ($mdlINocean eq "MOM6")) { + $mdlINocean = query("Coupled model output requested, Enter OUTPUT ocean model (MOM5 or MOM6):"); + } + } + # output ocean grid: $grOUTocean #------------------------------- until ($grOUTocean and $imo{$grOUTocean}) { @@ -786,6 +805,12 @@ sub check_inputs { $jmo4{"CS"} = $jm4{$grOUT}; } print "OUTPUT ocean grid: $grOUTocean\n"; + if (($grOUTocean eq "aa") or ($grOUTocean eq "cc") or + ($grOUTocean eq "dd") or ($grOUTocean eq "ee")) { + until (($mdlOUTocean eq "MOM5") or ($mdlOUTocean eq "MOM6")) { + $mdlOUTocean = query("Coupled model output requested, Enter OUTPUT ocean model (MOM5 or MOM6):"); + } + } # check tag info: $tagIN and $tagOUT #----------------------------------- @@ -2079,7 +2104,11 @@ sub set_IN_OUT { $bcsdir = "$bcsHEAD/$bcsTAG/$gridID"; } if ($coupledFLG{$ogrid}) { - $bcsdir = (<${bcsdir}*>)[0]; + if ($rank{$bcsTAG} >= $rank{"Icarus-NLv3_Reynolds"}) { + $bcsdir = "$new_coupled_model_dir/Icarus-NLv3/$mdlOUTocean/$gridID_tile"; + } else { + $bcsdir = (<${bcsdir}*>)[0]; + } } die "Error; Cannot find bcs directory: $bcsdir;" unless -d $bcsdir; @@ -2102,9 +2131,14 @@ sub set_IN_OUT { } $tile = "$bcsdir/$tile"; + # Coupled tile files if ($coupledFLG{$ogrid}) { $tile = "${gridID_tile}-Pfafstetter.til"; - $tile = "$coupled_model_tile{$tile}/$tile"; + if ($rank{$bcsTAG} >= $rank{"Icarus-NLv3_Reynolds"}) { + $tile = "$bcsdir/$tile"; + } else { + $tile = "$coupled_model_tile{$tile}/$tile"; + } } die "Error. Cannot find tile file: $tile" unless -f $tile; @@ -3341,6 +3375,7 @@ sub write_CMD_file { } $capture .= " -tagin $tagIN" if $capture !~ m/\s+\-tagin\b/; $capture .= " -oceanin $grINocean_" if $capture !~ m/\s+\-oceanin\b/; + $capture .= " -ocnmdlin $mdlINocean" if $capture !~ m/\s+\-ocnmdlin\b/; } if ($interactive) { @@ -3365,6 +3400,7 @@ sub write_CMD_file { $capture .= " -rs $rsFLG" if $capture !~ m/\s+\-rs\b/; $capture .= " -oceanout $grOUTocean" if $capture !~ m/\s+\-oceanout\b/; + $capture .= " -ocnmdlout $mdlOUTocean" if $capture !~ m/\s+\-ocnmdlout\b/; if ($mk_catchcn) { $capture .= " -catchcn" if $capture !~ m/\s+\-catchcn\b/; @@ -3905,15 +3941,26 @@ sub usage { note: the -np flag takes precedence over the -i flag OTHER OPTIONS - -levsout levsout number of atmosphere levels in output - -oceanin oceanIN ocean horizontal grid of inputs - =c : 1-deg (360x180); e.g. Reynolds - =e : 1/4-deg (1440x720); e.g. MERRA-2 - =f : 1/8-deg (2880x1440); e.g. OSTIA - =CS : OSTIA regridded to cubed-sphere - defaults to \'c\' - -oceanout oceanOUT ocean horizontal grid of outputs (see -oceanIN) - -esmabin ESMABIN location of build\'s scripts and programs; defaults to location + -levsout levsout number of atmosphere levels in output + -oceanin oceanIN ocean horizontal grid of inputs + data ocean grids + =c : 1-deg (360x180); e.g. Reynolds + =e : 1/4-deg (1440x720); e.g. MERRA-2 + =f : 1/8-deg (2880x1440); e.g. OSTIA + =CS : OSTIA regridded to cubed-sphere + coupled ocean grids (requires choice of ocean model) + =aa : 5-deg (72x36) + =cc : 1-deg (360x200) + =dd : 1/2-deg (720x410) + =ee : 1/4-deg (1440x1080) + defaults to \'c\' + -ocnmdlin oceanMDL ocean input model + data : data ocean (default) + MOM5 : MOM5 + MOM6 : MOM6 + -oceanout oceanOUT ocean horizontal grid of outputs (see -oceanin) + -ocnmdlout oceanMDL ocean output model (see -ocnmdlin) + -esmabin ESMABIN location of build\'s scripts and programs; defaults to location of regrid.pl script -iceDT dtime datetime for alternate landice rst input if regridding to \'Ganymed-2_0\' from earlier tag; dtime should have the @@ -3985,13 +4032,20 @@ sub usage { ------------------ Cn, where n = {12, 24, 48, 90, 180, 360, 500, 720, 1000, 1440, 2000, 2880, 5760} - Ocean Horizontal Grids - ====================== + Data Ocean Horizontal Grids + =========================== c = 1-deg (360x180); e.g. Reynolds e = 1/4-deg (1440x720) ; e.g. MERRA-2 f = 1/8-deg (2880x1440); e.g. OSTIA CS = OSTIA regridded to cubed-sphere grid + Coupled Ocean Horizontal Grids + ============================== + aa = 5-deg (72x36) (MOM6 only) + cc = 1-deg (360x200) + dd = 1/2-deg (720x410) + ee = 1/4-deg (1440x1080) + TAGS Use GCM or DAS tag names with -tagin and -tagout flags From 8d4b12114dff72cb541149c09ce2900738ebc81c Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 14 Oct 2021 12:09:57 -0400 Subject: [PATCH 02/16] Update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58b8f9f8..24c1edfd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Update `regrid.pl` + - Add options for MOM5 and MOM6 tile files + ### Removed ## [1.4.10] - 2021-10-08 From 8b1df206067cca2d1d641a18180b35ec8958a01f Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 14 Oct 2021 16:37:33 -0400 Subject: [PATCH 03/16] A few more fixes --- GEOS_Util/post/regrid.pl | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/GEOS_Util/post/regrid.pl b/GEOS_Util/post/regrid.pl index ef9389fa..80f0d770 100755 --- a/GEOS_Util/post/regrid.pl +++ b/GEOS_Util/post/regrid.pl @@ -26,7 +26,7 @@ my ($bkgFLG, $bkg_regrid_FLG, $c2cX, $capture, $coupled_model_dir, $new_coupled_model_dir); my ($dbHash, $debug, $drymassFLG, $dyn2dynX, $expid); my ($g5modules, $gcmFLG, $getinput, $grIN, $grINocean, $grINocean_, $mdlINocean); -my ($grOUT, $grOUTocean, $mdlOUTocean, $grouplist, $grpID, $hr, $interactive); +my ($grOUT, $grOUTocean, $grOUTocean_, $mdlOUTocean, $grouplist, $grpID, $hr, $interactive); my ($interp_restartsX, $landIceDT, $lblFLG, $lcvFLG, $levsIN, $levsOUT); my ($logfile, $merra, $mk_RestartsX, $mk_catch, $mk_catchcn, $mk_route); my ($mkdrstdateX, $month, $newid, $node, $noprompt, $outdir, $outdir_save); @@ -747,8 +747,8 @@ sub check_inputs { $grOUTocean_dflt = "c"; # These are the defaults for ocean models - $mdlINocean = "data"; - $mdlOUTocean = "data"; + $mdlINocean_dflt = "data"; + $mdlOUTocean_dflt = "data"; unless ($grINocean and ($imo{$grINocean}) and $grOUTocean and $imo{$grOUTocean}) { @@ -788,7 +788,10 @@ sub check_inputs { until (($mdlINocean eq "MOM5") or ($mdlINocean eq "MOM6")) { $mdlINocean = query("Coupled model output requested, Enter OUTPUT ocean model (MOM5 or MOM6):"); } + } else { + $mdlINocean = $mdlINocean_dflt } + print "INPUT ocean model $mdlINocean\n"; # output ocean grid: $grOUTocean #------------------------------- @@ -804,13 +807,17 @@ sub check_inputs { $imo4{"CS"} = $im4{$grOUT}; $jmo4{"CS"} = $jm4{$grOUT}; } - print "OUTPUT ocean grid: $grOUTocean\n"; + $grOUTocean_ = $grOUTocean unless $grOUTocean_; + print "OUTPUT ocean grid: $grOUTocean_\n"; if (($grOUTocean eq "aa") or ($grOUTocean eq "cc") or ($grOUTocean eq "dd") or ($grOUTocean eq "ee")) { until (($mdlOUTocean eq "MOM5") or ($mdlOUTocean eq "MOM6")) { $mdlOUTocean = query("Coupled model output requested, Enter OUTPUT ocean model (MOM5 or MOM6):"); } + } else { + $mdlOUTocean = $mdlOUTocean_dflt } + print "OUTPUT ocean model $mdlOUTocean\n"; # check tag info: $tagIN and $tagOUT #----------------------------------- @@ -1952,6 +1959,9 @@ sub set_IN_OUT { $IN{"ogrid_"} = $grINocean_; # used for display purposes $OUT{"ogrid_"} = $grOUTocean; + $IN{"omdl"} = $mdlINocean; + $OUT{"omdl"} = $mdlOUTocean; + # bkg_eta grid value #------------------- if ($bkg_regrid_FLG) { @@ -2223,6 +2233,7 @@ sub confirm_inputs { . ". atmos grid: $IN{atmos3} ($IN{agrid})\n" . ". atmos levs: $IN{levs}\n" . ". ocean grid: $IN{ocean} ($IN{ogrid_})\n" + . ". ocean model: $IN{omdl}\n" . ". bcsdir: $IN{bcsdir}\n" . ". tile file: $IN{tile}\n" . ". BCS tag: $IN{bcsTAG}\n"); @@ -2249,6 +2260,7 @@ sub confirm_inputs { . ". atmos grid: $OUT{atmos3} ($OUT{agrid})\n" . ". atmos levs: $OUT{levs}\n" . ". ocean grid: $OUT{ocean} ($OUT{ogrid})\n" + . ". ocean model: $OUT{omdl}\n" . ". bcsdir: $OUT{bcsdir}\n" . ". tile file: $OUT{tile}\n"); print_( ". bkg_eta grid: $OUT{bkg_regrid}\n") if $OUT{"bkg_regrid"}; From 55b63bbcb8b04bf1cca1d84e085da13392f88b39 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Mon, 18 Oct 2021 14:05:22 -0400 Subject: [PATCH 04/16] Fix output to input --- GEOS_Util/post/regrid.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GEOS_Util/post/regrid.pl b/GEOS_Util/post/regrid.pl index 80f0d770..b42d9b70 100755 --- a/GEOS_Util/post/regrid.pl +++ b/GEOS_Util/post/regrid.pl @@ -786,7 +786,7 @@ sub check_inputs { if (($grINocean eq "aa") or ($grINocean eq "cc") or ($grINocean eq "dd") or ($grINocean eq "ee")) { until (($mdlINocean eq "MOM5") or ($mdlINocean eq "MOM6")) { - $mdlINocean = query("Coupled model output requested, Enter OUTPUT ocean model (MOM5 or MOM6):"); + $mdlINocean = query("Coupled model input requested, Enter INPUT ocean model (MOM5 or MOM6):"); } } else { $mdlINocean = $mdlINocean_dflt From 82fab465c229ababe7cc85bea54163289a390ffa Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Mon, 18 Oct 2021 14:06:35 -0400 Subject: [PATCH 05/16] Add colons --- GEOS_Util/post/regrid.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GEOS_Util/post/regrid.pl b/GEOS_Util/post/regrid.pl index b42d9b70..c323ae7d 100755 --- a/GEOS_Util/post/regrid.pl +++ b/GEOS_Util/post/regrid.pl @@ -791,7 +791,7 @@ sub check_inputs { } else { $mdlINocean = $mdlINocean_dflt } - print "INPUT ocean model $mdlINocean\n"; + print "INPUT ocean model: $mdlINocean\n"; # output ocean grid: $grOUTocean #------------------------------- @@ -817,7 +817,7 @@ sub check_inputs { } else { $mdlOUTocean = $mdlOUTocean_dflt } - print "OUTPUT ocean model $mdlOUTocean\n"; + print "OUTPUT ocean model: $mdlOUTocean\n"; # check tag info: $tagIN and $tagOUT #----------------------------------- From d57073c9f1a313b9002567cd1bf0dfc85c8b920c Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Mon, 18 Oct 2021 14:23:19 -0400 Subject: [PATCH 06/16] Prevent uninit value --- GEOS_Util/post/regrid.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/GEOS_Util/post/regrid.pl b/GEOS_Util/post/regrid.pl index c323ae7d..d97588ef 100755 --- a/GEOS_Util/post/regrid.pl +++ b/GEOS_Util/post/regrid.pl @@ -750,6 +750,9 @@ sub check_inputs { $mdlINocean_dflt = "data"; $mdlOUTocean_dflt = "data"; + $mdlINocean = $mdlINocean_dflt; + $mdlOUTocean = $mdlOUTocean_dflt; + unless ($grINocean and ($imo{$grINocean}) and $grOUTocean and $imo{$grOUTocean}) { print "\nOcean Grids\n" From 1f7a92db47a014ae214f7073152de3ebe1101ec4 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 28 Oct 2021 11:18:30 -0400 Subject: [PATCH 07/16] Add model type question This PR adds questions so that you say input ocean model. if data, then output is assumed data. If the input model is not data, then it will ask what output model you want. --- GEOS_Util/post/regrid.pl | 209 ++++++++++++++++++++++----------------- 1 file changed, 120 insertions(+), 89 deletions(-) diff --git a/GEOS_Util/post/regrid.pl b/GEOS_Util/post/regrid.pl index d97588ef..53dad411 100755 --- a/GEOS_Util/post/regrid.pl +++ b/GEOS_Util/post/regrid.pl @@ -38,7 +38,7 @@ my ($year, $ymd, $zoom, $zoom_); my ($qcmd, $qwaitFLG); my (%CS, %CSo, %IN, %OUT, %SURFACE, %UPPERAIR_OPT, %UPPERAIR_REQ); -my (%atmLevs, %coupledFLG, %coupled_model_tile, %hgrd, %iceIN); +my (%atmLevs, %dataFLG, %coupledFLG, %coupledMDLFLG, %coupled_model_tile, %hgrd, %iceIN); my (%im, %im4, %imo, %imo4, %input_restarts); my (%jm, %jm4, %jm5, %jmo, %jmo4, %newLand); my (@anafiles, @cnlist, @warnings); @@ -75,8 +75,9 @@ $atmLevs{"144"} = "144"; $atmLevs{"181"} = "181"; -# ocean grids -#------------ +# data ocean grids +#----------------- +%dataFLG = ( "c" => 1, "e" => 1, "f" => 1, "CS" => 1 ); $imo{"c"} = "360"; $jmo{"c"} = "180"; # Reynolds $imo{"e"} = "1440"; $jmo{"e"} = "720"; # MERRA-2 $imo{"f"} = "2880"; $jmo{"f"} = "1440"; # OSTIA @@ -88,6 +89,10 @@ $jmo{"C$_"} = 6*$_; } +# coupled ocean models +#--------------------- +%coupledMDLFLG = ( "MOM5" => 1, "MOM6" => 1 ); + # coupled ocean grids #-------------------- %coupledFLG = ( "aa" => 1, "cc" => 1, "dd" => 1, "ee" => 1 ); @@ -538,8 +543,9 @@ sub init_tag_arrays_and_hashes { #======================================================================= sub check_inputs { my ($ans, $arcdir, $bkg_dflt, $dflt, $fname, $fvrst); - my ($grINocean_dflt, $grOUTocean_dflt, $ii); - my ($mdlINocean_dflt, $mdlOUTocean_dflt); + my ($grINocean_data_dflt, $grOUTocean_data_dflt, $ii); + my ($grINocean_coupled_dflt, $grOUTocean_coupled_dflt); + my ($mdlINocean_dflt, $mdlOUTocean_coupled_dflt); my ($label, $landIceVERin, $landIceVERout, $lbl_dflt); my ($lcv_dflt, $len, $levsOUTdflt, $msg, $newid_dflt); my ($prompt, $rstlcvIN, $warnFLG, $wemINdflt, $wemOUTdflt); @@ -642,6 +648,7 @@ sub check_inputs { $grIN = "d"; $grINocean = "c"; $mdlINocean = "data"; + $mdlOUTocean = "data"; if ($year < 1979) { die "Error. MERRA data < 1979 not available\n" } elsif ($year < 1989) { $expid = "d5_merra_jan79" } @@ -655,6 +662,7 @@ sub check_inputs { $grIN = "C180"; $grINocean = "e"; $mdlINocean = "data"; + $mdlOUTocean = "data"; if ("$year$month" < 197901) { die "Error. MERRA-2 data < 1979 not available\n" @@ -743,84 +751,104 @@ sub check_inputs { # # For non-cubed-sphere grids, $grINocean_ = $grINocean #--------------------------------------------------------------------------- - $grINocean_dflt = "c"; - $grOUTocean_dflt = "c"; + $grINocean_data_dflt = "c"; + $grOUTocean_data_dflt = "c"; - # These are the defaults for ocean models - $mdlINocean_dflt = "data"; - $mdlOUTocean_dflt = "data"; + $grINocean_coupled_dflt = "dd"; + $grOUTocean_coupled_dflt = "dd"; - $mdlINocean = $mdlINocean_dflt; - $mdlOUTocean = $mdlOUTocean_dflt; + # These are the defaults for ocean model + $mdlINocean_dflt = "data"; + $mdlOUTocean_coupled_dflt = "MOM6"; # We don't need a default if dataocean in + + unless ($mdlINocean) { + print "\nOcean Models\n" + . "------------\n" + . "data (Reynolds, MERRA-2, Ostia, Cubed-Sphere)\n" + . "MOM5 \n" + . "MOM6 \n" + . "\n"; + until ($mdlINocean and ( ($mdlINocean eq "data") or ($coupledMDLFLG{$mdlINocean}) ) ) { + $mdlINocean = query("Enter INPUT ocean model", $mdlINocean_dflt); + } + } + print "INPUT ocean model: $mdlINocean\n"; - unless ($grINocean and ($imo{$grINocean}) and + unless ($grINocean and $imo{$grINocean} and $grOUTocean and $imo{$grOUTocean}) { - print "\nOcean Grids\n" - . "-----------\n" - . "c = 360x180 (Reynolds)\n" - . "e = 1440x720 (MERRA-2)\n" - . "f = 2880x1440 (OSTIA)\n" - . "CS = same as atmosphere (OSTIA cubed-sphere)\n" - . "\n" - . "Coupled Ocean Grids\n" - . "-------------------\n" - . "aa = 72x36\n" - . "cc = 360x200\n" - . "dd = 720x410\n" - . "ee = 1440x1080\n\n"; - } - until ($grINocean and $imo{$grINocean}) { - $grINocean = query("Enter INPUT ocean grid:", $grINocean_dflt); - } - if (($grINocean eq "CS") or ($grINocean eq "CSi")) { - unless ($CSo{$grIN}) { - die "Error. Cannot have cubed ocean with atmosphere grid $grIN"; - } - $grINocean = "CSi"; - $grINocean_ = "CS"; - $imo{"CSi"} = $im{$grIN}; - $jmo{"CSi"} = $jm{$grIN}; - $imo4{"CSi"} = $im4{$grIN}; - $jmo4{"CSi"} = $jm4{$grIN}; - } - $grINocean_ = $grINocean unless $grINocean_; + if ($mdlINocean eq "data") { + print "\nData Ocean Grids\n" + . "----------------\n" + . "c = 360x180 (Reynolds)\n" + . "e = 1440x720 (MERRA-2)\n" + . "f = 2880x1440 (OSTIA)\n" + . "CS = same as atmosphere (OSTIA cubed-sphere)\n" + . "\n"; + until ($grINocean and $imo{$grINocean} and $dataFLG{$grINocean}) { + $grINocean = query("Enter INPUT ocean grid:", $grINocean_data_dflt); + } + if (($grINocean eq "CS") or ($grINocean eq "CSi")) { + unless ($CSo{$grIN}) { + die "Error. Cannot have cubed ocean with atmosphere grid $grIN"; + } + $grINocean = "CSi"; + $grINocean_ = "CS"; + $imo{"CSi"} = $im{$grIN}; + $jmo{"CSi"} = $jm{$grIN}; + $imo4{"CSi"} = $im4{$grIN}; + $jmo4{"CSi"} = $jm4{$grIN}; + } + $grINocean_ = $grINocean unless $grINocean_; + } else { + print "\nCoupled Ocean Grids\n" + . "-------------------\n" + . "aa = 72x36\n" + . "cc = 360x200\n" + . "dd = 720x410\n" + . "ee = 1440x1080\n\n"; + until ($grINocean and $imo{$grINocean} and $coupledFLG{$grINocean}) { + $grINocean = query("Enter INPUT ocean grid:", $grINocean_coupled_dflt); + } + $grINocean_ = $grINocean; + } + } print "INPUT ocean grid: $grINocean_\n"; - if (($grINocean eq "aa") or ($grINocean eq "cc") or - ($grINocean eq "dd") or ($grINocean eq "ee")) { - until (($mdlINocean eq "MOM5") or ($mdlINocean eq "MOM6")) { - $mdlINocean = query("Coupled model input requested, Enter INPUT ocean model (MOM5 or MOM6):"); - } + # output ocean model $mdlOUTocean + #-------------------------------- + # If dataocean, we can only output data ocean, but if coupled, we can choose + if ($mdlINocean eq "data") { + $mdlOUTocean = "data" } else { - $mdlINocean = $mdlINocean_dflt + until ($mdlOUTocean and $coupledMDLFLG{$mdlOUTocean}) { + $mdlOUTocean = query("Enter OUTPUT ocean model", $mdlOUTocean_coupled_dflt); + } } - print "INPUT ocean model: $mdlINocean\n"; + print "OUTPUT ocean model: $mdlOUTocean\n"; # output ocean grid: $grOUTocean #------------------------------- - until ($grOUTocean and $imo{$grOUTocean}) { - $grOUTocean = query("Enter OUTPUT ocean grid:", $grOUTocean_dflt); - } - if ($grOUTocean eq "CS") { - unless ($CSo{$grOUT}) { - die "Error. Cannot have cubed ocean with atmosphere grid $grOUT;"; - } - $imo{"CS"} = $im{$grOUT}; - $jmo{"CS"} = $jm{$grOUT}; - $imo4{"CS"} = $im4{$grOUT}; - $jmo4{"CS"} = $jm4{$grOUT}; - } - $grOUTocean_ = $grOUTocean unless $grOUTocean_; - print "OUTPUT ocean grid: $grOUTocean_\n"; - if (($grOUTocean eq "aa") or ($grOUTocean eq "cc") or - ($grOUTocean eq "dd") or ($grOUTocean eq "ee")) { - until (($mdlOUTocean eq "MOM5") or ($mdlOUTocean eq "MOM6")) { - $mdlOUTocean = query("Coupled model output requested, Enter OUTPUT ocean model (MOM5 or MOM6):"); - } + if ($mdlOUTocean eq "data") { + until ($grOUTocean and $imo{$grOUTocean} and $dataFLG{$grOUTocean}) { + $grOUTocean = query("Enter OUTPUT ocean grid:", $grOUTocean_data_dflt); + } + if ($grOUTocean eq "CS") { + unless ($CSo{$grOUT}) { + die "Error. Cannot have cubed ocean with atmosphere grid $grOUT;"; + } + $imo{"CS"} = $im{$grOUT}; + $jmo{"CS"} = $jm{$grOUT}; + $imo4{"CS"} = $im4{$grOUT}; + $jmo4{"CS"} = $jm4{$grOUT}; + } + $grOUTocean_ = $grOUTocean unless $grOUTocean_; } else { - $mdlOUTocean = $mdlOUTocean_dflt + until ($grOUTocean and $imo{$grOUTocean} and $coupledFLG{$grOUTocean}) { + $grOUTocean = query("Enter OUTPUT ocean grid:", $grOUTocean_coupled_dflt); + } + $grOUTocean_ = $grOUTocean; } - print "OUTPUT ocean model: $mdlOUTocean\n"; + print "OUTPUT ocean grid: $grOUTocean_\n"; # check tag info: $tagIN and $tagOUT #----------------------------------- @@ -3956,25 +3984,27 @@ sub usage { note: the -np flag takes precedence over the -i flag OTHER OPTIONS - -levsout levsout number of atmosphere levels in output - -oceanin oceanIN ocean horizontal grid of inputs - data ocean grids - =c : 1-deg (360x180); e.g. Reynolds - =e : 1/4-deg (1440x720); e.g. MERRA-2 - =f : 1/8-deg (2880x1440); e.g. OSTIA - =CS : OSTIA regridded to cubed-sphere - coupled ocean grids (requires choice of ocean model) - =aa : 5-deg (72x36) - =cc : 1-deg (360x200) - =dd : 1/2-deg (720x410) - =ee : 1/4-deg (1440x1080) - defaults to \'c\' - -ocnmdlin oceanMDL ocean input model - data : data ocean (default) - MOM5 : MOM5 - MOM6 : MOM6 - -oceanout oceanOUT ocean horizontal grid of outputs (see -oceanin) - -ocnmdlout oceanMDL ocean output model (see -ocnmdlin) + -levsout levsout number of atmosphere levels in output + -ocnmdlin ocnMDLIN ocean input model + data : data ocean (Reynolds, MERRA-2, Ostia, CS) + MOM5 : MOM5 + MOM6 : MOM6 + NOTE: If data in, only data out allowed + -oceanin oceanIN ocean horizontal grid of inputs + data ocean grids + =c : 1-deg (360x180); e.g. Reynolds + =e : 1/4-deg (1440x720); e.g. MERRA-2 + =f : 1/8-deg (2880x1440); e.g. OSTIA + =CS : OSTIA regridded to cubed-sphere + defaults to \'c\' + coupled ocean grids (requires choice of ocean model) + =aa : 5-deg (72x36) + =cc : 1-deg (360x200) + =dd : 1/2-deg (720x410) + =ee : 1/4-deg (1440x1080) + defaults to \'dd\' + -ocnmdlout ocnMDLOUT ocean model of outputs (see -ocnmdlin) + -oceanout oceanOUT ocean horizontal grid of outputs (see -oceanin) -esmabin ESMABIN location of build\'s scripts and programs; defaults to location of regrid.pl script -iceDT dtime datetime for alternate landice rst input if regridding to @@ -4090,6 +4120,7 @@ sub usage { AUTHOR Joe Stassi, SSAI (joe.stassi\@nasa.gov) + Matthew Thompson, SSAI (matthew.thompson\@nasa.gov) EOF ; From b6053072e141beebcc21959d64c331502011ddf9 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 28 Oct 2021 11:19:53 -0400 Subject: [PATCH 08/16] Remove perl glob, be explicit --- GEOS_Util/post/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/GEOS_Util/post/CMakeLists.txt b/GEOS_Util/post/CMakeLists.txt index 9675e374..774fe353 100644 --- a/GEOS_Util/post/CMakeLists.txt +++ b/GEOS_Util/post/CMakeLists.txt @@ -38,7 +38,12 @@ set_target_properties(stats.x PROPERTIES Fortran_MODULE_DIRECTORY ${include_${th ecbuild_add_executable (TARGET convert_aerosols.x SOURCES convert_aerosols.F) -file(GLOB perlscripts CONFIGURE_DEPENDS *.pl) +set (perlscripts + ecmwf2geos.pl + g5fcst_stats.pl + ncep2geos.pl + regrid.pl + ) install( PROGRAMS ${perlscripts} ec2grd.csh DESTINATION bin) From c2bbdae426d703b4ee695e7c324435378b9e1f56 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 28 Oct 2021 11:49:56 -0400 Subject: [PATCH 09/16] Add constraint flag --- GEOS_Util/post/regrid.pl | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/GEOS_Util/post/regrid.pl b/GEOS_Util/post/regrid.pl index 53dad411..fce5fb4c 100755 --- a/GEOS_Util/post/regrid.pl +++ b/GEOS_Util/post/regrid.pl @@ -30,7 +30,7 @@ my ($interp_restartsX, $landIceDT, $lblFLG, $lcvFLG, $levsIN, $levsOUT); my ($logfile, $merra, $mk_RestartsX, $mk_catch, $mk_catchcn, $mk_route); my ($mkdrstdateX, $month, $newid, $node, $noprompt, $outdir, $outdir_save); -my ($qos, $partition, $regridj, $rsFLG, $rstdir, $rstTAR, $rs_hinterpX, $rs_scaleX); +my ($qos, $partition, $constraint, $regridj, $rsFLG, $rstdir, $rstTAR, $rs_hinterpX, $rs_scaleX); my ($rstIN_template, $rstIN_templateB, $rst_tarfile, $rst_template); my ($rst_templateB, $scale_catchX, $scale_catchcnX, $slurmjob); my ($surfFLG, $surflay, $surflayIN, $tagIN, $tagOUT, $tarFLG); @@ -290,6 +290,7 @@ sub init { "grpid=s" => \$grpID, "qos=s" => \$qos, "partition=s" => \$partition, + "constraint=s" => \$constraint, "altbcs:s{,1}" => \$bcsALT, "zoom=i" => \$zoom, "db|debug|nc" => \$debug, @@ -303,6 +304,7 @@ sub init { $verbose = 0 unless $verbose; $qos = 0 unless $qos; $partition = 0 unless $partition; + $constraint = "sky" unless $constraint; usage() if $help; setprompt(0) if $noprompt; @@ -2393,7 +2395,7 @@ sub regrid_upperair_rsts_CS { my ($DYN, $MOIST, $ACHEM, $CCHEM, $CARMA, $AGCM, $AGCMout, $GMICHEM, $GOCART); my ($MAM, $MATRIX, $PCHEM, $STRATCHEM, $TR); my ($moist, $newrst, $rst, $status); - my ($mynodes); + my (%allowedConstraint); $im = $im{$grOUT}; if ($im eq "12") { $NPE = 12; $nwrit = 1 } @@ -2425,6 +2427,11 @@ sub regrid_upperair_rsts_CS { if ($im >= "2880") { $MEMPERCPU = "--mem-per-cpu=4G"} else { $MEMPERCPU = "" } + %allowedConstraint = ( "hasw" => 1, "sky" => 1, "cas" => 1); + unless($allowedConstraint{$constraint}) { + die "Error. Constraint $constraint is not allowed."; + } + # MAT Workaround C180 -> C720 cannot run on 192 # --------------------------------------------- if (($im{$grIN} eq "180") and ($im eq "720")) { $NPE = 96 } @@ -2484,13 +2491,6 @@ sub regrid_upperair_rsts_CS { $AGCMout = rstnameI(".", "agcm_import_rst"); - my $npn = `facter processorcount`; chomp($npn); - if ( $npn == 40 ) { - $mynodes = "sky"; - } else { - $mynodes = "hasw"; - } - # write input.nml file #--------------------- $input_nml = "$workdir/input.nml"; @@ -2519,7 +2519,7 @@ sub regrid_upperair_rsts_CS { #SBATCH --time=1:00:00 #SBATCH --ntasks=${NPE} ${MEMPERCPU} #SBATCH --job-name=regrid -#SBATCH --constraint=$mynodes +#SBATCH --constraint=$constraint #$QOSline #$PARTline @@ -2877,6 +2877,7 @@ sub regrid_surface_rsts { $flags .= " -rsttime $ymd$hr" if $mk_catchcn or $mk_route; $flags .= " -qos $qos" if ($mk_catch or $mk_catchcn) and $qos; $flags .= " -partition $partition" if ($mk_catch or $mk_catchcn) and $partition; + $flags .= " -constraint $constraint" if ($mk_catch or $mk_catchcn) and $constraint; } $flags .= " -zoom $zoom" if $zoom; @@ -3054,6 +3055,7 @@ sub regrid_surface_rsts { $flags .= " -zoom $zoom" if $zoom; $flags .= " -qos $qos" if ($mk_catch or $mk_catchcn) and $qos; $flags .= " -partition $partition" if ($mk_catch or $mk_catchcn) and $partition; + $flags .= " -constraint $constraint" if ($mk_catch or $mk_catchcn) and $constraint; #--$flags .= " -walltime 2:00:00" if $mk_catchcn; #--$flags .= " -ntasks 112" if $mk_catchcn; @@ -4054,6 +4056,7 @@ sub usage { -> numtasks <= 532 -> walltime le \'1:00:00\' -partition val use \'SBATCH --partition=val directive\' for batch jobs + -constraint val use \'SBATCH --constraint=val directive\' for batch jobs -db (debug mode) Do not clean work directory after running programs; -dbh (debug hash) Show contents of hashes: \%IN and \%OUT -v verbose mode From 07e6e9e34cbebba9130639c785fd2e014e2a142f Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Mon, 1 Nov 2021 15:17:44 -0400 Subject: [PATCH 10/16] Capture wemin and wemout --- GEOS_Util/post/regrid.pl | 46 +++++++++++++--------------------------- 1 file changed, 15 insertions(+), 31 deletions(-) diff --git a/GEOS_Util/post/regrid.pl b/GEOS_Util/post/regrid.pl index fce5fb4c..72cefb69 100755 --- a/GEOS_Util/post/regrid.pl +++ b/GEOS_Util/post/regrid.pl @@ -23,7 +23,7 @@ # global variables #----------------- my ($ESMABIN, $ESMATAG, $bcsHEAD, $bcsHEAD_ops, $bcsTagIN, $bcsTagOUT); -my ($bkgFLG, $bkg_regrid_FLG, $c2cX, $capture, $coupled_model_dir, $new_coupled_model_dir); +my ($bkgFLG, $bkg_regrid_FLG, $c2cX, $capture, $coupled_model_dir); my ($dbHash, $debug, $drymassFLG, $dyn2dynX, $expid); my ($g5modules, $gcmFLG, $getinput, $grIN, $grINocean, $grINocean_, $mdlINocean); my ($grOUT, $grOUTocean, $grOUTocean_, $mdlOUTocean, $grouplist, $grpID, $hr, $interactive); @@ -38,7 +38,7 @@ my ($year, $ymd, $zoom, $zoom_); my ($qcmd, $qwaitFLG); my (%CS, %CSo, %IN, %OUT, %SURFACE, %UPPERAIR_OPT, %UPPERAIR_REQ); -my (%atmLevs, %dataFLG, %coupledFLG, %coupledMDLFLG, %coupled_model_tile, %hgrd, %iceIN); +my (%atmLevs, %dataFLG, %coupledFLG, %coupledMDLFLG, %hgrd, %iceIN); my (%im, %im4, %imo, %imo4, %input_restarts); my (%jm, %jm4, %jm5, %jmo, %jmo4, %newLand); my (@anafiles, @cnlist, @warnings); @@ -103,26 +103,7 @@ # until an official location for coupled-model tiles is created #-------------------------------------------------------------- -$coupled_model_dir = "/discover/nobackup/yvikhlia/coupled/Forcings"; -$new_coupled_model_dir = "/discover/nobackup/projects/gmao/ssd/aogcm/atmosphere_bcs"; - -$coupled_model_tile{"CF0048x6C_TM0360xTM0200-Pfafstetter.til"} = - "${coupled_model_dir}/Ganymed/a48x288_o360x200/"; - -$coupled_model_tile{"CF0090x6C_TM0360xTM0200-Pfafstetter.til"} = - "${coupled_model_dir}/a90x540_o360x200"; - -$coupled_model_tile{"CF0090x6C_TM0720xTM0410-Pfafstetter.til"} = - "${coupled_model_dir}/Ganymed/a90x540_o720x410"; - -$coupled_model_tile{"CF0090x6C_TM1440xTM1080-Pfafstetter.til"} = - "${coupled_model_dir}/Ganymed/a90x540_o1440x1080"; - -$coupled_model_tile{"CF0180x6C_TM0720xTM0410-Pfafstetter.til"} = - "${coupled_model_dir}/a180x1080_o720x410"; - -$coupled_model_tile{"CF0180x6C_TM1440xTM1080-Pfafstetter.til"} = - "${coupled_model_dir}/Ganymed/a180x1080_o1440x1080"; +$coupled_model_dir = "/discover/nobackup/projects/gmao/ssd/aogcm/atmosphere_bcs"; # atmosphere cubed-sphere grids #------------------------------ @@ -1958,7 +1939,7 @@ sub set_IN_OUT { my ($HH, $agrid, $atmosID1, $atmosID2, $atmosID3, $atmosID4); my ($bcsTAG, $bcsdir, $gridID, $gridID_tile, $hgrid); my ($im, $im4, $imo, $imo4, $jm, $jm4, $jm5, $jmo, $jmo4); - my ($oceanID1, $oceanID2, $ogrid, $ogrid_); + my ($oceanID1, $oceanID2, $ogrid, $ogrid_, $omdl); my ($tile, $topo, $val); # tag values @@ -2050,6 +2031,7 @@ sub set_IN_OUT { $agrid = $$HH{"agrid"}; $ogrid = $$HH{"ogrid"}; $ogrid_ = $$HH{"ogrid_"}; + $omdl = $$HH{"omdl"}; $im = $im{$agrid}; $im4 = $im4{$agrid}; @@ -2148,9 +2130,13 @@ sub set_IN_OUT { } if ($coupledFLG{$ogrid}) { if ($rank{$bcsTAG} >= $rank{"Icarus-NLv3_Reynolds"}) { - $bcsdir = "$new_coupled_model_dir/Icarus-NLv3/$mdlOUTocean/$gridID_tile"; + $bcsdir = "$coupled_model_dir/Icarus-NLv3/$omdl/$gridID_tile"; + } elsif ($rank{$bcsTAG} >= $rank{"Icarus_Reynolds"}) { + $bcsdir = "$coupled_model_dir/Icarus/$omdl/$gridID_tile"; + } elsif ($rank{$bcsTAG} >= $rank{"Ganymed-4_0_Reynolds"}) { + $bcsdir = "$coupled_model_dir/Ganymed/$omdl/$gridID_tile"; } else { - $bcsdir = (<${bcsdir}*>)[0]; + die "Only BCs Ganymed-4_0 and newer supported"; } } @@ -2176,12 +2162,7 @@ sub set_IN_OUT { # Coupled tile files if ($coupledFLG{$ogrid}) { - $tile = "${gridID_tile}-Pfafstetter.til"; - if ($rank{$bcsTAG} >= $rank{"Icarus-NLv3_Reynolds"}) { - $tile = "$bcsdir/$tile"; - } else { - $tile = "$coupled_model_tile{$tile}/$tile"; - } + $tile = "$bcsdir/${gridID_tile}-Pfafstetter.til"; } die "Error. Cannot find tile file: $tile" unless -f $tile; @@ -3457,6 +3438,9 @@ sub write_CMD_file { $capture .= " -iceDT 0" if $capture !~ m/\s+\-iceDT\b/; } + $capture .= " -wemin $wemIN" if $capture !~ m/\s+\-wemin\b/; + $capture .= " -wemout $wemOUT" if $capture !~ m/\s+\-wemout\b/; + $capture .= " -grpID $grpID" if $capture !~ m/\s+\-grpID\b/ and $grpID; $capture .= " -zoom $zoom" if $capture !~ m/\s+\-zoom\b/ and $zoom_; From 20c38d3242ad6c6e83b5647ad1256094cac9be13 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Tue, 2 Nov 2021 10:53:09 -0400 Subject: [PATCH 11/16] Allow data to coupled or coupled to data --- GEOS_Util/post/regrid.pl | 116 ++++++++++++++++++--------------------- 1 file changed, 54 insertions(+), 62 deletions(-) diff --git a/GEOS_Util/post/regrid.pl b/GEOS_Util/post/regrid.pl index 72cefb69..828b3edf 100755 --- a/GEOS_Util/post/regrid.pl +++ b/GEOS_Util/post/regrid.pl @@ -528,7 +528,7 @@ sub check_inputs { my ($ans, $arcdir, $bkg_dflt, $dflt, $fname, $fvrst); my ($grINocean_data_dflt, $grOUTocean_data_dflt, $ii); my ($grINocean_coupled_dflt, $grOUTocean_coupled_dflt); - my ($mdlINocean_dflt, $mdlOUTocean_coupled_dflt); + my ($mdlINocean_dflt, $mdlOUTocean_dflt); my ($label, $landIceVERin, $landIceVERout, $lbl_dflt); my ($lcv_dflt, $len, $levsOUTdflt, $msg, $newid_dflt); my ($prompt, $rstlcvIN, $warnFLG, $wemINdflt, $wemOUTdflt); @@ -742,7 +742,7 @@ sub check_inputs { # These are the defaults for ocean model $mdlINocean_dflt = "data"; - $mdlOUTocean_coupled_dflt = "MOM6"; # We don't need a default if dataocean in + $mdlOUTocean_dflt = "data"; # We don't need a default if dataocean in unless ($mdlINocean) { print "\nOcean Models\n" @@ -759,78 +759,67 @@ sub check_inputs { unless ($grINocean and $imo{$grINocean} and $grOUTocean and $imo{$grOUTocean}) { - if ($mdlINocean eq "data") { - print "\nData Ocean Grids\n" - . "----------------\n" - . "c = 360x180 (Reynolds)\n" - . "e = 1440x720 (MERRA-2)\n" - . "f = 2880x1440 (OSTIA)\n" - . "CS = same as atmosphere (OSTIA cubed-sphere)\n" - . "\n"; - until ($grINocean and $imo{$grINocean} and $dataFLG{$grINocean}) { + print "\nData Ocean Grids\n" + . "----------------\n" + . "c = 360x180 (Reynolds)\n" + . "e = 1440x720 (MERRA-2)\n" + . "f = 2880x1440 (OSTIA)\n" + . "CS = same as atmosphere (OSTIA cubed-sphere)\n" + . "\nCoupled Ocean Grids\n" + . "-------------------\n" + . "aa = 72x36\n" + . "cc = 360x200\n" + . "dd = 720x410\n" + . "ee = 1440x1080\n\n"; + until ($grINocean and $imo{$grINocean} and ($dataFLG{$grINocean} or $coupledFLG{$grINocean}) ) { + if ($mdlINocean eq "data") { $grINocean = query("Enter INPUT ocean grid:", $grINocean_data_dflt); - } - if (($grINocean eq "CS") or ($grINocean eq "CSi")) { - unless ($CSo{$grIN}) { - die "Error. Cannot have cubed ocean with atmosphere grid $grIN"; - } - $grINocean = "CSi"; - $grINocean_ = "CS"; - $imo{"CSi"} = $im{$grIN}; - $jmo{"CSi"} = $jm{$grIN}; - $imo4{"CSi"} = $im4{$grIN}; - $jmo4{"CSi"} = $jm4{$grIN}; - } - $grINocean_ = $grINocean unless $grINocean_; - } else { - print "\nCoupled Ocean Grids\n" - . "-------------------\n" - . "aa = 72x36\n" - . "cc = 360x200\n" - . "dd = 720x410\n" - . "ee = 1440x1080\n\n"; - until ($grINocean and $imo{$grINocean} and $coupledFLG{$grINocean}) { + } else { $grINocean = query("Enter INPUT ocean grid:", $grINocean_coupled_dflt); } - $grINocean_ = $grINocean; + } + if (($grINocean eq "CS") or ($grINocean eq "CSi")) { + unless ($CSo{$grIN}) { + die "Error. Cannot have cubed ocean with atmosphere grid $grIN"; + } + $grINocean = "CSi"; + $grINocean_ = "CS"; + $imo{"CSi"} = $im{$grIN}; + $jmo{"CSi"} = $jm{$grIN}; + $imo4{"CSi"} = $im4{$grIN}; + $jmo4{"CSi"} = $jm4{$grIN}; } } + $grINocean_ = $grINocean unless $grINocean_; print "INPUT ocean grid: $grINocean_\n"; # output ocean model $mdlOUTocean #-------------------------------- # If dataocean, we can only output data ocean, but if coupled, we can choose - if ($mdlINocean eq "data") { - $mdlOUTocean = "data" - } else { - until ($mdlOUTocean and $coupledMDLFLG{$mdlOUTocean}) { - $mdlOUTocean = query("Enter OUTPUT ocean model", $mdlOUTocean_coupled_dflt); - } + until ($mdlOUTocean and ( ($mdlOUTocean eq "data") or ($coupledMDLFLG{$mdlOUTocean}) ) ) { + $mdlOUTocean = query("Enter OUTPUT ocean model", $mdlOUTocean_dflt); } print "OUTPUT ocean model: $mdlOUTocean\n"; # output ocean grid: $grOUTocean #------------------------------- - if ($mdlOUTocean eq "data") { - until ($grOUTocean and $imo{$grOUTocean} and $dataFLG{$grOUTocean}) { + until ($grOUTocean and $imo{$grOUTocean} and ($dataFLG{$grOUTocean} or $coupledFLG{$grOUTocean})) { + if ($mdlOUTocean eq "data") { $grOUTocean = query("Enter OUTPUT ocean grid:", $grOUTocean_data_dflt); - } - if ($grOUTocean eq "CS") { - unless ($CSo{$grOUT}) { - die "Error. Cannot have cubed ocean with atmosphere grid $grOUT;"; - } - $imo{"CS"} = $im{$grOUT}; - $jmo{"CS"} = $jm{$grOUT}; - $imo4{"CS"} = $im4{$grOUT}; - $jmo4{"CS"} = $jm4{$grOUT}; - } - $grOUTocean_ = $grOUTocean unless $grOUTocean_; - } else { - until ($grOUTocean and $imo{$grOUTocean} and $coupledFLG{$grOUTocean}) { + } else { $grOUTocean = query("Enter OUTPUT ocean grid:", $grOUTocean_coupled_dflt); } - $grOUTocean_ = $grOUTocean; } + if ($grOUTocean eq "CS") { + unless ($CSo{$grOUT}) { + die "Error. Cannot have cubed ocean with atmosphere grid $grOUT;"; + } + $imo{"CS"} = $im{$grOUT}; + $jmo{"CS"} = $jm{$grOUT}; + $imo4{"CS"} = $im4{$grOUT}; + $jmo4{"CS"} = $jm4{$grOUT}; + } + $grOUTocean_ = $grOUTocean unless $grOUTocean_; print "OUTPUT ocean grid: $grOUTocean_\n"; # check tag info: $tagIN and $tagOUT @@ -858,7 +847,7 @@ sub check_inputs { print "\n"; } } - if ($bcsTagIN) { print_("\nINPUT tag: $bcsTagIN\n\n") } + if ($bcsTagIN) { print_("INPUT tag: $bcsTagIN\n") } else { until ($bcsTagIN) { print_("\nType 'bcs' to see BCS tags or\n"); @@ -870,11 +859,14 @@ sub check_inputs { if ($rank{$bcsTagIN} >= 12 ) { $surflayIN = 50 } else { $surflayIN = 20 } - until ($bcsTagOUT) { - print_("\nType 'bcs' to see BCS tags or\n"); - $tagOUT = query("Enter GCM or DAS tag for outputs:", $current_tag); - $bcsTagOUT = resolve_bcsTAG($tagOUT, $grOUTocean, "out"); - $tagOUT = $bcsTagOUT if $tagOUT eq "bcs"; + if ($bcsTagOUT) { print_("OUTPUT tag: $bcsTagOUT\n") } + else { + until ($bcsTagOUT) { + print_("\nType 'bcs' to see BCS tags or\n"); + $tagOUT = query("Enter GCM or DAS tag for outputs:", $current_tag); + $bcsTagOUT = resolve_bcsTAG($tagOUT, $grOUTocean, "out"); + $tagOUT = $bcsTagOUT if $tagOUT eq "bcs"; + } } if ($rank{$bcsTagOUT} >= 12 ) { $surflay = 50; $drymassFLG = 1 } else { $surflay = 20 } @@ -1971,7 +1963,7 @@ sub set_IN_OUT { $OUT{"ogrid"} = $grOUTocean; $IN{"ogrid_"} = $grINocean_; # used for display purposes - $OUT{"ogrid_"} = $grOUTocean; + $OUT{"ogrid_"} = $grOUTocean_; $IN{"omdl"} = $mdlINocean; $OUT{"omdl"} = $mdlOUTocean; From df54e31988ea3a026ef61c930e892f81f30c4c03 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Tue, 2 Nov 2021 12:58:12 -0400 Subject: [PATCH 12/16] Update regrid.pl MPI variables --- GEOS_Util/post/regrid.pl | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/GEOS_Util/post/regrid.pl b/GEOS_Util/post/regrid.pl index 828b3edf..3c855d79 100755 --- a/GEOS_Util/post/regrid.pl +++ b/GEOS_Util/post/regrid.pl @@ -2528,31 +2528,24 @@ sub regrid_upperair_rsts_CS { if (\$?I_MPI_ROOT) then - # intel scaling suggestions - #-------------------------- + # Based on GEOSgcm NCCS Intel MPI settings + #----------------------------------------- - setenv I_MPI_DAPL_UD on - - setenv DAPL_UCM_CQ_SIZE 4096 - setenv DAPL_UCM_QP_SIZE 4096 - - setenv I_MPI_DAPL_UD_SEND_BUFFER_NUM 4096 - setenv I_MPI_DAPL_UD_RECV_BUFFER_NUM 4096 - setenv I_MPI_DAPL_UD_ACK_SEND_POOL_SIZE 4096 - setenv I_MPI_DAPL_UD_ACK_RECV_POOL_SIZE 4096 - setenv I_MPI_DAPL_UD_RNDV_EP_NUM 2 - setenv I_MPI_DAPL_UD_REQ_EVD_SIZE 2000 - - setenv DAPL_UCM_REP_TIME 2000 - setenv DAPL_UCM_RTU_TIME 2000 - setenv DAPL_UCM_RETRY 7 - setenv DAPL_ACK_RETRY 7 - setenv DAPL_ACK_TIMER 20 - setenv DAPL_UCM_RETRY 10 - setenv DAPL_ACK_RETRY 10 + setenv I_MPI_ADJUST_ALLREDUCE 12 + setenv I_MPI_ADJUST_GATHERV 3 + setenv I_MPI_SHM_HEAP_VSIZE 512 + setenv PSM2_MEMORY large + setenv I_MPI_EXTRA_FILESYSTEM 1 + setenv I_MPI_EXTRA_FILESYSTEM_FORCE gpfs + setenv ROMIO_FSTYPE_FORCE "gpfs:" else if (\$?MVAPICH2) then + setenv MV2_ENABLE_AFFINITY 0 + setenv MV2_ENABLE_AFFINITY 0 + setenv SLURM_DISTRIBUTION block + setenv MV2_MPIRUN_TIMEOUT 100 + setenv MV2_GATHERV_SSEND_THRESHOLD 256 endif From 5ac1d14792c9bfa66c67c9d415687d217ec291f4 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Tue, 9 Nov 2021 14:53:36 -0500 Subject: [PATCH 13/16] Update CI to be nicer looking --- .circleci/config.yml | 77 ++++++++++++++++++++++++++------------------ 1 file changed, 46 insertions(+), 31 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 810d9b04..8e659a7b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,7 +32,7 @@ workflows: matrix: parameters: compiler: [gfortran, ifort] - context: + context: - docker-hub-creds commands: @@ -42,7 +42,10 @@ commands: compiler: type: string steps: - - run: mpirun --version && << parameters.compiler >> --version && echo $BASEDIR && pwd && ls && echo "$(nproc)" + - run: + name: "Versions, etc." + command: | + mpirun --version && << parameters.compiler >> --version && echo $BASEDIR && pwd && ls && echo "$(nproc)" checkout_fixture: description: "Checkout fixture" @@ -50,9 +53,11 @@ commands: repo: type: string steps: - - run: | - cd ${CIRCLE_WORKING_DIRECTORY} - git clone https://github.com/GEOS-ESM/<< parameters.repo >>.git + - run: + name: "Checkout fixture" + command: | + cd ${CIRCLE_WORKING_DIRECTORY} + git clone https://github.com/GEOS-ESM/<< parameters.repo >>.git mepoclone: description: "Mepo clone external repos" @@ -60,10 +65,12 @@ commands: repo: type: string steps: - - run: | - cd ${CIRCLE_WORKING_DIRECTORY}/<< parameters.repo >> - mepo clone - mepo status + - run: + name: "Mepo clone external repos" + command: | + cd ${CIRCLE_WORKING_DIRECTORY}/<< parameters.repo >> + mepo clone + mepo status mepodevelop: description: "Mepo develop GEOSgcm_GridComp GEOSgcm_App GMAO_Shared" @@ -71,10 +78,12 @@ commands: repo: type: string steps: - - run: | - cd ${CIRCLE_WORKING_DIRECTORY}/<< parameters.repo >> - mepo develop GEOSgcm_GridComp GEOSgcm_App GMAO_Shared - mepo status + - run: + name: "Mepo develop GEOSgcm_GridComp GEOSgcm_App GMAO_Shared" + command: | + cd ${CIRCLE_WORKING_DIRECTORY}/<< parameters.repo >> + mepo develop GEOSgcm_GridComp GEOSgcm_App GMAO_Shared + mepo status checkout_feature_branch: description: "Mepo checkout-if-exists feature branch" @@ -82,14 +91,16 @@ commands: repo: type: string steps: - - run: | - cd ${CIRCLE_WORKING_DIRECTORY}/<< parameters.repo >> - echo "${CIRCLE_BRANCH}" - if [ "${CIRCLE_BRANCH}" != "develop" ] && [ "${CIRCLE_BRANCH}" != "main" ] - then - mepo checkout-if-exists ${CIRCLE_BRANCH} - fi - mepo status + - run: + name: "Mepo checkout-if-exists feature branch" + command: | + cd ${CIRCLE_WORKING_DIRECTORY}/<< parameters.repo >> + echo "${CIRCLE_BRANCH}" + if [ "${CIRCLE_BRANCH}" != "develop" ] && [ "${CIRCLE_BRANCH}" != "main" ] + then + mepo checkout-if-exists ${CIRCLE_BRANCH} + fi + mepo status cmake: description: "Run CMake" @@ -99,12 +110,14 @@ commands: compiler: type: string steps: - - run: | - mkdir -p /logfiles - cd ${CIRCLE_WORKING_DIRECTORY}/<< parameters.repo >> - mkdir -p ${CIRCLE_WORKING_DIRECTORY}/workspace/build-<< parameters.repo >> - cd ${CIRCLE_WORKING_DIRECTORY}/workspace/build-<< parameters.repo >> - cmake ${CIRCLE_WORKING_DIRECTORY}/<< parameters.repo >> -DBASEDIR=$BASEDIR/Linux -DCMAKE_Fortran_COMPILER=<< parameters.compiler >> -DCMAKE_BUILD_TYPE=Debug -DUSE_F2PY=OFF -DMPIEXEC_PREFLAGS=${MPIEXEC_PREFLAGS} -DCMAKE_INSTALL_PREFIX=${CIRCLE_WORKING_DIRECTORY}/workspace/install-<< parameters.repo >> |& tee /logfiles/cmake.log + - run: + name: "Run CMake" + command: | + mkdir -p /logfiles + cd ${CIRCLE_WORKING_DIRECTORY}/<< parameters.repo >> + mkdir -p ${CIRCLE_WORKING_DIRECTORY}/workspace/build-<< parameters.repo >> + cd ${CIRCLE_WORKING_DIRECTORY}/workspace/build-<< parameters.repo >> + cmake ${CIRCLE_WORKING_DIRECTORY}/<< parameters.repo >> -DBASEDIR=$BASEDIR/Linux -DCMAKE_Fortran_COMPILER=<< parameters.compiler >> -DCMAKE_BUILD_TYPE=Debug -DUSE_F2PY=OFF -DMPIEXEC_PREFLAGS=${MPIEXEC_PREFLAGS} -DCMAKE_INSTALL_PREFIX=${CIRCLE_WORKING_DIRECTORY}/workspace/install-<< parameters.repo >> |& tee /logfiles/cmake.log buildinstall: description: "Build and install" @@ -112,10 +125,12 @@ commands: repo: type: string steps: - - run: | - cd ${CIRCLE_WORKING_DIRECTORY}/workspace/build-<< parameters.repo >> - make -j"$(nproc)" install |& tee /logfiles/make.log - #MEDIUM# make -j4 install |& tee /logfiles/make.log + - run: + name: "Build and install" + command: | + cd ${CIRCLE_WORKING_DIRECTORY}/workspace/build-<< parameters.repo >> + make -j"$(nproc)" install |& tee /logfiles/make.log + #MEDIUM# make -j4 install |& tee /logfiles/make.log jobs: build-GEOSgcm: From ebeaba8bbd498d421ea99a6c15273b0099c7bf94 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Mon, 15 Nov 2021 12:34:06 -0500 Subject: [PATCH 14/16] Fix issue with MERRA and MERRA2 and output model --- GEOS_Util/post/regrid.pl | 2 -- 1 file changed, 2 deletions(-) diff --git a/GEOS_Util/post/regrid.pl b/GEOS_Util/post/regrid.pl index 99f1307e..5bd1fcce 100755 --- a/GEOS_Util/post/regrid.pl +++ b/GEOS_Util/post/regrid.pl @@ -631,7 +631,6 @@ sub check_inputs { $grIN = "d"; $grINocean = "c"; $mdlINocean = "data"; - $mdlOUTocean = "data"; if ($year < 1979) { die "Error. MERRA data < 1979 not available\n" } elsif ($year < 1989) { $expid = "d5_merra_jan79" } @@ -645,7 +644,6 @@ sub check_inputs { $grIN = "C180"; $grINocean = "e"; $mdlINocean = "data"; - $mdlOUTocean = "data"; if ("$year$month" < 197901) { die "Error. MERRA-2 data < 1979 not available\n" From 2098599bb5898db0e481a400b5f2517b12bd6f76 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Mon, 15 Nov 2021 12:39:10 -0500 Subject: [PATCH 15/16] More MERRA fixes --- GEOS_Util/post/regrid.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GEOS_Util/post/regrid.pl b/GEOS_Util/post/regrid.pl index 5bd1fcce..9c6ed5ed 100755 --- a/GEOS_Util/post/regrid.pl +++ b/GEOS_Util/post/regrid.pl @@ -742,7 +742,7 @@ sub check_inputs { $mdlINocean_dflt = "data"; $mdlOUTocean_dflt = "data"; # We don't need a default if dataocean in - unless ($mdlINocean) { + unless ($mdlINocean and not $merra) { print "\nOcean Models\n" . "------------\n" . "data (Reynolds, MERRA-2, Ostia, Cubed-Sphere)\n" From e23bdc3b5dea633d597b98aa07aac06a3f135963 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Tue, 30 Nov 2021 12:34:55 -0500 Subject: [PATCH 16/16] Add ability to use git tags for tagin and tagout --- CHANGELOG.md | 1 + GEOS_Util/post/regrid.pl | 235 +++++++++++++++++++++------------------ 2 files changed, 128 insertions(+), 108 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ec422fa..9c09da8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Update `regrid.pl` - Add options for MOM5 and MOM6 tile files + - Add ability to use git tags for "tagin" and "tagout" ### Removed diff --git a/GEOS_Util/post/regrid.pl b/GEOS_Util/post/regrid.pl index 9c6ed5ed..aea2d33c 100755 --- a/GEOS_Util/post/regrid.pl +++ b/GEOS_Util/post/regrid.pl @@ -50,7 +50,8 @@ my (@GCMtags, @DAStags); my (@F14, @F20, @F21, @G10, @G10p, @G20, @G30, @G40, @INL, @ICA); -my (@D214, @D540, @D561, @D580, @D591p, @D5A0, @D5B0, @D512, @D517); +my (@GITOL, @GITNL); # Git GCM tags +my (@D214, @D540, @D561, @D580, @D591p, @D5A0, @D5B0, @D512, @D517, @D525); my (%bcsTAG, %rank, %landIceVER, $landIceFLG); my ($rank_1_catchcn, $rank_1_route, $rank_saltwater_split); @@ -160,7 +161,7 @@ %SURFACE = ("catch_internal_rst" => 1, "catchcn_internal_rst" => 1, - "route_internal_rst" => 1, + "route_internal_rst" => 1, "lake_internal_rst" => 1, "landice_internal_rst" => 1, "openwater_internal_rst" => 1, @@ -447,28 +448,42 @@ sub init_tag_arrays_and_hashes { # BCS Tags: Icarus (New Land Parameters, New Topography) #--------------------------------------------------------------------------- @ICA = qw( ICA Icarus Jason ); - @D517 = qw( GEOSadas-5_17_0 GEOSadas-5_17_1 GEOSadas-5_18_0 + @D517 = qw( 517 + GEOSadas-5_17_0 GEOSadas-5_17_1 GEOSadas-5_18_0 GEOSadas-5_18_1 GEOSadas-5_18_2 GEOSadas-5_18_3 GEOSadas-5_18_3_p1 GEOSadas-5_19_0 GEOSadas-5_20_0 GEOSadas-5_20_0_p1 GEOSadas-5_20_0_p2 GEOSadas-5_21_0 GEOSadas-5_21_2 GEOSadas-5_21_3_p1 GEOSadas-5_22_0 GEOSadas-5_22_0_p1 GEOSadas-5_22_0_p2 GEOSadas-5_23_0 GEOSadas-5_23_0_p1 GEOSadas-5_24_0 GEOSadas-5_24_0_p1 ); + @GITOL = qw( GITOL + 10.3 10.4 10.5 + 10.6 10.7 10.8 + 10.9 10.10 10.11 + 10.12 10.13 10.14 + 10.15 10.16 10.17 + 10.18 ); # BCS Tags: Icarus-NLv3 (New Land Parameters) #--------------------------------------------------------------------------- - @INL = qw( INL Icarus-NL Icarus-NLv3 Jason-NL ); - - foreach (@F14) { $landIceVER{$_} = 1; $bcsTAG{$_} = "Fortuna-1_4" } - foreach (@F20) { $landIceVER{$_} = 1; $bcsTAG{$_} = "Fortuna-2_0" } - foreach (@F21) { $landIceVER{$_} = 1; $bcsTAG{$_} = "Fortuna-2_1" } - foreach (@G10) { $landIceVER{$_} = 1; $bcsTAG{$_} = "Ganymed-1_0" } - foreach (@G10p) { $landIceVER{$_} = 1; $bcsTAG{$_} = "Ganymed-1_0_M" } - foreach (@G20) { $landIceVER{$_} = 2; $bcsTAG{$_} = "Ganymed-1_0_M" } + @INL = qw( INL Icarus-NL Icarus-NLv3 Jason-NL ); + @GITNL = qw( GITNL 10.19 10.20 ); + @D525 = qw( 525 + GEOSadas-5_25_1 GEOSadas-5_25_1_p5 GEOSadas-5_25_p7 + GEOSadas-5_27_1 GEOSadas-5_29_3 ); + + foreach (@F14) { $landIceVER{$_} = 1; $bcsTAG{$_} = "Fortuna-1_4" } + foreach (@F20) { $landIceVER{$_} = 1; $bcsTAG{$_} = "Fortuna-2_0" } + foreach (@F21) { $landIceVER{$_} = 1; $bcsTAG{$_} = "Fortuna-2_1" } + foreach (@G10) { $landIceVER{$_} = 1; $bcsTAG{$_} = "Ganymed-1_0" } + foreach (@G10p) { $landIceVER{$_} = 1; $bcsTAG{$_} = "Ganymed-1_0_M" } + foreach (@G20) { $landIceVER{$_} = 2; $bcsTAG{$_} = "Ganymed-1_0_M" } foreach (@G30) { $landIceVER{$_} = 2; $bcsTAG{$_} = "Ganymed-1_0_Reynolds" } foreach (@G40) { $landIceVER{$_} = 2; $bcsTAG{$_} = "Ganymed-4_0_Reynolds" } - foreach (@ICA) { $landIceVER{$_} = 2; $bcsTAG{$_} = "Icarus_Reynolds" } + foreach (@ICA) { $landIceVER{$_} = 2; $bcsTAG{$_} = "Icarus_Reynolds" } + foreach (@GITOL) { $landIceVER{$_} = 2; $bcsTAG{$_} = "Icarus_Reynolds" } foreach (@INL) { $landIceVER{$_} = 2; $bcsTAG{$_} = "Icarus-NLv3_Reynolds" } + foreach (@GITNL) { $landIceVER{$_} = 2; $bcsTAG{$_} = "Icarus-NLv3_Reynolds" } foreach (@D214) { $landIceVER{$_} = 1; $bcsTAG{$_} = "Fortuna-1_4" } foreach (@D540) { $landIceVER{$_} = 1; $bcsTAG{$_} = "Fortuna-1_4" } @@ -479,9 +494,10 @@ sub init_tag_arrays_and_hashes { foreach (@D5B0) { $landIceVER{$_} = 2; $bcsTAG{$_} = "Ganymed-1_0_Reynolds" } foreach (@D512) { $landIceVER{$_} = 2; $bcsTAG{$_} = "Ganymed-4_0_Reynolds" } foreach (@D517) { $landIceVER{$_} = 2; $bcsTAG{$_} = "Icarus_Reynolds" } + foreach (@D525) { $landIceVER{$_} = 2; $bcsTAG{$_} = "Icarus-NLv3_Reynolds" } - @GCMtags = (\@F14, \@F20, \@F21, \@G10, \@G10p, \@G20, \@G30, \@G40, \@INL, \@ICA); - @DAStags = (\@D214, \@D540, \@D561, \@D580, \@D591p, \@D5A0, \@D5B0, \@D512); + @GCMtags = (\@F14, \@F20, \@F21, \@G10, \@G10p, \@G20, \@G30, \@G40, \@ICA, \@GITOL, \@INL, \@GITNL); + @DAStags = (\@D214, \@D540, \@D561, \@D580, \@D591p, \@D5A0, \@D5B0, \@D512, \@D517, \@D525); # rank of BCS tags #----------------- @@ -924,10 +940,10 @@ sub check_inputs { print "\nRegridding of Catch[CN] restarts requires specification of minimum snow water equivalent\n" . "values (WEmin) for the runs associated with the source (input) and target (output) restarts.\n" . "FYI, the following values are used in existing GEOS systems:\n" - . " WEmin = 26 kg/m2 : FP 5.13-5.22, MERRA-2, MERRA-Land, (Fortuna, Ganymed [G40], Icarus [ICA])\n" - . " WEmin = 13 kg/m2 : FP 5.25- , MERRA, (Icarus-NewLand [INL])\n" - . "----------------------------------------------\n"; - + . " WEmin = 26 kg/m2 : FP 5.13-5.22, MERRA-2, MERRA-Land, (Fortuna, Ganymed [G40], Icarus [ICA], Git GCM 10.3-10.18)\n" + . " WEmin = 13 kg/m2 : FP 5.25- , MERRA, (Icarus-NewLand [INL], Git GCM 10.19+)\n" + . "----------------------------------------------------------------------------------------------\n"; + if ($newLand{$bcsTagIN}) { $wemINdflt = 13 } else { $wemINdflt = 26 } @@ -954,15 +970,15 @@ sub check_inputs { #------------------ @cnlist = split(/,/, $mk_catchcn) if $mk_catchcn; if ($mk_catchcn) { - unless (scalar(@cnlist) != 4 || scalar(@cnlist) != 1) { - @cnlabel = (qw(CN_VERSION RESTART_ID RESTART_PATH RESTART_DOMAIN)); - foreach $ii (0..3) { - $prompt = "Enter Carbon (CN) $cnlabel[$ii]"; - if ($cnlist[$ii]) { $cnlist[$ii] = query($prompt, $cnlist[$ii]) } - else { $cnlist[$ii] = query($prompt) } - } - $mk_catchcn = join(",", @cnlist[0..3]); - } + unless (scalar(@cnlist) != 4 || scalar(@cnlist) != 1) { + @cnlabel = (qw(CN_VERSION RESTART_ID RESTART_PATH RESTART_DOMAIN)); + foreach $ii (0..3) { + $prompt = "Enter Carbon (CN) $cnlabel[$ii]"; + if ($cnlist[$ii]) { $cnlist[$ii] = query($prompt, $cnlist[$ii]) } + else { $cnlist[$ii] = query($prompt) } + } + $mk_catchcn = join(",", @cnlist[0..3]); + } unless ( $cnlist[0] eq "clm40" or $cnlist[0] eq "clm45") { die "Error. CN_VERSION should be clm40 or clm45\n"; @@ -1473,7 +1489,7 @@ sub resolve_bcsTAG { # was BCS tag found? #------------------ else { - print "\nWARNING. Cannot recognize Tag ID: $tagIDx"; + print "\nWARNING. Cannot recognize Tag ID: $tagIDx (NOTE: Use only X.Y for Git Tags)"; print " ($tagID)" if $tagID ne $tagIDx; print "\n"; } @@ -3925,10 +3941,10 @@ sub usage { ----------------------------- as ordered runtime parameters ----------------------------- - yyyymmdd 8-digit date of the restarts being regridded - hr 2-digit hour of the restarts being regridded - grOUT grid ID of the output restarts (see GRID IDENTIFIERS below) - outdir directory location for output restarts + yyyymmdd 8-digit date of the restarts being regridded + hr 2-digit hour of the restarts being regridded + grOUT grid ID of the output restarts (see GRID IDENTIFIERS below) + outdir directory location for output restarts -------------------- or as flagged values @@ -3939,27 +3955,27 @@ sub usage { -outdir outdir REQUIRED OPTION FOR MERRA INPUTS - -merra (same as -merra2) - -merra1 get input restarts from OPS MERRA-1 data archives - -merra2 get input restarts from OPS MERRA-2 data archives + -merra (same as -merra2) + -merra1 get input restarts from OPS MERRA-1 data archives + -merra2 get input restarts from OPS MERRA-2 data archives REQUIRED OPTIONS FOR NON-MERRA INPUTS - -d rstdir pathname for input tarfile or restart directory - -expid expid experiment ID of input restart files + -d rstdir pathname for input tarfile or restart directory + -expid expid experiment ID of input restart files INTERACTIVE OPTION - -i prompt for inputs that are not supplied - (this is the default if no inputs are supplied) - -np no prompt; take defaults for all prompts; - note: the -np flag takes precedence over the -i flag + -i prompt for inputs that are not supplied + (this is the default if no inputs are supplied) + -np no prompt; take defaults for all prompts; + note: the -np flag takes precedence over the -i flag OTHER OPTIONS -levsout levsout number of atmosphere levels in output -ocnmdlin ocnMDLIN ocean input model - data : data ocean (Reynolds, MERRA-2, Ostia, CS) - MOM5 : MOM5 - MOM6 : MOM6 - NOTE: If data in, only data out allowed + =data : data ocean (Reynolds, MERRA-2, Ostia, CS) + =MOM5 : MOM5 + =MOM6 : MOM6 + defailts to \'data\' -oceanin oceanIN ocean horizontal grid of inputs data ocean grids =c : 1-deg (360x180); e.g. Reynolds @@ -3975,60 +3991,60 @@ sub usage { defaults to \'dd\' -ocnmdlout ocnMDLOUT ocean model of outputs (see -ocnmdlin) -oceanout oceanOUT ocean horizontal grid of outputs (see -oceanin) - -esmabin ESMABIN location of build\'s scripts and programs; defaults to location - of regrid.pl script - -iceDT dtime datetime for alternate landice rst input if regridding to - \'Ganymed-2_0\' from earlier tag; dtime should have the - following format: -iceDT yyyymmdd_hh - if dtime is not provided or if no restarts can be found to - match dtime, then script will prompt user from list of - available datetimes. - if dtime eq \'0\', then alternate landice rst will not be used - -newid newid label to replace expid in output restart names; - defaults to \'n-expid\' where n is OUTPUT atmosphere grid ID - -tagin tagIN GCM or DAS tag associated with inputs (see TAGS below); - defaults to $former_tag - -tagout tagOUT GCM or DAS tag associated with outputs (see TAGS below); - defaults to $current_tag - -rs flag flag indicating which restarts to regrid - =1 for upper-air restarts only - =2 for land-surface restarts only - =3 for both upper-air and land-surface restarts (default) - -catchcn offers 2 options: - = 0, cold start for CLM40 using an archived restart file. For e.g. - -catchcn 0, - Notice the trailing comma - = CN_VERSION, RESTART_ID, RESTART_PATH, RESTART_DOMAIN - to start from a GEOSldas restart file (Note, keywords are comma-separated). - where CN_VERSION is the 2-digit CLM version (40, 45, etc.) while other keywords - are same as those in GEOSldas exeinp file. For e.g. - -catchcn 45,GEOSldas45_M36_rst_ldas06_16,/discover/nobackup/elee15/GEOSldas_4_5/sims/,SMAP_EASEv2_M36 - IMPORTANT GEOSldas restart file at 0z on the AGCM restart date must be available in GEOSldas directory. - Not valid for tags prior to Heracles; Note: This option will add - 10-20 minutes to the regrid process. - -wemin wemIN minimum water snow water equivalent for input catch/cn - -wemout wemOUT minimum water snow water equivalent for output catch/cn - - -route write the route_internal_rst - - -[no]bkg copy and rename input bkg + satbang/bias files - -[no]lbl label final restarts with \'tagID.gridID\' extension - -[no]lcv create rst.lcv file for final restarts - -gcm gcm mode; equivalent to -nobkg, -lbl, and -nolcv flags - -altbcs [bcsdir] use boundary condition files found in bcsdir; if bcsdir - is not given, then use Larry\'s bcs directory - -zoom n zoom value to send to land regridding codes - - -grpid group id; sponsor code to use for batch job charge - -qos val use \'SBATCH --qos=val directive\' for batch jobs; - \'-qos debug\' will not work unless these conditions are met - -> numtasks <= 532 - -> walltime le \'1:00:00\' - -partition val use \'SBATCH --partition=val directive\' for batch jobs - -constraint val use \'SBATCH --constraint=val directive\' for batch jobs - -db (debug mode) Do not clean work directory after running programs; - -dbh (debug hash) Show contents of hashes: \%IN and \%OUT - -v verbose mode - -h[elp] print usage message + -esmabin ESMABIN location of build\'s scripts and programs; defaults to location + of regrid.pl script + -iceDT dtime datetime for alternate landice rst input if regridding to + \'Ganymed-2_0\' from earlier tag; dtime should have the + following format: -iceDT yyyymmdd_hh + if dtime is not provided or if no restarts can be found to + match dtime, then script will prompt user from list of + available datetimes. + if dtime eq \'0\', then alternate landice rst will not be used + -newid newid label to replace expid in output restart names; + defaults to \'n-expid\' where n is OUTPUT atmosphere grid ID + -tagin tagIN GCM or DAS tag associated with inputs (see TAGS below); + defaults to $former_tag + -tagout tagOUT GCM or DAS tag associated with outputs (see TAGS below); + defaults to $current_tag + -rs flag flag indicating which restarts to regrid + =1 for upper-air restarts only + =2 for land-surface restarts only + =3 for both upper-air and land-surface restarts (default) + -catchcn offers 2 options: + = 0, cold start for CLM40 using an archived restart file. For e.g. + -catchcn 0, - Notice the trailing comma + = CN_VERSION, RESTART_ID, RESTART_PATH, RESTART_DOMAIN + to start from a GEOSldas restart file (Note, keywords are comma-separated). + where CN_VERSION is the 2-digit CLM version (40, 45, etc.) while other keywords + are same as those in GEOSldas exeinp file. For e.g. + -catchcn 45,GEOSldas45_M36_rst_ldas06_16,/discover/nobackup/elee15/GEOSldas_4_5/sims/,SMAP_EASEv2_M36 + IMPORTANT GEOSldas restart file at 0z on the AGCM restart date must be available in GEOSldas directory. + Not valid for tags prior to Heracles; Note: This option will add + 10-20 minutes to the regrid process. + -wemin wemIN minimum water snow water equivalent for input catch/cn + -wemout wemOUT minimum water snow water equivalent for output catch/cn + + -route write the route_internal_rst + + -[no]bkg copy and rename input bkg + satbang/bias files + -[no]lbl label final restarts with \'tagID.gridID\' extension + -[no]lcv create rst.lcv file for final restarts + -gcm gcm mode; equivalent to -nobkg, -lbl, and -nolcv flags + -altbcs [bcsdir] use boundary condition files found in bcsdir; if bcsdir + is not given, then use Larry\'s bcs directory + -zoom n zoom value to send to land regridding codes + + -grpid group id; sponsor code to use for batch job charge + -qos val use \'SBATCH --qos=val directive\' for batch jobs; + \'-qos debug\' will not work unless these conditions are met + -> numtasks <= 532 + -> walltime le \'1:00:00\' + -partition val use \'SBATCH --partition=val directive\' for batch jobs + -constraint val use \'SBATCH --constraint=val directive\' for batch jobs + -db (debug mode) Do not clean work directory after running programs; + -dbh (debug hash) Show contents of hashes: \%IN and \%OUT + -v verbose mode + -h[elp] print usage message GRID IDENTIFIERS @@ -4067,15 +4083,17 @@ sub usage { Sample GCM tags --------------- - F14 : $F14[1] ............ $F14[-1] - F21 : $F21[1] ............ $F21[-1] - G10 : $G10[1] ............ $G10[-1] - G10p : $G10p[1] ......... $G10p[-1] - G20 : $G20[1] ............ $G20[-1] - G30 : $G30[1] ............ $G30[-1] - G40 : $G40[1] ............ $G40[-1] - ICA : $ICA[1] ................. $ICA[-1] - INL : $INL[1] .............. $INL[-1] + F14 : $F14[1] ........... $F14[-1] + F21 : $F21[1] ........... $F21[-1] + G10 : $G10[1] ........... $G10[-1] + G10p : $G10p[1] ........ $G10p[-1] + G20 : $G20[1] ........... $G20[-1] + G30 : $G30[1] ........... $G30[-1] + G40 : $G40[1] ........... $G40[-1] + ICA : $ICA[1] ................ $ICA[-1] + GITOL : $GITOL[1] .................. $GITOL[-1] + INL : $INL[1] ............. $INL[-1] + GITNL : $GITNL[1] ................. $GITNL[-1] Sample DAS tags --------------- @@ -4088,6 +4106,7 @@ sub usage { 5B0 : $D5B0[1] ..... $D5B0[-1] 512 : $D512[1] ........ $D512[-1] 517 : $D517[1] ........ $D517[-1] + 525 : $D525[1] ........ $D525[-1] AUTHOR Joe Stassi, SSAI (joe.stassi\@nasa.gov)