Skip to content

Commit

Permalink
update test_fms
Browse files Browse the repository at this point in the history
  • Loading branch information
abrooks1085 committed Dec 4, 2023
1 parent bf4f334 commit 6f38e14
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions test_fms/coupler/test_atmos_ocean_fluxes.F90
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ subroutine test_aof_set_coupler_flux

!> set flux fields
do i=1, num_bcs
coupler_index(i)=aof_set_coupler_flux(name=flux_name(i), &
coupler_index(i)=aof_set_coupler_flux(flux_name=flux_name(i), &
flux_type=flux_type(i), &
implementation=impl(i), &
atm_tr_index=atm_tr_index(i), &
Expand Down Expand Up @@ -161,9 +161,9 @@ subroutine test_coupler_1d_bc_type

do i=1, num_bcs
!> check fluxes name
call check_answers(flux_name(i), gas_fluxes%FMS_TEST_BC_TYPE_(i)%name, 'gas_fluxes flux name')
call check_answers(flux_name(i), gas_fields_atm%FMS_TEST_BC_TYPE_(i)%name, 'gas_fields_atms flux name')
call check_answers(flux_name(i), gas_fields_ice%FMS_TEST_BC_TYPE_(i)%name, 'gas_fields_ice flux name')
call check_answers(flux_name(i), gas_fluxes%FMS_TEST_BC_TYPE_(i)%field_name, 'gas_fluxes flux name')
call check_answers(flux_name(i), gas_fields_atm%FMS_TEST_BC_TYPE_(i)%field_name, 'gas_fields_atms flux name')
call check_answers(flux_name(i), gas_fields_ice%FMS_TEST_BC_TYPE_(i)%field_name, 'gas_fields_ice flux name')

!> check implementation
call check_answers(impl(i), gas_fluxes%FMS_TEST_BC_TYPE_(i)%implementation, 'gas_fluxes impl')
Expand Down
6 changes: 3 additions & 3 deletions test_fms/coupler/test_coupler_types.F90
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ program test_coupler_types
time_t = set_date(1, 1, 1)
do i=1, num_bc
do j=1, num_fields
bc_2d_new%FMS_TEST_BC_TYPE_(i)%field(j)%name = "bc"//string(i)//"_var2d_"//string(j)
bc_3d_new%FMS_TEST_BC_TYPE_(i)%field(j)%name = "bc"//string(i)//"_var3d_"//string(j)
bc_2d_new%FMS_TEST_BC_TYPE_(i)%field(j)%diag_name = "bc"//string(i)//"_var2d_"//string(j)
bc_3d_new%FMS_TEST_BC_TYPE_(i)%field(j)%diag_name = "bc"//string(i)//"_var3d_"//string(j)
bc_2d_new%FMS_TEST_BC_TYPE_(i)%field(j)%long_name = "bc"//string(i)//"_variable_2d_"//string(j)//"_min"
bc_3d_new%FMS_TEST_BC_TYPE_(i)%field(j)%long_name = "bc"//string(i)//"_variable_3d_"//string(j)//"_min"
enddo
Expand Down Expand Up @@ -314,4 +314,4 @@ subroutine check_field_data_3d(bc_3d, expected)
enddo
end subroutine check_field_data_3d

end program
end program
18 changes: 9 additions & 9 deletions test_fms/coupler/test_coupler_utils.inc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ subroutine set_up_1d_coupler_type(bc_type, data_grid)

do j = 1, nfields
write(field_num,'(i1)') j
bc_type%FMS_TEST_BC_TYPE_(i)%field(j)%name="var_"//field_num
bc_type%FMS_TEST_BC_TYPE_(i)%field(j)%diag_name="var_"//field_num
allocate(bc_type%FMS_TEST_BC_TYPE_(i)%field(j)%values(data_grid(1):data_grid(2)))
bc_type%FMS_TEST_BC_TYPE_(i)%field(j)%values = real(j, kind=FMS_CP_TEST_KIND_)
end do
Expand Down Expand Up @@ -98,7 +98,7 @@ subroutine set_up_2d_coupler_type(bc_type, data_grid, appendix, to_read)

do j = 1, nfields
write(field_num,'(i1)') j
bc_type%FMS_TEST_BC_TYPE_(i)%field(j)%name="var_"//field_num
bc_type%FMS_TEST_BC_TYPE_(i)%field(j)%diag_name="var_"//field_num
allocate(bc_type%FMS_TEST_BC_TYPE_(i)%field(j)%values(data_grid(1):data_grid(2), data_grid(3):data_grid(4)))
if (to_read) then
bc_type%FMS_TEST_BC_TYPE_(i)%field(j)%values = real(999., kind=FMS_CP_TEST_KIND_)
Expand Down Expand Up @@ -140,7 +140,7 @@ subroutine compare_2d_answers(bc_type_read, bc_type)
sum(bc_type_read%FMS_TEST_BC_TYPE_(i)%field(j)%values)) then
call mpp_error(FATAL, "test_coupler_2d: Answers do not match for: " &
& //trim(bc_type%FMS_TEST_BC_TYPE_(i)%ice_restart_file)&
& //" var: "//trim(bc_type%FMS_TEST_BC_TYPE_(i)%field(j)%name))
& //" var: "//trim(bc_type%FMS_TEST_BC_TYPE_(i)%field(j)%diag_name))
endif
end do
end do
Expand All @@ -149,13 +149,13 @@ subroutine compare_2d_answers(bc_type_read, bc_type)
if (sum(bc_type_read%FMS_TEST_BC_TYPE_(3)%field(1)%values) .ne. &
sum(bc_type_read%FMS_TEST_BC_TYPE_(1)%field(1)%values)) then
call mpp_error(FATAL, "test_coupler_2d: Answers do not match for var: "// &
trim(bc_type_read%FMS_TEST_BC_TYPE_(3)%field(1)%name))
trim(bc_type_read%FMS_TEST_BC_TYPE_(3)%field(1)%diag_name))
endif

if (sum(bc_type_read%FMS_TEST_BC_TYPE_(3)%field(2)%values) .ne. &
sum(bc_type_read%FMS_TEST_BC_TYPE_(1)%field(2)%values)) then
call mpp_error(FATAL, "test_coupler_2d: Answers do not match for var: "// &
trim(bc_type_read%FMS_TEST_BC_TYPE_(3)%field(2)%name))
trim(bc_type_read%FMS_TEST_BC_TYPE_(3)%field(2)%diag_name))
endif


