Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update orography code for low-res grids #1012

Merged
merged 71 commits into from
Jan 17, 2025
Merged
Changes from 1 commit
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
91c08f4
Update cpld_gridgen program to create C12, C18 and C24.
GeorgeGayno-NOAA Nov 21, 2024
20d3b1e
Remove some unused logic from the orog program.
GeorgeGayno-NOAA Nov 21, 2024
4612227
Increase MAXSUM parameter so orog code will work with C12.
GeorgeGayno-NOAA Nov 22, 2024
40a1c50
Update ocean merge script to point to location of low res
GeorgeGayno-NOAA Nov 22, 2024
53a97b8
Update gdas_init utility for low res cases.
GeorgeGayno-NOAA Nov 22, 2024
fe71fa1
Dynamically compute MAXSUM used in the computation of GWD
GeorgeGayno-NOAA Nov 22, 2024
73f9e7d
Add strawman unit test for orog routine get_index.
GeorgeGayno-NOAA Nov 22, 2024
546153f
Add more test points to ftst_get_index.F90 unit test.
GeorgeGayno-NOAA Nov 25, 2024
6936faa
Add more test points to ftst_get_index.F90.
GeorgeGayno-NOAA Nov 25, 2024
8ca9bdf
Add some comments to unit test.
GeorgeGayno-NOAA Nov 25, 2024
9d47f97
Merge branch 'develop' into lowres_grids
GeorgeGayno-NOAA Nov 26, 2024
c15de74
Baseline rough unit test for function inside_a_polygon.
GeorgeGayno-NOAA Nov 26, 2024
35c06bd
Add more test points.
GeorgeGayno-NOAA Nov 26, 2024
cc477f4
Add point to test the case when the test point coincides with
GeorgeGayno-NOAA Dec 2, 2024
cfe59e1
Add a test point located in the middle of the polygon.
GeorgeGayno-NOAA Dec 2, 2024
e8637db
Finish unit test for inside_a_polygon.
GeorgeGayno-NOAA Dec 2, 2024
dc516b6
Baseline a preliminary unit test for the two 'transpose' routines.
Dec 3, 2024
1c21bcf
Update unit test to also call the transpose_orog routine.
Dec 3, 2024
92bac68
Add unit test for routine find_poles.
Dec 3, 2024
58cd3bc
Add partial unit test for routine find_nearest_pole_points.
Dec 3, 2024
c8dad11
Complete unit test for "file_nearest_pole_points".
Dec 5, 2024
db7f7c2
Merge branch 'develop' into lowres_grids
Dec 9, 2024
4df1f51
Baseline a test for function get_xnsum.
Dec 13, 2024
d39963a
Add more test points to get_xnsum test.
Dec 13, 2024
4f4de62
Finish unit test for function get_xnsum.
Dec 13, 2024
4ba550c
Merge branch 'develop' into lowres_grids
Dec 17, 2024
302a082
Add unit test for routine get_xnsum2.
Dec 17, 2024
79c5d00
Remove unused variable from ./tests/orog/ftst_transpose.F90
Dec 17, 2024
d4ba274
Baseline unit test for routine get_xnsum3.
Dec 17, 2024
ed80ff3
Create initial unit test for routine remove_isolated_pts.
Dec 30, 2024
6c03013
Add more realistic values for test point.
Dec 31, 2024
276a2ba
Add another test point to the rm_isolated_pts unit test.
Dec 31, 2024
25c6b54
Add some diagnostic print to remove_isolated_pts.
Dec 31, 2024
a7545ea
Update routine remove_isolated_pts to not process the
Dec 31, 2024
11dda0c
Update first unit test point to be a 4x4 grid as to test
Dec 31, 2024
cb800d4
Merge branch 'develop' into lowres_grids
Jan 2, 2025
380a57c
Remove unused 'if' branch from 'remove_isolated_pts'. I suspect
Jan 2, 2025
0c9f20b
Some final updates to the ftst_rm_isolated_pts unit test.
Jan 3, 2025
d63ecfd
Remove unused line from ./tests/orog/CMakeLists.txt
Jan 3, 2025
be93997
Baseline a unit test for routine "read_global_mask" and a
Jan 3, 2025
31d5486
Convert 'read_global_mask' to use f90 version of netcdf.
Jan 3, 2025
ddfbc61
Add check to 'read_global_mask' to check the i/j dimensions
Jan 3, 2025
53250b2
Add unit test for 'read_global_orog'.
Jan 3, 2025
858629b
Convert routine 'read_global_orog' to use f90 netcdf library.
Jan 3, 2025
e23b2fd
Add unit test for 'read_mdl_dims'.
Jan 7, 2025
06a6c30
Finish unit test for 'read_mdl_dims'. Update prolog
Jan 8, 2025
5d56079
Convert routine 'read_mdl_dims' to use the f90 versions
Jan 8, 2025
e7d2ae6
Baseline test for routine 'read_mdl_grid_file'.
Jan 8, 2025
f272d8c
Update routine 'read_mdl_grid_file' to use f90 version
Jan 8, 2025
1bade53
Baseline unit test for routine 'read_mask'. Fix doxygen in
Jan 9, 2025
f140e7a
Convert 'read_mdl' routine to use f90 versions of netcdf
Jan 9, 2025
8a35838
Update 'qc_orog_by_ramp' to read the 'j' dimension of the ramp
Jan 9, 2025
2dc24d6
Baseline test for routine "qc_orog_by_ramp".
GeorgeGayno-NOAA Jan 10, 2025
92b232a
Remove unneeded 'if' statement from 'qc_orog_by_ramp'.
GeorgeGayno-NOAA Jan 10, 2025
8a15fc3
Update routine "write_mask_netcdf" to use f90 netcdf routines.
GeorgeGayno-NOAA Jan 10, 2025
99a2e4f
Convert routine 'write_netcdf' to use f90 netcdf routines.
GeorgeGayno-NOAA Jan 10, 2025
1e57a0f
Convert netcdf error routine to use f90 versions of netcdf.
GeorgeGayno-NOAA Jan 10, 2025
6a68569
Remove some diagnostic print from the orog code.
GeorgeGayno-NOAA Jan 13, 2025
8acb8a8
Revert cpld_gridgen changes. These will be handled by Denise.
GeorgeGayno-NOAA Jan 13, 2025
a70379d
Minor cleanup to ./tests/orog/CMakeLists.txt.
GeorgeGayno-NOAA Jan 13, 2025
bc2dac8
Add some comments to ./tests/orog/ftst_find_poles.F90.
GeorgeGayno-NOAA Jan 13, 2025
9147bf3
Update comments in ./tests/orog/ftst_get_index.F90.
GeorgeGayno-NOAA Jan 13, 2025
5f83189
Fix print statement in ./tests/orog/ftst_get_xnsum3.F90
GeorgeGayno-NOAA Jan 13, 2025
2197dff
Update comments in ./tests/orog/ftst_qc_orog_by_ramp.F90
Jan 14, 2025
97314f4
Fix typo in four tests.
Jan 14, 2025
e90b3f3
Remove some unused variables from routine make_mask.
Jan 14, 2025
55d45fa
Remove temporary logic from ./ush/fv3gfs_ocean_merge.sh.
Jan 14, 2025
28e0e0d
Remove temporary logic from ./util/gdas_init/run_v16.chgres.sh.
Jan 14, 2025
ac55299
Fix typo in ./util/gdas_init/run_v16.chgres.sh.
Jan 14, 2025
a074ec4
For gdas_init utility, set the default ocean resolution to
Jan 14, 2025
64d26a4
Revert ./util/gdas_init/config to original settings.
Jan 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Baseline unit test for routine get_xnsum3.
Fixes #1000.
George Gayno committed Dec 17, 2024
commit d4ba27429cdd636f616fdab78456ebd20be4fde2
6 changes: 5 additions & 1 deletion tests/orog/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
# George Gayno, Ed Hartnett

