Skip to content

Commit

Permalink
better documentation of interp_to_sam_match
Browse files Browse the repository at this point in the history
  • Loading branch information
AdelekeBankole committed Sep 27, 2024
1 parent 1ceff73 commit fb1ad59
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tests/test_CAM_interface/test_cam_interface.F90
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ module cam_tests
contains

subroutine test_interp_to_sam_match(test_name)
!! Check interpolation to SAM grid by interpolating variable of value 1.0
!! Define a CAM grid from 1111.0 to 10.0
!! Check interpolation to SAM grid by defining an idential CAM grid and
!! interpolating a variable equal to the pressure
!! Define a CAM grid consiting of 4 atmosperic columns
!! from 1111.0 to 10.0

character(len=*), intent(in) :: test_name

Expand All @@ -46,15 +48,17 @@ subroutine test_interp_to_sam_match(test_name)
! Set SAM variable equal to cell size (density 1.0)
var_cam(i, :) = pres_sam(1:48)
enddo
! Set interface of top of CAM grid
! Set interface of top of CAM grid because the top interface in SAM is not provided
p_int_cam(:,48) = p_cam(:, 48) + (p_int_cam(:, 47)-p_cam(:, 48))

ps_cam(:) = presi_sam(1)
var_cam_surface(:) = presi_sam(1)

call interp_to_sam(p_cam, ps_cam, var_cam, var_sam, var_cam_surface)

! Set anything above 30 elems to zero as per interpolation routine
! Compare the results of the interpolation scheme to expected output
! Set anything above 30 elems to zero as the parameterization and interpolation
! code only uses the bottom 30 cells on the SAM grid
var_sam_exp = var_cam
var_sam_exp(:, 31:48) = 0.0
call assert_array_equal(var_sam, var_sam_exp, test_name)
Expand Down

0 comments on commit fb1ad59

Please sign in to comment.