Expand Down Expand Up @@ -209,7 +209,7 @@ subroutine set_up_3d_coupler_type(bc_type, data_grid, appendix, to_read)

do j = 1, nfields
write(field_num,'(i1)') j
bc_type%FMS_TEST_BC_TYPE_(i)%field(j)%name="var_"//field_num
bc_type%FMS_TEST_BC_TYPE_(i)%field(j)%diag_name="var_"//field_num
allocate(bc_type%FMS_TEST_BC_TYPE_(i)%field(j)%values(data_grid(1):data_grid(2), data_grid(3):data_grid(4), &
data_grid(5)))

Expand Down Expand Up @@ -253,7 +253,7 @@ subroutine compare_3d_answers(bc_type_read, bc_type)
sum(bc_type_read%FMS_TEST_BC_TYPE_(i)%field(j)%values)) then
call mpp_error(FATAL, "test_coupler_3d: Answers do not match for: "// &
& trim(bc_type%FMS_TEST_BC_TYPE_(i)%ice_restart_file) &
& //" var: "//trim(bc_type%FMS_TEST_BC_TYPE_(i)%field(j)%name))
& //" var: "//trim(bc_type%FMS_TEST_BC_TYPE_(i)%field(j)%diag_name))
endif
end do
end do
Expand All @@ -262,13 +262,13 @@ subroutine compare_3d_answers(bc_type_read, bc_type)
if (sum(bc_type_read%FMS_TEST_BC_TYPE_(3)%field(1)%values) .ne. &
sum(bc_type_read%FMS_TEST_BC_TYPE_(1)%field(1)%values)) then
call mpp_error(FATAL, "test_coupler_3d: Answers do not match for var: "// &
& trim(bc_type_read%FMS_TEST_BC_TYPE_(3)%field(1)%name))
& trim(bc_type_read%FMS_TEST_BC_TYPE_(3)%field(1)%diag_name))
endif

if (sum(bc_type_read%FMS_TEST_BC_TYPE_(3)%field(2)%values) .ne. &
sum(bc_type_read%FMS_TEST_BC_TYPE_(1)%field(2)%values)) then
call mpp_error(FATAL, "test_coupler_3d: Answers do not match for var: "// &
& trim(bc_type_read%FMS_TEST_BC_TYPE_(3)%field(2)%name))
& trim(bc_type_read%FMS_TEST_BC_TYPE_(3)%field(2)%diag_name))
endif


Expand Down

0 comments on commit 6f38e14

Please sign in to comment.