From 0c0ff9800be36af10f4d691061bc19dd5de52d12 Mon Sep 17 00:00:00 2001 From: "Christina.Holt" Date: Wed, 14 Apr 2021 20:01:34 +0000 Subject: [PATCH 1/9] Fix for seg fault in forecast step with GEFS. --- sorc/chgres_cube.fd/surface.F90 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sorc/chgres_cube.fd/surface.F90 b/sorc/chgres_cube.fd/surface.F90 index 2b15950c9..cba84fd02 100644 --- a/sorc/chgres_cube.fd/surface.F90 +++ b/sorc/chgres_cube.fd/surface.F90 @@ -3939,6 +3939,10 @@ subroutine qc_check do j = clb(2), cub(2) do i = clb(1), cub(1) if (veg_greenness_ptr(i,j) <= 0.01) data_ptr(i,j) = 0.0 + if (data_ptr(i,j) > 0.5) then + print*,"- ZERO OUT TARGET GRID CANOPY MOISTURE CONTENT WITH UNREALISTIC VALUES" + data_ptr(i,j) = 0.0 + endif enddo enddo From 01c4ad5299934f9cb8fd5f7a26b6558009f59512 Mon Sep 17 00:00:00 2001 From: Larissa Reames Date: Wed, 21 Apr 2021 21:37:38 +0000 Subject: [PATCH 2/9] chgres_cube: Correct erroneously high soil temperatures at isolated points in GEFS data by replacing it with skin temperature. Addresses Issue #447 --- sorc/chgres_cube.fd/input_data.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/sorc/chgres_cube.fd/input_data.F90 b/sorc/chgres_cube.fd/input_data.F90 index 4bb74b83d..92a0f1d7b 100644 --- a/sorc/chgres_cube.fd/input_data.F90 +++ b/sorc/chgres_cube.fd/input_data.F90 @@ -5394,6 +5394,7 @@ subroutine read_input_sfc_grib2_file(localpet) do j = 1, j_input do i = 1, i_input if (slmsk_save(i,j) == 0_esmf_kind_i4 ) dummy3d(i,j,k) = tsk_save(i,j) + if (slmsk_save(i,j) == 1_esmf_kind_i4 .and. dummy3d(i,j,k) > 350.0_esmf_kind_r8) dummy3d(i,j,k) = tsk_save(i,j) if (slmsk_save(i,j) == 2_esmf_kind_i4 ) dummy3d(i,j,k) = icet_default enddo enddo From eebf9567772633504556a8def7362f7ccbc354d2 Mon Sep 17 00:00:00 2001 From: Larissa Reames Date: Mon, 26 Apr 2021 20:45:57 +0000 Subject: [PATCH 3/9] chgres_cube: Move do loop / if statement block for correcting erroneous soil temperatures to its own subroutine. --- sorc/chgres_cube.fd/input_data.F90 | 54 ++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 14 deletions(-) diff --git a/sorc/chgres_cube.fd/input_data.F90 b/sorc/chgres_cube.fd/input_data.F90 index 92a0f1d7b..82e3a15d9 100644 --- a/sorc/chgres_cube.fd/input_data.F90 +++ b/sorc/chgres_cube.fd/input_data.F90 @@ -69,7 +69,8 @@ module input_data integer, public :: veg_type_landice_input = 15 !< NOAH land ice option !< defined at this veg type. !< Default is igbp. - + integer, parameter :: icet_default = 265.0 !< Default value of soil and skin + !< temperature (K) over ice. type(esmf_field), public :: canopy_mc_input_grid !< canopy moist content type(esmf_field), public :: f10m_input_grid !< log((z0+10)*1/z0) type(esmf_field), public :: ffmm_input_grid !< log((z0+z1)*1/z0) @@ -4597,15 +4598,15 @@ subroutine read_input_sfc_grib2_file(localpet) integer :: rc, varnum, iret, i, j,k integer :: ncid2d, varid, varsize - integer, parameter :: icet_default = 265.0 + !integer, parameter :: icet_default = 265.0 logical :: exist, rap_latlon real(esmf_kind_r4) :: value - real(esmf_kind_r4), allocatable :: dummy2d(:,:),tsk_save(:,:),icec_save(:,:) + real(esmf_kind_r4), allocatable :: dummy2d(:,:),icec_save(:,:) real(esmf_kind_r4), allocatable :: dummy1d(:) - real(esmf_kind_r8), allocatable :: dummy2d_8(:,:),dummy2d_82(:,:) + real(esmf_kind_r8), allocatable :: dummy2d_8(:,:),dummy2d_82(:,:),tsk_save(:,:) real(esmf_kind_r8), allocatable :: dummy3d(:,:,:), dummy3d_stype(:,:,:) integer(esmf_kind_i4), allocatable :: slmsk_save(:,:) integer(esmf_kind_i8), allocatable :: dummy2d_i(:,:) @@ -4834,7 +4835,7 @@ subroutine read_input_sfc_grib2_file(localpet) print*,"- READ SKIN TEMPERATURE." rc = grb2_inq(the_file, inv_file, ':TMP:',':surface:', data2=dummy2d) if (rc <= 0 ) call error_handler("READING SKIN TEMPERATURE.", rc) - tsk_save(:,:) = dummy2d + tsk_save(:,:) = real(dummy2d,esmf_kind_r8) dummy2d_8 = real(dummy2d,esmf_kind_r8) do j = 1, j_input do i = 1, i_input @@ -5390,15 +5391,16 @@ subroutine read_input_sfc_grib2_file(localpet) vname = "soilt" vname_file = ":TSOIL:" call read_grib_soil(the_file,inv_file,vname,vname_file,dummy3d,rc) - do k=1,lsoil_input - do j = 1, j_input - do i = 1, i_input - if (slmsk_save(i,j) == 0_esmf_kind_i4 ) dummy3d(i,j,k) = tsk_save(i,j) - if (slmsk_save(i,j) == 1_esmf_kind_i4 .and. dummy3d(i,j,k) > 350.0_esmf_kind_r8) dummy3d(i,j,k) = tsk_save(i,j) - if (slmsk_save(i,j) == 2_esmf_kind_i4 ) dummy3d(i,j,k) = icet_default - enddo - enddo - enddo + !do k=1,lsoil_input + ! do j = 1, j_input + ! do i = 1, i_input + ! if (slmsk_save(i,j) == 0_esmf_kind_i4 ) dummy3d(i,j,k) = tsk_save(i,j) + ! if (slmsk_save(i,j) == 1_esmf_kind_i4 .and. dummy3d(i,j,k) > 350.0_esmf_kind_r8) dummy3d(i,j,k) = tsk_save(i,j) + ! if (slmsk_save(i,j) == 2_esmf_kind_i4 ) dummy3d(i,j,k) = icet_default + ! enddo + ! enddo + !enddo + call check_soilt(dummy3d,slmsk_save,tsk_save) print*,'soilt ',maxval(dummy3d),minval(dummy3d) deallocate(tsk_save, slmsk_save) @@ -6608,4 +6610,28 @@ recursive subroutine quicksort(a, first, last) if (j+1 < last) call quicksort(a, j+1, last) end subroutine quicksort +!> Check for and replace erroneous values in soil temperature. +!! +!! @param soilt [inout] 3-dimensional soil temperature arrray +!! @param landmask [in] landmask of the input grid +!! @param skint [in] 2-dimensional skin temperature array +!! @author Larissa Reames CIMMS/NSSL + +subroutine check_soilt(soilt, landmask, skint) + implicit none + real(esmf_kind_r8), intent(inout) :: soilt(lsoil_input,i_input,j_input) + real(esmf_kind_r8), intent(in) :: skint(i_input,j_input) + integer(esmf_kind_i4), intent(in) :: landmask(i_input,j_input) + + integer :: i, j, k + do k=1,lsoil_input + do j = 1, j_input + do i = 1, i_input + if (landmask(i,j) == 0_esmf_kind_i4 ) soilt(i,j,k) = skint(i,j) + if (landmask(i,j) == 1_esmf_kind_i4 .and. soilt(i,j,k) > 350.0_esmf_kind_r8) soilt(i,j,k) = skint(i,j) + if (landmask(i,j) == 2_esmf_kind_i4 ) soilt(i,j,k) = icet_default + enddo + enddo + enddo +end subroutine check_soilt end module input_data From acb55e079334a7abe4bea0fa6ed837fe787ee3c3 Mon Sep 17 00:00:00 2001 From: Larissa Reames Date: Mon, 26 Apr 2021 20:47:27 +0000 Subject: [PATCH 4/9] chgres_cube: Remove commented code that was previously used for the check on soil temperature. --- sorc/chgres_cube.fd/input_data.F90 | 9 --------- 1 file changed, 9 deletions(-) diff --git a/sorc/chgres_cube.fd/input_data.F90 b/sorc/chgres_cube.fd/input_data.F90 index 82e3a15d9..2c714b95f 100644 --- a/sorc/chgres_cube.fd/input_data.F90 +++ b/sorc/chgres_cube.fd/input_data.F90 @@ -5391,15 +5391,6 @@ subroutine read_input_sfc_grib2_file(localpet) vname = "soilt" vname_file = ":TSOIL:" call read_grib_soil(the_file,inv_file,vname,vname_file,dummy3d,rc) - !do k=1,lsoil_input - ! do j = 1, j_input - ! do i = 1, i_input - ! if (slmsk_save(i,j) == 0_esmf_kind_i4 ) dummy3d(i,j,k) = tsk_save(i,j) - ! if (slmsk_save(i,j) == 1_esmf_kind_i4 .and. dummy3d(i,j,k) > 350.0_esmf_kind_r8) dummy3d(i,j,k) = tsk_save(i,j) - ! if (slmsk_save(i,j) == 2_esmf_kind_i4 ) dummy3d(i,j,k) = icet_default - ! enddo - ! enddo - !enddo call check_soilt(dummy3d,slmsk_save,tsk_save) print*,'soilt ',maxval(dummy3d),minval(dummy3d) From c68d9586638487f9a95a76cd508afeb572892a7a Mon Sep 17 00:00:00 2001 From: Larissa Reames Date: Tue, 27 Apr 2021 18:58:23 +0000 Subject: [PATCH 5/9] First attempt at creating a test for check_soilt routine. --- sorc/chgres_cube.fd/input_data.F90 | 2 + tests/chgres_cube/CMakeLists.txt | 12 ++- tests/chgres_cube/ftst_sfc_input_data.F90 | 95 +++++++++++++++++++++++ 3 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 tests/chgres_cube/ftst_sfc_input_data.F90 diff --git a/sorc/chgres_cube.fd/input_data.F90 b/sorc/chgres_cube.fd/input_data.F90 index fb83097bd..d0e56d757 100644 --- a/sorc/chgres_cube.fd/input_data.F90 +++ b/sorc/chgres_cube.fd/input_data.F90 @@ -48,6 +48,8 @@ module input_data private + public :: check_soilt + ! Fields associated with the atmospheric model. type(esmf_field), public :: dzdt_input_grid !< vert velocity diff --git a/tests/chgres_cube/CMakeLists.txt b/tests/chgres_cube/CMakeLists.txt index eb5a73a5b..d4a9570a2 100644 --- a/tests/chgres_cube/CMakeLists.txt +++ b/tests/chgres_cube/CMakeLists.txt @@ -1,7 +1,7 @@ # This is the cmake build file for the tests directory of the # UFS_UTILS project. # -# George Gayno, Lin Gan, Ed Hartnett +# George Gayno, Lin Gan, Ed Hartnett, Larissa Reames # Include cmake to allow parallel I/O tests. include (LibMPI) @@ -58,3 +58,13 @@ add_mpi_test(ftst_search_util EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/ftst_search_util NUMPROCS 1 TIMEOUT 60) + +add_executable(ftst_sfc_input_data ftst_sfc_input_data.F90) +target_link_libraries(ftst_sfc_input_data + chgres_cube_lib) + +# Cause test to be run with MPI. +add_mpi_test(ftst_sfc_input_data + EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/ftst_sfc_input_data + NUMPROCS 4 + TIMEOUT 60) diff --git a/tests/chgres_cube/ftst_sfc_input_data.F90 b/tests/chgres_cube/ftst_sfc_input_data.F90 new file mode 100644 index 000000000..06134e66e --- /dev/null +++ b/tests/chgres_cube/ftst_sfc_input_data.F90 @@ -0,0 +1,95 @@ + program test_sfc_input_data + +! Test sfc_input_data. For now only one test is performed +! on the subroutine soilt_check using a sample 3x3 matrix. +! +! author: Larissa Reames (larissa.reames@noaa.gov) + + use mpi + use esmf + use input_data + + implicit none + + integer, parameter :: i_input = 3 + integer, parameter :: j_input = 3 + integer, parameter :: tile = 1 + + integer :: ierr + + integer(esmf_kind_i4) :: mask(i_input,j_input) + real(esmf_kind_r8), allocatable :: soilt_bad(:,:,:), & + soilt_updated(:,:,:), & + soilt_correct(:,:,:) + real(esmf_kind_r8) :: skint(i_input,j_input) + + lsoil_input = 2 + + allocate(soilt_bad(lsoil_input,i_input,j_input)) + allocate(soilt_updated(lsoil_input,i_input,j_input)) + allocate(soilt_correct(lsoil_input,i_input,j_input)) + +!-------------------------------------------------------- +! These variables are used to test all three functions of +! the check_soilt routine (i.e., replace water point soil +! temperature and excessive land point soil temperature +! with skin temperature and store a default ice column +! temperature in the soil temperature array since this +! array isn't available in grib2 files) +!-------------------------------------------------------- + +! Definition of the mask. The '1' indicates an isolated +! island or lake depending on the field type and '2' +! indicates sea ice. + + data mask /0, 1, 0, 0, 0, 1, 0, 0, 2/ + +! Soil temperature array with some values that are all incorrect +! based on landmask type. This will be the input soil array + + soilt_bad(1,1:i_input,1:j_input) = reshape((/0., 9999999.9, 0., & + 0., 0., 295.0, & + 0., 25.0, 25.0 /),(/3,3/)) + soilt_bad(2,1:i_input,1:j_input) = reshape((/0., 9999999.9, 0., & + 0., 0., 295.0, & + 0., 25.0, 25.0 /),(/3,3/)) + +! Subjective, reasonable skin temperature array. + + data skint /285.0, 295.0, 280.0, 281.0, 282.0, 283.0, 284.0, 285.0, 260.0/ + + +!-------------------------------------------------------- +! This is the corrected soil temperature array that +! should be passed back from the check_soilt routine +!-------------------------------------------------------- + + soilt_correct(1,1:i_input,1:j_input) = reshape( (/285.0, 295.0, 280.0, & + 281.0, 282.0, 295.0, & + 284.0, 285.0, 265.0/), (/3,3/)) + soilt_correct(2,1:i_input,1:j_input) = reshape( (/285.0, 295.0, 280.0, & + 281.0, 282.0, 295.0, & + 284.0, 285.0, 265.0/), (/3,3/)) + + + print*,"Starting test of check_soilt subroutine." + + call mpi_init(ierr) + + print*,'Run test.' + + soilt_updated = soilt_bad + call check_soilt(soilt_updated,mask,skint) + + if (any(soilt_updated /= soilt_correct)) then + print*,'TEST FAILED ' + print*,'ARRAY SHOULD BE:', soilt_correct + print*,'ARRAY FROM TEST:', soilt_updated + stop 2 + endif + + call mpi_finalize(ierr) + + print*,"SUCCESS!" + + end program test_sfc_input_data From 1e798e4873721f2e518ef918b8d5adac111f65f3 Mon Sep 17 00:00:00 2001 From: Larissa Reames Date: Tue, 27 Apr 2021 20:30:04 +0000 Subject: [PATCH 6/9] Bug fix for incorrect index order in check_soilt. Updates to test, which now passes. --- sorc/chgres_cube.fd/input_data.F90 | 13 +++++-- tests/chgres_cube/ftst_sfc_input_data.F90 | 45 +++++++++++------------ 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/sorc/chgres_cube.fd/input_data.F90 b/sorc/chgres_cube.fd/input_data.F90 index d0e56d757..fa8a9f7c9 100644 --- a/sorc/chgres_cube.fd/input_data.F90 +++ b/sorc/chgres_cube.fd/input_data.F90 @@ -6612,17 +6612,22 @@ end subroutine quicksort subroutine check_soilt(soilt, landmask, skint) implicit none - real(esmf_kind_r8), intent(inout) :: soilt(lsoil_input,i_input,j_input) + real(esmf_kind_r8), intent(inout) :: soilt(i_input,j_input,lsoil_input) real(esmf_kind_r8), intent(in) :: skint(i_input,j_input) integer(esmf_kind_i4), intent(in) :: landmask(i_input,j_input) integer :: i, j, k + do k=1,lsoil_input do j = 1, j_input do i = 1, i_input - if (landmask(i,j) == 0_esmf_kind_i4 ) soilt(i,j,k) = skint(i,j) - if (landmask(i,j) == 1_esmf_kind_i4 .and. soilt(i,j,k) > 350.0_esmf_kind_r8) soilt(i,j,k) = skint(i,j) - if (landmask(i,j) == 2_esmf_kind_i4 ) soilt(i,j,k) = icet_default + if (landmask(i,j) == 0_esmf_kind_i4 ) then + soilt(i,j,k) = skint(i,j) + else if (landmask(i,j) == 1_esmf_kind_i4 .and. soilt(i,j,k) > 350.0_esmf_kind_r8) then + soilt(i,j,k) = skint(i,j) + else if (landmask(i,j) == 2_esmf_kind_i4 ) then + soilt(i,j,k) = icet_default + endif enddo enddo enddo diff --git a/tests/chgres_cube/ftst_sfc_input_data.F90 b/tests/chgres_cube/ftst_sfc_input_data.F90 index 06134e66e..d1efca125 100644 --- a/tests/chgres_cube/ftst_sfc_input_data.F90 +++ b/tests/chgres_cube/ftst_sfc_input_data.F90 @@ -8,26 +8,29 @@ program test_sfc_input_data use mpi use esmf use input_data + use model_grid implicit none - integer, parameter :: i_input = 3 - integer, parameter :: j_input = 3 - integer, parameter :: tile = 1 - integer :: ierr - integer(esmf_kind_i4) :: mask(i_input,j_input) - real(esmf_kind_r8), allocatable :: soilt_bad(:,:,:), & - soilt_updated(:,:,:), & - soilt_correct(:,:,:) - real(esmf_kind_r8) :: skint(i_input,j_input) + integer(esmf_kind_i4), allocatable :: mask(:,:) + real(esmf_kind_r8), allocatable :: soilt_bad(:,:,:), & + soilt_updated(:,:,:), & + soilt_correct(:,:,:) + real(esmf_kind_r8), allocatable :: skint(:,:) + + call mpi_init(ierr) lsoil_input = 2 + i_input = 3 + j_input = 3 - allocate(soilt_bad(lsoil_input,i_input,j_input)) - allocate(soilt_updated(lsoil_input,i_input,j_input)) - allocate(soilt_correct(lsoil_input,i_input,j_input)) + allocate(mask(i_input,j_input)) + allocate(skint(i_input,j_input)) + allocate(soilt_bad(i_input,j_input,lsoil_input)) + allocate(soilt_updated(i_input,j_input,lsoil_input)) + allocate(soilt_correct(i_input,j_input,lsoil_input)) !-------------------------------------------------------- ! These variables are used to test all three functions of @@ -42,42 +45,38 @@ program test_sfc_input_data ! island or lake depending on the field type and '2' ! indicates sea ice. - data mask /0, 1, 0, 0, 0, 1, 0, 0, 2/ + mask = reshape((/0, 1, 0, 0, 0, 1, 0, 0, 2/),(/3,3/)) ! Soil temperature array with some values that are all incorrect ! based on landmask type. This will be the input soil array - soilt_bad(1,1:i_input,1:j_input) = reshape((/0., 9999999.9, 0., & + soilt_bad(1:i_input,1:j_input,1) = reshape((/0., 9999999.9, 0., & 0., 0., 295.0, & 0., 25.0, 25.0 /),(/3,3/)) - soilt_bad(2,1:i_input,1:j_input) = reshape((/0., 9999999.9, 0., & + soilt_bad(1:i_input,1:j_input,2) = reshape((/0., 9999999.9, 0., & 0., 0., 295.0, & 0., 25.0, 25.0 /),(/3,3/)) ! Subjective, reasonable skin temperature array. - data skint /285.0, 295.0, 280.0, 281.0, 282.0, 283.0, 284.0, 285.0, 260.0/ - + skint = reshape((/285.0, 295.0, 280.0, 281.0, 282.0, 283.0, 284.0, 285.0, 260.0/), & + (/3,3/)) !-------------------------------------------------------- ! This is the corrected soil temperature array that ! should be passed back from the check_soilt routine !-------------------------------------------------------- - soilt_correct(1,1:i_input,1:j_input) = reshape( (/285.0, 295.0, 280.0, & + soilt_correct(1:i_input,1:j_input,1) = reshape( (/285.0, 295.0, 280.0, & 281.0, 282.0, 295.0, & 284.0, 285.0, 265.0/), (/3,3/)) - soilt_correct(2,1:i_input,1:j_input) = reshape( (/285.0, 295.0, 280.0, & + soilt_correct(1:i_input,1:j_input,2) = reshape( (/285.0, 295.0, 280.0, & 281.0, 282.0, 295.0, & 284.0, 285.0, 265.0/), (/3,3/)) print*,"Starting test of check_soilt subroutine." - call mpi_init(ierr) - - print*,'Run test.' - soilt_updated = soilt_bad call check_soilt(soilt_updated,mask,skint) From 22f85e187a0c01e65ab4003eb1075c149a34dd56 Mon Sep 17 00:00:00 2001 From: Larissa Reames Date: Tue, 27 Apr 2021 21:00:43 +0000 Subject: [PATCH 7/9] Revert "Fix for seg fault in forecast step with GEFS." This will need to be done in a unique subroutine in input_data This reverts commit 0c0ff9800be36af10f4d691061bc19dd5de52d12. --- sorc/chgres_cube.fd/surface.F90 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sorc/chgres_cube.fd/surface.F90 b/sorc/chgres_cube.fd/surface.F90 index fbf863fbd..f373bebd4 100644 --- a/sorc/chgres_cube.fd/surface.F90 +++ b/sorc/chgres_cube.fd/surface.F90 @@ -3938,10 +3938,6 @@ subroutine qc_check do j = clb(2), cub(2) do i = clb(1), cub(1) if (veg_greenness_ptr(i,j) <= 0.01) data_ptr(i,j) = 0.0 - if (data_ptr(i,j) > 0.5) then - print*,"- ZERO OUT TARGET GRID CANOPY MOISTURE CONTENT WITH UNREALISTIC VALUES" - data_ptr(i,j) = 0.0 - endif enddo enddo From 67e43c0ad97b7777616fc5dd1aef0c1cb697878b Mon Sep 17 00:00:00 2001 From: Larissa Reames Date: Wed, 28 Apr 2021 16:59:37 +0000 Subject: [PATCH 8/9] Updated comments associated with check_soilt and its test to be more accurate. --- sorc/chgres_cube.fd/input_data.F90 | 9 ++++++++- tests/chgres_cube/ftst_sfc_input_data.F90 | 11 +++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/sorc/chgres_cube.fd/input_data.F90 b/sorc/chgres_cube.fd/input_data.F90 index fa8a9f7c9..f42d16a20 100644 --- a/sorc/chgres_cube.fd/input_data.F90 +++ b/sorc/chgres_cube.fd/input_data.F90 @@ -6603,7 +6603,14 @@ recursive subroutine quicksort(a, first, last) if (j+1 < last) call quicksort(a, j+1, last) end subroutine quicksort -!> Check for and replace erroneous values in soil temperature. +!> Check for and replace certain values in soil temperature. +!> At open water points (landmask=0) use skin temperature as +!> a filler value. At land points (landmask=1) with excessive +!> soil temperature, replace soil temperature with skin temperature. +!> In GEFSv12.0 data there are some erroneous missing values at +!> land points which this corrects. At sea ice points (landmask=2), +!> store a default ice column temperature because grib2 files do not +!> have ice column temperature which FV3 expects at these points. !! !! @param soilt [inout] 3-dimensional soil temperature arrray !! @param landmask [in] landmask of the input grid diff --git a/tests/chgres_cube/ftst_sfc_input_data.F90 b/tests/chgres_cube/ftst_sfc_input_data.F90 index d1efca125..4234a1ec6 100644 --- a/tests/chgres_cube/ftst_sfc_input_data.F90 +++ b/tests/chgres_cube/ftst_sfc_input_data.F90 @@ -34,16 +34,15 @@ program test_sfc_input_data !-------------------------------------------------------- ! These variables are used to test all three functions of -! the check_soilt routine (i.e., replace water point soil +! the check_soilt routine (i.e., replace water point ! temperature and excessive land point soil temperature ! with skin temperature and store a default ice column -! temperature in the soil temperature array since this -! array isn't available in grib2 files) +! temperature in the soil temperature array at sea ice +! points since this array isn't available in grib2 files) !-------------------------------------------------------- -! Definition of the mask. The '1' indicates an isolated -! island or lake depending on the field type and '2' -! indicates sea ice. +! Definition of the mask. The '0' indicates open water, '1' +! any land point, and '2' sea ice. mask = reshape((/0, 1, 0, 0, 0, 1, 0, 0, 2/),(/3,3/)) From ba2f57526c83cc30cb7defec194e2755252bf624 Mon Sep 17 00:00:00 2001 From: Larissa Reames Date: Wed, 28 Apr 2021 17:35:06 +0000 Subject: [PATCH 9/9] Changed constant icet_default to be in ALL CAPS --- sorc/chgres_cube.fd/input_data.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sorc/chgres_cube.fd/input_data.F90 b/sorc/chgres_cube.fd/input_data.F90 index f42d16a20..83c0bcaaa 100644 --- a/sorc/chgres_cube.fd/input_data.F90 +++ b/sorc/chgres_cube.fd/input_data.F90 @@ -71,7 +71,7 @@ module input_data integer, public :: veg_type_landice_input = 15 !< NOAH land ice option !< defined at this veg type. !< Default is igbp. - integer, parameter :: icet_default = 265.0 !< Default value of soil and skin + integer, parameter :: ICET_DEFAULT = 265.0 !< Default value of soil and skin !< temperature (K) over ice. type(esmf_field), public :: canopy_mc_input_grid !< canopy moist content type(esmf_field), public :: f10m_input_grid !< log((z0+10)*1/z0) @@ -6633,7 +6633,7 @@ subroutine check_soilt(soilt, landmask, skint) else if (landmask(i,j) == 1_esmf_kind_i4 .and. soilt(i,j,k) > 350.0_esmf_kind_r8) then soilt(i,j,k) = skint(i,j) else if (landmask(i,j) == 2_esmf_kind_i4 ) then - soilt(i,j,k) = icet_default + soilt(i,j,k) = ICET_DEFAULT endif enddo enddo