Skip to content

Commit

Permalink
feature/chgres_cube_grib2_release This commit references #7.
Browse files Browse the repository at this point in the history
Simplify logic that sets ice column temperatures to the
default value.  The original logic was not working as intended.
  • Loading branch information
GeorgeGayno-NOAA committed Jan 17, 2020
1 parent 3388d34 commit 1c2bc99
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions sorc/chgres_cube.fd/input_data.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4417,7 +4417,7 @@ subroutine read_input_sfc_grib2_file(localpet)
enddo
enddo

slmsk_save = int(dummy2d,esmf_kind_i4)
slmsk_save = nint(dummy2d)

deallocate(icec_save)
endif
Expand Down Expand Up @@ -4776,9 +4776,10 @@ subroutine read_input_sfc_grib2_file(localpet)
call error_handler("IN FieldScatter", rc)

!---------------------------------------------------------------------------------
! At open water (slmsk==0), the soil temperature array is set to a filler value
! of SST. At sea/lake ice (slmsk==2) , it is ice column temperature. That field
! is not available in the GFS grib2 data, so use a default value.
! At open water (slmsk==0), the soil temperature array is not used and set
! to the filler value of SST. At lake/sea ice points (slmsk=2), the soil
! temperature array holds ice column temperature. That field is not available
! in GFS grib data, so set to a default value.
!---------------------------------------------------------------------------------

if (localpet == 0) then
Expand All @@ -4790,9 +4791,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) == 2_esmf_kind_i4 .and. .not. (dummy3d(i,j,k) <= 0.0 .and. dummy3d(i,j,k) <1000.0)) then
dummy3d(i,j,k) = icet_default
endif
if (slmsk_save(i,j) == 2_esmf_kind_i4 ) dummy3d(i,j,k) = icet_default
enddo
enddo
enddo
Expand Down

0 comments on commit 1c2bc99

Please sign in to comment.