Skip to content

Commit

Permalink
simply ufs fix for new aoflux variables
Browse files Browse the repository at this point in the history
  • Loading branch information
DeniseWorthen committed Jun 9, 2024
1 parent 709de40 commit 21a692f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
7 changes: 4 additions & 3 deletions mediator/esmFldsExchange_ufs_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,10 @@ subroutine esmFldsExchange_ufs(gcomp, phase, rc)
deallocate(flds)

! from med: fields returned by the atm/ocn flux computation, otherwise unadvertised
allocate(flds(8))
flds = (/'So_tref ', 'So_qref ', 'So_ustar ', 'So_re ','So_ssq ', 'So_u10 ', &
'So_duu10n', 'Faox_lat '/)
allocate(flds(12))
flds = (/'So_tref ', 'So_qref ', 'So_ustar ', 'So_re ', 'So_ssq ', &
'So_u10 ', 'So_duu10n ', 'Faox_lat ', 'So_ugustOut ', 'So_u10withGust', &
'So_u10res ', 'Faxa_rainc '/)
do n = 1,size(flds)
fldname = trim(flds(n))
if (phase == 'advertise') then
Expand Down
19 changes: 8 additions & 11 deletions mediator/med_phases_aofluxes_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1601,7 +1601,7 @@ subroutine set_aoflux_in_pointers(fldbun_a, fldbun_o, aoflux_in, lsize, xgrid, r
if (chkerr(rc,__LINE__,u_FILE_u)) return
call fldbun_getfldptr(fldbun_a, 'Sa_shum', aoflux_in%shum, xgrid=xgrid, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (coupling_mode == 'cesm') then
if (associated(aoflux_in%rainc)) then
call fldbun_getfldptr(fldbun_a, 'Faxa_rainc', aoflux_in%rainc, xgrid=xgrid, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
end if
Expand Down Expand Up @@ -1716,6 +1716,13 @@ subroutine set_aoflux_out_pointers(fldbun, lsize, aoflux_out, xgrid, rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
call fldbun_getfldptr(fldbun, 'So_duu10n', aoflux_out%duu10n, xgrid=xgrid, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

call fldbun_getfldptr(fldbun, 'So_ugustOut', aoflux_out%ugust_out, xgrid=xgrid, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
call fldbun_getfldptr(fldbun, 'So_u10withGust', aoflux_out%u10_withGust, xgrid=xgrid, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
call fldbun_getfldptr(fldbun, 'So_u10res', aoflux_out%u10res, xgrid=xgrid, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
call fldbun_getfldptr(fldbun, 'Faox_taux', aoflux_out%taux, xgrid=xgrid, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
call fldbun_getfldptr(fldbun, 'Faox_tauy', aoflux_out%tauy, xgrid=xgrid, rc=rc)
Expand Down Expand Up @@ -1745,18 +1752,8 @@ subroutine set_aoflux_out_pointers(fldbun, lsize, aoflux_out, xgrid, rc)
if (add_gusts) then
call fldbun_getfldptr(fldbun, 'So_ugustOut', aoflux_out%ugust_out, xgrid=xgrid, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
call fldbun_getfldptr(fldbun, 'So_u10withGust', aoflux_out%u10_withGust, xgrid=xgrid, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
else
allocate(aoflux_out%ugust_out(lsize)); aoflux_out%ugust_out(:) = 0._R8
allocate(aoflux_out%u10_withGust(lsize)); aoflux_out%u10_withGust(:) = 0._R8
end if

if (coupling_mode == 'cesm') then
call fldbun_getfldptr(fldbun, 'So_u10res', aoflux_out%u10res, xgrid=xgrid, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
else
allocate(aoflux_out%u10res(lsize)); aoflux_out%u10res(:) = 0._R8
end if

end subroutine set_aoflux_out_pointers
Expand Down

0 comments on commit 21a692f

Please sign in to comment.