Skip to content

Commit

Permalink
Merge pull request #477 from mvertens/feature/bugfix
Browse files Browse the repository at this point in the history
bug fix primarily for usf testing
  • Loading branch information
jedwards4b authored Jul 1, 2024
2 parents 3305e11 + 7a265d7 commit 47fb4e6
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions mediator/med_fraction_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ module med_fraction_mod
use med_methods_mod , only : fldbun_init => med_methods_FB_init
use med_methods_mod , only : fldbun_reset => med_methods_FB_reset
use med_map_mod , only : med_map_field
use med_internalstate_mod , only : ncomps
use med_internalstate_mod , only : ncomps, samegrid_atmlnd

implicit none
private
Expand Down Expand Up @@ -496,21 +496,26 @@ subroutine med_fraction_init(gcomp, rc)
call med_map_field(field_src, field_dst, is_local%wrap%RH(complnd,compatm,:), maptype, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

call fldbun_getdata1d(is_local%wrap%FBfrac(compatm), 'lfrac', lfrac, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
! Reset ofrac in FBFrac(compatm)
if (samegrid_atmlnd) then
call fldbun_getdata1d(is_local%wrap%FBfrac(compatm), 'lfrac', lfrac, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
else
call fldbun_getdata1d(is_local%wrap%FBfrac(compatm), 'lfrin', lfrac, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
end if
call fldbun_getdata1d(is_local%wrap%FBfrac(compatm), 'ofrac', ofrac, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
if (associated(ofrac)) then
do n = 1,size(lfrac)
lfrac(n) = lfrin(n)
ofrac(n) = 1.0_R8 - lfrac(n)
if (abs(ofrac(n)) < eps_fraclim) then
ofrac(n) = 0.0_R8
end if
end do
do n = 1,size(lfrac)
ofrac(n) = 1.0_R8 - lfrac(n)
if (abs(ofrac(n)) < eps_fraclim) then
ofrac(n) = 0.0_R8
end if
end do
end if

end if
end if
end if

!---------------------------------------
Expand Down

0 comments on commit 47fb4e6

Please sign in to comment.