From b0f55987b221b132dc7de36ed68a018c6ea6aaf3 Mon Sep 17 00:00:00 2001 From: "Reuben W. Nixon-Hill" Date: Fri, 16 Aug 2024 11:01:55 +0100 Subject: [PATCH] tidy special case --- src/opsinputs/opsinputs_fill_mod.F90 | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/opsinputs/opsinputs_fill_mod.F90 b/src/opsinputs/opsinputs_fill_mod.F90 index dd14e1ad..82adf87c 100644 --- a/src/opsinputs/opsinputs_fill_mod.F90 +++ b/src/opsinputs/opsinputs_fill_mod.F90 @@ -1363,7 +1363,7 @@ subroutine opsinputs_fill_fillrealfromgeoval( & type(ufo_geoval), pointer :: GeoVal real(kind_real) :: MissingReal integer(integer64), dimension(2) :: GeoValShape -integer(integer64) :: NumLevs +integer(integer64) :: LvlIdx character(len=*), parameter :: & RoutineName = "opsinputs_fill_fillrealfromgeoval" @@ -1400,15 +1400,14 @@ subroutine opsinputs_fill_fillrealfromgeoval( & ! field is only used for surface visibility calculations so no further ! specific handling is required. GeoValShape = shape(GeoVaL % vals) - NumLevs = GeoValShape(1) - where (GeoVal % vals(NumLevs,:) /= MissingReal) - Real1 = GeoVal % vals(NumLevs,:) - end where + LvlIdx = GeoValShape(1) ! Usually 70 else - where (GeoVal % vals(1,:) /= MissingReal) - Real1 = GeoVal % vals(1,:) - end where + LvlIdx = 1 end if + + where (GeoVal % vals(LvlIdx,:) /= MissingReal) + Real1 = GeoVal % vals(LvlIdx,:) + end where end if end subroutine opsinputs_fill_fillrealfromgeoval