Skip to content

Commit aa7f5c1

Browse files
committed
Merge branch 'main' into xgrid_default
2 parents e649244 + 0de751f commit aa7f5c1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

mediator/med_phases_aofluxes_mod.F90

+7-5
Original file line numberDiff line numberDiff line change
@@ -1644,7 +1644,13 @@ subroutine set_aoflux_in_pointers(fldbun_a, fldbun_o, aoflux_in, lsize, xgrid, r
16441644
if (chkerr(rc,__LINE__,u_FILE_u)) return
16451645
end if
16461646

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

16621664
if (flds_wiso) then

0 commit comments

Comments
 (0)