Skip to content

Commit

Permalink
Force sfc_climo_gen to always place a valid value at
Browse files Browse the repository at this point in the history
all points with at least some land.

Fixes ufs-community#123.
  • Loading branch information
GeorgeGayno-NOAA committed Jan 9, 2024
1 parent 4284a66 commit d28519a
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions sorc/sfc_climo_gen.fd/model_grid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -370,16 +370,16 @@ subroutine get_model_info(orog_file, mask, land_frac, lat2d, lon2d, idim, jdim)
! surface data will not be mapped to it.
!-----------------------------------------------------------------------

error=nf90_inq_varid(ncid, 'lake_frac', id_var)
if (error /= 0) then
print*,"- READ LAND MASK (SLMSK)"
error=nf90_inq_varid(ncid, 'slmsk', id_var)
call netcdf_err(error, "READING SLMSK ID")
error=nf90_get_var(ncid, id_var, dummy)
call netcdf_err(error, "READING SLMSK")
mask = nint(dummy)
land_frac = -999.
else
!error=nf90_inq_varid(ncid, 'lake_frac', id_var)
!if (error /= 0) then
! print*,"- READ LAND MASK (SLMSK)"
! error=nf90_inq_varid(ncid, 'slmsk', id_var)
! call netcdf_err(error, "READING SLMSK ID")
! error=nf90_get_var(ncid, id_var, dummy)
! call netcdf_err(error, "READING SLMSK")
! mask = nint(dummy)
! land_frac = -999.
!else
print*,"- READ LAND FRACTION"
error=nf90_inq_varid(ncid, 'land_frac', id_var)
call netcdf_err(error, "READING LAND_FRAC ID")
Expand All @@ -393,7 +393,7 @@ subroutine get_model_info(orog_file, mask, land_frac, lat2d, lon2d, idim, jdim)
endif
enddo
enddo
endif
!endif

print*,"- READ LATITUDE"
error=nf90_inq_varid(ncid, 'geolat', id_var)
Expand Down

0 comments on commit d28519a

Please sign in to comment.