From 64db99ba71b5ce9ee70701e0c59a293971535d73 Mon Sep 17 00:00:00 2001 From: gsketefian <31046882+gsketefian@users.noreply.github.com> Date: Fri, 2 Aug 2019 17:01:44 -0600 Subject: [PATCH] Changes to NCL scripts to find write-component grid parameters. (#52) * Use sfc_climo_gen code from the "develop" branch of UFS_UTILS instead of the previous feature branch. * Add RUN_ENVIR parameter to switch between nco and community modes. * Simplify set of possible values that VERBOSE takes on. * Rename predefined domains for clarity and add new predefined domain (13km HRRR/CONUS). * Set WORKDIR equal to EXPT_DIR so that the preprocessing subdirectories are under EXPT_DIR along with everything else. * Remove creation of symlinks whose names don't contain the string "halo". That is already done in stage_static.sh. * Add copying of mosaic file from grid work directory to shave work directory so that all grid and orography files are in one place after the shave step. This makes things more convenient for later tasks in the workflow (i.e. those after make_grid_orog). * Add capability to read in grid and orography files from a specified directory instead of creating a grid. Similarly, add capability to read in surface climatology files from a specified directory instead of generating these files. * Fixes after testing workflow: ush/checkout_repo.sh: Change branch to use from feature/chgres_grib2_gsk to feature/chgres_grib2 since that has all the latest (and the _gsk one may have been overwritten). ush/get_extrn_mdl_file_dir_info.sh: Change variable name; remove debugging statements. ush/get_extrn_mdl_files.sh: Put in a check for the availability of external model data on the specified CDATE. ush/make_ICS_surf_LBC0.sh: Change cd to cd_vrfy; fix directory in which to look for surface climatology files. ush/make_LBC1_to_LBCN.sh: Change cd to cd_vrfy; fix directory in which to look for surface climatology files; fix bug involving input_type. ush/run_FV3SAR.sh: Change cd to cd_vrfy. ush/stage_static.sh: Put in fix so that RES and CRES are calculated only if the make_grid_orog task is not being run. Also, put in fix to set these variables in the variable definitions file. ush/templates/FV3SAR_wflow.xml: Make file non-executable. * Fix bug (directory being considered should be the one for LBCS, not ICSSURF). * Changes to NCL code to allow finding of write-component grid parameters on 13km HRRR (CONUS) grid. --- ush/NCL/plot_FV3SAR_field_native.ncl | 10 ++++++++-- ush/NCL/process_plot_params.ncl | 5 ++++- ush/NCL/read_FV3SAR_grid_native.ncl | 26 +++++++++++++------------- ush/make_LBC1_to_LBCN.sh | 2 +- 4 files changed, 26 insertions(+), 17 deletions(-) diff --git a/ush/NCL/plot_FV3SAR_field_native.ncl b/ush/NCL/plot_FV3SAR_field_native.ncl index 355668c4aa..8319f7cff7 100644 --- a/ush/NCL/plot_FV3SAR_field_native.ncl +++ b/ush/NCL/plot_FV3SAR_field_native.ncl @@ -41,6 +41,8 @@ run_dir = "/scratch3/BMC/det/Gerard.Ketefian/UFS_CAM_test_instructions/expt_dirs run_dir = "/scratch4/BMC/gmtb/Linlin.Pan/ice/Linlin.Pan/rtgen.112531/tmp/fv3_regional_control" run_dir = "/scratch3/BMC/det/beck/FV3-CAM/run_dirs/real_time/2019062300" +run_dir = "/scratch3/BMC/det/Gerard.Ketefian/FV3SAR_demo_PASPBL_20190725/expt_dirs/FFFFF" + tile_inds := (/ 1, 7, 4 /) ;tile_inds := (/ 1, 4 /) ;tile_inds := (/ 5, 6 /) @@ -418,8 +420,8 @@ char_dq + "ncgm" + char_dq + "." + char_nl ; ; ********************************************************************** ; -if (True) then -;if (False) then +;if (True) then +if (False) then fn := "1916021000000" fp := addfile(fn + ".grb2", "r") @@ -674,6 +676,10 @@ if (True) then dx_native = 3.0d+3 dy_native = 3.0d+3 + + dx_native = 13.0d+3 + dy_native = 13.0d+3 + angle_units = "deg" out := calc_wrtcmp_grid_params_lambert_cnfrml( \ diff --git a/ush/NCL/process_plot_params.ncl b/ush/NCL/process_plot_params.ncl index a2a49dcfee..ac29977abc 100644 --- a/ush/NCL/process_plot_params.ncl +++ b/ush/NCL/process_plot_params.ncl @@ -148,7 +148,10 @@ example_usage_and_help_str ; ; ********************************************************************** ; - work_dir = str_sub_str(run_dir, "expt_dirs", "work_dirs") +; Don't need this line since we got rid of work_dirs and put all prepro- +; cessing output in subdirectories in the experiment directory. +; work_dir = str_sub_str(run_dir, "expt_dirs", "work_dirs") + work_dir = run_dir diff --git a/ush/NCL/read_FV3SAR_grid_native.ncl b/ush/NCL/read_FV3SAR_grid_native.ncl index 37c1ff4bb9..f5c0ef623b 100644 --- a/ush/NCL/read_FV3SAR_grid_native.ncl +++ b/ush/NCL/read_FV3SAR_grid_native.ncl @@ -231,19 +231,19 @@ begin if (strcmp_exact(gtype, "regional") .and. (n_tile .eq. 7)) then grid_fn = grid_fn + ".halo" + tostring(nhalo_T7) + ".nc" -; grid_fn = work_dir + "/shave/" + grid_fn - -;The following is just a temporary fix to get plots for Jeff's real_time -;runs which don't use the latest directory structure. The above is still -; the correct way to do it in general -temp_dir := str_sub_str(run_dir, "run_dirs", "work_dirs") -;temp_dir := str_sub_str(temp_dir, "2019062300", "shave") -indx := str_index_of_substr(temp_dir, "/", -1) -temp_dir := str_get_cols(temp_dir, 0, indx-1) -print("run_dir = " + char_dq + run_dir + char_dq) -print("temp_dir = " + char_dq + temp_dir + char_dq) -pause -grid_fn = temp_dir + "/shave/" + grid_fn + grid_fn = work_dir + "/shave/" + grid_fn + +;;The following is just a temporary fix to get plots for Jeff's real_time +;;runs which don't use the latest directory structure. The above is still +;; the correct way to do it in general +;temp_dir := str_sub_str(run_dir, "run_dirs", "work_dirs") +;;temp_dir := str_sub_str(temp_dir, "2019062300", "shave") +;indx := str_index_of_substr(temp_dir, "/", -1) +;temp_dir := str_get_cols(temp_dir, 0, indx-1) +;print("run_dir = " + char_dq + run_dir + char_dq) +;print("temp_dir = " + char_dq + temp_dir + char_dq) +;pause +;grid_fn = temp_dir + "/shave/" + grid_fn else grid_fn = grid_fn + ".nc" diff --git a/ush/make_LBC1_to_LBCN.sh b/ush/make_LBC1_to_LBCN.sh index 7ff6a0e1d7..96b83b7883 100755 --- a/ush/make_LBC1_to_LBCN.sh +++ b/ush/make_LBC1_to_LBCN.sh @@ -410,7 +410,7 @@ esac #----------------------------------------------------------------------- # num_fhrs="${#EXTRN_MDL_LBC_UPDATE_FHRS[@]}" -for (( i=0; i<=$(( $num_fhrs - 1 )); i++ )); do +for (( i=0; i<$num_fhrs; i++ )); do # # Get the forecast hour of the external model. #