From 62ac75c9a2c72d91a64461fd8fb8210fbeab3a5b Mon Sep 17 00:00:00 2001 From: Cory Martin Date: Fri, 4 Aug 2023 16:05:05 -0400 Subject: [PATCH 1/2] Actually switch to CRTM 2.4 now (#550) * start to 2.4 fix * Change to use CRTM fix env var --- modulefiles/GDAS/hera.lua | 2 +- modulefiles/GDAS/orion.lua | 2 +- test/atm/global-workflow/config.atmanl | 2 +- ush/ufoeval/run_ufo_hofx_test.sh | 2 +- ush/ufsda/stage.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modulefiles/GDAS/hera.lua b/modulefiles/GDAS/hera.lua index 76012b0da..f4946fdb0 100644 --- a/modulefiles/GDAS/hera.lua +++ b/modulefiles/GDAS/hera.lua @@ -80,7 +80,7 @@ setenv('MPIEXEC_EXEC', mpiexec) setenv('MPIEXEC_NPROC', mpinproc) setenv('R2D2_CONFIG', '/scratch1/NCEPDEV/stmp4/Cory.R.Martin/R2D2_SHARED/config_hera.yaml') -setenv("CRTM_FIX","/scratch1/NCEPDEV/da/Cory.R.Martin/GDASApp/fix/crtm") +setenv("CRTM_FIX","/scratch1/NCEPDEV/da/Cory.R.Martin/GDASApp/fix/crtm/2.4.0") setenv("GDASAPP_TESTDATA","/scratch1/NCEPDEV/da/Cory.R.Martin/CI/GDASApp/data") prepend_path("PATH","/scratch2/NCEPDEV/nwprod/hpc-stack/libs/hpc-stack/intel-18.0.5.274/prod_util/1.2.2/bin") diff --git a/modulefiles/GDAS/orion.lua b/modulefiles/GDAS/orion.lua index 0eb0875b1..e9463219c 100644 --- a/modulefiles/GDAS/orion.lua +++ b/modulefiles/GDAS/orion.lua @@ -78,7 +78,7 @@ setenv('MPIEXEC_EXEC', mpiexec) setenv('MPIEXEC_NPROC', mpinproc) setenv('R2D2_CONFIG', '/work2/noaa/da/cmartin/GDASApp/R2D2_SHARED/config_orion.yaml') -setenv("CRTM_FIX","/work2/noaa/da/cmartin/GDASApp/fix/crtm") +setenv("CRTM_FIX","/work2/noaa/da/cmartin/GDASApp/fix/crtm/2.4.0") setenv("GDASAPP_TESTDATA","/work2/noaa/da/cmartin/CI/GDASApp/data") prepend_path("PATH","/apps/contrib/NCEP/libs/hpc-stack/intel-2018.4/prod_util/1.2.2/bin") diff --git a/test/atm/global-workflow/config.atmanl b/test/atm/global-workflow/config.atmanl index c7c106ccc..147a042ae 100755 --- a/test/atm/global-workflow/config.atmanl +++ b/test/atm/global-workflow/config.atmanl @@ -20,6 +20,6 @@ export io_layout_x=1 export io_layout_y=1 export JEDIEXE=${HOMEgfs}/exec/fv3jedi_var.x -export crtm_VERSION="2.3.0" +export crtm_VERSION="2.4.0" echo "END: config.atmanl" diff --git a/ush/ufoeval/run_ufo_hofx_test.sh b/ush/ufoeval/run_ufo_hofx_test.sh index 8ec802038..f78745e01 100755 --- a/ush/ufoeval/run_ufo_hofx_test.sh +++ b/ush/ufoeval/run_ufo_hofx_test.sh @@ -135,7 +135,7 @@ mkdir -p $workdir # Link CRTM coefficients [ -d $workdir/crtm ] && rm -rf $workdir/crtm -ln -sf $FixDir/crtm/2.3.0 $workdir/crtm +ln -sf $FixDir/crtm/2.4.0 $workdir/crtm # copy BC files if [ $radiance = "YES" ]; then diff --git a/ush/ufsda/stage.py b/ush/ufsda/stage.py index bed7a9b39..6698324fc 100644 --- a/ush/ufsda/stage.py +++ b/ush/ufsda/stage.py @@ -67,7 +67,7 @@ def gdas_fix(input_fix_dir, working_dir, config): ufsda.disk_utils.symlink(os.path.join(gdasapp_parm, 'io', 'fv3jedi_fieldmetadata_restart.yaml'), os.path.join(config['fv3jedi_fieldmetadata_dir'], 'fv3jedi_fieldmetadata_restart.yaml')) # link CRTM coeff dir - ufsda.disk_utils.symlink(os.path.join(input_fix_dir, 'crtm', '2.3.0'), + ufsda.disk_utils.symlink(os.path.join(input_fix_dir, 'crtm', '2.4.0'), config['CRTM_COEFF_DIR']) From 8ca585bf2f54e8f1b3b7a79e8c5c45919f36b117 Mon Sep 17 00:00:00 2001 From: AndrewEichmann-NOAA <58948505+AndrewEichmann-NOAA@users.noreply.github.com> Date: Mon, 7 Aug 2023 20:28:30 -0400 Subject: [PATCH 2/2] removed duplicate variable specification (#551) * removed duplicate variable specification * pep8 compliance --- scripts/exgdas_global_marine_analysis_vrfy.py | 55 +++++++++---------- ush/soca/soca_vrfy.py | 17 +++--- 2 files changed, 34 insertions(+), 38 deletions(-) diff --git a/scripts/exgdas_global_marine_analysis_vrfy.py b/scripts/exgdas_global_marine_analysis_vrfy.py index 88a33f49b..fa72a148b 100755 --- a/scripts/exgdas_global_marine_analysis_vrfy.py +++ b/scripts/exgdas_global_marine_analysis_vrfy.py @@ -48,11 +48,11 @@ config = plotConfig(grid_file=grid_file, data_file=data_file, lats=np.arange(-60, 60, 10), - variables_zonal=['Temp', 'Salt'], - variables_horiz=['Temp', 'Salt', 'ave_ssh'], - allbounds={'Temp': [-0.5, 0.5], - 'Salt': [-0.1, 0.1], - 'ave_ssh': [-0.1, 0.1]}, + variables_zonal={'Temp': [-0.5, 0.5], + 'Salt': [-0.1, 0.1]}, + variables_horiz={'Temp': [-0.5, 0.5], + 'Salt': [-0.1, 0.1], + 'ave_ssh': [-0.1, 0.1]}, colormap='RdBu', comout=os.path.join(comout, 'vrfy', 'incr')) ocnIncPlotter = statePlotter(config) @@ -66,10 +66,9 @@ config = plotConfig(grid_file=grid_file, data_file=data_file, lats=np.arange(-60, 60, 10), - variables_horiz=['aicen', 'hicen', 'hsnon'], - allbounds={'aicen': [-0.2, 0.2], - 'hicen': [-0.5, 0.5], - 'hsnon': [-0.1, 0.1]}, + variables_horiz={'aicen': [-0.2, 0.2], + 'hicen': [-0.5, 0.5], + 'hsnon': [-0.1, 0.1]}, colormap='RdBu', projs=['North', 'South'], comout=os.path.join(comout, 'vrfy', 'incr')) @@ -83,10 +82,9 @@ data_file = os.path.join(comout, f'{RUN}.t'+cyc+'z.iceana.nc') config = plotConfig(grid_file=grid_file, data_file=data_file, - variables_horiz=['aicen', 'hicen', 'hsnon'], - allbounds={'aicen': [0.0, 1.0], - 'hicen': [0.0, 4.0], - 'hsnon': [0.0, 0.5]}, + variables_horiz={'aicen': [0.0, 1.0], + 'hicen': [0.0, 4.0], + 'hsnon': [0.0, 0.5]}, colormap='jet', projs=['North', 'South', 'Global'], comout=os.path.join(comout, 'vrfy', 'ana')) @@ -100,10 +98,9 @@ data_file = os.path.join(com_ice_history, f'{RUN}.t{gcyc}z.icef006.nc') config = plotConfig(grid_file=grid_file, data_file=data_file, - variables_horiz=['aice_h', 'hs_h', 'hi_h'], - allbounds={'aice_h': [0.0, 1.0], - 'hs_h': [0.0, 4.0], - 'hi_h': [0.0, 0.5]}, + variables_horiz={'aice_h': [0.0, 1.0], + 'hs_h': [0.0, 4.0], + 'hi_h': [0.0, 0.5]}, colormap='jet', projs=['North', 'South', 'Global'], comout=os.path.join(comout, 'vrfy', 'bkg')) @@ -117,10 +114,9 @@ data_file = os.path.join(comout, f'{RUN}.t'+cyc+'z.ocnana.nc') config = plotConfig(grid_file=grid_file, data_file=data_file, - variables_horiz=['ave_ssh', 'Temp', 'Salt'], - allbounds={'ave_ssh': [-1.8, 1.3], - 'Temp': [-1.8, 34.0], - 'Salt': [30, 38]}, + variables_horiz={'ave_ssh': [-1.8, 1.3], + 'Temp': [-1.8, 34.0], + 'Salt': [30, 38]}, colormap='jet', comout=os.path.join(comout, 'vrfy', 'ana')) ocnAnaPlotter = statePlotter(config) @@ -133,10 +129,9 @@ data_file = os.path.join(com_ocean_history, f'{RUN}.t{gcyc}z.ocnf006.nc') config = plotConfig(grid_file=grid_file, data_file=data_file, - variables_horiz=['ave_ssh', 'Temp', 'Salt'], - allbounds={'ave_ssh': [-1.8, 1.3], - 'Temp': [-1.8, 34.0], - 'Salt': [30, 38]}, + variables_horiz={'ave_ssh': [-1.8, 1.3], + 'Temp': [-1.8, 34.0], + 'Salt': [30, 38]}, colormap='jet', comout=os.path.join(comout, 'vrfy', 'bkg')) ocnBkgPlotter = statePlotter(config) @@ -150,11 +145,11 @@ config = plotConfig(grid_file=grid_file, data_file=data_file, lats=np.arange(-60, 60, 10), - variables_zonal=['Temp', 'Salt'], - variables_horiz=['Temp', 'Salt', 'ave_ssh'], - allbounds={'Temp': [0, 2], - 'Salt': [0, 0.2], - 'ave_ssh': [0, 0.1]}, + variables_zonal={'Temp': [0, 2], + 'Salt': [0, 0.2]}, + variables_horiz={'Temp': [0, 2], + 'Salt': [0, 0.2], + 'ave_ssh': [0, 0.1]}, colormap='jet', comout=os.path.join(comout, 'vrfy', 'bkgerr')) bkgErrPlotter = statePlotter(config) diff --git a/ush/soca/soca_vrfy.py b/ush/soca/soca_vrfy.py index 248505711..2c8d602a0 100755 --- a/ush/soca/soca_vrfy.py +++ b/ush/soca/soca_vrfy.py @@ -19,14 +19,13 @@ def plotConfig(grid_file=[], data_file=[], variable=[], levels=[], - allbounds=[], bounds=[], colormap=[], max_depth=np.nan, max_depths=[700.0, 5000.0], comout=[], - variables_horiz=[], - variables_zonal=[], + variables_horiz={}, + variables_zonal={}, lat=np.nan, lats=np.arange(-60, 60, 10), proj='set me', @@ -41,7 +40,6 @@ def plotConfig(grid_file=[], config['fields file'] = data_file config['levels'] = [1] config['colormap'] = colormap - config['all bounds'] = allbounds config['bounds'] = bounds config['lats'] = lats # all the lats to plot config['lat'] = lat # the lat being currently plotted @@ -140,15 +138,18 @@ def plot(self): for max_depth in self.config['max depths']: self.config['max depth'] = max_depth - for variable in self.config['zonal variables']: - bounds = self.config['all bounds'][variable] + variableBounds = self.config['zonal variables'] + for variable in variableBounds.keys(): + bounds = variableBounds[variable] self.config.update({'variable': variable, 'bounds': bounds}) plotZonalSlice(self.config) ####################################### # Horizontal slices for proj in self.config['projs']: - for variable in self.config['horiz variables']: - bounds = self.config['all bounds'][variable] + + variableBounds = self.config['horiz variables'] + for variable in variableBounds.keys(): + bounds = variableBounds[variable] self.config.update({'variable': variable, 'bounds': bounds, 'proj': proj}) plotHorizontalSlice(self.config)