Skip to content

Commit

Permalink
Bug fix to the dynamic lapse rate implementation
Browse files Browse the repository at this point in the history
Added a check to screen for undefined lapse rate values. The code
will use the default uniform lapse rate at those locations

Resolves NASA-LIS#1410
  • Loading branch information
sujayvkumar committed Sep 19, 2023
1 parent b2d501a commit c9ac3fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions lis/core/LIS_spatialDownscalingMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ subroutine LIS_lapseRateCorrection(nest, modelelev, lapseRate, LIS_FORC_Base_Sta
force_prs = psurf(t)
index = LIS_domain(nest)%tile(t)%index
lapse = lapseRate(index)

elevdiff = LIS_domain(nest)%tile(t)%elev-&
modelelev(index)
tcforce=force_tmp+(lapse*elevdiff)
Expand Down
11 changes: 7 additions & 4 deletions lis/metforcing/merra2/read_merra2.F90
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ subroutine read_merra2(n, order, month, findex, &
call interp_merra2_var(n,findex,month,vwind, 6, .false., merraforc)
call interp_merra2_var(n,findex,month,ps, 7, .false., merraforc)

LIS_forc(n,findex)%lapseRate(:) = -0.0065

if(merra2_struc(n)%usedynlapserate.eq.1) then

inquire(file=trim(lapseratefname),exist=file_exists)
Expand Down Expand Up @@ -255,10 +257,11 @@ subroutine read_merra2(n, order, month, findex, &
do r=1,LIS_rc%lnr(n)
do c=1,LIS_rc%lnc(n)
if(LIS_domain(n)%gindex(c,r).ne.-1) then

gid = LIS_domain(n)%gindex(c,r)
LIS_forc(n,findex)%lapseRate(gid) = &
lapse_rate_out(c+(r-1)*LIS_rc%lnc(n))/1000.0
if(.not.isNaN(lapse_rate_out(c+(r-1)*LIS_rc%lnc(n)))) then
gid = LIS_domain(n)%gindex(c,r)
LIS_forc(n,findex)%lapseRate(gid) = &
lapse_rate_out(c+(r-1)*LIS_rc%lnc(n))/1000.0
endif
endif
enddo
enddo
Expand Down

0 comments on commit c9ac3fb

Please sign in to comment.