@@ -1644,7 +1644,13 @@ subroutine set_aoflux_in_pointers(fldbun_a, fldbun_o, aoflux_in, lsize, xgrid, r
1644
1644
if (chkerr(rc,__LINE__,u_FILE_u)) return
1645
1645
end if
1646
1646
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
1648
1654
call fldbun_getfldptr(fldbun_a, ' Sa_pslv' , aoflux_in% psfc, xgrid= xgrid, rc= rc)
1649
1655
if (chkerr(rc,__LINE__,u_FILE_u)) return
1650
1656
end if
@@ -1653,10 +1659,6 @@ subroutine set_aoflux_in_pointers(fldbun_a, fldbun_o, aoflux_in, lsize, xgrid, r
1653
1659
if (compute_atm_dens .or. compute_atm_thbot) then
1654
1660
call fldbun_getfldptr(fldbun_a, ' Sa_pbot' , aoflux_in% pbot, xgrid= xgrid, rc= rc)
1655
1661
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
1660
1662
end if
1661
1663
1662
1664
if (flds_wiso) then
0 commit comments