if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -warn unused")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-0 -fdefault-real-8")
endif()
@@ -49,3 +49,7 @@ target_link_libraries(ftst_get_xnsum orog_lib)
add_executable(ftst_get_xnsum2 ftst_get_xnsum2.F90)
add_test(NAME orog-ftst_get_xnsum2 COMMAND ftst_get_xnsum2)
target_link_libraries(ftst_get_xnsum2 orog_lib)

add_executable(ftst_get_xnsum3 ftst_get_xnsum3.F90)
add_test(NAME orog-ftst_get_xnsum3 COMMAND ftst_get_xnsum3)
target_link_libraries(ftst_get_xnsum3 orog_lib)
74 changes: 74 additions & 0 deletions tests/orog/ftst_get_xnsum3.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
program check_get_xnsum3

! Unit test for routine get_xnsum3, which counts the
! number of high-resolution orography points within a
! model grid box, and counts the number of high-resolution
! points higher than a critical height. The critical
! height is passed into routine get_xnsum3, whereas in
! get_xnsum2 it is computed.

use orog_utils, only : get_xnsum3

implicit none

integer, parameter :: imn=360 ! i-dimension of high-res grid
integer, parameter :: jmn=181 ! j-dimension of high-res grid

integer :: j
integer :: zavg(imn,jmn) ! High-res grid terrain

real :: delxn=360.0/float(imn) ! Resolution of high-res grid in degrees.
real :: glat(jmn) ! Latitude of each high-res grid row in degrees.
real :: lon1,lat1,lon2,lat2,hc
real :: xnsum1,xnsum2

! Variables holding the expected test results.

integer :: expected_xnsum1, expected_xnsum2

data expected_xnsum1 /4/ ! Expected number of high-res pts in model
! grid box that are above the critical height.
data expected_xnsum2 /16/ ! Expected total number of high-res pts in model grid box.

print*,"Begin test of routine get_xnsum2."

! The high-res grid is a global one-degree lat/lon grid. Point (1,1)
! is the south pole/greenwich.

do j = 1, jmn
glat(j) = -90.0 + float(j-1) * delxn
enddo

! Bounds of model grid box - straddles equator/greenwich.
! There are 16 high-res points located within the model
! box. The i/j range of these 16 points is i=359,360,1,2
! and j=0,91,92,93.

lon1 = -2.5 ! in degrees.
lon2 = 2.5
lat1 = -1.5
lat2 = 1.5

! Initialize high-res orography. Half of the points
! within the model grid box are at sea level, one quarter
! are at 500 meters and one quarter are at 1000 meters.
! The critical height was chosen as 700 meters. So,
! four points should be above the critical value.

zavg = -999 ! Flag value for sea level.
zavg(359,90:93) = 1000
zavg(360,90:93) = 500

hc = 700.0 ! Critical height in meters.

call get_xnsum3(lon1,lat1,lon2,lat2,imn,jmn, &
glat,zavg,delxn,xnsum1,xnsum2,hc)

if (nint(xnsum1) /= expected_xnsum1) stop 2
if (nint(xnsum2) /= expected_xnsum2) stop 4

print*,"OK"

print*,"SUCCESS"

end program check_get_xnsum3