-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GSL orographic drag parameter computation (#273)
Add new program to compute parameters needed for the GSL subgrid-scale orographic drag suite. Update the grid generation scripts to make the creation of these parameters an option. Add a regression test for this new option. Fixes #253
- Loading branch information
mdtoy
authored
Apr 9, 2021
1 parent
e28b309
commit 15bab55
Showing
19 changed files
with
3,004 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/bin/bash | ||
|
||
#----------------------------------------------------------------------- | ||
# Create a regional esg grid with GSL gravity wave drag files. | ||
# Compare output to a set of baseline files using the 'nccmp' utility. | ||
# This script is run by the machine specific driver script. | ||
#----------------------------------------------------------------------- | ||
|
||
set -x | ||
|
||
export TEMP_DIR=${WORK_DIR}/regional.gsl.gwd.work | ||
export out_dir=${WORK_DIR}/regional.gsl.gwd | ||
|
||
export gtype=regional_esg | ||
export make_gsl_orog=true # Create GSL gravity wave drag fields | ||
export target_lon=-97.5 # Center longitude of the highest resolution tile | ||
export target_lat=35.5 # Center latitude of the highest resolution tile | ||
export idim=301 # Dimension of grid in 'i' direction | ||
export jdim=200 # Dimension of grid in 'j' direction | ||
export delx=0.0585 # Grid spacing in degrees in 'i' direction | ||
export dely=0.0585 # Grid spacing in degrees in 'j' direction | ||
export halo=4 | ||
|
||
NCCMP=${NCCMP:-$(which nccmp)} | ||
|
||
#----------------------------------------------------------------------- | ||
# Start script. | ||
#----------------------------------------------------------------------- | ||
|
||
echo "Starting at: " `date` | ||
|
||
$home_dir/ush/fv3gfs_driver_grid.sh | ||
|
||
iret=$? | ||
if [ $iret -ne 0 ]; then | ||
set +x | ||
echo "<<< REGIONAL GSL GWD TEST FAILED. <<<" | ||
exit $iret | ||
fi | ||
|
||
echo "Ending at: " `date` | ||
|
||
#----------------------------------------------------------------------------- | ||
# Compare output to baseline set of data. | ||
#----------------------------------------------------------------------------- | ||
|
||
cd $out_dir/C772 | ||
|
||
test_failed=0 | ||
for files in *tile*.nc ./fix_sfc/*tile*.nc | ||
do | ||
if [ -f $files ]; then | ||
echo CHECK $files | ||
$NCCMP -dmfqS $files $HOMEreg/regional.gsl.gwd/$files | ||
iret=$? | ||
if [ $iret -ne 0 ]; then | ||
test_failed=1 | ||
fi | ||
fi | ||
done | ||
|
||
set +x | ||
if [ $test_failed -ne 0 ]; then | ||
echo "<<< REGIONAL GSL GWD TEST FAILED. >>>" | ||
else | ||
echo "<<< REGIONAL GSL GWD TEST PASSED. >>>" | ||
fi | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
set(fortran_src | ||
module_gsl_oro_data_lg_scale.f90 | ||
module_gsl_oro_data_sm_scale.f90 | ||
gsl_oro_data.f90) | ||
|
||
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") | ||
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -convert big_endian -assume byterecl") | ||
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") | ||
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8 -fconvert=big-endian -fno-range-check") | ||
if(CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 10) | ||
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch -fallow-invalid-boz") | ||
endif() | ||
endif() | ||
|
||
set(exe_name orog_gsl) | ||
add_executable(${exe_name} ${fortran_src}) | ||
target_link_libraries( | ||
${exe_name} | ||
NetCDF::NetCDF_Fortran) | ||
|
||
install(TARGETS ${exe_name} RUNTIME DESTINATION ${exec_dir}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
This code creates orographic statistics fields required for the orographic drag suite developed by NOAA's Global Systems Laboratory (GSL). The fields are a subset of the ones calculated by "orog.fd" except that they are calculated in a different manner. The fields are: | ||
stddev -- standard deviation of subgrid topography | ||
convexity -- convexity of subgrid topography | ||
oa1,oa2,oa3,oa4 -- orographic asymmetry of subgrid topography (for 4 orientations: | ||
1-westerly, 2-southerly, 3-southwesterly, 4-northwesterly) | ||
ol1,ol2,ol3,ol4 -- orographic effective length of subgrid topography (for 4 orientations: | ||
1-westerly, 2-southerly, 3-southwesterly, 4-northwesterly) | ||
|
||
Two Cxxx_oro_data files are created: | ||
- an "ls" (large-scale) file for the gravity wave drag and blocking schemes of Kim and Doyle (QJRMS, 2005) | ||
- a "ss" (small-scale) file for the small-scale gravity wave drag scheme of Tsiringakis et al. (QJRMS, 2017) and the turbulent orographic form drag (TOFD) scheme of Beljaars et al. (QJRMS, 2004) | ||
|
||
The inputs to be passed to the executable are tile number (1-6 for global, 7 for stand-alone regional) and grid resolution, e.g., 768 for C768. | ||
|
||
The source data are the following two files to be located in the "fix" directory: | ||
- geo_em.d01.lat-lon.2.5m.HGT_M.nc -- global topographic data on 2.5-minute lat-lon grid (interpolated from GMTED2010 30-second topographic data) | ||
- HGT.Beljaars_filtered.lat-lon.30s_res.nc -- global topographic data on 30-second lat-lon grid (GMTED2010 data smoothed according to Beljaars et al. (QJRMS, 2004)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
!> @file | ||
!! @brief Create orographic (oro_data) files for use by GSL drag suite | ||
!! @author Michael Toy, NOAA/GSL | ||
!! @date 2021-03-12 | ||
!! | ||
!! Program GSL_ORO_DATA | ||
!! | ||
!! This program calls subroutines which calculate the parameters | ||
!! required for the GSL subgrid-scale orographic gravity-wave drag (GWDO) | ||
!! suite on the FV3 grid. These parameters are for the small-scale | ||
!! GWD (Tsiringakis et al., 2017) and turbulent orographic form drag (TOFD) | ||
!! (Beljaars et al., 2004) schemes of the GSL drag suite. | ||
!! The output fields are: | ||
!! - stddev standard deviation of subgrid-scale topograpy | ||
!! - convexity convexity (kurtosis) of subgrid-scale topography | ||
!! - ol{1,2,3,4} orographic effective lengths of subgrid-scale topography | ||
!! for 4 orientations: 1-westerly, 2-southerly, 3-southwesterly, 4-northwesterly | ||
!! - oa{1,2,3,4} orographic asymmetries of subgrid-scale topography | ||
!! for 4 orientations: 1-westerly, 2-southerly, 3-southwesterly, 4-northwesterly | ||
!! | ||
!! Note: This program works for both the global FV3GFS cubed | ||
!! sphere, i.e., for tiles 1 through 6, (and 7 if nested | ||
!! grid) (halo.eq.-999 for no halo), and for the stand-alone | ||
!! regional lam (tile 7 and halo.ne.-999) | ||
!! If a halo number is given, this is only to specify the | ||
!! Cxxx_grid.halox data used for input. The oro_data files | ||
!! are always "halo0" output. | ||
!! | ||
!! Based on code by Michael Duda provided by NCAR/MMM | ||
|
||
!> Brief description of program: Creates orographic (oro_data) files | ||
!! needed by the GSL drag suite physics parameterization | ||
!! | ||
!! @author Michaei Toy, NOAA/GSL | ||
!! @return 0 for success, error code otherwise. | ||
program gsl_oro_data | ||
|
||
use gsl_oro_data_sm_scale, only: calc_gsl_oro_data_sm_scale | ||
use gsl_oro_data_lg_scale, only: calc_gsl_oro_data_lg_scale | ||
|
||
implicit none | ||
|
||
|
||
character(len=2) :: tile_num ! tile number entered by user | ||
character(len=7) :: res_indx ! grid-resolution index, e.g., 96, 192, 384, 768, | ||
! etc. entered by user | ||
character(len=4) :: halo ! halo value entered by user (for input grid data) | ||
|
||
logical :: duplicate_oro_data_file ! flag for whether oro_data_ls file is a duplicate | ||
! of oro_data_ss due to minimum grid size being less than 7.5km | ||
|
||
|
||
|
||
! Read in FV3GFS grid info | ||
print * | ||
print *, "Enter tile number:" | ||
read (5,*) tile_num | ||
print * | ||
print *, "Enter grid-resolution index:" | ||
read (5,*) res_indx | ||
print * | ||
print *, "Enter halo number (-999 for no halo):" | ||
read (5,*) halo | ||
print * | ||
print *, "Creating tile oro_data for tile number: ", tile_num | ||
print *, "Grid resolution = ", res_indx | ||
print *, "Halo = ", halo | ||
print * | ||
|
||
|
||
call calc_gsl_oro_data_sm_scale(tile_num,res_indx,halo,duplicate_oro_data_file) | ||
|
||
print *, "duplicate_oro_data_file =", duplicate_oro_data_file | ||
print * | ||
|
||
if ( .not.duplicate_oro_data_file ) then | ||
call calc_gsl_oro_data_lg_scale(tile_num,res_indx,halo) | ||
end if | ||
|
||
|
||
print * | ||
print *, "End program gsl_oro_data" | ||
print * | ||
|
||
|
||
end program gsl_oro_data |
Oops, something went wrong.