diff --git a/tests/baseline_configs/config.grid_RRFS_CONUS_13km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v15p2.sh b/tests/baseline_configs/config.grid_RRFS_CONUS_13km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v15p2.sh new file mode 100644 index 000000000..ba82a4111 --- /dev/null +++ b/tests/baseline_configs/config.grid_RRFS_CONUS_13km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v15p2.sh @@ -0,0 +1,18 @@ +RUN_ENVIR="community" +PREEXISTING_DIR_METHOD="rename" + +PREDEF_GRID_NAME="RRFS_CONUS_13km" +GRID_GEN_METHOD="ESGgrid" +QUILTING="TRUE" + +CCPP_PHYS_SUITE="FV3_GFS_v15p2" +FCST_LEN_HRS="06" +LBC_SPEC_INTVL_HRS="3" + +DATE_FIRST_CYCL="20190701" +DATE_LAST_CYCL="20190701" +CYCL_HRS=( "00" ) + +EXTRN_MDL_NAME_ICS="FV3GFS" +EXTRN_MDL_NAME_LBCS="FV3GFS" +USE_USER_STAGED_EXTRN_FILES="TRUE" diff --git a/tests/baseline_configs/config.grid_RRFS_CONUS_13km_FV3GFS_FV3GFS.sh b/tests/baseline_configs/config.grid_RRFS_CONUS_13km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v16beta.sh similarity index 100% rename from tests/baseline_configs/config.grid_RRFS_CONUS_13km_FV3GFS_FV3GFS.sh rename to tests/baseline_configs/config.grid_RRFS_CONUS_13km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v16beta.sh diff --git a/tests/baseline_configs/config.grid_RRFS_CONUS_13km_HRRRX_RAPX.sh b/tests/baseline_configs/config.grid_RRFS_CONUS_13km_ics_HRRRX_lbcs_RAPX_suite_GSD_SAR.sh similarity index 100% rename from tests/baseline_configs/config.grid_RRFS_CONUS_13km_HRRRX_RAPX.sh rename to tests/baseline_configs/config.grid_RRFS_CONUS_13km_ics_HRRRX_lbcs_RAPX_suite_GSD_SAR.sh diff --git a/tests/baseline_configs/config.grid_RRFS_CONUS_13km_ics_HRRRX_lbcs_RAPX_suite_RRFS_v1beta.sh b/tests/baseline_configs/config.grid_RRFS_CONUS_13km_ics_HRRRX_lbcs_RAPX_suite_RRFS_v1beta.sh new file mode 100644 index 000000000..cf21b53a7 --- /dev/null +++ b/tests/baseline_configs/config.grid_RRFS_CONUS_13km_ics_HRRRX_lbcs_RAPX_suite_RRFS_v1beta.sh @@ -0,0 +1,18 @@ +RUN_ENVIR="community" +PREEXISTING_DIR_METHOD="rename" + +PREDEF_GRID_NAME="RRFS_CONUS_13km" +GRID_GEN_METHOD="ESGgrid" +QUILTING="TRUE" + +CCPP_PHYS_SUITE="FV3_RRFS_v1beta" +FCST_LEN_HRS="06" +LBC_SPEC_INTVL_HRS="3" + +DATE_FIRST_CYCL="20200801" +DATE_LAST_CYCL="20200801" +CYCL_HRS=( "00" ) + +EXTRN_MDL_NAME_ICS="HRRRX" +EXTRN_MDL_NAME_LBCS="RAPX" +USE_USER_STAGED_EXTRN_FILES="TRUE" diff --git a/tests/baseline_configs/config.grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v15p2.sh b/tests/baseline_configs/config.grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v15p2.sh new file mode 100644 index 000000000..cfdf4a643 --- /dev/null +++ b/tests/baseline_configs/config.grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v15p2.sh @@ -0,0 +1,18 @@ +RUN_ENVIR="community" +PREEXISTING_DIR_METHOD="rename" + +PREDEF_GRID_NAME="RRFS_CONUS_25km" +GRID_GEN_METHOD="ESGgrid" +QUILTING="TRUE" + +CCPP_PHYS_SUITE="FV3_GFS_v15p2" +FCST_LEN_HRS="06" +LBC_SPEC_INTVL_HRS="3" + +DATE_FIRST_CYCL="20190701" +DATE_LAST_CYCL="20190701" +CYCL_HRS=( "00" ) + +EXTRN_MDL_NAME_ICS="FV3GFS" +EXTRN_MDL_NAME_LBCS="FV3GFS" +USE_USER_STAGED_EXTRN_FILES="TRUE" diff --git a/tests/baseline_configs/config.grid_RRFS_CONUS_25km_FV3GFS_FV3GFS.sh b/tests/baseline_configs/config.grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v16beta.sh similarity index 100% rename from tests/baseline_configs/config.grid_RRFS_CONUS_25km_FV3GFS_FV3GFS.sh rename to tests/baseline_configs/config.grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v16beta.sh diff --git a/tests/baseline_configs/config.grid_RRFS_CONUS_25km_HRRRX_RAPX.sh b/tests/baseline_configs/config.grid_RRFS_CONUS_25km_ics_HRRRX_lbcs_RAPX_suite_GSD_SAR.sh similarity index 100% rename from tests/baseline_configs/config.grid_RRFS_CONUS_25km_HRRRX_RAPX.sh rename to tests/baseline_configs/config.grid_RRFS_CONUS_25km_ics_HRRRX_lbcs_RAPX_suite_GSD_SAR.sh diff --git a/tests/baseline_configs/config.grid_RRFS_CONUS_25km_ics_HRRRX_lbcs_RAPX_suite_RRFS_v1beta.sh b/tests/baseline_configs/config.grid_RRFS_CONUS_25km_ics_HRRRX_lbcs_RAPX_suite_RRFS_v1beta.sh new file mode 100644 index 000000000..1e8030413 --- /dev/null +++ b/tests/baseline_configs/config.grid_RRFS_CONUS_25km_ics_HRRRX_lbcs_RAPX_suite_RRFS_v1beta.sh @@ -0,0 +1,18 @@ +RUN_ENVIR="community" +PREEXISTING_DIR_METHOD="rename" + +PREDEF_GRID_NAME="RRFS_CONUS_25km" +GRID_GEN_METHOD="ESGgrid" +QUILTING="TRUE" + +CCPP_PHYS_SUITE="FV3_RRFS_v1beta" +FCST_LEN_HRS="06" +LBC_SPEC_INTVL_HRS="3" + +DATE_FIRST_CYCL="20200801" +DATE_LAST_CYCL="20200801" +CYCL_HRS=( "00" ) + +EXTRN_MDL_NAME_ICS="HRRRX" +EXTRN_MDL_NAME_LBCS="RAPX" +USE_USER_STAGED_EXTRN_FILES="TRUE" diff --git a/tests/baseline_configs/config.grid_RRFS_CONUS_3km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v15p2.sh b/tests/baseline_configs/config.grid_RRFS_CONUS_3km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v15p2.sh new file mode 100644 index 000000000..9c442dab3 --- /dev/null +++ b/tests/baseline_configs/config.grid_RRFS_CONUS_3km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v15p2.sh @@ -0,0 +1,18 @@ +RUN_ENVIR="community" +PREEXISTING_DIR_METHOD="rename" + +PREDEF_GRID_NAME="RRFS_CONUS_3km" +GRID_GEN_METHOD="ESGgrid" +QUILTING="TRUE" + +CCPP_PHYS_SUITE="FV3_GFS_v15p2" +FCST_LEN_HRS="06" +LBC_SPEC_INTVL_HRS="3" + +DATE_FIRST_CYCL="20190701" +DATE_LAST_CYCL="20190701" +CYCL_HRS=( "00" ) + +EXTRN_MDL_NAME_ICS="FV3GFS" +EXTRN_MDL_NAME_LBCS="FV3GFS" +USE_USER_STAGED_EXTRN_FILES="TRUE" diff --git a/tests/baseline_configs/config.grid_RRFS_CONUS_3km_FV3GFS_FV3GFS.sh b/tests/baseline_configs/config.grid_RRFS_CONUS_3km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v16beta.sh similarity index 100% rename from tests/baseline_configs/config.grid_RRFS_CONUS_3km_FV3GFS_FV3GFS.sh rename to tests/baseline_configs/config.grid_RRFS_CONUS_3km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v16beta.sh diff --git a/tests/baseline_configs/config.grid_RRFS_CONUS_3km_HRRRX_RAPX.sh b/tests/baseline_configs/config.grid_RRFS_CONUS_3km_ics_HRRRX_lbcs_RAPX_suite_GSD_SAR.sh similarity index 100% rename from tests/baseline_configs/config.grid_RRFS_CONUS_3km_HRRRX_RAPX.sh rename to tests/baseline_configs/config.grid_RRFS_CONUS_3km_ics_HRRRX_lbcs_RAPX_suite_GSD_SAR.sh diff --git a/tests/baseline_configs/config.grid_RRFS_CONUS_3km_ics_HRRRX_lbcs_RAPX_suite_RRFS_v1beta.sh b/tests/baseline_configs/config.grid_RRFS_CONUS_3km_ics_HRRRX_lbcs_RAPX_suite_RRFS_v1beta.sh new file mode 100644 index 000000000..ee0535721 --- /dev/null +++ b/tests/baseline_configs/config.grid_RRFS_CONUS_3km_ics_HRRRX_lbcs_RAPX_suite_RRFS_v1beta.sh @@ -0,0 +1,18 @@ +RUN_ENVIR="community" +PREEXISTING_DIR_METHOD="rename" + +PREDEF_GRID_NAME="RRFS_CONUS_3km" +GRID_GEN_METHOD="ESGgrid" +QUILTING="TRUE" + +CCPP_PHYS_SUITE="FV3_RRFS_v1beta" +FCST_LEN_HRS="06" +LBC_SPEC_INTVL_HRS="3" + +DATE_FIRST_CYCL="20200801" +DATE_LAST_CYCL="20200801" +CYCL_HRS=( "00" ) + +EXTRN_MDL_NAME_ICS="HRRRX" +EXTRN_MDL_NAME_LBCS="RAPX" +USE_USER_STAGED_EXTRN_FILES="TRUE" diff --git a/tests/baselines_list.txt b/tests/baselines_list.txt index 9c2297087..c620625f7 100644 --- a/tests/baselines_list.txt +++ b/tests/baselines_list.txt @@ -13,12 +13,18 @@ grid_RRFS_AK_13km_FV3GFS_FV3GFS grid_RRFS_AK_13km_RAPX_RAPX grid_RRFS_AK_3km_FV3GFS_FV3GFS grid_RRFS_AK_3km_RAPX_RAPX -grid_RRFS_CONUS_13km_FV3GFS_FV3GFS -grid_RRFS_CONUS_13km_HRRRX_RAPX -grid_RRFS_CONUS_25km_FV3GFS_FV3GFS -grid_RRFS_CONUS_25km_HRRRX_RAPX -grid_RRFS_CONUS_3km_FV3GFS_FV3GFS -grid_RRFS_CONUS_3km_HRRRX_RAPX +grid_RRFS_CONUS_13km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v15p2 +grid_RRFS_CONUS_13km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v16beta +grid_RRFS_CONUS_13km_ics_HRRRX_lbcs_RAPX_suite_GSD_SAR +grid_RRFS_CONUS_13km_ics_HRRRX_lbcs_RAPX_suite_RRFS_v1beta +grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v15p2 +grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v16beta +grid_RRFS_CONUS_25km_ics_HRRRX_lbcs_RAPX_suite_GSD_SAR +grid_RRFS_CONUS_25km_ics_HRRRX_lbcs_RAPX_suite_RRFS_v1beta +grid_RRFS_CONUS_3km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v15p2 +grid_RRFS_CONUS_3km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v16beta +grid_RRFS_CONUS_3km_ics_HRRRX_lbcs_RAPX_suite_GSD_SAR +grid_RRFS_CONUS_3km_ics_HRRRX_lbcs_RAPX_suite_RRFS_v1beta grid_RRFS_SUBCONUS_3km_FV3GFS_FV3GFS grid_RRFS_SUBCONUS_3km_HRRRX_RAPX nco_RRFS_CONUS_25km_HRRRX_RAPX diff --git a/ush/NCL/calc_wrtcmp_grid_params_lambert_cnfrml.ncl b/ush/NCL/calc_wrtcmp_grid_params_lambert_cnfrml.ncl index d747f33d0..2a917a126 100644 --- a/ush/NCL/calc_wrtcmp_grid_params_lambert_cnfrml.ncl +++ b/ush/NCL/calc_wrtcmp_grid_params_lambert_cnfrml.ncl @@ -28,7 +28,7 @@ local lon_ctr, lat_ctr, lat1, lat2, \ num_gap_cells, \ dx, x_SW, x_NE, Lx, Lx_ovr_dx, nx, frac_x, x_increment, \ dy, y_SW, y_NE, Ly, Ly_ovr_dy, ny, frac_y, y_increment, \ - sphr_coords, lon_SW, lat_SW, \ + sphr_coords, lonctr_ll_cell, latctr_ll_cell, \ param_names, num_params, param_names_and_vals, trailing_comments, \ np, param_name, param_value, param_value_str, \ regex_search, regex_print, sed_cmd, \ @@ -119,8 +119,8 @@ begin ; dx = dx_native dy = dy_native -; num_margin_cells = 1 - num_margin_cells = 5 + num_margin_cells = 1 +; num_margin_cells = 5 ; num_margin_cells = 100 ; ; ********************************************************************** @@ -156,16 +156,16 @@ begin ; ; ********************************************************************** ; - y_S_native_max = max((/y_SW_native, y_S_native, y_SE_native/)) y_N_native_min = min((/y_NW_native, y_N_native, y_NE_native/)) y_S = y_S_native_max + num_margin_cells*dy y_N = y_N_native_min - num_margin_cells*dy - y_S_tmp = y_S - y_N_tmp = y_N - y_S = -min(abs((/y_S_tmp, y_N_tmp/))) +; The following forces the write-component domain in Lambert conformal +; space (i.e. the xy-plane) to be symmetric (about (x,y)=(0,0)) in the y +; direction. Can't remember why I wanted to enforece this... + y_S = -min(abs((/y_S, y_N/))) y_N = -y_S Ly = y_N - y_S @@ -178,23 +178,28 @@ begin ; ; ********************************************************************** ; -; Calculate the spherical coordinates of the southwest corner of the na- -; tive grid from its Lambert coordinates. +; Calculate the spherical coordinates of the southwest corner of the +; native grid from its Lambert coordinates. +; +; Note that the coordinates that the write-component takes as input are +; those of the center of the grid cell at the lower-left corner of the +; grid. However, the Lambert coordinates (x_W, y_S) caluclated above +; are those of the lower-left vertex (not center) of that cell. Thus, +; we first add half a grid distance in the x and y directions to the +; Lambert coordinates of the vertex to obtain the Lambert coordinates of +; the cell center. We then convert the result to spherical coordinates. ; ; ********************************************************************** ; - x_W = x_W + 0.5*dx - x_E = x_E - 0.5*dx - - y_S = y_S + 0.5*dy - y_N = y_N - 0.5*dy + xctr_ll_cell = x_W + 0.5*dx + yctr_ll_cell = y_S + 0.5*dy sphr_coords \ := convert_lambert_cnfrml_coords_to_sphr( \ lon_ctr, lat_ctr, lat1, lat2, rad_Earth, angle_units, \ - x_W, y_S) - lon_SW = sphr_coords@lon - lat_SW = sphr_coords@lat + xctr_ll_cell, yctr_ll_cell) + lonctr_ll_cell = sphr_coords@lon + latctr_ll_cell = sphr_coords@lat ; ; ********************************************************************** ; @@ -280,10 +285,10 @@ begin param_value := ny fmt_str = "%10.0f" else if (strcmp_exact(param_name, "lon1")) then - param_value := lon_SW + param_value := lonctr_ll_cell fmt_str = "%16.8f" else if (strcmp_exact(param_name, "lat1")) then - param_value := lat_SW + param_value := latctr_ll_cell fmt_str = "%16.8f" else if (strcmp_exact(param_name, "dx")) then param_value := dx diff --git a/ush/NCL/calc_wrtcmp_grid_params_rotated_latlon.ncl b/ush/NCL/calc_wrtcmp_grid_params_rotated_latlon.ncl index 4038b69ca..250442161 100644 --- a/ush/NCL/calc_wrtcmp_grid_params_rotated_latlon.ncl +++ b/ush/NCL/calc_wrtcmp_grid_params_rotated_latlon.ncl @@ -12,6 +12,7 @@ loadscript(lib_location + "strpad.ncl") loadscript(lib_location + "repeat_str.ncl") loadscript(lib_location + "calc_rotated_sphr_coords_from_sphr.ncl") loadscript(lib_location + "calc_sphr_coords_from_rotated_sphr.ncl") +loadscript(lib_location + "convert_from_to_sphr_coords_to_from_rotated_sphr.ncl") undef("calc_wrtcmp_grid_params_rotated_latlon") @@ -61,23 +62,79 @@ begin ; lon_ctr = lon_ctr_native lat_ctr = lat_ctr_native - lat1 = lat_ctr - lat2 = lat_ctr ; ; ********************************************************************** ; -; Calculate the Lambert coordinates of the southwest corner of the na- -; tive grid from its spherical coordinates. +; The following is a manual intervention to ensure that the first elements +; of lon_tile_corners_face_midpts_native and lat_tile_corners_face_midpts_native +; represent the southwest corner of the grid. If that is already the case, +; i_start should be set to 0. +; +; Note that this will not be the case for a GFDLgrid type of grid because +; for that case, tile 6 on which the regional grid (tile 7) is based starts +; its numbering such that the northeast corner of the tile is (i,j) = (0,0), +; and i increases going west while j increases going south. For that case, +; i_start must be set to 4 (since the northwest corner is the first element +; and thus has an index of 0, so we have to march four points forward - +; to the midpoint of the north face, then to the northwest corner, then +; to the midpoint of the west face, and finally to the southwest corner). +; +; The following may also be needed for grids (of either GFDLgrid or ESGgrid +; type) that straddle the international date line (which is the case if +; they include one or the other pole). The RAP domain is such an example. +; In such cases, the order of the coordinates must be manually verified +; and possbily fixed using the code below. +; +; ********************************************************************** +; +if (False) +;if (True) + +print("") +print("(lon_tile_corners_face_midpts_native, lat_tile_corners_face_midpts_native) = " + \ + lon_tile_corners_face_midpts_native + ", " + \ + lat_tile_corners_face_midpts_native) +pause + + i_start = 4 + + nn = dimsizes(lon_tile_corners_face_midpts_native) + i_end = i_start + nn - 1 + + i_vec = ispan(i_start, i_end, 1) + i_vec = where(i_vec .gt. nn-1, i_vec - nn, i_vec) + + lon_tile_corners_face_midpts_native := lon_tile_corners_face_midpts_native(i_vec) + lat_tile_corners_face_midpts_native := lat_tile_corners_face_midpts_native(i_vec) +print("") +print("(lon_tile_corners_face_midpts_native, lat_tile_corners_face_midpts_native) = " + \ + lon_tile_corners_face_midpts_native + ", " + \ + lat_tile_corners_face_midpts_native) +pause + +end if + + +; +; ********************************************************************** +; +; Calculate the rotated spherical coordinates of the southwest corner of +; the native grid from its spherical coordinates. ; ; ********************************************************************** ; - lambert_coords \ - := calc_rotated_sphr_coords_from_sphr( \ - lon_ctr, lat_ctr, lat1, lat2, angle_units, \ + rotated_sphr_coords \ + := convert_from_to_sphr_coords_to_from_rotated_sphr( \ + lon_ctr, lat_ctr, angle_units, 1, \ lon_tile_corners_face_midpts_native, \ lat_tile_corners_face_midpts_native) - x_tile_corners_face_midpts_native = lambert_coords@x - y_tile_corners_face_midpts_native = lambert_coords@y + x_tile_corners_face_midpts_native = rotated_sphr_coords@lon_out + y_tile_corners_face_midpts_native = rotated_sphr_coords@lat_out +;print("") +;print("(x_tile_corners_face_midpts_native, y_tile_corners_face_midpts_native) = " + \ +; x_tile_corners_face_midpts_native + ", " + \ +; y_tile_corners_face_midpts_native) +;pause i = 0 x_SW_native = x_tile_corners_face_midpts_native(i) @@ -117,10 +174,13 @@ begin ; ; ********************************************************************** ; - dx = dx_native - dy = dy_native -; num_margin_cells = 1 - num_margin_cells = 5 + +; Calculate grid size in degrees along the rotated spherical coordinates. + dx = (dx_native/rad_Earth)*degs_per_rad + dy = (dy_native/rad_Earth)*degs_per_rad + + num_margin_cells = 1 +; num_margin_cells = 5 ; num_margin_cells = 100 ; ; ********************************************************************** @@ -162,9 +222,7 @@ begin y_S = y_S_native_max + num_margin_cells*dy y_N = y_N_native_min - num_margin_cells*dy - y_S_tmp = y_S - y_N_tmp = y_N - y_S = -min(abs((/y_S_tmp, y_N_tmp/))) + y_S = -min(abs((/y_S, y_N/))) y_N = -y_S Ly = y_N - y_S @@ -177,23 +235,29 @@ begin ; ; ********************************************************************** ; -; Calculate the spherical coordinates of the southwest corner of the na- -; tive grid from its Lambert coordinates. +; Calculate the spherical coordinates of the southwest corner of the +; native grid from its Lambert coordinates. ; ; ********************************************************************** ; - x_W = x_W + 0.5*dx - x_E = x_E - 0.5*dx + lon_ctr_ll_cell = x_W + 0.5*dx + lat_ctr_ll_cell = y_S + 0.5*dy + + lon_ctr_ur_cell = x_E - 0.5*dx + lat_ctr_ur_cell = y_N - 0.5*dy + +; dlon = dx*degs_per_rad +; dlat = dy*degs_per_rad - y_S = y_S + 0.5*dy - y_N = y_N - 0.5*dy + dlon = dx + dlat = dy - sphr_coords \ - := calc_sphr_coords_from_rotated_sphr( \ - lon_ctr, lat_ctr, lat1, lat2, rad_Earth, angle_units, \ - x_W, y_S) - lon_SW = sphr_coords@lon - lat_SW = sphr_coords@lat +; sphr_coords \ +; := calc_sphr_coords_from_rotated_sphr( \ +; lon_ctr, lat_ctr, lat1, lat2, rad_Earth, angle_units, \ +; x_W, y_S) +; lon_SW = sphr_coords@lon +; lat_SW = sphr_coords@lat ; ; ********************************************************************** ; @@ -265,22 +329,22 @@ begin param_value := lat_ctr fmt_str = "%16.8f" else if (strcmp_exact(param_name, "lon1")) then - param_value := lon_SW + param_value := lon_ctr_ll_cell fmt_str = "%16.8f" else if (strcmp_exact(param_name, "lat1")) then - param_value := lat_SW + param_value := lat_ctr_ll_cell fmt_str = "%16.8f" else if (strcmp_exact(param_name, "lon2")) then - param_value := lon_SW + param_value := lon_ctr_ur_cell fmt_str = "%16.8f" else if (strcmp_exact(param_name, "lat2")) then - param_value := lat_SW + param_value := lat_ctr_ur_cell fmt_str = "%16.8f" else if (strcmp_exact(param_name, "dlon")) then - param_value := dx + param_value := dlon fmt_str = "%16.8f" else if (strcmp_exact(param_name, "dlat")) then - param_value := dy + param_value := dlat fmt_str = "%16.8f" else diff --git a/ush/NCL/find_wrtcmp_grid_params.ncl b/ush/NCL/find_wrtcmp_grid_params.ncl index c70045d13..d7b3d97c9 100644 --- a/ush/NCL/find_wrtcmp_grid_params.ncl +++ b/ush/NCL/find_wrtcmp_grid_params.ncl @@ -9,6 +9,21 @@ ;help = True expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/test_latest_20191002/expt_dirs/test_sheleg_GSD_HRRR3km_01" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_feature_predef_grids/expt_dirs/try01/grid_GSD_HRRR13km" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_feature_predef_grids/expt_dirs/try01/suite_FV3_GSD_SAR" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_feature_predef_grids/expt_dirs/try01/suite_FV3_GSD_SAR_3km_works03" +;expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_feature_predef_grids/expt_dirs/try01/suite_FV3_GSD_SAR_3km" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_feature_predef_grids/expt_dirs/try01/grid_RRFS_SUBCONUS_3km" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_feature_predef_grids/expt_dirs/try01/grid_CONUS_25km_GFDLgrid" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_feature_predef_grids/expt_dirs/try01/grid_CONUS_3km_GFDLgrid" +;expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_feature_predef_grids/expt_dirs/try01/grid_RRFS_AK_3km" +;expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_feature_predef_grids/expt_dirs/try01/grid_RRFS_AK_13km" +;expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_feature_predef_grids/expt_dirs/try01/grid_RRFS_AK_13km_old001" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_bugfix_adjust_CONUS_grids/expt_dirs/try01/grid_RRFS_CONUS_13km_HRRRX_RAPX" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_bugfix_adjust_CONUS_grids/expt_dirs/try01/grid_RRFS_CONUS_3km_FV3GFS_FV3GFS" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_bugfix_adjust_CONUS_grids/expt_dirs/try03/grid_RRFS_CONUS_13km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v15p2" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_bugfix_adjust_CONUS_grids/expt_dirs/try03/grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v15p2" + ; ; ********************************************************************** @@ -85,16 +100,17 @@ begin var_defns_fp = expt_dir + "/var_defns.sh" param_names = (/ \ -"WRTCMP_PARAMS_TEMPLATE_FP", \ +"WRTCMP_PARAMS_TMPL_FP", \ "WRTCMP_output_grid", \ -"gtype", \ +"GTYPE", \ "CRES", \ -"delx", \ -"dely", \ -"nh4_T7" /) +"ESGgrid_DELX", \ +"ESGgrid_DELY", \ +"NH4" /) num_params = dimsizes(param_names) do np=0, num_params-1 +print("np = " + np) param_name = param_names(np) regex_search = "^\s*" + param_name + "=(" + char_dq + "([^" \ @@ -104,23 +120,28 @@ begin + "s/" + regex_search + "/" + regex_print + "/p" + char_sq \ + " " + var_defns_fp sed_output = systemfunc(sed_cmd) +print("sed_output = " + sed_output) ; ; Convert the output from the sed command (which will be a string) to ; the appropriate NCL data type. ; - if (strcmp_exact(param_name, "WRTCMP_PARAMS_TEMPLATE_FP")) then - WRTCMP_PARAMS_TEMPLATE_FP = tostring(sed_output) + if (strcmp_exact(param_name, "WRTCMP_PARAMS_TMPL_FP")) then + WRTCMP_PARAMS_TMPL_FP = tostring(sed_output) else if (strcmp_exact(param_name, "WRTCMP_output_grid")) then WRTCMP_output_grid = tostring(sed_output) - else if (strcmp_exact(param_name, "gtype")) then - gtype = tostring(sed_output) + else if (strcmp_exact(param_name, "GTYPE")) then + GTYPE = tostring(sed_output) else if (strcmp_exact(param_name, "CRES")) then CRES = tostring(sed_output) - else if (strcmp_exact(param_name, "delx")) then + else if (strcmp_exact(param_name, "ESGgrid_DELX")) then dx_native = todouble(sed_output) - else if (strcmp_exact(param_name, "dely")) then +;dx_native = 25122.693954919 ; Need if using the CONUS_25km_GFDLgrid grid +;dx_native = 2964.19334212185 ; Need if using the CONUS_3km_GFDLgrid grid + else if (strcmp_exact(param_name, "ESGgrid_DELY")) then dy_native = todouble(sed_output) - else if (strcmp_exact(param_name, "nh4_T7")) then +;dy_native = 25122.693954919 ; Need if using the CONUS_25km_GFDLgrid grid +;dy_native = 2964.19334212185 ; Need if using the CONUS_3km_GFDLgrid grid + else if (strcmp_exact(param_name, "NH4")) then nhalo_T7 = tointeger(sed_output) else @@ -145,11 +166,12 @@ begin ; ; ********************************************************************** ; -; Check that gtype has the proper value. +; Check that GTYPE has the proper value. ; ; ********************************************************************** ; - if (strcmp_exact(gtype, "regional")) then +print("AAAAAAAAAAAAAAAAAAAAAAAAAAA") + if (strcmp_exact(GTYPE, "regional")) then inds_tiles_to_plot = (/ 7 /) @@ -157,9 +179,9 @@ begin msg := char_nl + \ "ERROR: " + curnt_script_proc_func_name + ":" + char_nl + \ -"This script is designed to handle only regional grids. Thus, gtype" + char_nl + \ +"This script is designed to handle only regional grids. Thus, GTYPE" + char_nl + \ "may only be set to " + char_dq + "regional" + char_dq + ":" + char_nl + \ -" gtype = " + char_dq + gtype + char_dq + char_nl + \ +" GTYPE = " + char_dq + GTYPE + char_dq + char_nl + \ "Stopping." + char_nl print("" + msg) @@ -173,12 +195,13 @@ begin ; ; ********************************************************************** ; +print("BBBBBBBBBBBBBBBBBBBBBBBBBBB") remove_rgnl_halo = True get_tile_bdies = False grid_info := read_FV3LAM_grid_native( \ expt_dir, \ - gtype, \ + GTYPE, \ CRES, \ inds_tiles_to_plot, \ get_tile_bdies, \ @@ -192,6 +215,14 @@ begin = grid_info@lon_tile_corners_face_midpts_all_tiles lat_tile_corners_face_midpts_tiles_to_plot \ = grid_info@lat_tile_corners_face_midpts_all_tiles + +;lon_tile_corners_face_midpts_tiles_to_plot \ +;= where(lon_tile_corners_face_midpts_tiles_to_plot .gt. 0.0d+0, \ +; lon_tile_corners_face_midpts_tiles_to_plot - 360.0d+0, \ +; lon_tile_corners_face_midpts_tiles_to_plot) +;print("lon_tile_corners_face_midpts_tiles_to_plot, lat_tile_corners_face_midpts_tiles_to_plot = " + \ +; lon_tile_corners_face_midpts_tiles_to_plot + ", " + lat_tile_corners_face_midpts_tiles_to_plot) +;pause ; ; ********************************************************************** ; @@ -202,7 +233,7 @@ begin ; ********************************************************************** ; wrtcmp_config_fp = expt_dir + "/aaaa" - sys_output = systemfunc("cp " + WRTCMP_PARAMS_TEMPLATE_FP + \ + sys_output = systemfunc("cp " + WRTCMP_PARAMS_TMPL_FP + \ " " + wrtcmp_config_fp) ; ; ********************************************************************** diff --git a/ush/NCL/lib/append_to_snumeric_array.ncl b/ush/NCL/lib/append_to_snumeric_array.ncl new file mode 100644 index 000000000..5734024b0 --- /dev/null +++ b/ush/NCL/lib/append_to_snumeric_array.ncl @@ -0,0 +1,130 @@ +; +; ********************************************************************** +; +; File name: append_to_snumeric_array.ncl +; Author: Gerard Ketefian +; +; Description: +; ^^^^^^^^^^^ +; This function appends to the snumeric array orig_array the snumeric +; array array_to_append. The result is saved in new_array and returned. +; Note that if the two arrays are not of the same snumeric type, then +; array_to_append is converted to the type of orig_array before appending +; it to orig_array. +; +; ********************************************************************** +; +loadscript(lib_location + "strcmp_exact.ncl") + +undef("append_to_snumeric_array") + +function append_to_snumeric_array( \ + orig_array:snumeric, array_to_append:snumeric) + +local dims_orig_array, \ + num_dims_orig_array, \ + dims_orig_array_str, \ +\ + dims_array_to_append, \ + num_dims_array_to_append, \ + dims_array_to_append_str, \ +\ + msg, \ +\ + num_dims, \ + dims_compare, \ + right_dims_equal, \ +\ + tmp, \ + new_array + +begin +; +; ********************************************************************** +; +; Get the dimensions and the number of dimensions of the two input arrays. +; +; ********************************************************************** +; + dims_orig_array := dimsizes(orig_array) + num_dims_orig_array := dimsizes(dims_orig_array) + dims_orig_array_str \ + := "(/ " + str_join(tostring(dims_orig_array), ", ") + " /)" + + dims_array_to_append := dimsizes(array_to_append) + num_dims_array_to_append := dimsizes(dims_array_to_append) + dims_array_to_append_str \ + := "(/ " + str_join(tostring(dims_array_to_append), ", ") + " /)" +; +; ********************************************************************** +; +; Check that the two input arrays have the same number of dimensions. +; +; ********************************************************************** +; + if (num_dims_array_to_append .ne. num_dims_orig_array) then + msg = "" + char_nl + \ +"Error:" + char_nl + \ +"The number of dimensions of orig_array (num_dims_orig_array) and of " + char_nl + \ +"array_to_append (num_dims_array_to_append) must be the same:" + char_nl + \ +" dims_orig_array = " + dims_orig_array_str + char_nl + \ +" dims_array_to_append = " + dims_array_to_append_str + char_nl + \ +" num_dims_orig_array = " + num_dims_orig_array + char_nl + \ +" num_dims_array_to_append = " + num_dims_array_to_append + char_nl + \ +"Stopping." + print("" + msg) + exit + end if +; +; ********************************************************************** +; +; Check that all dimensions in the two input arrays after (i.e. to the +; right of) the first dimension are identical. +; +; ********************************************************************** +; + num_dims = num_dims_orig_array + if (num_dims .gt. 1) then + dims_compare := (dims_orig_array .eq. dims_array_to_append) + right_dims_equal := all(dims_compare(1:)) + else + right_dims_equal := True + end if + + if (.not. right_dims_equal) then + msg = "" + char_nl + \ +"Error:" + char_nl + \ +"All dimensions of orig_array and array_to_append after the first dimension" + char_nl + \ +"must be equal:" + char_nl + \ +" dims_orig_array = " + dims_orig_array_str + char_nl + \ +" dims_array_to_append = " + dims_array_to_append_str + char_nl + \ +"Stopping." + print("" + msg) + exit + end if +; +; ********************************************************************** +; +; If necessary, convert the type of array_to_append to that of orig_array. +; +; ********************************************************************** +; + tmp := array_to_append + if (.not. strcmp_exact(typeof(tmp), typeof(orig_array))) then + tmp := totype(tmp, typeof(orig_array)) + end if +; +; ********************************************************************** +; +; Append array_to_append to orig_array and save the result in new_array. +; Then return new_array. +; +; ********************************************************************** +; + new_array := array_append_record(orig_array, tmp, 0) + + return(new_array) + +end + + diff --git a/ush/NCL/lib/interpol_extrapol_linear.ncl b/ush/NCL/lib/interpol_extrapol_linear.ncl new file mode 100644 index 000000000..9f5afcfdc --- /dev/null +++ b/ush/NCL/lib/interpol_extrapol_linear.ncl @@ -0,0 +1,52 @@ +; +; ********************************************************************** +; +; File name: interpol_extrapol_linear.ncl +; Author: Gerard Ketefian +; +; Description: +; ^^^^^^^^^^^ +; This function compares each element of the string array str_array to +; the string (scalar) str. It returns a variable (match_found) that +; will be set to True if at least one element of str_array is identical +; to str and False otherwise (i.e. it will be set to False if none of +; the elements of str_array are identical to str). This function also +; returns (as an attribute of match_found) a 1-D logical array (exact_- +; match) having the same dimensions as str_array that will be True at +; those indices at which str_array is identical to str and False every- +; where else. +; +; Note that str_array may be a scalar string, in which case this func- +; tion simply compares two strings. If the two strings are identical, +; then this function returns True in match_found as well as its attri- +; bute match_found@str_array (which in this case will be a scalar). If +; the two strings are not identical, then match_found and match_found@- +; match_by_elem will both be False. +; +; ********************************************************************** +; +undef("interpol_extrapol_linear") + +function interpol_extrapol_linear( \ + x1[*]:snumeric, y1[*]:snumeric, \ + x2[*]:snumeric, y2[*]:snumeric, \ + x[*]:snumeric) + +local slope, y_int, y + +begin +; +; ********************************************************************** +; +; Perform linear interpolation and return the result. +; +; ********************************************************************** +; + slope := (y2 - y1)/(x2 - x1) + y_int := (x2*y1 - x1*y2)/(x2 - x1) + y := slope*x + y_int + return(y) + +end + + diff --git a/ush/NCL/plot_FV3LAM_field_native.ncl b/ush/NCL/plot_FV3LAM_field_native.ncl index a28dc77e6..11facf61c 100644 --- a/ush/NCL/plot_FV3LAM_field_native.ncl +++ b/ush/NCL/plot_FV3LAM_field_native.ncl @@ -18,11 +18,14 @@ ;help = True -expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/FV3LAM_demo_PASPBL_20190725/expt_dirs/test_GSD_HRRR25km" -expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/FV3LAM_demo_PASPBL_20190725/expt_dirs/test_GSD_HRRR13km" -expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/FV3LAM_demo_PASPBL_20190725/expt_dirs/test_GSD_HRRR3km" -expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/FV3LAM_demo_PASPBL_20190725/expt_dirs/test_GSD_HAFSV0.A" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/FV3SAR_demo_PASPBL_20190725/expt_dirs/test_GSD_HRRR25km" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/FV3SAR_demo_PASPBL_20190725/expt_dirs/test_GSD_HRRR13km" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/FV3SAR_demo_PASPBL_20190725/expt_dirs/test_GSD_HRRR3km" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/FV3SAR_demo_PASPBL_20190725/expt_dirs/test_GSD_HAFSV0.A" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/expt_dirs/regional_001_old001" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/expt_dirs/regional_003_works01" +CDATE="2019052000" tile_inds := (/ 1, 7, 4 /) ;tile_inds := (/ 1, 4 /) @@ -48,6 +51,7 @@ file_basename = "atmos_static" file_basename = "fv3_history2d" file_basename = "phyf000" +file_basename = "C401_oro_data.tile7.halo0.nc" ; This is a temporary change for plotting ICs. ;file_basename = "sfc_data.tile7" @@ -63,7 +67,7 @@ field_name = "sqrt_cell_area" ;field_name = "angle_cell_dx" ;field_name = "angle_cell_dy" -;field_name = "orog_raw" +field_name = "orog_raw" ;field_name = "orog_filt" ;field_name = "time" @@ -74,7 +78,7 @@ field_name = "sqrt_cell_area" ;field_name = "spfh" ;field_name = "cnwat" ;field_name = "zsurf" -field_name = "sltyp" +;field_name = "sltyp" ;field_name = "slc" ;field_name = "smc" ;field_name = "stc" @@ -86,16 +90,17 @@ field_name = "sltyp" ;field_name = "rainwat" ;field_name = "none" +;field_name = "c0" map_proj = "cyln" -;map_proj = "ortho" +map_proj = "ortho" ; ; This should be set to (0,0) for "cyln" map projection. ; map_proj_ctr = (/ 0.0, 0.0 /) ; This should be set to (0,0) for "cyln" map projection. ;map_proj_ctr = (/ -106.0, 54.0 /) ; RAP domain. -;map_proj_ctr = (/ -97.5, 38.5 /) ; HRRR domain. +map_proj_ctr = (/ -97.5, 38.5 /) ; HRRR domain. ;map_proj_ctr = (/ 6.0, 54.0 /) ; RAP domain corner. @@ -141,7 +146,7 @@ remove_rgnl_halo = True show_RAP_bdy = True -;show_RAP_bdy = False +show_RAP_bdy = False RAP_bdy_color = "red" @@ -159,7 +164,8 @@ field_name_RAP = "sqrt_cell_area" ; This is for HRRR grib2 file. field_name_RAP = "VGTYP_P0_L1_GLC0" -RAP_dir = "/scratch1/BMC/fim/Gerard.Ketefian/regional_FV3_EMC_visit_20180509" +;RAP_dir = "/scratch1/BMC/fim/Gerard.Ketefian/regional_FV3_EMC_visit_20180509" +RAP_dir = "/scratch1/BMC/gsd-fv3-dev/Gerard.Ketefian/regional_FV3_EMC_visit_20180509" ;RAP_grid_fn = "/home/Gerard/fv3_regional/fv3sar_workflow/ush/NCL/plot_grid.ncl" ;RAP_grid_fn = "/scratch3/BMC/fim/Gerard.Ketefian/regional_FV3_EMC_visit_20180509/geo_em.d01.RAP.nc" ;RAP_grid_fn = RAP_dir + "/geo_em.d01.RAP.nc" @@ -226,6 +232,7 @@ load "plot_horiz_field.ncl" load "set_file_field_names.ncl" load "get_wrtcmp_grid.ncl" load "calc_wrtcmp_grid_params_lambert_cnfrml.ncl" +load "calc_wrtcmp_grid_params.ncl" load "make_plot_titles.ncl" begin @@ -505,14 +512,15 @@ end if show_wrtcmp_grid = False show_wrtcmp_bdy = True -; show_wrtcmp_bdy = False + show_wrtcmp_bdy = False wrtcmp_bdy_color = "green" ; rd := "/scratch3/BMC/det/Gerard.Ketefian/UFS_CAM_test_instructions/expt_dirs/NX1800_NY1120_A0p21423_Kmns0p23209_HRRR_test_cycl_slurm_01/2017090700" ; rd := "/scratch3/BMC/det/Gerard.Ketefian" - rd := run_dir + "/2019052000" +; rd := run_dir + "/2019052000" + rd := expt_dir + "/" + CDATE + "00" wrtcmp_config_fn := rd + "/model_configure" ; wrtcmp_config_tmpl_fn = wrtcmp_config_fn + ".tmpl" @@ -523,6 +531,7 @@ end if ; ; ********************************************************************** ; +;if (False) then if (show_wrtcmp_grid .or. show_wrtcmp_bdy) then print("") print("wrtcmp_config_fn = " + char_dq + wrtcmp_config_fn + char_dq) @@ -546,20 +555,23 @@ pause print("lat_grid_cntr_wrtcmp = " + lat_grid_cntr_wrtcmp + " deg") pause - - out := calc_wrtcmp_grid_params( \ - wrtcmp_config_fn, \ - lon_ctr_native, lat_ctr_native, \ - lon_tile_corners_face_midpts_native, \ - lat_tile_corners_face_midpts_native, \ - dx_native, dy_native, \ - angle_units) - -print("") -print("out = " + out) -pause +;lon_ctr_native = lon_grid_cntr_wrtcmp +;lat_ctr_native = lat_grid_cntr_wrtcmp +; +; out := calc_wrtcmp_grid_params( \ +; wrtcmp_config_fn, \ +; lon_ctr_native, lat_ctr_native, \ +; lon_tile_corners_face_midpts_native, \ +; lat_tile_corners_face_midpts_native, \ +; dx_native, dy_native, \ +; angle_units) +; +;print("") +;print("out = " + out) +;pause end if +;end if ; ; ********************************************************************** ; @@ -989,6 +1001,8 @@ pause horiz_area_units) file_names_by_tile := file_field_info@file_names_by_tile +;file_names_by_tile := expt_dir + "/fix_sar/C401_oro_data.tile7.halo0.nc" +file_names_by_tile := expt_dir + "/fix_lam/C401_oro_data.tile7.halo0.nc" field_names_by_tile := file_field_info@field_names_by_tile func_xy_only := file_field_info@func_xy_only func_xyz_only := file_field_info@func_xyz_only @@ -1045,6 +1059,8 @@ pause ) else +print("") +print("XXXXXXXXXXX") field_info \ := read_FV3LAM_field_native( \ @@ -1130,6 +1146,7 @@ inds_tiles_to_plot_str + " ..." ; ********************************************************************** ; field_unstruc_all_grids := field_unstruc +print("AAAAAAA dimsizes(field_unstruc_all_grids) = " + dimsizes(field_unstruc_all_grids)) ; ; ********************************************************************** ; @@ -1146,6 +1163,10 @@ inds_tiles_to_plot_str + " ..." ; ; ********************************************************************** ; +field_name_RAP = "AAAA" +field_desc_RAP = "BBBB" +field_units_RAP = "CCCC" + if (show_RAP_grid .or. plot_RAP_field) then ; ; ********************************************************************** @@ -1198,6 +1219,8 @@ inds_tiles_to_plot_str + " ..." field_unstruc_all_grids \ := array_append_record( \ field_unstruc_RAP, field_unstruc_all_grids, 0) +print("") +print("BBBBBB dimsizes(field_unstruc_all_grids) = " + dimsizes(field_unstruc_all_grids)) end if ; @@ -1263,6 +1286,7 @@ inds_tiles_to_plot_str + " ..." ; ; ********************************************************************** ; +nn=0 title_info \ := make_plot_titles( \ inds_tiles_to_plot, \ @@ -1282,6 +1306,9 @@ inds_tiles_to_plot_str + " ..." left_str := title_info@left_str main_str := title_info@main_str right_str := title_info@right_str +left_str := "" +main_str := "" +right_str := "" ; ; ********************************************************************** ; @@ -1437,9 +1464,10 @@ inds_tiles_to_plot_str + " ..." extrnl_tag = "extrnl" bdy_plot_order := new(num_bdies_to_plot, "string") -bdy_plot_order(0) = wrtcmp_tag -bdy_plot_order(1) = extrnl_tag -bdy_plot_order(2) = native_tag +;bdy_plot_order(0) = wrtcmp_tag +;bdy_plot_order(1) = extrnl_tag +;bdy_plot_order(2) = native_tag +bdy_plot_order(0) = native_tag indx_ptr_start := new(num_bdies_to_plot, "integer") indx_ptr_end := new(num_bdies_to_plot, "integer") @@ -1601,6 +1629,10 @@ end if ; Temporarily make the field all missing/fill values, so we can see grids/boundaries. ;field_unstruc_all_grids = field_unstruc_all_grids@_FillValue +print("nx_all_grids = " + nx_all_grids) +print("") +print("CCCCCCC dimsizes(field_unstruc_all_grids) = " + dimsizes(field_unstruc_all_grids)) + plot_info := plot_horiz_field( \ fn_graphics, \ nx_all_grids, ny_all_grids, \ diff --git a/ush/NCL/plot_grid.ncl b/ush/NCL/plot_grid.ncl index 6f9a10e2a..5c5f903b8 100644 --- a/ush/NCL/plot_grid.ncl +++ b/ush/NCL/plot_grid.ncl @@ -20,20 +20,91 @@ ;run_dir = "ABCD" ;run_dir = "/home/Gerard/fv3_regional/fv3sar_workflow/ush/NCL" -run_dir = "/scratch3/BMC/det/Gerard.Ketefian/UFS_CAM_test_instructions/expt_dirs/NX1734_NY1008_A0p21423_Kmns0p23209_HRRR_test_HRRRgrid02" -run_dir = "/scratch3/BMC/det/Gerard.Ketefian/UFS_CAM_test_instructions/expt_dirs/NX1800_NY1120_A0p21423_Kmns0p23209_HRRR_test_cycl_slurm_01" +;run_dir = "/scratch3/BMC/det/Gerard.Ketefian/UFS_CAM_test_instructions/expt_dirs/NX1734_NY1008_A0p21423_Kmns0p23209_HRRR_test_HRRRgrid02" +;run_dir = "/scratch3/BMC/det/Gerard.Ketefian/UFS_CAM_test_instructions/expt_dirs/NX1800_NY1120_A0p21423_Kmns0p23209_HRRR_test_cycl_slurm_01" + +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/expt_dirs/regional_001_old001" +expt_dir = "/scratch2/BMC/det/beck/SAR-FV3/run_dirs/real_time2" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/expt_dirs/regional_007" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/expt_dirs/GFDLgrid_debug_verif" +;expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/expt_dirs/GFDLgrid_debug_verif_preprocess_good" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/expt_dirs/GFDLgrid_AK_3km" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/expt_dirs/new_JPgrid" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/expt_dirs/RTMA_grid_25km" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/expt_dirs/regional_003" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/expt_dirs/GSD_RAP13km" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/expt_dirs/GSD_RAP13km_works02" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/expt_dirs/RRFS_HRRR3km_from_regional_003" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/expt_dirs/regional_002_GSD_HRRR3km" +;expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/expt_dirs/nco_GSD_HRRR3km" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_bugfix_rrfs_v1beta/expt_dirs/regional_002" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_bugfix_rrfs_v1beta/expt_dirs/FV3_RRFS_v1beta" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_bugfix_rrfs_v1beta/expt_dirs/FV3_RRFS_v1beta_3km" +;expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_bugfix_adjust_CONUS_grids/expt_dirs/regional_002_25km" +;expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_bugfix_adjust_CONUS_grids/expt_dirs/regional_002_13km" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_bugfix_rrfs_v1beta/expt_dirs/subconus" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_bugfix_rrfs_v1beta/expt_dirs/nco_GSD_SUBCONUS3km_HRRRX_RAPX_works01" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_feature_WE2E_testing/expt_dirs/try13/regional_002" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_feature_WE2E_testing/expt_dirs/try13/nco_GSD_HRRR3km_HRRRX_RAPX" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_feature_WE2E_testing/expt_dirs/try15/suite_FV3_GSD_SAR_3km" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_feature_predef_grids/expt_dirs/try01/grid_GSD_HRRR13km" CDATE="2017090712" +CDATE="2019052000" +;CDATE="2020031212" +;CDATE="2017090700" +CDATE="2019070100" +;CDATE="2020080100" +;expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_feature_predef_grids/expt_dirs/try01/suite_FV3_GSD_SAR_3km_works03" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_feature_predef_grids/expt_dirs/try01/suite_FV3_GSD_SAR_3km" +CDATE="2019052000" -tile_inds := (/ 1, 7, 4 /) +;expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_feature_predef_grids/expt_dirs/try01/grid_GSD_HRRR13km" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_feature_predef_grids/expt_dirs/try01/grid_RRFS_CONUS_13km" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_feature_predef_grids/expt_dirs/try01/grid_RRFS_CONUS_13km_HRRRX_RAPX" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_bugfix_adjust_CONUS_grids/expt_dirs/try01/grid_RRFS_CONUS_13km_FV3GFS_FV3GFS" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_bugfix_adjust_CONUS_grids/expt_dirs/try03/grid_RRFS_CONUS_13km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v15p2" +CDATE="2019070100" + +;expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_bugfix_adjust_CONUS_grids/expt_dirs/try01/grid_RRFS_CONUS_13km_HRRRX_RAPX" +;CDATE="2020080100" + +;expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_bugfix_adjust_CONUS_grids/expt_dirs/try01/grid_RRFS_CONUS_3km_FV3GFS_FV3GFS" +;CDATE="2019070100" + +;expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_feature_predef_grids/expt_dirs/try01/grid_RRFS_SUBCONUS_3km" +;CDATE="2019070100" + +;expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_feature_predef_grids/expt_dirs/try01/grid_CONUS_3km_GFDLgrid" +;CDATE="2019070100" + +;expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_feature_predef_grids/expt_dirs/try01/grid_CONUS_25km_GFDLgrid" +expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_bugfix_adjust_CONUS_grids/expt_dirs/try03/grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v15p2" +CDATE="2019070100" + +;expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_feature_predef_grids/expt_dirs/try01/suite_FV3_GSD_SAR" +;CDATE="2019052000" + +;expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_feature_predef_grids/expt_dirs/try01/grid_RRFS_AK_3km" +;CDATE="2019052000" + +;expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_feature_predef_grids/expt_dirs/try01/grid_RRFS_AK_13km" +;expt_dir = "/scratch2/BMC/det/Gerard.Ketefian/UFS_CAM/PR_feature_predef_grids/expt_dirs/try01/grid_RRFS_AK_13km_old001" +;CDATE="2019052000" + + +run_dir = expt_dir + "/" + CDATE +print("AAAAAA run_dir = " + run_dir) + +;tile_inds := (/ 1, 7, 4 /) ;tile_inds := (/ 1, 4 /) ;tile_inds := (/ 5, 6 /) -tile_inds := (/ 5, 7 /) +;tile_inds := (/ 5, 7 /) ;tile_inds := (/ 5, 6, 7 /) ;tile_inds := (/ 5 /) ;tile_inds := (/ 6 /) -;tile_inds := (/ 7 /) +tile_inds := (/ 7 /) ;tile_inds := (/ 6, 7 /) ;subreg_limits := (/ -180, 180, -90, 90 /) @@ -53,15 +124,22 @@ tile_inds := (/ 5, 7 /) remove_rgnl_halo = True ;remove_rgnl_halo = False -;plot_RAP_field = True -plot_RAP_field = False +plot_RAP_field = True +;plot_RAP_field = False + +field_name_RAP = "XLAT_M" +;field_name_RAP = "cell_area" +;field_name_RAP = "VGTYP_P0_L1_GLC0" +show_RAP_bdy = True RAP_bdy_color = "red" RAP_dir = "/scratch3/BMC/fim/Gerard.Ketefian/regional_FV3_EMC_visit_20180509" +RAP_dir = "/scratch1/BMC/gsd-fv3-dev/Gerard.Ketefian/regional_FV3_EMC_visit_20180509" ;RAP_grid_fn = "/home/Gerard/fv3_regional/fv3sar_workflow/ush/NCL/plot_grid.ncl" ;RAP_grid_fn = "/scratch3/BMC/fim/Gerard.Ketefian/regional_FV3_EMC_visit_20180509/geo_em.d01.RAP.nc" RAP_grid_fn = RAP_dir + "/geo_em.d01.RAP.nc" +RAP_grid_fn = RAP_dir + "/geo_em.d01.HRRR.nc" map_proj = "cyln" @@ -74,6 +152,7 @@ map_proj_ctr = (/ 0.0, 0.0 /) ; This should be set to (0,0) for "cyln" map proje ;map_proj_ctr = (/ -97.5, 38.5 /) ; HRRR domain. ;map_proj_ctr = (/ 6.0, 54.0 /) ; RAP domain corner. +;map_proj_ctr = (/ -161.5, 63.0 /) ; Alaska ;map_proj_ctr = (/ -98.5, 30.0 /) @@ -84,14 +163,142 @@ plot_subreg = True ;subreg_limits := (/ -180, 180, -90, 90 /) ;subreg_limits := (/ -75, -45, 30, 60 /) + + + +subreg_limits := (/ -128, -67, 23, 51 /) ; HRRR domain if using "cyln" map projection. subreg_limits := (/ -135, -60, 20, 55 /) ; HRRR domain if using "cyln" map projection. ;subreg_limits := (/ -125, -70, 20, 55 /) ; HRRR domain if using "ortho" map projection. -;subreg_limits := (/ -145, -90, 30, 60 /) ; Northwest corner of HRRR domain. -;subreg_limits := (/ -135, -125, 40, 50 /) ; Northwest corner of HRRR domain, zoomed. -;subreg_limits := (/ -123, -121, 48, 50 /) ; Northwest corner of HRRR domain, zoomed more. -;subreg_limits := (/ -120, -115, 30, 35 /) -;subreg_limits := (/ -125, -120, 15, 25 /) ; Southwest corner of HRRR domain. -subreg_limits := (/ -120, -75, 20, 55 /) ; Center of HRRR domain. +;subreg_limits := (/ -105, -95, 20, 30 /) ; Center of southern edge of HRRR domain. + +;subreg_limits := (/ -128, -118, 32, 42 /) ; Center of western edge of HRRR domain. + +;subreg_limits := (/ -120, -75, 20, 55 /) ; Center of HRRR domain, zoomed. +;subreg_limits := (/ -110, -85, 30, 45 /) ; Center of HRRR domain, zoomed more. +;subreg_limits := (/ -100, -97, 36, 39 /) ; Center of HRRR domain, zoomed more. + +;subreg_limits := (/ -135, -60, 20, 55 /) + + + +; Zoom in on midpoint of southern edge of CONUS domain. +;subreg_limits := (/ -103.5, -93.5, 22.5, 26.5 /) ; 10deg x 4deg +;subreg_limits := (/ -100.0, -95.0, 24.0, 26.0 /) ; 5deg x 2deg +;subreg_limits := (/ -99.5, -97.5, 24, 25 /) ; 2deg x 1deg +;subreg_limits := (/ -99, -98, 24.15, 24.65 /) ; 1deg x 0.5deg + +; Zoom in on midpoint of eastern edge of CONUS domain. +;subreg_limits := (/ -71, -66, 33.5, 38.5 /) ; 5deg x 5deg + +; Zoom in on midpoint of northern edge of CONUS domain. +;subreg_limits := (/ -103.5, -93.5, 50.2, 54.2 /) ; 10deg x 4deg +;subreg_limits := (/ -100.0, -95.0, 51.3, 53.3 /) ; 5deg x 2deg +;subreg_limits := (/ -99.5, -97.5, 51.9, 52.9 /) ; 2deg x 1deg +;subreg_limits := (/ -99, -98, 52.3, 52.8 /) ; 1deg x 0.5deg + +; Zoom in on midpoint of western edge of CONUS domain. +;subreg_limits := (/ -128, -123, 33.5, 38.5 /) ; 5deg x 5deg + +; Zoom in on northwest corner of CONUS domain. +;subreg_limits := (/ -129, -99, 32, 52 /) ; 20deg x 20deg +;subreg_limits := (/ -131, -121, 40, 50 /) ; 10deg x 10deg +;subreg_limits := (/ -133, -128, 44, 49 /) ; 5deg x 5deg +;subreg_limits := (/ -133.5, -131.5, 46.2, 48.2 /) ; 2deg x 2deg +;subreg_limits := (/ -134, -133, 47, 48 /) ; 1deg x 1deg + +; Zoom in on southwest corner of CONUS domain. +;subreg_limits := (/ -125, -105, 22, 42 /) ; 20deg x 20deg +;subreg_limits := (/ -124, -114, 22, 32 /) ; 10deg x 10deg +;subreg_limits := (/ -124, -119, 21, 26 /) ; 5deg x 5deg +;subreg_limits := (/ -123.3, -121.3, 21.2, 23.2 /) ; 2deg x 2deg +;subreg_limits := (/ -123.1, -122.1, 21.2, 22.2 /) ; 1deg x 1deg +;subreg_limits := (/ -122.95, -122.45, 21.45, 21.95 /) ; 0.5deg x 0.5deg +;subreg_limits := (/ -122.9, -122.8, 21.45, 21.55 /) ; 0.1deg x 0.1deg +;subreg_limits := (/ -122.85, -122.83, 21.49, 21.51 /) ; 0.02deg x 0.02deg + +; Zoom in on southeast corner of CONUS domain. +;subreg_limits := (/ -68, -88, 22, 42 /) ; 20deg x 20deg +;subreg_limits := (/ -70, -80, 20, 30 /) ; 10deg x 10deg +;subreg_limits := (/ -71, -76, 21, 26 /) ; 5deg x 5deg +;subreg_limits := (/ -71.9, -73.9, 21.4, 23.4 /) ; 2deg x 2deg +;subreg_limits := (/ -72, -73, 21.2, 22.2 /) ; 1deg x 1deg +;subreg_limits := (/ -72.0, -72.5, 21.45, 21.95 /) ; 0.5deg x 0.5deg +;subreg_limits := (/ -72.1, -72.2, 21.45, 21.55 /) ; 0.1deg x 0.1deg +;subreg_limits := (/ -72.15, -72.17, 21.49, 21.51 /) ; 0.02deg x 0.02deg + +; Zoom in on northeast corner of CONUS domain. +;subreg_limits := (/ -66, -86, 32, 52 /) ; 20deg x 20deg +;subreg_limits := (/ -64, -74, 40, 50 /) ; 10deg x 10deg. +;subreg_limits := (/ -62, -67, 44, 49 /) ; 5deg x 5deg. +;subreg_limits := (/ -61.5, -63.5, 46.2, 48.2 /) ; 2deg x 2deg. +;subreg_limits := (/ -61.2, -62.2, 47, 48 /) ; 1deg x 1deg. + + + + +; EMC's 25km BIG CONUS grid. +;subreg_limits := (/ -145, -50, 10, 65 /) + +; Zoom in on northwest corner of BIG CONUS domain. +;subreg_limits := (/ -139, -136, 51, 54 /) ; 3deg x 3deg + +; Zoom in on southwest corner of BIG CONUS domain. +;subreg_limits := (/ -123, -120, 14, 17 /) ; 3deg x 3deg + +; Zoom in on southeast corner of BIG CONUS domain. +;subreg_limits := (/ -75, -72, 14, 17 /) ; 3deg x 3deg + +; Zoom in on northeast corner of BIG CONUS domain. +;subreg_limits := (/ -59, -56, 51, 54 /) ; 3deg x 3deg + + + + +; EMC's 3km BIG CONUS grid. +;subreg_limits := (/ -145, -50, 10, 65 /) + +; Zoom in on northwest corner of BIG CONUS domain. +;subreg_limits := (/ -137, -134, 47, 50 /) ; 3deg x 3deg + +; Zoom in on southwest corner of BIG CONUS domain. +;subreg_limits := (/ -125, -122, 18.5, 21.5 /) ; 3deg x 3deg + +; Zoom in on southeast corner of BIG CONUS domain. +;subreg_limits := (/ -74, -71, 18.5, 21.5 /) ; 3deg x 3deg + +; Zoom in on northeast corner of BIG CONUS domain. +;subreg_limits := (/ -61, -58, 47, 50 /) ; 3deg x 3deg + + + + +; Alaska domain subregions: +;subreg_limits := (/ -210, -120, 45, 80 /) ; whole AK domain; won't work with cyln projection + +; Zoom in on northwest corner of Alaska domain. +;subreg_limits := (/ 141, 145, 66, 70 /) ; 4deg x 4deg +;subreg_limits := (/ 142, 144, 66, 70 /) ; 2deg x 4deg +;subreg_limits := (/ 142, 144, 67, 69 /) ; 2deg x 2deg + +; Zoom in on southwest corner of Alaska domain. +;subreg_limits := (/ 170, 174, 44, 48 /) ; 4deg x 4deg +;subreg_limits := (/ 170, 173, 44, 47 /) ; 3deg x 3deg +;subreg_limits := (/ 171, 173, 45, 47 /) ; 2deg x 2deg + +; Zoom in on southeast corner of Alaska domain. +;subreg_limits := (/ -137, -133, 44, 48 /) ; 4deg x 4deg +;subreg_limits := (/ -136, -133, 44, 47 /) ; 3deg x 3deg +;subreg_limits := (/ -135.5, -133.5, 44.8, 46.8 /) ; 2deg x 2deg + +; Zoom in on northeast corner of Alaska domain. +;subreg_limits := (/ -108, -102, 65, 71 /) ; 6deg x 6deg +;subreg_limits := (/ -107, -103, 66, 70 /) ; 4deg x 4deg +;subreg_limits := (/ -106, -104, 66, 70 /) ; 2deg x 4deg +;subreg_limits := (/ -106, -104, 67, 69 /) ; 2deg x 2deg + + +;subreg_limits := (/ -135, -60, 15, 60 /) ; RTMA domain if using "ortho" map projection. +;subreg_limits := (/ -128, -126, 34, 36 /) ; Center of western boundary of CONUS ;subreg_limits := (/ -15, 0, 0, 15 /) ;subreg_limits := (/ -30, 0, 0, 30 /) @@ -129,7 +336,7 @@ field_name = "area" ;field_name = "abcd" -;field_name = "orog_raw" +field_name = "orog_raw" ;field_name = "orog_filt" ;field_name = "time" @@ -139,13 +346,14 @@ field_name = "area" field_name = "sltyp" field_name = "dswrf" +field_name = "zsurf" show_tile_bdies = True ;show_tile_bdies = False -;show_tile_grids = True -show_tile_grids = False +show_tile_grids = True +;show_tile_grids = False file_basename = "atmos_static" @@ -153,14 +361,12 @@ file_basename = "atmos_static" file_basename = "fv3_history2d" -;show_wrtcmp_grid = True +show_wrtcmp_grid = True show_wrtcmp_grid = False show_wrtcmp_bdy = True ;show_wrtcmp_bdy = False -wrtcmp_bdy_color = "green" - separator_line \ := "************************************************************************" @@ -183,6 +389,7 @@ loadscript(lib_location + "repeat_str.ncl") loadscript(lib_location + "calc_field_stats.ncl") loadscript(lib_location + "get_rect_grid_bdy.ncl") loadscript(lib_location + "set_cnLevels_lbLabels.ncl") +loadscript(lib_location + "append_to_snumeric_array.ncl") load "process_plot_params.ncl" load "read_FV3LAM_grid_native.ncl" @@ -373,9 +580,11 @@ char_dq + "ncgm" + char_dq + "." + char_nl gtype = plot_params@gtype num_tiles_to_plot = plot_params@num_tiles_to_plot inds_tiles_to_plot = plot_params@inds_tiles_to_plot +;print("XXXXXXXXXXXXXXX") +;print("inds_tiles_to_plot = " + inds_tiles_to_plot) + cres = plot_params@cres - run_dir = plot_params@run_dir - work_dir = plot_params@work_dir + expt_dir = plot_params@expt_dir horiz_dist_units = plot_params@horiz_dist_units horiz_area_units = plot_params@horiz_area_units @@ -401,87 +610,6 @@ char_dq + "ncgm" + char_dq + "." + char_nl plot_subreg = plot_params@plot_subreg subreg_limits = plot_params@subreg_limits - - -; -; ********************************************************************** -; -; Read in the FV3-LAM grid. -; -; ********************************************************************** -; -read_FV3LAM_wrtcmp = True -;read_FV3LAM_wrtcmp = False - -if (read_FV3LAM_wrtcmp) then - - FV3LAM_wrtcmp_fn = run_dir + "/" + CDATE + "/" + "dynf000.nc" - get_domain_bdy = True - grid_info := read_FV3LAM_grid_wrtcmp( \ - FV3LAM_wrtcmp_fn, \ - get_domain_bdy) - - fp_wrtcmp = grid_info@fp - nx = grid_info@nx - ny = grid_info@ny - lon_cntrs_unstruc = grid_info@lon_cntrs_unstruc - lat_cntrs_unstruc = grid_info@lat_cntrs_unstruc - lon_verts_unstruc = grid_info@lon_verts_unstruc - lat_verts_unstruc = grid_info@lat_verts_unstruc - lon_bdy = grid_info@lon_bdy - lat_bdy = grid_info@lat_bdy - coord_data_type_FV3LAM = grid_info@coord_data_type - -else - - nhalo_T7 = 4 ; Should this be at the top, i.e. defined as a global variable???? - ; or be a requird input that gets processed along with the other - ; command linea arguments? - - grid_info := read_FV3LAM_grid_native( \ - work_dir, \ - gtype, \ - cres, \ - inds_tiles_to_plot, \ - show_tile_bdies, \ - nhalo_T7, \ - remove_rgnl_halo) - - grid_fn_tiles_to_plot = grid_info@grid_fn_all_tiles - - nhSG_tiles_to_plot = grid_info@nhSG_all_tiles - nxhSG_tiles_to_plot = grid_info@nxhSG_all_tiles - nyhSG_tiles_to_plot = grid_info@nyhSG_all_tiles - nxSG_tiles_to_plot = grid_info@nxSG_all_tiles - nySG_tiles_to_plot = grid_info@nySG_all_tiles - - nh_tiles_to_plot = grid_info@nh_all_tiles - nxh_tiles_to_plot = grid_info@nxh_all_tiles - nyh_tiles_to_plot = grid_info@nyh_all_tiles - nx_tiles_to_plot = grid_info@nx_all_tiles - ny_tiles_to_plot = grid_info@ny_all_tiles - - remove_halo_tiles_to_plot = grid_info@remove_halo_all_tiles - - lon_cntrs_unstruc = grid_info@lon_cntrs_all_tiles_unstruc - lat_cntrs_unstruc = grid_info@lat_cntrs_all_tiles_unstruc - lon_verts_unstruc = grid_info@lon_verts_all_tiles_unstruc - lat_verts_unstruc = grid_info@lat_verts_all_tiles_unstruc - - lon_bdy = grid_info@lon_bdy_all_tiles - lat_bdy = grid_info@lat_bdy_all_tiles - - lon_tile_cntr_tiles_to_plot = grid_info@lon_tile_cntr_all_tiles - lat_tile_cntr_tiles_to_plot = grid_info@lat_tile_cntr_all_tiles - - lon_tile_corners_face_midpts_tiles_to_plot \ - = grid_info@lon_tile_corners_face_midpts_all_tiles - lat_tile_corners_face_midpts_tiles_to_plot \ - = grid_info@lat_tile_corners_face_midpts_all_tiles - - coord_data_type_FV3LAM = grid_info@coord_data_type - -end if ; ; ********************************************************************** ; @@ -489,687 +617,309 @@ end if ; ; ********************************************************************** ; -time_inds_to_plot := (/ 0, 2 /) ; This must be specified on the command line. -time_inds_to_plot := (/ 0 /) ; This must be specified on the command line. - - -fcst_output_hrs := (/ 0, 1, 2, 3, 4, 5, 6 /) ; Read this in from file, e.g. var_defns.sh. -;fcst_output_hrs := (/ 0, 2, 4, 6 /) ; Read this in from file, e.g. var_defns.sh. -fcst_output_hrs := (/ 0 /) ; Read this in from file, e.g. var_defns.sh. -fcst_output_hrs := (/ 5 /) ; Read this in from file, e.g. var_defns.sh. - -fcst_hrs_to_plot := fcst_output_hrs(time_inds_to_plot) -num_fcst_hrs = dimsizes(fcst_hrs_to_plot) - -vert_inds_to_plot := (/ 0, 10 /) -vert_inds_to_plot := (/ 0 /) -num_vert = dimsizes(vert_inds_to_plot) +native = True +;native = False +native@plot_gridlines = True +native@plot_gridlines = False +;native@gridline_color = "black" +native@gridline_color = "red" +native@plot_bdy = True +native@bdy_color = native@gridline_color +native@bdy_line_thickness = 4.0 +;native@bdy_line_thickness = 16.0 +native@bdy_dash_pattern = 1 +halo = True +;halo = False +halo@plot_gridlines = True +;halo@plot_gridlines = False +halo@gridline_color = "orange" +halo@plot_bdy = True +;halo@plot_bdy = False +halo@bdy_color = halo@gridline_color +halo@bdy_line_thickness = 4.0 +halo@bdy_dash_pattern = 1 -; Must set to 0 for write-component files since those each contain output for only one time. -if (read_FV3LAM_wrtcmp) then - time_inds_to_plot = 0*time_inds_to_plot -end if - - -do n=0, num_fcst_hrs-1 - do k=0, num_vert-1 - - print("") - print("") - print("" + separator_line) - print("" + separator_line) - print("n = " + n + "; k = " + k) - print("" + separator_line) - print("" + separator_line) - - vert_indx = vert_inds_to_plot(k) - time_indx = time_inds_to_plot(n) - fcst_hr = fcst_hrs_to_plot(n) - - fmt_str = "%03i" - vert_indx_str = sprinti(fmt_str, vert_indx) - fcst_hr_str = sprinti(fmt_str, fcst_hr) - -;print("") -; print("fcst_hr = " + fcst_hr) -; print("fcst_hr_str = " + fcst_hr_str) -;print("") -; print("vert_indx = " + vert_indx) -; print("vert_indx_str = " + vert_indx_str) -;pause - +wrtcmp = True +;wrtcmp = False +wrtcmp@plot_gridlines = True +wrtcmp@plot_gridlines = False +;wrtcmp@gridline_color = "green" +wrtcmp@gridline_color = "blue" +wrtcmp@plot_bdy = True +wrtcmp@bdy_color = wrtcmp@gridline_color +wrtcmp@bdy_line_thickness = 6.0 +wrtcmp@bdy_dash_pattern = 1 +extrnl = True +;extrnl = False +;extrnl@plot_gridlines = True +extrnl@plot_gridlines = False +;extrnl@gridline_color = "red" +extrnl@gridline_color = "green" +extrnl@plot_bdy = True +extrnl@bdy_color = extrnl@gridline_color +extrnl@bdy_line_thickness = 4.0 +extrnl@bdy_dash_pattern = 1 ; ; ********************************************************************** ; -; If we want to plot output files generated by the write-component ... -; -; ********************************************************************** -; -if (read_FV3LAM_wrtcmp) then -; -; Set the file name. This depends on the time index/ forecast output hour. -; - -; FV3LAM_wrtcmp_fn = run_dir + "/dynf000.nc" -; FV3LAM_wrtcmp_fn = run_dir + "/phyf000.nc" -; FV3LAM_wrtcmp_fn = run_dir + "/phyf" + fcst_hr_str + ".nc" - FV3LAM_wrtcmp_fn = run_dir + "/" + CDATE + "/" + "phyf" + fcst_hr_str + ".nc" - -; -; ********************************************************************** ; -; Call a function that runs various checks on the specified field. This -; function will: -; -; 1) Verify that the field exists as a as a variable in the file. -; 2) Verify that its functional dependence on space and time is one of -; the following: -; a) Function of only the two horizontal directions but not the ver- -; tical direction or time. In this case, the func_xy_only attrib- -; ute of the returned variable will be set to True. -; b) Function of only the two horizontal directions and the vertical -; direction but not time. In this case, the func_xyz_only attrib- -; ute of the returned variable will be set to True. -; c) Function of only the two horizontal directions and time but not -; the vertical direction. In this case, the func_xyt_only attrib- -; ute of the returned variable will be set to True. -; d) Function of the two horizontal directions, the vertical direc- -; tion, and time. In this case, the func_xyzt_only attribute of -; the returned variable will be set to True. -; 3) Verify that the specified vertical and/or time indices do not ex- -; ceed the array bounds of the variable that represents the specified -; field. -; 4) Return: -; a) The rank, dimension names, and dimension sizes of the variable -; that represents the field. -; b) The functional dependence of the field on x, y, z, and t. ; ; ********************************************************************** ; +grid_opts = True +grid_opts@plot_gridlines := new(1, logical) +grid_opts@gridline_colors := new(1, string) -; x_filedim_names = (/ "grid_xt" /) -; y_filedim_names = (/ "grid_yt" /) -; z_filedim_names = (/ "pfull", "phalf" /) -; t_filedim_names = (/ "time" /) - - var_info := check_filevar_existence_dims( \ - FV3LAM_wrtcmp_fn, \ - field_name, \ - nx, ny, \ - vert_inds_to_plot, \ - time_inds_to_plot) -; x_filedim_names, \ -; y_filedim_names, \ -; z_filedim_names, \ -; t_filedim_names, \ - - var_rank = var_info@var_rank - var_dim_names = var_info@var_dim_names - var_dim_sizes = var_info@var_dim_sizes - func_xy_only = var_info@func_xy_only - func_xyz_only = var_info@func_xyz_only - func_xyt_only = var_info@func_xyt_only - func_xyzt_only = var_info@func_xyzt_only - -;print("") -;print("func_xy_only = " + func_xy_only) -;print("func_xyz_only = " + func_xyz_only) -;print("func_xyt_only = " + func_xyt_only) -;print("func_xyzt_only = " + func_xyzt_only) - -; -; ********************************************************************** -; -; Read the specified field on the FV3-LAM write-component grid. -; -; ********************************************************************** -; - field_info \ - := read_FV3LAM_field_wrtcmp( \ - field_name, \ - horiz_dist_units, horiz_area_units, \ - FV3LAM_wrtcmp_fn, \ - nx, ny, \ - vert_indx, time_indx, \ - func_xy_only, func_xyz_only, func_xyt_only, func_xyzt_only) - - fp_field_FV3LAM = field_info@fp - field_desc = field_info@field_desc - field_units = field_info@field_units - field_unstruc = field_info@field_unstruc - field_min = field_info@field_min - field_max = field_info@field_max - field_median = field_info@field_median - field_mean = field_info@field_mean - field_data_type_FV3LAM = field_info@field_data_type - - plot_title = field_desc + " [" + field_units + "]" - print("") - print("plot_title = " + char_dq + plot_title + char_dq) -; -; ********************************************************************** -; -; If we want to plot output files generated by the FMS (?) on FV3's na- -; tive cubed-sphere grid ... -; -; ********************************************************************** -; -else -; -; ********************************************************************** -; -; +bdy_opts = True +bdy_opts@num_bdies = 0 +bdy_opts@plot_bdy = new(1, logical) +bdy_opts@bdy_colors = new(1, string) +bdy_opts@bdy_line_thicknesses = new(1, float) +bdy_opts@bdy_dash_patterns = new(1, integer) ; ; ********************************************************************** ; - file_name_base = "fv3_history" ; Should be a global input. +; Initialize arrays to single-element arrays. These will be appended to +; as necessary. ; ; ********************************************************************** ; -; Set the dimension names we expect to see in the file(s) from which we -; will read in the field. This depends on the file name base. These -; dimension names will be used to check the consistency of the dimen- -; sions of the specified field. -; -; ********************************************************************** -; - -; if (strcmp_exact(file_name_base, "grid_spec")) then -; x_filedim_names = (/ "grid_x", "grid_xt" /) -; y_filedim_names = (/ "grid_y", "grid_yt" /) -; z_filedim_names = (/ "phalf", "pfull" /) -; t_filedim_names = (/ "time" /) -; else if (strcmp_exact(file_name_base, "atmos_static") .or. \ -; strcmp_exact(file_name_base, "fv3_history") .or. \ -; strcmp_exact(file_name_base, "fv3_history2d") .or. \ -; strcmp_exact(file_name_base, "ref3D")) then -; x_filedim_names = (/ "grid_xt" /) -; y_filedim_names = (/ "grid_yt" /) -; z_filedim_names = (/ "phalf", "pfull" /) -; t_filedim_names = (/ "time" /) -; else -; msg := char_nl + \ -;"Unknown file base name (file_name_base) specified:" + char_nl + \ -;" file_name_base = " + char_dq + file_name_base + char_dq + char_nl + \ -;"Stopping." -; exit -; end if -; end if +num_grids := 0 +nx_all := new(1, integer) +ny_all := new(1, integer) +lon_cntrs_unstruc := new(1, double) +lat_cntrs_unstruc := new(1, double) +lon_verts_unstruc := new((/1,4/), double) +lat_verts_unstruc := new((/1,4/), double) +lon_bdy := new(1, double) +lat_bdy := new(1, double) +field_unstruc := new(1, double) ; ; ********************************************************************** ; -; Loop through the specified tiles and form the file name corresponding -; to each tile (from which the field will be read in). +; If native is set to True, read in the native FV3LAM grid. ; ; ********************************************************************** ; - file_names_by_tile = new((/ num_tiles_to_plot /), "string") - field_names_by_tile = new((/ num_tiles_to_plot /), "string") +if (native .or. halo) then +;if (native) then - print("") - print("" + separator_line) - msg := \ -"Setting file and field name for each specified tile ..." + char_nl + \ -"[The field name for a tile will be set to " + char_dq + "none" + char_dq + \ -" if a file for that tile " + char_nl + \ -"does not exist, e.g. if the tile in consideration is #5, but we are on a " + char_nl + \ -"regional grid (in which case files/fields are only available on tile #7).]" - print("" + msg) + num_grids = num_grids + 1 - do nn=0, num_tiles_to_plot-1 + nhalo_T7 = 4 ; Should this be at the top, i.e. defined as a global variable???? + ; or be a requird input that gets processed along with the other + ; command linea arguments? - print("") - msg := "nn = " + nn - print("" + msg) - underline = repeat_str("-", strlen(msg)) - print("" + underline) + grid_info := read_FV3LAM_grid_native( \ + expt_dir, \ + gtype, \ + cres, \ + inds_tiles_to_plot, \ + show_tile_bdies, \ + nhalo_T7, \ + remove_rgnl_halo) - n_tile = inds_tiles_to_plot(nn) - print("") - print(" n_tile = " + n_tile) -; -; ********************************************************************** -; -; Generate the file name for the current tile. -; -; ********************************************************************** -; - file_name := run_dir + "/" + file_name_base - if (.not. strcmp_exact(gtype, "regional")) then - file_name := file_name + ".tile" + tostring(n_tile) - end if - file_name := file_name + ".nc" - file_names_by_tile(nn) = file_name + if (remove_rgnl_halo) then + nx_all := append_to_snumeric_array(nx_all, grid_info@nx_all_tiles) + ny_all := append_to_snumeric_array(ny_all, grid_info@ny_all_tiles) + else + nx_all := append_to_snumeric_array(nx_all, grid_info@nxh_all_tiles) + ny_all := append_to_snumeric_array(ny_all, grid_info@nyh_all_tiles) + end if - print(" file_names_by_tile(" + nn + ") = " + \ - char_dq + file_names_by_tile(nn) + char_dq) -; -; ********************************************************************** -; -; -; -; ********************************************************************** -; - field_names_by_tile(nn) = field_name - if (strcmp_exact(gtype, "regional") .and. (n_tile .ne. 7)) then - field_names_by_tile(nn) = "none" - msg := char_nl + \ -" The specified field is not available on the current tile:" + char_nl + \ -" n_tile = " + n_tile + char_nl + \ -" field_name = " + char_dq + field_name + char_dq + char_nl + \ -" Setting the field name for the current tile to " + char_dq + "none" + char_dq + ":" + char_nl + \ -" field_names_by_tile(" + nn + ") = " + char_dq + field_names_by_tile(nn) + char_dq - print("" + msg) - else - print(" field_names_by_tile(" + nn + ") = " + \ - char_dq + field_names_by_tile(nn) + char_dq) - end if + lon_cntrs_unstruc \ + := append_to_snumeric_array(lon_cntrs_unstruc, grid_info@lon_cntrs_all_tiles_unstruc) + lat_cntrs_unstruc \ + := append_to_snumeric_array(lat_cntrs_unstruc, grid_info@lat_cntrs_all_tiles_unstruc) + + lon_verts_unstruc \ + := append_to_snumeric_array(lon_verts_unstruc, grid_info@lon_verts_all_tiles_unstruc) + lat_verts_unstruc \ + := append_to_snumeric_array(lat_verts_unstruc, grid_info@lat_verts_all_tiles_unstruc) + + lon_bdy := append_to_snumeric_array(lon_bdy, grid_info@lon_bdy_all_tiles) + lat_bdy := append_to_snumeric_array(lat_bdy, grid_info@lat_bdy_all_tiles) + + grid_opts@plot_gridlines \ + := array_append_record(grid_opts@plot_gridlines, native@plot_gridlines, 0) + grid_opts@gridline_colors \ + := array_append_record(grid_opts@gridline_colors, native@gridline_color, 0) + + if (native@plot_bdy) then + bdy_opts@num_bdies = bdy_opts@num_bdies + 1 + bdy_opts@plot_bdy \ + := array_append_record(bdy_opts@plot_bdy, native@plot_bdy, 0) + bdy_opts@bdy_colors \ + := array_append_record(bdy_opts@bdy_colors, native@bdy_color, 0) + bdy_opts@bdy_line_thicknesses \ + := array_append_record(bdy_opts@bdy_line_thicknesses, native@bdy_line_thickness, 0) + bdy_opts@bdy_dash_patterns \ + := array_append_record(bdy_opts@bdy_dash_patterns, native@bdy_dash_pattern, 0) + end if + +end if ; ; ********************************************************************** ; -; Perform checks on variable. +; If halo is set to True, then ... ; ; ********************************************************************** ; - if (.not. strcmp_exact(field_names_by_tile(nn), "none")) then - - if ((nn .gt. 0) .and. isvar("var_info")) then - var_info_prev_tile := var_info - end if +if (halo) then - var_info := check_filevar_existence_dims( \ - file_names_by_tile(nn), \ - field_names_by_tile(nn), \ - nx_tiles_to_plot(nn), ny_tiles_to_plot(nn), \ - vert_inds_to_plot, \ - time_inds_to_plot) -; x_filedim_names, \ -; y_filedim_names, \ -; z_filedim_names, \ -; t_filedim_names, \ - - fp_field_file = var_info@fp - var_rank = var_info@var_rank - var_dim_names = var_info@var_dim_names - var_dim_sizes = var_info@var_dim_sizes - func_xy_only = var_info@func_xy_only - func_xyz_only = var_info@func_xyz_only - func_xyt_only = var_info@func_xyt_only - func_xyzt_only = var_info@func_xyzt_only - average_in_x = var_info@average_in_x - average_in_y = var_info@average_in_y - - if ((nn .gt. 0) .and. isvar("var_info_prev_tile")) then - - n_tile_prev = inds_tiles_to_plot(nn-1) - - var_rank_prev_tile := var_info_prev_tile@var_rank - var_dim_names_prev_tile := var_info_prev_tile@var_dim_names - var_dim_sizes_prev_tile := var_info_prev_tile@var_dim_sizes - func_xy_only_prev_tile := var_info_prev_tile@func_xy_only - func_xyz_only_prev_tile := var_info_prev_tile@func_xyz_only - func_xyt_only_prev_tile := var_info_prev_tile@func_xyt_only - func_xyzt_only_prev_tile := var_info_prev_tile@func_xyzt_only - average_in_x_prev_tile := var_info_prev_tile@average_in_x - average_in_y_prev_tile := var_info_prev_tile@average_in_y - - if (var_rank .eq. var_rank_prev_tile) then - var_dim_names_differ := False - do i=0, var_rank_prev_tile-1 - if (.not. strcmp_exact(var_dim_names, var_dim_names_prev_tile(i))) then - var_dim_names_differ := True - break - end if - end do - end if - - if (var_rank .ne. var_rank_prev_tile) then - - msg := char_nl + \ -"The variable's rank (var_rank) changed from tile " + n_tile_prev + \ -" to tile " + n_tile + ":" + char_nl + \ -" var_rank_prev_tile = " + var_rank_prev_tile + char_nl + \ -" var_rank = " + var_rank + char_nl + \ -"Stopping." - print("" + msg) - exit - - else if (var_dim_names_differ) then - - var_dim_names_prev_tile_str \ - := str_join(var_dim_names_prev_tile, char_dq + ", " + char_dq) - var_dim_names_prev_tile_str \ - := "(" + char_dq + var_dim_names_prev_tile_str + char_dq + ")" - - var_dim_names_str \ - := str_join(var_dim_names, char_dq + ", " + char_dq) - var_dim_names_str \ - := "(" + char_dq + var_dim_names_str + char_dq + ")" - - msg := char_nl + \ -"The variable's dimension names (var_dim_names) changed from tile " + \ -n_tile_prev + " to " + char_nl + \ -"tile " + n_tile + ":" + char_nl + \ -" var_dim_names_prev_tile = " + var_dim_names_prev_tile_str + char_nl + \ -" var_dim_names = " + var_dim_names_str + char_nl + \ -"Stopping." - print("" + msg) - exit - - else if (any(var_dim_sizes .ne. var_dim_sizes_prev_tile)) then - - var_dim_sizes_prev_tile_str \ - := "(" + str_join(tostring(var_dim_sizes_prev_tile), ", ") + ")" - var_dim_sizes_str \ - := "(" + str_join(tostring(var_dim_sizes), ", ") + ")" - - msg := char_nl + \ -"The variable's dimension sizes (var_dim_sizes) changed from tile " + \ -n_tile_prev + " to " + char_nl + \ -"tile " + n_tile + ":" + char_nl + \ -" var_dim_sizes_prev_tile = " + var_dim_sizes_prev_tile_str + char_nl + \ -" var_dim_sizes = " + var_dim_sizes_str + char_nl + \ -"Stopping." - print("" + msg) - exit - - else if (func_xy_only .ne. func_xy_only_prev_tile) then - - msg := char_nl + \ -"The variable's functional dependence status on only the horizontal " + char_nl + \ -"coordinates x and y (func_xy_only) changed from tile " + n_tile_prev + " to " + \ -"tile " + n_tile + ":" + char_nl + \ -" func_xy_only_prev_tile = " + func_xy_only_prev_tile + char_nl + \ -" func_xy_only = " + func_xy_only + char_nl + \ -"Stopping." - print("" + msg) - exit - - else if (func_xyz_only .ne. func_xyz_only_prev_tile) then - - msg := char_nl + \ -"The variable's functional dependence status on only the horizontal " + char_nl + \ -"coordinates x and y and the vertical coordinate (func_xyz_only) " + char_nl + \ -"changed from tile " + n_tile_prev + " to tile " + n_tile + ":" + char_nl + \ -" func_xyz_only_prev_tile = " + func_xyz_only_prev_tile + char_nl + \ -" func_xyz_only = " + func_xyz_only + char_nl + \ -"Stopping." - print("" + msg) - exit - - else if (func_xyt_only .ne. func_xyt_only_prev_tile) then - - msg := char_nl + \ -"The variable's functional dependence status on only the horizontal " + char_nl + \ -"coordinates x and y and time (func_xyt_only) changed from tile " + n_tile_prev + char_nl + \ -"to tile " + n_tile + ":" + char_nl + \ -" func_xyt_only_prev_tile = " + func_xyt_only_prev_tile + char_nl + \ -" func_xyt_only = " + func_xyt_only + char_nl + \ -"Stopping." - print("" + msg) - exit - - else if (func_xyzt_only .ne. func_xyzt_only_prev_tile) then - - msg := char_nl + \ -"The variable's functional dependence status on the horizontal coordinates " + char_nl + \ -"x and y, the vertical coordinate, and time (func_xyzt_only) changed from " + char_nl + \ -"tile " + n_tile_prev + " to tile " + n_tile + ":" + char_nl + \ -" func_xyzt_only_prev_tile = " + func_xyzt_only_prev_tile + char_nl + \ -" func_xyzt_only = " + func_xyzt_only + char_nl + \ -"Stopping." - print("" + msg) - exit - - else if (average_in_x .ne. average_in_x_prev_tile) then - - msg := char_nl + \ -"The averaging in the x direction needed to obtain the variable's values " + char_nl + \ -"at cell centers (average_in_x) changed from tile " + n_tile_prev + \ -" to tile " + n_tile + ":" + char_nl + \ -" average_in_x_prev_tile = " + average_in_x_prev_tile + char_nl + \ -" average_in_x = " + average_in_x + char_nl + \ -"Stopping." - print("" + msg) - exit - - else if (average_in_y .ne. average_in_y_prev_tile) then - - msg := char_nl + \ -"The averaging in the x direction needed to obtain the variable's values " + char_nl + \ -"at cell centers (average_in_y) changed from tile " + n_tile_prev + \ -" to tile " + n_tile + ":" + char_nl + \ -" average_in_y_prev_tile = " + average_in_y_prev_tile + char_nl + \ -" average_in_y = " + average_in_y + char_nl + \ -"Stopping." - print("" + msg) - exit - - end if - end if - end if - end if - end if - end if - end if - end if - end if + num_grids = num_grids + 1 - end if +; nhalo_T7 = 4 ; Should this be at the top, i.e. defined as a global variable???? +; ; or be a requird input that gets processed along with the other +; ; command linea arguments? +; +; grid_info := read_FV3LAM_grid_native( \ +; expt_dir, \ +; gtype, \ +; cres, \ +; inds_tiles_to_plot, \ +; show_tile_bdies, \ +; nhalo_T7, \ +; False) - end if + nx_all := append_to_snumeric_array(nx_all, grid_info@nxh_all_tiles) + ny_all := append_to_snumeric_array(ny_all, grid_info@nyh_all_tiles) - end do + lon_cntrs_unstruc \ + := append_to_snumeric_array(lon_cntrs_unstruc, grid_info@lon_halo_cntrs_all_tiles_unstruc) + lat_cntrs_unstruc \ + := append_to_snumeric_array(lat_cntrs_unstruc, grid_info@lat_halo_cntrs_all_tiles_unstruc) - print("") - print("Done setting file and field name for each specified tile.") - print("" + separator_line) + lon_verts_unstruc \ + := append_to_snumeric_array(lon_verts_unstruc, grid_info@lon_halo_verts_all_tiles_unstruc) + lat_verts_unstruc \ + := append_to_snumeric_array(lat_verts_unstruc, grid_info@lat_halo_verts_all_tiles_unstruc) + lon_bdy := append_to_snumeric_array(lon_bdy, grid_info@lon_halo_bdy_all_tiles) + lat_bdy := append_to_snumeric_array(lat_bdy, grid_info@lat_halo_bdy_all_tiles) + grid_opts@plot_gridlines \ + := array_append_record(grid_opts@plot_gridlines, halo@plot_gridlines, 0) + grid_opts@gridline_colors \ + := array_append_record(grid_opts@gridline_colors, halo@gridline_color, 0) -; -; ********************************************************************** -; -; -; -; ********************************************************************** -; - field_info \ - := read_FV3LAM_field_native( \ - field_names_by_tile, \ - file_names_by_tile, \ - gtype, inds_tiles_to_plot, \ - nh_tiles_to_plot, \ - nxh_tiles_to_plot, nyh_tiles_to_plot, \ - nx_tiles_to_plot, ny_tiles_to_plot, \ - remove_halo_tiles_to_plot, \ - vert_indx, time_indx, \ - func_xy_only, func_xyz_only, func_xyt_only, func_xyzt_only, \ - average_in_x, average_in_y) - -; fp_field_FV3LAM = field_info@fp ; This would in general be an array or list of file pointers. - field_desc = field_info@field_desc - field_units = field_info@field_units - field_unstruc = field_info@field_all_tiles_unstruc - field_min_all_tiles = field_info@field_min_all_tiles - field_max_all_tiles = field_info@field_max_all_tiles - field_median_all_tiles = field_info@field_median_all_tiles - field_mean_all_tiles = field_info@field_mean_all_tiles - field_data_type_FV3LAM = field_info@field_data_type - - plot_title = field_desc + " [" + field_units + "]" - print("") - print("plot_title = " + char_dq + plot_title + char_dq) -; -; ********************************************************************** -; -; Calculate and print out basic statistics of the field over all tiles -; to be plotted. -; -; ********************************************************************** -; - temp := tostring(inds_tiles_to_plot) - temp := str_join(temp, ", ") - temp := str_concat( (/"[tile(s) ", temp, "]"/) ) - msg := "Calculating statistics of field over all FV3-LAM tiles to be plotted " + \ - temp + " ..." - print("") - print("" + separator_line) - print("" + msg) - -; print_field_stats = True - print_field_stats = False - field_stat_info \ - := calc_field_stats( \ - field_unstruc, field_desc, field_units, print_field_stats) - msg := " " + field_stat_info@msg - print("") - print("" + msg) + if (halo@plot_bdy) then + bdy_opts@num_bdies = bdy_opts@num_bdies + 1 + bdy_opts@plot_bdy \ + := array_append_record(bdy_opts@plot_bdy, halo@plot_bdy, 0) + bdy_opts@bdy_colors \ + := array_append_record(bdy_opts@bdy_colors, halo@bdy_color, 0) + bdy_opts@bdy_line_thicknesses \ + := array_append_record(bdy_opts@bdy_line_thicknesses, halo@bdy_line_thickness, 0) + bdy_opts@bdy_dash_patterns \ + := array_append_record(bdy_opts@bdy_dash_patterns, halo@bdy_dash_pattern, 0) + end if - msg := "Done calculating statistics of field over all FV3-LAM tiles to be plotted." - print("") - print("" + msg) - print("" + separator_line) +end if ; ; ********************************************************************** ; -; Save field statistics in appropriate variables. +; If wrtcmp is set to True, read in the write-component grid. ; ; ********************************************************************** ; - field_min := field_stat_info@field_min - field_max := field_stat_info@field_max - field_median := field_stat_info@field_median - field_mean := field_stat_info@field_mean - -end if - - +if (wrtcmp) then + num_grids = num_grids + 1 + FV3LAM_wrtcmp_fn = run_dir + "/" + "dynf000.nc" + get_domain_bdy = True + grid_info := read_FV3LAM_grid_wrtcmp( \ + FV3LAM_wrtcmp_fn, \ + get_domain_bdy) -; -; ********************************************************************** -; -; If plot_RAP_field is set to True, read in the coordinates of the RAP -; grid and possibly also a field on that grid. -; -; ********************************************************************** -; - if (plot_RAP_field) then -; -; ********************************************************************** -; -; Read in the RAP grid from file. -; -; ********************************************************************** -; - grid_info := read_RAP_grid(RAP_grid_fn, show_RAP_bdy) - -; fp_RAP_grid = grid_info@fp - nx_RAP = grid_info@nx - ny_RAP = grid_info@ny - lon_cntrs_unstruc_RAP = grid_info@lon_cntrs_unstruc - lat_cntrs_unstruc_RAP = grid_info@lat_cntrs_unstruc - lon_verts_unstruc_RAP = grid_info@lon_verts_unstruc - lat_verts_unstruc_RAP = grid_info@lat_verts_unstruc - lon_bdy_RAP = grid_info@lon_bdy - lat_bdy_RAP = grid_info@lat_bdy - coord_data_type_RAP = grid_info@coord_data_type -; -; ********************************************************************** -; -; Calculate the coordinates of the center of the RAP domain. -; -; ********************************************************************** -; -if (False) then - - rem_x = mod(nx_RAP, 2) - rem_y = mod(ny_RAP, 2) - - if ((rem_x .eq. 0) .and. (rem_y .eq. 0)) then - i_cntr = nx_RAP/2 - j_cntr = ny_RAP/2 - lon_RAP_cntr = lon_verts_RAP(j_cntr,i_cntr) - lat_RAP_cntr = lat_verts_RAP(j_cntr,i_cntr) - else if ((rem_x .eq. 1) .and. (rem_y .eq. 0)) then - i_cntr = (nx_RAP - 1)/2 - j_cntr = ny_RAP/2 - lon_vpts_RAP := fg->XLONG_V(:,:,:) - lat_vpts_RAP := fg->XLAT_V(:,:,:) - lon_vpts_RAP := rm_single_dims(lon_vpts_RAP) - lat_vpts_RAP := rm_single_dims(lat_vpts_RAP) - lon_RAP_cntr = lon_vpts_RAP(j_cntr,i_cntr) - lat_RAP_cntr = lat_vpts_RAP(j_cntr,i_cntr) - else if ((rem_x .eq. 0) .and. (rem_y .eq. 1)) then - i_cntr = nx_RAP/2 - j_cntr = (ny_RAP - 1)/2 - lon_upts_RAP := fg->XLONG_U(:,:,:) - lat_upts_RAP := fg->XLAT_U(:,:,:) - lon_upts_RAP := rm_single_dims(lon_upts_RAP) - lat_upts_RAP := rm_single_dims(lat_upts_RAP) - lon_RAP_cntr = lon_upts_RAP(j_cntr,i_cntr) - lat_RAP_cntr = lat_upts_RAP(j_cntr,i_cntr) - else if ((rem_x .eq. 1) .and. (rem_y .eq. 1)) then - i_cntr = (nx_RAP - 1)/2 - j_cntr = (ny_RAP - 1)/2 - lon_RAP_cntr = lon_cntrs_RAP(j_cntr,i_cntr) - lat_RAP_cntr = lat_cntrs_RAP(j_cntr,i_cntr) - end if - end if - end if - end if - - print("") - print("lon_RAP_cntr = " + lon_RAP_cntr + " deg") - print("lat_RAP_cntr = " + lat_RAP_cntr + " deg") + nx_all := append_to_snumeric_array(nx_all, grid_info@nx) + ny_all := append_to_snumeric_array(ny_all, grid_info@ny) + + lon_cntrs_unstruc \ + := append_to_snumeric_array(lon_cntrs_unstruc, grid_info@lon_cntrs_unstruc) + lat_cntrs_unstruc \ + := append_to_snumeric_array(lat_cntrs_unstruc, grid_info@lat_cntrs_unstruc) + + lon_verts_unstruc \ + := append_to_snumeric_array(lon_verts_unstruc, grid_info@lon_verts_unstruc) + lat_verts_unstruc \ + := append_to_snumeric_array(lat_verts_unstruc, grid_info@lat_verts_unstruc) + + lon_bdy := append_to_snumeric_array(lon_bdy, grid_info@lon_bdy) + lat_bdy := append_to_snumeric_array(lat_bdy, grid_info@lat_bdy) + + grid_opts@plot_gridlines \ + := array_append_record(grid_opts@plot_gridlines, wrtcmp@plot_gridlines, 0) + grid_opts@gridline_colors \ + := array_append_record(grid_opts@gridline_colors, wrtcmp@gridline_color, 0) + + if (wrtcmp@plot_bdy) then + bdy_opts@num_bdies = bdy_opts@num_bdies + 1 + bdy_opts@plot_bdy \ + := array_append_record(bdy_opts@plot_bdy, wrtcmp@plot_bdy, 0) + bdy_opts@bdy_colors \ + := array_append_record(bdy_opts@bdy_colors, wrtcmp@bdy_color, 0) + bdy_opts@bdy_line_thicknesses \ + := array_append_record(bdy_opts@bdy_line_thicknesses, wrtcmp@bdy_line_thickness, 0) + bdy_opts@bdy_dash_patterns \ + := array_append_record(bdy_opts@bdy_dash_patterns, wrtcmp@bdy_dash_pattern, 0) + end if end if + +print("") +printVarSummary(wrtcmp) ; ; ********************************************************************** ; -; Read in the specified field on the RAP domain. +; If extrnl is set to True, read in the FV3LAM grid. ; ; ********************************************************************** ; - field_info := read_RAP_field( \ - field_name, \ - horiz_dist_units, \ - horiz_area_units, \ - RAP_grid_fn, \ - nx_RAP, \ - ny_RAP) - -; fp_field_RAP = field_info@fp - field_desc_RAP = field_info@field_desc - field_units_RAP = field_info@field_units - field_unstruc_RAP = field_info@field_unstruc - field_min_RAP = field_info@field_min - field_max_RAP = field_info@field_max - field_median_RAP = field_info@field_median - field_mean_RAP = field_info@field_mean - field_data_type_RAP = field_info@field_data_type - - plot_title_RAP = field_desc_RAP + " [" + field_units_RAP + "]" - print("") - print("plot_title_RAP = " + char_dq + plot_title_RAP + char_dq) - -end if - - +if (extrnl) then + num_grids = num_grids + 1 + grid_info := read_RAP_grid(RAP_grid_fn, show_RAP_bdy) + nx_all := append_to_snumeric_array(nx_all, grid_info@nx) + ny_all := append_to_snumeric_array(ny_all, grid_info@ny) + lon_cntrs_unstruc \ + := append_to_snumeric_array(lon_cntrs_unstruc, grid_info@lon_cntrs_unstruc) + lat_cntrs_unstruc \ + := append_to_snumeric_array(lat_cntrs_unstruc, grid_info@lat_cntrs_unstruc) + lon_verts_unstruc \ + := append_to_snumeric_array(lon_verts_unstruc, grid_info@lon_verts_unstruc) + lat_verts_unstruc \ + := append_to_snumeric_array(lat_verts_unstruc, grid_info@lat_verts_unstruc) + lon_bdy := append_to_snumeric_array(lon_bdy, grid_info@lon_bdy) + lat_bdy := append_to_snumeric_array(lat_bdy, grid_info@lat_bdy) + grid_opts@plot_gridlines \ + := array_append_record(grid_opts@plot_gridlines, extrnl@plot_gridlines, 0) + grid_opts@gridline_colors \ + := array_append_record(grid_opts@gridline_colors, extrnl@gridline_color, 0) + if (extrnl@plot_bdy) then + bdy_opts@num_bdies = bdy_opts@num_bdies + 1 + bdy_opts@plot_bdy \ + := array_append_record(bdy_opts@plot_bdy, extrnl@plot_bdy, 0) + bdy_opts@bdy_colors \ + := array_append_record(bdy_opts@bdy_colors, extrnl@bdy_color, 0) + bdy_opts@bdy_line_thicknesses \ + := array_append_record(bdy_opts@bdy_line_thicknesses, extrnl@bdy_line_thickness, 0) + bdy_opts@bdy_dash_patterns \ + := array_append_record(bdy_opts@bdy_dash_patterns, extrnl@bdy_dash_pattern, 0) + end if +end if ; ; ********************************************************************** ; @@ -1177,147 +927,145 @@ end if ; ; ********************************************************************** ; - fn_graphics = cres + "_grid_f" + fcst_hr_str + "_k" + vert_indx_str - - coord_fill_val := default_fillvalue(typeof(lon_cntrs_unstruc)) +nx_all := nx_all(1:) +ny_all := ny_all(1:) +lon_cntrs_unstruc := lon_cntrs_unstruc(1:) +lat_cntrs_unstruc := lat_cntrs_unstruc(1:) +lon_verts_unstruc := lon_verts_unstruc(1:,:) +lat_verts_unstruc := lat_verts_unstruc(1:,:) +lon_bdy := lon_bdy(1:) +lat_bdy := lat_bdy(1:) +;field_unstruc := new(1, double) ; ; ********************************************************************** ; -; If plot_RAP_field is set to True, combine the coordinate arrays for -; the FV3-LAM and the RAP into a single set of arrays for plotting. -; -; ********************************************************************** -; - if (plot_RAP_field) then -; -; ********************************************************************** ; -; If the RAP coordinate arrays are not of the same data type as the FV3- -; LAM coordinate arrays, convert the data type of the former to that of -; the latter. ; ; ********************************************************************** ; - if (.not. strcmp_exact(coord_data_type_FV3LAM, coord_data_type_RAP)) then - - lon_cntrs_unstruc_RAP \ - := totype(lon_cntrs_unstruc_RAP, coord_data_type_FV3LAM) - - lat_cntrs_unstruc_RAP \ - := totype(lat_cntrs_unstruc_RAP, coord_data_type_FV3LAM) - - lon_verts_unstruc_RAP \ - := totype(lon_verts_unstruc_RAP, coord_data_type_FV3LAM) +n := dimsizes(grid_opts@plot_gridlines) +if (n .gt. 1) then + grid_opts@plot_gridlines := grid_opts@plot_gridlines(1:) + grid_opts@gridline_colors := (/ grid_opts@gridline_colors(1:) /) +end if - lat_verts_unstruc_RAP \ - := totype(lat_verts_unstruc_RAP, coord_data_type_FV3LAM) +bdy_opts@plot_bdy := (/ bdy_opts@plot_bdy(1:) /) +bdy_opts@bdy_colors := bdy_opts@bdy_colors(1:) +bdy_opts@bdy_line_thicknesses := bdy_opts@bdy_line_thicknesses(1:) +bdy_opts@bdy_dash_patterns := bdy_opts@bdy_dash_patterns(1:) +bdy_opts@num_bdy_pts_all_bdies := 2*(nx_all + ny_all) + 1 - end if +print("") +printVarSummary(grid_opts) +print("") +printVarSummary(bdy_opts) ; ; ********************************************************************** ; -; If the RAP field is not of the same data type as the FV3-LAM field, -; convert the data type of the former to that of the latter. -; -; ********************************************************************** -; - if (.not. strcmp_exact(field_data_type_FV3LAM, field_data_type_RAP)) then - - field_unstruc_RAP \ - := totype(field_unstruc_RAP, field_data_type_FV3LAM) - - end if -; -; ********************************************************************** ; -; Prepend RAP coordinates and fields to the corresponding arrays for the -; FV3-LAM so that the RAP grid is drawn first and the FV3-LAM tiles are -; then drawn on top. ; ; ********************************************************************** ; - lon_cntrs_unstruc \ - := array_append_record(lon_cntrs_unstruc_RAP, lon_cntrs_unstruc, 0) - - lat_cntrs_unstruc \ - := array_append_record(lat_cntrs_unstruc_RAP, lat_cntrs_unstruc, 0) - lon_verts_unstruc \ - := array_append_record(lon_verts_unstruc_RAP, lon_verts_unstruc, 0) +;grid_opts := True +;grid_opts@plot_gridlines := new(1, logical) +;grid_opts@gridline_colors := new(1, string) +; +;bdy_opts := True +;bdy_opts@num_bdies = 0 +;bdy_opts@plot_bdy = new(1, logical) +;bdy_opts@bdy_colors = new(1, string) +;bdy_opts@bdy_line_thicknesses = new(1, float) +;bdy_opts@bdy_dash_patterns = new(1, integer) - lat_verts_unstruc \ - := array_append_record(lat_verts_unstruc_RAP, lat_verts_unstruc, 0) - field_unstruc \ - := array_append_record(field_unstruc_RAP, field_unstruc, 0) -; -; ********************************************************************** -; -; Calculate and print out basic statistics of the field, now including -; the RAP field. +;print("AAAAAA native = " + native) +;if (native) then ; -; ********************************************************************** +; grid_opts@plot_gridlines \ +; := array_append_record(grid_opts@plot_gridlines, native@plot_gridlines, 0) +; grid_opts@gridline_colors \ +; := array_append_record(grid_opts@gridline_colors, native@gridline_color, 0) ; - msg := "Calculating statistics of combined field on FV3-LAM and RAP grids ..." - print("") - print("" + separator_line) - print("" + msg) - -; print_field_stats = True - print_field_stats = False - field_stat_info \ - := calc_field_stats( \ - field_unstruc, field_desc, field_units, print_field_stats) - msg := " " + field_stat_info@msg - print("") - print("" + msg) - - field_min := field_stat_info@field_min - field_max := field_stat_info@field_max - field_median := field_stat_info@field_median - field_mean := field_stat_info@field_mean - - msg := "Done calculating statistics of combined field on FV3-LAM and RAP grids." - print("") - print("" + msg) - print("" + separator_line) +; if (native@plot_bdy) then +; bdy_opts@num_bdies = bdy_opts@num_bdies + 1 +; bdy_opts@plot_bdy \ +; := array_append_record(bdy_opts@plot_bdy, native@plot_bdy, 0) +; bdy_opts@bdy_colors \ +; := array_append_record(bdy_opts@bdy_colors, native@bdy_color, 0) +; bdy_opts@bdy_line_thicknesses \ +; := array_append_record(bdy_opts@bdy_line_thicknesses, native@bdy_line_thickness, 0) +; bdy_opts@bdy_dash_patterns \ +; := array_append_record(bdy_opts@bdy_dash_patterns, native@bdy_dash_pattern, 0) +; end if ; -; ********************************************************************** +;end if + +;print("AAAAAA wrtcmp = " + wrtcmp) +;if (wrtcmp) then +; +; grid_opts@plot_gridlines \ +; := array_append_record(grid_opts@plot_gridlines, wrtcmp@plot_gridlines, 0) +; grid_opts@gridline_colors \ +; := array_append_record(grid_opts@gridline_colors, wrtcmp@gridline_color, 0) +; +; if (wrtcmp@plot_bdy) then +; bdy_opts@num_bdies = bdy_opts@num_bdies + 1 +; bdy_opts@plot_bdy \ +; := array_append_record(bdy_opts@plot_bdy, wrtcmp@plot_bdy, 0) +; bdy_opts@bdy_colors \ +; := array_append_record(bdy_opts@bdy_colors, wrtcmp@bdy_color, 0) +; bdy_opts@bdy_line_thicknesses \ +; := array_append_record(bdy_opts@bdy_line_thicknesses, wrtcmp@bdy_line_thickness, 0) +; bdy_opts@bdy_dash_patterns \ +; := array_append_record(bdy_opts@bdy_dash_patterns, wrtcmp@bdy_dash_pattern, 0) +; end if ; -; If show_RAP_bdy is set to True, prepend the RAP boundary coordinates -; to those for the FV3-LAM tiles. +;end if + +;print("AAAAAA extrnl = " + extrnl) +;if (extrnl) then +; +; grid_opts@plot_gridlines +; := array_append_record(grid_opts@plot_gridlines, extrnl@plot_gridlines, 0) +; grid_opts@gridline_colors \ +; := array_append_record(grid_opts@gridline_colors, extrnl@gridline_color, 0) +; +; if (extrnl@plot_bdy) then +; bdy_opts@num_bdies = bdy_opts@num_bdies + 1 +; bdy_opts@plot_bdy \ +; := array_append_record(bdy_opts@plot_bdy, extrnl@plot_bdy, 0) +; bdy_opts@bdy_colors \ +; := array_append_record(bdy_opts@bdy_colors, extrnl@bdy_color, 0) +; bdy_opts@bdy_line_thicknesses \ +; := array_append_record(bdy_opts@bdy_line_thicknesses, extrnl@bdy_line_thickness, 0) +; bdy_opts@bdy_dash_patterns \ +; := array_append_record(bdy_opts@bdy_dash_patterns, extrnl@bdy_dash_pattern, 0) +; end if ; -; ********************************************************************** +;end if + +;print("") +;printVarSummary(grid_opts) ; - if (show_RAP_bdy) then +;n := dimsizes(grid_opts@plot_gridlines) +;if (n .gt. 1) then +; grid_opts@plot_gridlines := grid_opts@plot_gridlines(1:) +; grid_opts@gridline_colors := (/ grid_opts@gridline_colors(1:) /) +;end if ; -; Perform data conversion if necessary. +;bdy_opts@plot_bdy := (/ bdy_opts@plot_bdy(1:) /) +;bdy_opts@bdy_colors := bdy_opts@bdy_colors(1:) +;bdy_opts@bdy_line_thicknesses := bdy_opts@bdy_line_thicknesses(1:) +;bdy_opts@bdy_dash_patterns := bdy_opts@bdy_dash_patterns(1:) +;bdy_opts@num_bdy_pts_all_bdies = 2*(nx_all + ny_all) + 1 ; - if (strcmp_exact(coord_data_type_FV3LAM, coord_data_type_RAP) .eq. False) then - lon_bdy_RAP := totype(lon_bdy_RAP, coord_data_type_FV3LAM) - lat_bdy_RAP := totype(lat_bdy_RAP, coord_data_type_FV3LAM) - end if - - if (.not. show_tile_bdies) then - - lon_bdy := lon_bdy_RAP - lat_bdy := lat_bdy_RAP - - else - -; lon_bdy_RAP := array_append_record(lon_bdy_RAP, coord_fill_val, 0) - lon_bdy := array_append_record(coord_fill_val, lon_bdy, 0) - lon_bdy := array_append_record(lon_bdy_RAP, lon_bdy, 0) - -; lat_bdy_RAP := array_append_record(lat_bdy_RAP, coord_fill_val, 0) - lat_bdy := array_append_record(coord_fill_val, lat_bdy, 0) - lat_bdy := array_append_record(lat_bdy_RAP, lat_bdy, 0) - - end if - - end if +;print("") +;printVarSummary(grid_opts) +;print("") +;printVarSummary(bdy_opts) - end if +;exit ; ; ********************************************************************** ; @@ -1351,9 +1099,12 @@ end if plot_opts@subreg_limits = subreg_limits end if -left_str = "AAA" -main_str = "BBB" -right_str = "CCC" +;left_str = "AAA" +;main_str = "BBB" +;right_str = "CCC" +left_str = "" +main_str = "" +right_str = "" plot_opts@left_str = left_str plot_opts@main_str = main_str @@ -1365,6 +1116,17 @@ right_str = "CCC" ; ; ********************************************************************** ; +nx_big = sum(nx_all) +ny_big = sum(ny_all) +field_unstruc := new(nx_big*ny_big, double) + + field_min := min(field_unstruc) + field_max := max(field_unstruc) + +;print("field_min = " + field_min) +;print("field_max = " + field_max) +;pause + print("") print("" + separator_line) msg := \ @@ -1386,85 +1148,11 @@ right_str = "CCC" print("Done calculating " + char_dq + "nice" + char_dq + " contour values.") print("" + separator_line) - -; -; ********************************************************************** -; -; Set the arrays containing the number of grid points in the x and y di- -; rections for all tiles and grids to be plotted. -; -; ********************************************************************** -; -;nx_all_grids := nx -;ny_all_grids := ny - -; nx_all_grids \ -; := where(remove_halo_tiles_to_plot, \ -; nx_tiles_to_plot, nxh_tiles_to_plot) -; ny_all_grids \ -; := where(remove_halo_tiles_to_plot, \ -; ny_tiles_to_plot, nyh_tiles_to_plot) - -; if (show_RAP_grid .or. plot_RAP_field) then -; nx_all_grids := array_append_record(nx_RAP, nx_all_grids, 0) -; ny_all_grids := array_append_record(ny_RAP, ny_all_grids, 0) -; end if - -; if (show_wrtcmp_grid) then -; nx_all_grids := array_append_record(nx_wrtcmp, nx_all_grids, 0) -; ny_all_grids := array_append_record(ny_wrtcmp, ny_all_grids, 0) -; end if - - - -; -; ********************************************************************** -; -; -; -; ********************************************************************** -; - -grid_opts := True -;grid_opts@num_grids = num_grids_to_plot -grid_opts@num_grids = 1 -;grid_opts@plot_grid = plot_grid -grid_opts@plot_grid = show_wrtcmp_grid -;grid_opts@gridline_colors = gridline_colors -grid_opts@gridline_colors = wrtcmp_bdy_color - - -bdy_opts := True -;bdy_opts@num_bdies = num_bdies_to_plot -bdy_opts@num_bdies = 1 -;bdy_opts@num_bdy_pts_all_bdies = num_bdy_pts_all_bdies -bdy_opts@num_bdy_pts_all_bdies = 2*(nx + ny) + 1 -;bdy_opts@plot_bdy = plot_bdy -bdy_opts@plot_bdy = show_wrtcmp_bdy -;bdy_opts@bdy_colors = bdy_colors -bdy_opts@bdy_colors = wrtcmp_bdy_color -;bdy_opts@bdy_line_thicknesses = bdy_line_thicknesses -bdy_opts@bdy_line_thicknesses = 4.0 -;bdy_opts@bdy_dash_patterns = bdy_dash_patterns -bdy_opts@bdy_dash_patterns = 1 - - -; Old way of calling plot_horiz_field + changes to get it to work with -; new way, but doesn't work. Use the new call further below, but some -; input arguments not yet defined. Should be defined as in file -; plot_FV3LAM_field_native.ncl. -; plot_info := plot_horiz_field( \ -; fn_graphics, \ -; lon_cntrs_unstruc, lat_cntrs_unstruc, \ -; lon_verts_unstruc, lat_verts_unstruc, \ -; lon_bdy, lat_bdy, \ -; field_unstruc, \ -; plot_options) - - +; fn_graphics = cres + "_grid_f" + fcst_hr_str + "_k" + vert_indx_str + fn_graphics = cres + "_grids" plot_info := plot_horiz_field( \ fn_graphics, \ - nx, ny, \ + nx_all, ny_all, \ lon_cntrs_unstruc, lat_cntrs_unstruc, \ lon_verts_unstruc, lat_verts_unstruc, \ lon_bdy, lat_bdy, \ @@ -1474,14 +1162,9 @@ bdy_opts@bdy_dash_patterns = 1 plot_opts) - -print("BYE!!!!!!!!!!!!!!!!!!!!!!!") - - - - - end do -end do +print("") +print("BYE") +exit end diff --git a/ush/NCL/plot_horiz_field.ncl b/ush/NCL/plot_horiz_field.ncl index a9c5caafd..35d9ca212 100644 --- a/ush/NCL/plot_horiz_field.ncl +++ b/ush/NCL/plot_horiz_field.ncl @@ -179,7 +179,9 @@ begin indx_start := new(num_grids, "integer") indx_end := new(num_grids, "integer") - + +print("num_grids = " + num_grids) +;pause do i=0, num_grids-1 if (i .eq. 0) then indx_start(i) = 0 @@ -192,6 +194,7 @@ begin print("") print("(nx_all_grids, ny_all_grids) = " + \ "(" + nx_all_grids + ", " + ny_all_grids + ")") +pause ; ; ********************************************************************** ; @@ -275,8 +278,10 @@ print("indx_end(i) = " + indx_end(i)) ; lon_cntrs_crnt_grid_unstruc \ := lon_cntrs_unstruc(indx_start(i):indx_end(i)) +;print("dimsizes(lon_cntrs_crnt_grid_unstruc) = " + dimsizes(lon_cntrs_crnt_grid_unstruc)) lat_cntrs_crnt_grid_unstruc \ := lat_cntrs_unstruc(indx_start(i):indx_end(i)) +;print("dimsizes(lat_cntrs_crnt_grid_unstruc) = " + dimsizes(lat_cntrs_crnt_grid_unstruc)) rsrc@sfXArray = lon_cntrs_crnt_grid_unstruc rsrc@sfYArray = lat_cntrs_crnt_grid_unstruc @@ -285,24 +290,47 @@ print("indx_end(i) = " + indx_end(i)) ; These resources must be set in order if the cnFillMode resource is set ; to "CellFill". ; +;print("XXXXXXXXXXXXXXXXXXXXXXXXXXXX") +;print("dimsizes(lon_verts_unstruc) = " + dimsizes(lon_verts_unstruc)) +;print("indx_start(i) = " + indx_start(i)) +;print("indx_end(i) = " + indx_end(i)) +;pause lon_verts_crnt_grid_unstruc \ := lon_verts_unstruc(indx_start(i):indx_end(i),:) +;print("dimsizes(lon_verts_crnt_grid_unstruc) = " + dimsizes(lon_verts_crnt_grid_unstruc)) lat_verts_crnt_grid_unstruc \ := lat_verts_unstruc(indx_start(i):indx_end(i),:) +;print("dimsizes(lat_verts_crnt_grid_unstruc) = " + dimsizes(lat_verts_crnt_grid_unstruc)) rsrc@sfXCellBounds = lon_verts_crnt_grid_unstruc rsrc@sfYCellBounds = lat_verts_crnt_grid_unstruc ; -; If the grid_opts@plot_grid(i) is set to True, draw the cell edges +; If the grid_opts@plot_gridlines(i) is set to True, draw the cell edges ; (gridlines) of the current grid. ; - if (grid_opts@plot_grid(i)) then +;print("DDDDDDDD") +;print(grid_opts) +;print("EEEEEE i = " + i) +;print(" dimsizes(grid_opts@plot_gridlines(i)) = " + dimsizes(grid_opts@plot_gridlines(i))) +;print(dimsizes(grid_opts@plot_gridlines(i))) +;print(dimsizes(grid_opts@plot_gridlines)) +;tmp := grid_opts@plot_gridlines(i) +tmp := grid_opts@plot_gridlines +;print("FFFFFFFFFFFFFF") +;print("KKKKKKKKKK tmp(i) = " + tmp(i)) +;print("GGGGGGGGGGG") +;print(dimsizes(tmp)) +;print("HHHHHHHHHHH") +;exit +; if (grid_opts@plot_gridlines(i)) then +; if ( False ) then + if (tmp(i)) then ; ; The resource cnCellFillMissingValEdgeColor should ideally set the cell ; edge color of those cells that contain missing values, but it seems to ; have no effect - at least when the field on the current grid contains ; all missing/fill values. For this reason, when the field on a grid -; contains all missing/fill values and grid_opts@plot_grid(i) for that +; contains all missing/fill values and grid_opts@plot_gridlines(i) for that ; grid is set to True (i.e. we want to see the gridlines but not a field ; on that grid), we resort to the method below in which we set the cn- ; CellFillEdgeColor resource to the color we want for the gridlines, and @@ -328,6 +356,7 @@ print("indx_end(i) = " + indx_end(i)) ; Extract the portion of the field array that contains the field values ; on the current grid. ; +;print("dimsizes(field_unstruc) = " + dimsizes(field_unstruc)) field_crnt_grid_unstruc \ := field_unstruc(indx_start(i):indx_end(i)) ; @@ -335,7 +364,7 @@ print("indx_end(i) = " + indx_end(i)) ; ues, then reset at least one value to a non-missing value (e.g. zero), ; and set the opacity of the field to 0 (transparent). We do this in ; order to be able to see the gridlines in cases in which all values in -; the field on the current grid are missing, and grid_opts@plot_grid(i) +; the field on the current grid are missing, and grid_opts@plot_gridlines(i) ; is set to True (because in that case, the cnCellFillMissingValEdgeCo- ; lor resource doesn't seem to have an effect, so we use the cnCellFill- ; EdgeColor resource instead along with setting the opacity to 0). @@ -432,6 +461,14 @@ print("indx_end(i) = " + indx_end(i)) ; rsrc@mpDataBaseVersion = "MediumRes" ; rsrc@mpDataBaseVersion = "HighRes" +; rsrc@mpDataBaseVersion = "Dynamic" + rsrc@mpDataSetName = "Earth..4" + +; rsrc@mpOutlineBoundarySets = "USStates" +; rsrc@mpOutlineBoundarySets = "AllBoundaries" +; rsrc@mpOutlineSpecifiers = (/ "United States:states", "Canada:states", "Mexico:states" /) + rsrc@mpOutlineSpecifiers = (/ "land:states" /) +; rsrc@mpOutlineDrawOrder = "PostDraw" ; ; Plot curves of constant longitude and latitude (regardless of the plot ; projection). @@ -978,6 +1015,8 @@ print("indx_end(i) = " + indx_end(i)) id_grid_bdies := new(num_bdies, "graphic") bdy_indx_end := -1 +;print("") +;print("dimsizes(id_grid_bdies) = " + dimsizes(id_grid_bdies)) do i=0, num_bdies-1 @@ -988,15 +1027,25 @@ print("indx_end(i) = " + indx_end(i)) if (show_grid_bdy(i)) then resp := True - resp@gsLineColor = bdy_opts@bdy_colors(i) - resp@gsLineThicknessF = bdy_opts@bdy_line_thicknesses(i) - resp@gsLineDashPattern = bdy_opts@bdy_dash_patterns(i) + resp@gsLineColor := bdy_opts@bdy_colors(i) + resp@gsLineThicknessF := bdy_opts@bdy_line_thicknesses(i) + resp@gsLineDashPattern := bdy_opts@bdy_dash_patterns(i) lon_crnt_bdy := lon_bdy_all_bdies(bdy_indx_start:bdy_indx_end) lat_crnt_bdy := lat_bdy_all_bdies(bdy_indx_start:bdy_indx_end) +print("") +print("i = " + i) +print("num_bdies = " + num_bdies) +print("bdy_opts@bdy_colors(i) = " + bdy_opts@bdy_colors(i)) +print("bdy_indx_start = " + bdy_indx_start) +print("bdy_indx_end = " + bdy_indx_end) +;print(resp) + id_grid_bdies(i) \ = gsn_add_polyline( \ wks, contour_map, lon_crnt_bdy, lat_crnt_bdy, resp) +; gsn_add_polyline( \ +; wks, contour_map, lon_crnt_bdy, lat_crnt_bdy, resp) end if diff --git a/ush/NCL/process_plot_params.ncl b/ush/NCL/process_plot_params.ncl index b58b42320..297cd284f 100644 --- a/ush/NCL/process_plot_params.ncl +++ b/ush/NCL/process_plot_params.ncl @@ -236,7 +236,7 @@ example_usage_and_help_str ; ********************************************************************** ; cmd = "sed --silent --regexp-extended --expression " \ - + "'s/^[ ]*(RES=)([" + char_dq + "]*)([0-9]+)([" + char_dq + "]*)(.*)/\3/p' " \ + + "'s/^[ ]*(CRES=)([" + char_dq + "]*)C([0-9]+)([" + char_dq + "]*)(.*)/\3/p' " \ + var_defns_fn res := systemfunc(cmd) ; diff --git a/ush/NCL/read_FV3LAM_grid_native.ncl b/ush/NCL/read_FV3LAM_grid_native.ncl index 7862666d8..e676163be 100644 --- a/ush/NCL/read_FV3LAM_grid_native.ncl +++ b/ush/NCL/read_FV3LAM_grid_native.ncl @@ -6,57 +6,56 @@ ; ; Description: ; ^^^^^^^^^^^ -; This function returns the file names, dimensions, cell center coordi- -; nates, and cell vertex coordinates of the grids associated with the -; specified FV3 cubed-sphere tiles (tile_inds). If get_tile_bdies is -; set to True, it also returns the coordinates of those grid cell verti- -; ces that lie on the boundary of each specified tile. +; This function returns the file names, dimensions, cell center coordinates, +; and cell vertex coordinates of the grids associated with the specified +; FV3 cubed-sphere tiles (tile_inds). If get_tile_bdies is set to True, +; it also returns the coordinates of those grid cell vertices that lie on +; the boundary of each specified tile. ; ; The input arguments to this function are as follows: ; ; expt_dir: -; This is the experiment directory created by the FV3-LAM workflow gene- -; ration script. The grid specification files corresponding to the -; cubed-sphere tiles are within subdirectories under this directory. +; This is the experiment directory created by the FV3SAR workflow generation +; script. The grid specification files corresponding to the cubed-sphere +; tiles are within subdirectories under this directory. ; ; gtype: -; This is a string containing the grid type of the FV3 cubed-sphere grid -; being read in. For files generated by the FV3-LAMR workflow, this will -; be equal to "regional". +; This is a string containing the type of the FV3 cubed-sphere grid being +; read in. For files generated by the FV3SAR workflow, this will be equal +; to "regional". ; ; cres: ; This is the C-resolution of the global cubed-sphere grid that serves ; as the "parent" of the regional grid. It consists of the character ; "C" followed by an interger that is equal to the number of grid cells ; in each of the two horizontal directions (say x and y) on each of the -; six tiles of the parent global grid. Note that this number is in ge- -; neral not equal to the number of grid cells on the regional grid (i.e. -; the one on tile 7) because the latter is given by the former multi- -; plied by a refinement factor (an integer) that is normally greater -; than 1. +; six tiles of the parent global grid. Note that this number is in general +; not equal to the number of grid cells on the regional grid (i.e. the +; one on tile 7) because the latter is given by the former multiplied by +; a refinement factor (an integer) that is normally greater than 1. ; ; tile_inds: ; The indices of the tiles (associated with ither the parent global grid ; or the regional grid) to consider in this function. ; ; get_tile_bdies: -; A logical variable that specifies whether arrays containing the coor- -; dinates of grid cell vertices that lie on the boundary of each tile -; specified in tile_inds are to be extracted and returned. +; A logical variable that specifies whether arrays containing the coordinates +; of grid cell vertices that lie on the boundary of each tile specified +; in tile_inds are to be extracted and returned. ; ; nhalo_T7: ; The width of the halo (in units of grid cells) included in the grid -; specification file for the regional grid (tile 7). If tile_inds in- -; cludes tile 7, then this is used to form the name of the grid file for -; that tile. Also, if tile_inds includes tile 7 and if remove_rgnl_halo -; is set to True, then a halo of width nhalo_T7 is removed from any ar- -; rays read in from the tile 7 grid file. This is not used if tile_inds -; does not include tile 7. +; specification file for the regional grid (tile 7). If tile_inds includes +; tile 7, then this is used to form the name of the grid file for that +; tile. Also, if tile_inds includes tile 7 and if remove_rgnl_halo is +; set to True, then a halo of width nhalo_T7 is removed from any arrays +; read in from the tile 7 grid file. This is not used if tile_inds does +; not include tile 7. ; ; remove_rgnl_halo: ; Flag indicating whether to remove a halo of width nhalo_T7 from any -; arrays read in from the tile 7 grid file. This is not used if tile_- -; inds does not include tile 7. +; arrays read in from the tile 7 grid file. This is not used if tile_inds +; does not include tile 7. ; ; ********************************************************************** ; @@ -120,8 +119,6 @@ local num_tiles_to_plot, \ \ lon_cntrs_crnt_tile_unstruc, lat_cntrs_crnt_tile_unstruc, \ lon_verts_crnt_tile_unstruc, lat_verts_crnt_tile_unstruc, \ - lon_cntrs_all_tiles_unstruc, lat_cntrs_all_tiles_unstruc, \ - lon_verts_all_tiles_unstruc, lat_verts_all_tiles_unstruc, \ \ grid_info @@ -145,12 +142,12 @@ begin ; grid_fn_all_tiles: ; Full path to the grid file corresponding to each tile. Note that the ; grid file contains information (coordinates, etc) on the supergrid of -; a given tile, where the supergrid is a grid having twice the resolu- -; tion of the actual (i.e. computational) grid. +; a given tile, where the supergrid is a grid having twice the resolution +; of the actual (i.e. computational) grid. ; ; remove_halo_all_tiles: -; Logical array that specifies whether the halo cells around a given -; tile should be removed before plotting or other processing. +; Logical array that specifies whether the halo cells around a given tile +; should be removed before plotting or other processing. ; ; nhSG_all_tiles: ; Halo width on the supergrid of each tile, in units of supergrid cells. @@ -158,12 +155,12 @@ begin ; will be zero for tiles 1 through 6. ; ; nxhSG_all_tiles, nyhSG_all_tiles: -; Number of cells, including the halo, in the x and y directions, res- -; pectively, on the supergrid of each tile. +; Number of cells, including the halo, in the x and y directions, +; respectively, on the supergrid of each tile. ; ; nxSG_all_tiles, nySG_all_tiles: -; Number of cells, excluding the halo, in the x and y directions, res- -; pectively, on the supergrid of each tile. +; Number of cells, excluding the halo, in the x and y directions, +; respectively, on the supergrid of each tile. ; ; nh_all_tiles: ; Halo width on the computational grid of each tile, in units of grid @@ -171,12 +168,12 @@ begin ; so this will be zero for tiles 1 through 6. ; ; nxh_all_tiles, nyh_all_tiles: -; Number of cells, including the halo, in the x and y directions, res- -; pectively, on the computational grid of each tile. +; Number of cells, including the halo, in the x and y directions, +; respectively, on the computational grid of each tile. ; ; nx_all_tiles, ny_all_tiles: -; Number of cells, excluding the halo, in the x and y directions, res- -; pectively, on the computational grid of each tile. +; Number of cells, excluding the halo, in the x and y directions, +; respectively, on the computational grid of each tile. ; ; coord_data_type_all_tiles: ; The data type of the coordinate arrays in the grid file corresponding @@ -222,17 +219,20 @@ begin ; ; ********************************************************************** ; -; Set the file name (including path) for the current tile. Then save -; the resut in the grid_fn_all_tiles array for later use. +; Set the file name (including path) for the current tile. Then save the +; result in the grid_fn_all_tiles array for later use. ; ; ********************************************************************** ; +; Maybe read in the new parameter DOT_OR_USCORE from the var_defns.sh file. grid_fn = cres + "_grid.tile" + n_tile +; grid_fn = cres + ".grid.tile" + n_tile if (strcmp_exact(gtype, "regional") .and. (n_tile .eq. 7)) then grid_fn = grid_fn + ".halo" + tostring(nhalo_T7) + ".nc" else grid_fn = grid_fn + ".nc" end if +; grid_fn = expt_dir + "/fix_sar/" + grid_fn grid_fn = expt_dir + "/fix_lam/" + grid_fn grid_fn_all_tiles(nn) = grid_fn @@ -361,9 +361,9 @@ begin msg := str_join(msg, char_nl) msg := char_nl + \ -"For simplicity, we require that the coordinate arrays in the files cor-" + char_nl + \ -"responding to the specified tiles all have the same data type. In this " + char_nl + \ -"case, they are not:" + char_nl + \ +"For simplicity, we require that the coordinate arrays in the files " + char_nl + \ +"corresponding to the specified tiles all have the same data type. In " + char_nl + \ +"this case, they are not:" + char_nl + \ msg + char_nl + \ "Stopping." @@ -382,12 +382,12 @@ msg + char_nl + \ ; ; ********************************************************************** ; -; Initialize the arrays that will contain the grid and boundary coordi- -; nates of all specified tiles to 1-element arrays containing missing -; values of type coord_data_type. After the coordinates are appended to -; these arrays in the loop below, the first elements of these arrays -; will be stripped away (since they are created here only to make it -; convenient to append to the arrays). +; Initialize the arrays that will contain the grid and boundary coordinates +; of all specified tiles to 1-element arrays containing missing values +; of type coord_data_type. After the coordinates are appended to these +; arrays in the loop below, the first elements of these arrays will be +; stripped away (since they are created here only to make it convenient +; to append to the arrays). ; ; ********************************************************************** ; @@ -397,6 +397,13 @@ msg + char_nl + \ lat_verts_all_tiles_unstruc := new((/1,4/), coord_data_type) lon_bdy_all_tiles := new(1, coord_data_type) lat_bdy_all_tiles := new(1, coord_data_type) + + lon_halo_cntrs_all_tiles_unstruc := new(1, coord_data_type) + lat_halo_cntrs_all_tiles_unstruc := new(1, coord_data_type) + lon_halo_verts_all_tiles_unstruc := new((/1,4/), coord_data_type) + lat_halo_verts_all_tiles_unstruc := new((/1,4/), coord_data_type) + lon_halo_bdy_all_tiles := new(1, coord_data_type) + lat_halo_bdy_all_tiles := new(1, coord_data_type) ; ; ********************************************************************** ; @@ -477,8 +484,8 @@ msg + char_nl + \ ; ; ********************************************************************** ; -; Get the coordinates of the cell vertices on the current tile from -; those of the supergrid. +; Get the coordinates of the cell vertices on the current tile from those +; of the supergrid. ; ; ********************************************************************** ; @@ -497,9 +504,32 @@ msg + char_nl + \ ; ; ********************************************************************** ; -; If on a regional grid, if the current tile is tile 7 (the regional do- -; main/grid), and if remove_rgnl_halo is set to True, then remove a halo -; of width nhalo_T7 cells from each of the coordinate arrays. +; Set arrays containing the coordinates of just the halo cells (with all +; internal cells' coordinates set to the approprite type of fill value). +; This approach allows us to more conveniently plot just the halo cells +; using the same plotting routines as for the internal cells. +; +; ********************************************************************** +; + lon_halo_cntrs_crnt_tile := lon_cntrs_crnt_tile + lon_halo_cntrs_crnt_tile(nh:nyh-nh,nh:nxh-nh) \ + = default_fillvalue(coord_data_type) + lat_halo_cntrs_crnt_tile := lat_cntrs_crnt_tile + lat_halo_cntrs_crnt_tile(nh:nyh-nh,nh:nxh-nh) \ + = default_fillvalue(coord_data_type) + + lon_halo_verts_crnt_tile := lon_verts_crnt_tile + lon_halo_verts_crnt_tile(nh+1:nyh-nh-1,nh+1:nxh-nh-1) \ + = default_fillvalue(coord_data_type) + lat_halo_verts_crnt_tile := lat_verts_crnt_tile + lat_halo_verts_crnt_tile(nh+1:nyh-nh-1,nh+1:nxh-nh-1) \ + = default_fillvalue(coord_data_type) +; +; ********************************************************************** +; +; If on a regional grid, if the current tile is tile 7 (the regional +; domain/grid), and if remove_rgnl_halo is set to True, then remove a +; halo of width nhalo_T7 cells from each of the coordinate arrays. ; ; ********************************************************************** ; @@ -555,13 +585,16 @@ msg + char_nl + \ ; arrays, and their size (i.e. the number of elements they contain) is ; equal to the number of cells on the current tile's grid (i.e. nxh*nyh ; or nx*ny). This unstructured format is useful for generating color- -; contour plots of fields on the grid that have one value per cell re- -; presented by a flat color in that cell. +; contour plots of fields on the grid that have one value per cell +; represented by a flat color in that cell. ; ; ********************************************************************** ; lon_cntrs_crnt_tile_unstruc := ndtooned(lon_cntrs_crnt_tile) lat_cntrs_crnt_tile_unstruc := ndtooned(lat_cntrs_crnt_tile) + + lon_halo_cntrs_crnt_tile_unstruc := ndtooned(lon_halo_cntrs_crnt_tile) + lat_halo_cntrs_crnt_tile_unstruc := ndtooned(lat_halo_cntrs_crnt_tile) ; ; ********************************************************************** ; @@ -575,21 +608,57 @@ msg + char_nl + \ ; ; ********************************************************************** ; + +; Get dimensions again because they depend on whether the halo is being +; removed or not (remove_rgnl_halo). + dims := dimsizes(lon_cntrs_crnt_tile) + endx := dims(1) + endy := dims(0) + lon_verts_crnt_tile_unstruc \ - := (/ ndtooned(lon_verts_crnt_tile(0:ny-1,0:nx-1)), \ - ndtooned(lon_verts_crnt_tile(0:ny-1,1:nx)), \ - ndtooned(lon_verts_crnt_tile(1:ny,1:nx)), \ - ndtooned(lon_verts_crnt_tile(1:ny,0:nx-1)) /) + := (/ ndtooned(lon_verts_crnt_tile(0:endy-1,0:endx-1)), \ + ndtooned(lon_verts_crnt_tile(0:endy-1,1:endx)), \ + ndtooned(lon_verts_crnt_tile(1:endy,1:endx)), \ + ndtooned(lon_verts_crnt_tile(1:endy,0:endx-1)) /) lon_verts_crnt_tile_unstruc \ := transpose(lon_verts_crnt_tile_unstruc) lat_verts_crnt_tile_unstruc \ - := (/ ndtooned(lat_verts_crnt_tile(0:ny-1,0:nx-1)), \ - ndtooned(lat_verts_crnt_tile(0:ny-1,1:nx)), \ - ndtooned(lat_verts_crnt_tile(1:ny,1:nx)), \ - ndtooned(lat_verts_crnt_tile(1:ny,0:nx-1)) /) + := (/ ndtooned(lat_verts_crnt_tile(0:endy-1,0:endx-1)), \ + ndtooned(lat_verts_crnt_tile(0:endy-1,1:endx)), \ + ndtooned(lat_verts_crnt_tile(1:endy,1:endx)), \ + ndtooned(lat_verts_crnt_tile(1:endy,0:endx-1)) /) lat_verts_crnt_tile_unstruc \ := transpose(lat_verts_crnt_tile_unstruc) + + +; Do same for halo coordinates. + lon_halo_verts_crnt_tile_unstruc \ + := (/ ndtooned(lon_halo_verts_crnt_tile(0:nyh-1,0:nxh-1)), \ + ndtooned(lon_halo_verts_crnt_tile(0:nyh-1,1:nxh)), \ + ndtooned(lon_halo_verts_crnt_tile(1:nyh,1:nxh)), \ + ndtooned(lon_halo_verts_crnt_tile(1:nyh,0:nxh-1)) /) + lon_halo_verts_crnt_tile_unstruc \ + := transpose(lon_halo_verts_crnt_tile_unstruc) + + lat_halo_verts_crnt_tile_unstruc \ + := (/ ndtooned(lat_halo_verts_crnt_tile(0:nyh-1,0:nxh-1)), \ + ndtooned(lat_halo_verts_crnt_tile(0:nyh-1,1:nxh)), \ + ndtooned(lat_halo_verts_crnt_tile(1:nyh,1:nxh)), \ + ndtooned(lat_halo_verts_crnt_tile(1:nyh,0:nxh-1)) /) + lat_halo_verts_crnt_tile_unstruc \ + := transpose(lat_halo_verts_crnt_tile_unstruc) + + do i=0, nxh-1 + do j=0, nyh-1 + if ((i .ge. nh) .and. (i .le. nxh-nh-1)) .and. \ + ((j .ge. nh) .and. (j .le. nyh-nh-1)) then + indx = i + j*nxh + lon_halo_verts_crnt_tile_unstruc(indx,:) = default_fillvalue(coord_data_type) + lat_halo_verts_crnt_tile_unstruc(indx,:) = default_fillvalue(coord_data_type) + end if + end do + end do ; ; ********************************************************************** ; @@ -612,6 +681,20 @@ msg + char_nl + \ lat_verts_all_tiles_unstruc \ := array_append_record( \ lat_verts_all_tiles_unstruc, lat_verts_crnt_tile_unstruc, 0) + + lon_halo_cntrs_all_tiles_unstruc \ + := array_append_record( \ + lon_halo_cntrs_all_tiles_unstruc, lon_halo_cntrs_crnt_tile_unstruc, 0) + lat_halo_cntrs_all_tiles_unstruc \ + := array_append_record( \ + lat_halo_cntrs_all_tiles_unstruc, lat_halo_cntrs_crnt_tile_unstruc, 0) + + lon_halo_verts_all_tiles_unstruc \ + := array_append_record( \ + lon_halo_verts_all_tiles_unstruc, lon_halo_verts_crnt_tile_unstruc, 0) + lat_halo_verts_all_tiles_unstruc \ + := array_append_record( \ + lat_halo_verts_all_tiles_unstruc, lat_halo_verts_crnt_tile_unstruc, 0) ; ; ********************************************************************** ; @@ -643,6 +726,30 @@ msg + char_nl + \ lat_bdy_all_tiles \ := array_append_record(lat_bdy_all_tiles, lat_bdy_crnt_tile, 0) + +; Do same for halo coordinates. +; +; First, get the coordinates of the boundary points on the current tile. +; Here, by "boundary points", we mean those cell vertices that happen to +; lie on the tile's boundary. +; + repeat_last_point = True + array_order = "ji" + bdy_info := get_rect_grid_bdy( \ + lon_halo_verts_crnt_tile, lat_halo_verts_crnt_tile, \ + repeat_last_point, array_order) + lon_halo_bdy_crnt_tile := bdy_info@x_bdy + lat_halo_bdy_crnt_tile := bdy_info@y_bdy +; +; Append to the arrays that will contain the coordinates of the boundary +; points on all specified tiles. We refer to these as the "all-tiles" +; arrays. +; + lon_halo_bdy_all_tiles \ + := array_append_record(lon_halo_bdy_all_tiles, lon_halo_bdy_crnt_tile, 0) + lat_halo_bdy_all_tiles \ + := array_append_record(lat_halo_bdy_all_tiles, lat_halo_bdy_crnt_tile, 0) + end if ; ; ********************************************************************** @@ -673,9 +780,9 @@ msg + char_nl + \ ; ********************************************************************** ; ; Set the i-indices of the domain's left (west) boundary, center, and -; right (east) boundary and the j-indices of the bottom (south) bounda- -; ry, middle (center), and top (north) boundary in the arrays containing -; the coordinates of the supergrid. +; right (east) boundary and the j-indices of the bottom (south) boundary, +; middle (center), and top (north) boundary in the arrays containing the +; coordinates of the supergrid. ; ; ********************************************************************** ; @@ -703,13 +810,13 @@ msg + char_nl + \ ; ; ********************************************************************** ; -; Check whether any of the four faces of the current tile cross the in- -; ternational date line (IDL). This is important because if so, we will -; not be able to identify the southwest (SW), southeast (SE), northwest -; (NW), and northeast (NE) corners of the tile. We perform this check -; for each face by checking whether there is a jump in the longitudes of -; grid cell corner points that lie on the face as we move along the -; face. +; Check whether any of the four faces of the current tile cross the +; international date line (IDL). This is important because if so, we +; will not be able to identify the southwest (SW), southeast (SE), +; northwest (NW), and northeast (NE) corners of the tile. We perform +; this check for each face by checking whether there is a jump in the +; longitudes of grid cell corner points that lie on the face as we move +; along the face. ; ; Note that if one (or both) of the poles lies within the tile, then one ; of the tile faces must cross the IDL. Thus, the IDL crossing check @@ -723,6 +830,9 @@ msg + char_nl + \ ; ; ********************************************************************** ; + face_id_strs := (/ "bottom", "right", "top", "left" /) + num_faces := dimsizes(face_id_strs) +if (False) then ; abs_dlon_cutoff := 0.0d+0 ; For debugging only. abs_dlon_cutoff := 180.0d+0 @@ -757,19 +867,20 @@ msg + char_nl + \ msg := char_nl + \ "The " + char_dq + face_id_str + char_dq + " boundary of the current tile " + \ "crosses the international date " + char_nl + \ -"line (IDL) because there is a jump in longitude from one grid point to " + char_nl + \ -"the next along that boundary with a magnitude that is greater than or " + char_nl + \ -"equal to the maximum allowed value specified by " + char_dq + "abs_dlon_cutoff" + char_dq + ":" + char_nl + \ -" abs_dlon_cutoff = " + abs_dlon_cutoff_str + " deg" + char_nl + \ +"line (IDL) because there is a jump in longitude (abs_dlon_max) from one " + char_nl + \ +"grid point to the next along that boundary with a magnitude that is greater " + char_nl + \ +"than or equal to the maximum allowed value specified by " + char_dq + "abs_dlon_cutoff" + char_dq + ":" + char_nl + \ " abs_dlon_max = " + abs_dlon_max_str + " deg" + char_nl + \ -"Please express the longitude and latitude of the grid points in a rota-" + char_nl + \ -"ted lat/lon coordinate system to avoid this problem." + char_nl + \ +" abs_dlon_cutoff = " + abs_dlon_cutoff_str + " deg" + char_nl + \ +"Please express the longitude and latitude of the grid points in a rotated" + char_nl + \ +"lat/lon coordinate system to avoid this problem." + char_nl + \ "Stopping." print("" + msg) exit end if end do +end if ; ; ********************************************************************** ; @@ -812,8 +923,8 @@ msg + char_nl + \ ; ; Save in lon_face_midpts_crnt_tile and lat_face_midpts_crnt_tile the ; longitudes and latitudes of the midpoints of the four faces of the -; current tile, starting with the bottom face and proceeding counter- -; clockwise to the left face. +; current tile, starting with the bottom face and proceeding counterclockwise +; to the left face. ; ; ********************************************************************** ; @@ -839,9 +950,9 @@ msg + char_nl + \ ; ; ********************************************************************** ; -; Now find the indices into lon_tile_corners_crnt_tile (or lat_tile_- -; corners_crnt_tile) of the southwest, southeast, northeast, and north- -; west corners of the current tile. +; Now find the indices into lon_tile_corners_crnt_tile (or +; lat_tile_corners_crnt_tile) of the southwest, southeast, northeast, +; and northwest corners of the current tile. ; ; ********************************************************************** ; @@ -912,25 +1023,30 @@ msg + char_nl + \ end if end do + +indx_SW := (/ 0 /) +indx_SE := (/ 1 /) +indx_NE := (/ 2 /) +indx_NW := (/ 3 /) ; ; ********************************************************************** ; -; Now rearrange the lon_tile_corners_crnt_tile and lat_tile_corners_- -; crnt_tile arrays so that the first element corresponds to the south- -; west corner of the tile, the second corresponds to the southeast cor- -; ner, the third corresponds to the northeast corner, and the fourth -; corresponds to the northwest corner. Also, rearange the lon_face_- -; midpts_crnt_tile and lat_face_midpts_crnt_tile arrays so that the -; first element corresponds to the southern face, the second corresponds -; to the eastern face, the third corresponds to the northern face, and -; the fourth corresponds to the western face. +; Now rearrange the lon_tile_corners_crnt_tile and lat_tile_corners_crnt_tile +; arrays so that the first element corresponds to the southwest corner of +; the tile, the second corresponds to the southeast corner, the third +; corresponds to the northeast corner, and the fourth corresponds to the +; northwest corner. Also, rearange the lon_face_midpts_crnt_tile and +; lat_face_midpts_crnt_tile arrays so that the first element corresponds +; to the southern face, the second corresponds to the eastern face, the +; third corresponds to the northern face, and the fourth corresponds to +; the western face. ; ; ********************************************************************** ; ; IMPORTANT NOTE: ; For a global cubed-sphere grid, for three of the tiles (the ones over -; the north and south poles and the one that straddles the IDL), the in- -; dices of the SW, SE, NE, and NW corners of the tile will not be set +; the north and south poles and the one that straddles the IDL), the +; indices of the SW, SE, NE, and NW corners of the tile will not be set ; (they will remain set to their initial missing values), so the check ; below will be triggered. Something more complex needs to be done for ; such tiles, but we do not worry about it here for now since we're only @@ -1024,9 +1140,8 @@ msg + char_nl + \ ; ; Remove the first elements in the unstructured arrays containing the ; coordinates of the grid cells and tile boundaries. Recall that these -; first elements were defined to make it convenient to append the coor- -; dinates of each consecutive tile; they contain missing values of type -; coord_data_type. +; first elements were defined to make it convenient to append the coordinates +; of each consecutive tile; they contain missing values of type coord_data_type. ; ; ********************************************************************** ; @@ -1034,9 +1149,17 @@ msg + char_nl + \ lat_cntrs_all_tiles_unstruc := lat_cntrs_all_tiles_unstruc(1:) lon_verts_all_tiles_unstruc := lon_verts_all_tiles_unstruc(1:,:) lat_verts_all_tiles_unstruc := lat_verts_all_tiles_unstruc(1:,:) + + lon_halo_cntrs_all_tiles_unstruc := lon_halo_cntrs_all_tiles_unstruc(1:) + lat_halo_cntrs_all_tiles_unstruc := lat_halo_cntrs_all_tiles_unstruc(1:) + lon_halo_verts_all_tiles_unstruc := lon_halo_verts_all_tiles_unstruc(1:,:) + lat_halo_verts_all_tiles_unstruc := lat_halo_verts_all_tiles_unstruc(1:,:) + if (get_tile_bdies) then lon_bdy_all_tiles := lon_bdy_all_tiles(1:) lat_bdy_all_tiles := lat_bdy_all_tiles(1:) + lon_halo_bdy_all_tiles := lon_halo_bdy_all_tiles(1:) + lat_halo_bdy_all_tiles := lat_halo_bdy_all_tiles(1:) end if ; ; ********************************************************************** @@ -1072,6 +1195,14 @@ msg + char_nl + \ grid_info@lon_bdy_all_tiles = lon_bdy_all_tiles grid_info@lat_bdy_all_tiles = lat_bdy_all_tiles + grid_info@lon_halo_cntrs_all_tiles_unstruc = lon_halo_cntrs_all_tiles_unstruc + grid_info@lat_halo_cntrs_all_tiles_unstruc = lat_halo_cntrs_all_tiles_unstruc + grid_info@lon_halo_verts_all_tiles_unstruc = lon_halo_verts_all_tiles_unstruc + grid_info@lat_halo_verts_all_tiles_unstruc = lat_halo_verts_all_tiles_unstruc + + grid_info@lon_halo_bdy_all_tiles = lon_halo_bdy_all_tiles + grid_info@lat_halo_bdy_all_tiles = lat_halo_bdy_all_tiles + grid_info@lon_tile_cntr_all_tiles = lon_tile_cntr_all_tiles grid_info@lat_tile_cntr_all_tiles = lat_tile_cntr_all_tiles diff --git a/ush/NCL/read_FV3LAM_grid_wrtcmp.ncl b/ush/NCL/read_FV3LAM_grid_wrtcmp.ncl index 77bddcef3..7ed14cbe9 100644 --- a/ush/NCL/read_FV3LAM_grid_wrtcmp.ncl +++ b/ush/NCL/read_FV3LAM_grid_wrtcmp.ncl @@ -19,6 +19,7 @@ loadscript(lib_location + "special_chars.ncl") loadscript(lib_location + "constants.ncl") loadscript(lib_location + "strcmp_exact.ncl") loadscript(lib_location + "get_rect_grid_bdy.ncl") +loadscript(lib_location + "interpol_extrapol_linear.ncl") undef("read_FV3LAM_grid_wrtcmp") @@ -90,15 +91,12 @@ begin ; Read in the cell vertex coordinates. ; ; ********************************************************************** -; +; if (strcmp_exact(coord_sys, "rotated_latlon") .or. \ strcmp_exact(coord_sys, "lambert_conformal")) then - lon_verts := fp->grid_xt(:,:) - lat_verts := fp->grid_yt(:,:) - -lon_verts = lon_verts*degs_per_rad -lat_verts = lat_verts*degs_per_rad + lon_cntrs := fp->lon(:,:) + lat_cntrs := fp->lat(:,:) else @@ -116,9 +114,9 @@ lat_verts = lat_verts*degs_per_rad ; ; ********************************************************************** ; - dims := dimsizes(lon_verts) - nx = dims(1) - 1 - ny = dims(0) - 1 + dims := dimsizes(lon_cntrs) + nx = dims(1) + ny = dims(0) print("") print(" nx = " + nx) @@ -126,23 +124,210 @@ lat_verts = lat_verts*degs_per_rad ; ; ********************************************************************** ; -; Calculate cell center coordinates from cell vertex coordinates. +; Calculate cell vertex coordinates from cell center coordinates. For +; vertices that are in the interior of the write-component domain, we +; simply averate the four neighboring cell center coordinates to obtain +; the coordinates of the vertex. For vertices that lie on the boundary +; of the domain, we perform linear extrapolation using the coordinates +; of vertices that lie within the domain (and whose coordinates we have +; already calculated using the coordinates of the cell centers). +; +; ********************************************************************** +; + lon_verts := new((/ ny+1, nx+1 /), coord_data_type) + lat_verts := new((/ ny+1, nx+1 /), coord_data_type) +;lon_verts = -98.5d+0 +;lat_verts = 37.5d+0 +; +; Average the coordinates of the four neighboring center points around +; each vertex that is in the interior of the domain/grid to obtain the +; coordinates of that internal vertex. +; + lon_verts(1:ny-1,1:nx-1) \ + = (lon_cntrs(0:ny-2,0:nx-2) \ + + lon_cntrs(0:ny-2,1:nx-1) \ + + lon_cntrs(1:ny-1,1:nx-1) \ + + lon_cntrs(1:ny-1,0:nx-2))/4.0d+0 + + lat_verts(1:ny-1,1:nx-1) \ + = (lat_cntrs(0:ny-2,0:nx-2) \ + + lat_cntrs(0:ny-2,1:nx-1) \ + + lat_cntrs(1:ny-1,1:nx-1) \ + + lat_cntrs(1:ny-1,0:nx-2))/4.0d+0 +; +; Create integer (index) arrays needed in the extrapolations below in the +; x direction. +; + ivec1 := new(ny-1, "integer") + ivec2 := new(ny-1, "integer") + ivec3 := new(ny-1, "integer") +; +; Extrapolate to obtain coordinates of vertices along the left boundary +; (but not including the vertices on the bottom-left and top-left corners +; of the grid). +; + i1 = 1 + i2 = 2 + i3 = 0 + ivec1 = i1 + ivec2 = i2 + ivec3 = i3 + lon_verts(1:ny-1,i3) \ + = interpol_extrapol_linear( \ + ivec1, lon_verts(1:ny-1,i1), ivec2, lon_verts(1:ny-1,i2), ivec3) + lat_verts(1:ny-1,i3) \ + = interpol_extrapol_linear( \ + ivec1, lat_verts(1:ny-1,i1), ivec2, lat_verts(1:ny-1,i2), ivec3) +; +; Extrapolate to obtain coordinates of vertices along the right boundary +; (but not including the vertices on the bottom-right and top-right corners +; of the grid). +; + i1 = nx - 2 + i2 = nx - 1 + i3 = nx + ivec1 = i1 + ivec2 = i2 + ivec3 = i3 + lon_verts(1:ny-1,i3) \ + = interpol_extrapol_linear( \ + ivec1, lon_verts(1:ny-1,i1), ivec2, lon_verts(1:ny-1,i2), ivec3) + lat_verts(1:ny-1,i3) \ + = interpol_extrapol_linear( \ + ivec1, lat_verts(1:ny-1,i1), ivec2, lat_verts(1:ny-1,i2), ivec3) +; +; Create integer (index) arrays needed in the extrapolations below in the +; y direction. +; + jvec1 := new(nx-1, "integer") + jvec2 := new(nx-1, "integer") + jvec3 := new(nx-1, "integer") +; +; Extrapolate to obtain coordinates of vertices along the bottom boundary +; (but not including the vertices on the bottom-left and bottom-right +; corners of the grid). +; + j1 = 1 + j2 = 2 + j3 = 0 + jvec1 = j1 + jvec2 = j2 + jvec3 = j3 + lon_verts(j3,1:nx-1) \ + = interpol_extrapol_linear( \ + jvec1, lon_verts(j1,1:nx-1), jvec2, lon_verts(j2,1:nx-1), jvec3) + lat_verts(j3,1:nx-1) \ + = interpol_extrapol_linear( \ + jvec1, lat_verts(j1,1:nx-1), jvec2, lat_verts(j2,1:nx-1), jvec3) +; +; Extrapolate to obtain coordinates of vertices along the top boundary +; (but not including the vertices on the top-left and top-right corners +; of the grid). +; + j1 = ny - 2 + j2 = ny - 1 + j3 = ny + jvec1 = j1 + jvec2 = j2 + jvec3 = j3 + lon_verts(j3,1:nx-1) \ + = interpol_extrapol_linear( \ + jvec1, lon_verts(j1,1:nx-1), jvec2, lon_verts(j2,1:nx-1), jvec3) + lat_verts(j3,1:nx-1) \ + = interpol_extrapol_linear( \ + jvec1, lat_verts(j1,1:nx-1), jvec2, lat_verts(j2,1:nx-1), jvec3) +; +; ********************************************************************** +; +; Extrapolate to obtain the coordinates of the vertex on the bottom-left +; corner of the grid. +; +; ********************************************************************** +; + i1 = 1 + i2 = 2 + i3 = 0 + j3 = 0 + lon_verts(j3,i3) \ + = interpol_extrapol_linear( \ + i1, lon_verts(j3,i1), i2, lon_verts(j3,i2), i3) + + j1 = 1 + j2 = 2 + j3 = 0 + i3 = 0 + lat_verts(j3,i3) \ + = interpol_extrapol_linear( \ + j1, lat_verts(j1,i3), i2, lat_verts(j2,i3), j3) +; +; ********************************************************************** +; +; Extrapolate to obtain the coordinates of the vertex on the bottom-right +; corner of the grid. +; +; ********************************************************************** +; + i1 = nx - 2 + i2 = nx - 1 + i3 = nx + j3 = 0 + lon_verts(j3,i3) \ + = interpol_extrapol_linear( \ + i1, lon_verts(j3,i1), i2, lon_verts(j3,i2), i3) + + j1 = 1 + j2 = 2 + j3 = 0 + i3 = nx + lat_verts(j3,i3) \ + = interpol_extrapol_linear( \ + j1, lat_verts(j1,i3), j2, lat_verts(j2,i3), j3) +; +; ********************************************************************** +; +; Extrapolate to obtain the coordinates of the vertex on the top-right +; corner of the grid. +; +; ********************************************************************** +; + i1 = nx - 2 + i2 = nx - 1 + i3 = nx + j3 = ny + lon_verts(j3,i3) \ + = interpol_extrapol_linear( \ + i1, lon_verts(j3,i1), i2, lon_verts(j3,i2), i3) + + j1 = ny - 2 + j2 = ny - 1 + j3 = ny + i3 = nx + lat_verts(j3,i3) \ + = interpol_extrapol_linear( \ + j1, lat_verts(j1,i3), j2, lat_verts(j2,i3), j3) +; +; ********************************************************************** +; +; Extrapolate to obtain the coordinates of the vertex on the top-left +; corner of the grid. ; ; ********************************************************************** ; -; lon_cntrs := new((/ ny, nx /), coord_data_type) - lon_cntrs = lon_verts(0:ny-1,0:nx-1) \ - + lon_verts(0:ny-1,1:nx) \ - + lon_verts(1:ny,1:nx) \ - + lon_verts(1:ny,0:nx-1) - lon_cntrs = 0.25d+0*lon_cntrs + i1 = 1 + i2 = 2 + i3 = 0 + j3 = ny + lon_verts(j3,i3) \ + = interpol_extrapol_linear( \ + i1, lon_verts(j3,i1), i2, lon_verts(j3,i2), i3) -; lat_cntrs := new((/ ny, nx /), coord_data_type) - lat_cntrs = lat_verts(0:ny-1,0:nx-1) \ - + lat_verts(0:ny-1,1:nx) \ - + lat_verts(1:ny,1:nx) \ - + lat_verts(1:ny,0:nx-1) - lat_cntrs = 0.25d+0*lat_cntrs + j1 = ny - 2 + j2 = ny - 1 + j3 = ny + i3 = 0 + lat_verts(j3,i3) \ + = interpol_extrapol_linear( \ + j1, lat_verts(j1,i3), j2, lat_verts(j2,i3), j3) ; ; ********************************************************************** ; diff --git a/ush/set_predef_grid_params.sh b/ush/set_predef_grid_params.sh index 636fcf70c..80c37d51b 100644 --- a/ush/set_predef_grid_params.sh +++ b/ush/set_predef_grid_params.sh @@ -340,16 +340,16 @@ predefined domain: ESGgrid_DELX="25000.0" ESGgrid_DELY="25000.0" - ESGgrid_NX=204 - ESGgrid_NY=114 + ESGgrid_NX=200 + ESGgrid_NY=112 ESGgrid_WIDE_HALO_WIDTH=6 DT_ATMOS="300" - LAYOUT_X="6" + LAYOUT_X="5" LAYOUT_Y="2" - BLOCKSIZE="34" + BLOCKSIZE="40" if [ "$QUILTING" = "TRUE" ]; then WRTCMP_write_groups="1" @@ -359,10 +359,10 @@ predefined domain: WRTCMP_cen_lat="${ESGgrid_LAT_CTR}" WRTCMP_stdlat1="${ESGgrid_LAT_CTR}" WRTCMP_stdlat2="${ESGgrid_LAT_CTR}" - WRTCMP_nx="201" - WRTCMP_ny="109" - WRTCMP_lon_lwr_left="-121.52372751" - WRTCMP_lat_lwr_left="23.57183129" + WRTCMP_nx="197" + WRTCMP_ny="107" + WRTCMP_lon_lwr_left="-121.12455072" + WRTCMP_lat_lwr_left="23.89394570" WRTCMP_dx="${ESGgrid_DELX}" WRTCMP_dy="${ESGgrid_DELY}" fi @@ -394,16 +394,16 @@ predefined domain: ESGgrid_DELX="13000.0" ESGgrid_DELY="13000.0" - ESGgrid_NX=400 - ESGgrid_NY=232 + ESGgrid_NX=384 + ESGgrid_NY=224 ESGgrid_WIDE_HALO_WIDTH=6 - DT_ATMOS="180" + DT_ATMOS="45" LAYOUT_X="16" LAYOUT_Y="8" - BLOCKSIZE="29" + BLOCKSIZE="32" if [ "$QUILTING" = "TRUE" ]; then WRTCMP_write_groups="1" @@ -413,10 +413,10 @@ predefined domain: WRTCMP_cen_lat="${ESGgrid_LAT_CTR}" WRTCMP_stdlat1="${ESGgrid_LAT_CTR}" WRTCMP_stdlat2="${ESGgrid_LAT_CTR}" - WRTCMP_nx="397" - WRTCMP_ny="225" - WRTCMP_lon_lwr_left="-121.93788248" - WRTCMP_lat_lwr_left="22.51531359" + WRTCMP_nx="381" + WRTCMP_ny="217" + WRTCMP_lon_lwr_left="-121.11782706" + WRTCMP_lat_lwr_left="23.18443988" WRTCMP_dx="${ESGgrid_DELX}" WRTCMP_dy="${ESGgrid_DELY}" fi @@ -448,16 +448,16 @@ predefined domain: ESGgrid_DELX="3000.0" ESGgrid_DELY="3000.0" - ESGgrid_NX=1740 - ESGgrid_NY=1036 + ESGgrid_NX=1680 + ESGgrid_NY=1024 ESGgrid_WIDE_HALO_WIDTH=6 DT_ATMOS="40" LAYOUT_X="30" - LAYOUT_Y="14" - BLOCKSIZE="29" + LAYOUT_Y="16" + BLOCKSIZE="32" if [ "$QUILTING" = "TRUE" ]; then WRTCMP_write_groups="1" @@ -467,10 +467,10 @@ predefined domain: WRTCMP_cen_lat="${ESGgrid_LAT_CTR}" WRTCMP_stdlat1="${ESGgrid_LAT_CTR}" WRTCMP_stdlat2="${ESGgrid_LAT_CTR}" - WRTCMP_nx="1738" - WRTCMP_ny="1012" - WRTCMP_lon_lwr_left="-122.07320852" - WRTCMP_lat_lwr_left="21.93831404" + WRTCMP_nx="1678" + WRTCMP_ny="1002" + WRTCMP_lon_lwr_left="-121.29805882" + WRTCMP_lat_lwr_left="22.26588883" WRTCMP_dx="${ESGgrid_DELX}" WRTCMP_dy="${ESGgrid_DELY}" fi