Skip to content

Commit

Permalink
Merge branch 'main' into xgrid_default
Browse files Browse the repository at this point in the history
  • Loading branch information
billsacks committed Oct 24, 2024
2 parents e649244 + 0de751f commit aa7f5c1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions mediator/med_phases_aofluxes_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1644,7 +1644,13 @@ subroutine set_aoflux_in_pointers(fldbun_a, fldbun_o, aoflux_in, lsize, xgrid, r
if (chkerr(rc,__LINE__,u_FILE_u)) return
end if

if (FB_fldchk(fldbun_a, 'Sa_pslv', rc=rc)) then
! The following conditional captures the cases where aoflux_in%psfc is needed in calls
! to flux_atmocn / flux_atmocn_ccpp. Note that coupling_mode=='cesm' is equivalent to
! the CESMCOUPLED CPP token, and coupling_mode(1:3)=='ufs' is roughly equivalent to
! the UFS_AOFLUX CPP token (noting that we should only be in this subroutine if using
! one of the aoflux variants of the ufs coupling_mode).
if ((trim(coupling_mode) == 'cesm') .or. &
(coupling_mode(1:3) == 'ufs' .and. trim(aoflux_code) == 'ccpp')) then
call fldbun_getfldptr(fldbun_a, 'Sa_pslv', aoflux_in%psfc, xgrid=xgrid, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
end if
Expand All @@ -1653,10 +1659,6 @@ subroutine set_aoflux_in_pointers(fldbun_a, fldbun_o, aoflux_in, lsize, xgrid, r
if (compute_atm_dens .or. compute_atm_thbot) then
call fldbun_getfldptr(fldbun_a, 'Sa_pbot', aoflux_in%pbot, xgrid=xgrid, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (trim(coupling_mode) == 'ufs.frac.aoflux') then
call fldbun_getfldptr(fldbun_a, 'Sa_pslv', aoflux_in%psfc, xgrid=xgrid, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
end if
end if

if (flds_wiso) then
Expand Down

0 comments on commit aa7f5c1

Please sign in to comment.