Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 13 additions & 25 deletions mediator/med_phases_aofluxes_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1600,33 +1600,21 @@ subroutine set_aoflux_in_pointers(fldbun_a, fldbun_o, aoflux_in, lsize, xgrid, r
lsize = size(aoflux_in%zbot)
aoflux_in%lsize = lsize

! note the ocn_surface_flux_scheme -1 will be deprecated in the future
if (ocn_surface_flux_scheme == -1) then
call fldbun_getfldptr(fldbun_a, 'Sa_u10m', aoflux_in%ubot, xgrid=xgrid, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
call fldbun_getfldptr(fldbun_a, 'Sa_v10m', aoflux_in%vbot, xgrid=xgrid, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
call fldbun_getfldptr(fldbun_a, 'Sa_t2m', aoflux_in%tbot, xgrid=xgrid, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
call fldbun_getfldptr(fldbun_a, 'Sa_q2m', aoflux_in%shum, xgrid=xgrid, rc=rc)
call fldbun_getfldptr(fldbun_a, 'Sa_u', aoflux_in%ubot, xgrid=xgrid, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
call fldbun_getfldptr(fldbun_a, 'Sa_v', aoflux_in%vbot, xgrid=xgrid, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
call fldbun_getfldptr(fldbun_a, 'Sa_tbot', aoflux_in%tbot, xgrid=xgrid, rc=rc)
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 (add_gusts) then
call fldbun_getfldptr(fldbun_a, 'Faxa_rainc', aoflux_in%rainc, xgrid=xgrid, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
else
call fldbun_getfldptr(fldbun_a, 'Sa_u', aoflux_in%ubot, xgrid=xgrid, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
call fldbun_getfldptr(fldbun_a, 'Sa_v', aoflux_in%vbot, xgrid=xgrid, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
call fldbun_getfldptr(fldbun_a, 'Sa_tbot', aoflux_in%tbot, xgrid=xgrid, rc=rc)
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 (add_gusts) then
call fldbun_getfldptr(fldbun_a, 'Faxa_rainc', aoflux_in%rainc, xgrid=xgrid, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
else
! rainc is not used without add_gusts but some compilers complain about the unallocated pointer
! in the subroutine interface
allocate(aoflux_in%rainc(1))
end if
! rainc is not used without add_gusts but some compilers complain about the unallocated pointer
! in the subroutine interface
allocate(aoflux_in%rainc(1))
end if

! extra fields for CCPP aoflux
Expand Down
14 changes: 3 additions & 11 deletions ufs/flux_atmocn_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ subroutine flux_adjust_constants( flux_convergence_tolerance, &
end subroutine flux_adjust_constants

!===============================================================================
subroutine flux_atmOcn(logunit, nMax,zbot ,ubot ,vbot ,thbot , &
subroutine flux_atmOcn(logunit, nMax,zbot ,ubot ,vbot ,thbot , &
& qbot , rbot ,tbot ,us ,vs , &
& ts , mask ,sen ,lat ,lwup , &
& evap , taux ,tauy ,tref ,qref , &
Expand Down Expand Up @@ -255,11 +255,7 @@ subroutine flux_atmOcn(logunit, nMax,zbot ,ubot ,vbot ,thbot , &

!--- shift wind speed using old coefficient ---
rd = rdn / (1.0_R8 + rdn/loc_karman*(alz-psimh))
if (ocn_surface_flux_scheme == -1)then
u10n = vmag
else
u10n = vmag * rd / rdn
end if
u10n = vmag * rd / rdn

!--- update transfer coeffs at 10m and neutral stability ---
rdn = sqrt(cdn(u10n))
Expand All @@ -268,11 +264,7 @@ subroutine flux_atmOcn(logunit, nMax,zbot ,ubot ,vbot ,thbot , &
!(1.0_R8-stable) * chxcdu + stable * chxcds

!--- shift all coeffs to measurement height and stability ---
if (ocn_surface_flux_scheme == -1)then
rd = rdn
else
rd = rdn / (1.0_R8 + rdn/loc_karman*(alz-psimh))
end if
rd = rdn / (1.0_R8 + rdn/loc_karman*(alz-psimh))
rh = rhn / (1.0_R8 + rhn/loc_karman*(alz-psixh))
re = ren / (1.0_R8 + ren/loc_karman*(alz-psixh))

Expand Down