forked from GeorgeGayno-NOAA/UFS_UTILS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
filter_topo - Add extrapolation of regional fields to halo points (uf…
…s-community#571) Fixes a bug when running the filter_topo program in regional mode. Several variables are allocated, but their values along the halo are never initialized. This lead to unstable results. Add a routine to extrapolate fields from the grid interior to the halo. Fixes ufs-community#105.
- Loading branch information
1 parent
f9b353f
commit 69e009f
Showing
4 changed files
with
130 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
! Unit test for filter_topo routine "fill_regional_halo". | ||
! | ||
! Author Ratko Vasic | ||
|
||
program fill_halo | ||
|
||
use utils | ||
|
||
implicit none | ||
|
||
integer :: halo,ix,jx,i,j | ||
|
||
real, allocatable :: testdata(:,:,:) | ||
|
||
print*, "Starting test of filter_topo routine fill_regional_halo" | ||
|
||
halo = 3 | ||
ix=6 | ||
jx=9 | ||
|
||
allocate(testdata(1-halo:ix+halo,1-halo:jx+halo,1)) | ||
|
||
! Initialize whole domain (including halo points) to zero | ||
testdata(:,:,:)=0. | ||
|
||
! Initialize inner domain | ||
do j=1,jx | ||
do i=1,ix | ||
testdata(i,j,1)=10*i+j | ||
enddo | ||
enddo | ||
|
||
!!! do j=1-halo,jx+halo | ||
!!! write(0,101) testdata(1-halo:ix+halo,j,1) | ||
!!! enddo | ||
!!!101 format(12(f9.5,x)) | ||
|
||
! Fill halo points | ||
call fill_regional_halo(testdata, halo) | ||
|
||
!!! print* | ||
!!! do j=1-halo,jx+halo | ||
!!! write(0,101) testdata(1-halo:ix+halo,j,1) | ||
!!! enddo | ||
|
||
if(testdata(-2,-2,1)== 5.5 .and. testdata(-2,12,1)== 14.5 .and. & | ||
testdata( 9,-2,1)== 65.5 .and. testdata( 9,12,1)== 74.5) then | ||
print*, "OK" | ||
print*, "SUCCESS!" | ||
else | ||
stop 22 | ||
endif | ||
|
||
deallocate(testdata) | ||
|
||
end program fill_halo |