Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CESM specific - activated atm/ocn flux scheme2 #307

Merged
merged 3 commits into from
Jul 8, 2022
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
20 changes: 17 additions & 3 deletions cesm/flux_atmocn/shr_flux_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ end subroutine shr_flux_adjust_constants
! Thomas Toniazzo (Bjerknes Centre, Bergen) ”
!===============================================================================
SUBROUTINE flux_atmOcn(logunit, nMax ,zbot ,ubot ,vbot ,thbot , &
& qbot ,s16O ,sHDO ,s18O ,rbot , &
& tbot ,us ,vs , &
& qbot ,s16O ,sHDO ,s18O ,rbot, &
& tbot ,us ,vs, pslv, &
& ts ,mask , seq_flux_atmocn_minwind, &
& sen ,lat ,lwup , &
& r16O, rhdo, r18O, &
Expand Down Expand Up @@ -169,6 +169,7 @@ SUBROUTINE flux_atmOcn(logunit, nMax ,zbot ,ubot ,vbot ,thbot , &
real(R8) ,intent(in) :: r18O (nMax) ! ocn H218O tracer ratio/Rstd
real(R8) ,intent(in) :: rbot (nMax) ! atm air density (kg/m^3)
real(R8) ,intent(in) :: tbot (nMax) ! atm T (K)
real(R8) ,intent(in) :: pslv (nMax) ! atm sea level pressure(Pa)
real(R8) ,intent(in) :: us (nMax) ! ocn u-velocity (m/s)
real(R8) ,intent(in) :: vs (nMax) ! ocn v-velocity (m/s)
real(R8) ,intent(in) :: ts (nMax) ! ocn temperature (K)
Expand Down Expand Up @@ -553,9 +554,22 @@ SUBROUTINE flux_atmOcn(logunit, nMax ,zbot ,ubot ,vbot ,thbot , &
endif
ENDDO

else if (ocn_surface_flux_scheme .eq. 2) then

call flux_atmOcn_UA(logunit,&
nMax, zbot, ubot, vbot, thbot, &
qbot, s16O, sHDO, s18O, rbot, &
tbot, pslv, us, vs, &
ts, mask, sen, lat, lwup, &
r16O, rhdo, r18O, &
evap, evap_16O, evap_HDO, evap_18O, &
taux, tauy, tref, qref, &
duu10n, ustar_sv, re_sv, ssq_sv, &
missval)

else

call shr_sys_abort(subName//" subroutine flux_atmOcn requires ocn_surface_flux_scheme = 0 or 1")
call shr_sys_abort(subName//" subroutine flux_atmOcn requires ocn_surface_flux_scheme = 0, 1 or 2")

endif !! ocn_surface_flux_scheme

Expand Down
12 changes: 11 additions & 1 deletion cime_config/namelist_definition_drv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,17 @@
<value>ogrid</value>
</values>
</entry>

<entry id="ocn_surface_flux_scheme">
<type>integer</type>
<category>control</category>
<group>MED_attributes</group>
<desc>
atm/ocn flux calculation scheme
</desc>
<values>
<value>0</value>
</values>
</entry>
<entry id="gust_fac">
<type>real</type>
<category>control</category>
Expand Down
1 change: 1 addition & 0 deletions mediator/esmFldsExchange_cesm_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
call addmap(fldListFr(compatm)%flds, 'Sa_shum', compocn, mapbilnr, 'one', atm2ocn_map)
call addmap(fldListFr(compatm)%flds, 'Sa_ptem', compocn, mapbilnr, 'one', atm2ocn_map)
call addmap(fldListFr(compatm)%flds, 'Sa_dens', compocn, mapbilnr, 'one', atm2ocn_map)
call addmap(fldListFr(compatm)%flds, 'Sa_pslv', compocn, mapbilnr, 'one', atm2ocn_map)
if (fldchk(is_local%wrap%FBImp(compatm,compatm), 'Sa_shum_wiso', rc=rc)) then
call addmap(fldListFr(compatm)%flds, 'Sa_shum_wiso', compocn, mapbilnr, 'one', atm2ocn_map)
end if
Expand Down
15 changes: 14 additions & 1 deletion mediator/med_phases_aofluxes_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,12 @@ subroutine med_aofluxes_init(gcomp, aoflux_in, aoflux_out, rc)
else
ocn_surface_flux_scheme = 0
end if
#ifdef CESMCOUPLED
if (mastertask) then
write(logunit,*)
write(logunit,'(a)') trim(subname)//' ocn_surface_flux_scheme is '//trim(cvalue)
end if
#endif

! bottom level potential temperature and/or botom level density
! will need to be computed if not received from the atm
Expand Down Expand Up @@ -1050,7 +1056,7 @@ subroutine med_aofluxes_update(gcomp, aoflux_in, aoflux_out, rc)
nMax=aoflux_in%lsize, &
zbot=aoflux_in%zbot, ubot=aoflux_in%ubot, vbot=aoflux_in%vbot, thbot=aoflux_in%thbot, qbot=aoflux_in%shum, &
s16O=aoflux_in%shum_16O, sHDO=aoflux_in%shum_HDO, s18O=aoflux_in%shum_18O, rbot=aoflux_in%dens, &
tbot=aoflux_in%tbot, us=aoflux_in%uocn, vs=aoflux_in%vocn, ts=aoflux_in%tocn, &
tbot=aoflux_in%tbot, us=aoflux_in%uocn, vs=aoflux_in%vocn, pslv=aoflux_in%psfc, ts=aoflux_in%tocn, &
mask=aoflux_in%mask, seq_flux_atmocn_minwind=0.5_r8, &
sen=aoflux_out%sen, lat=aoflux_out%lat, lwup=aoflux_out%lwup, &
r16O=aoflux_in%roce_16O, rhdo=aoflux_in%roce_HDO, r18O=aoflux_in%roce_18O, &
Expand Down Expand Up @@ -1507,6 +1513,8 @@ subroutine set_aoflux_in_pointers(fldbun_a, fldbun_o, aoflux_in, lsize, xgrid, r
! Set pointers for aoflux_in attributes
! Note that if computation is on the xgrid, fldbun_a and fldbun_o are both fldbun_x

use med_methods_mod , only : FB_fldchk => med_methods_FB_FldChk

! input/output variables
type(ESMF_FieldBundle) , intent(inout) :: fldbun_a
type(ESMF_FieldBundle) , intent(inout) :: fldbun_o
Expand Down Expand Up @@ -1575,6 +1583,11 @@ 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
call fldbun_getfldptr(fldbun_a, 'Sa_pslv', aoflux_in%psfc, xgrid=xgrid, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
end if

! if either density or potential temperature are computed, will need bottom level pressure
if (compute_atm_dens .or. compute_atm_thbot) then
call fldbun_getfldptr(fldbun_a, 'Sa_pbot', aoflux_in%pbot, xgrid=xgrid, rc=rc)
Expand Down