Skip to content

Commit

Permalink
Merge pull request NCAR#41 from climbfuji/ben_bwg_mod_for_frac
Browse files Browse the repository at this point in the history
Mods to MYNN sfc and PBL for fractional/coupled for latest gsd/develop code (based on NCAR#40)
  • Loading branch information
DomHeinzeller authored Jun 25, 2020
2 parents 10eaa1a + 728c076 commit 022ae37
Show file tree
Hide file tree
Showing 5 changed files with 247 additions and 19 deletions.
67 changes: 54 additions & 13 deletions physics/module_MYNNPBL_wrapper.F90
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ SUBROUTINE mynnedmf_wrapper_run( &
& dtsfci_diag,dqsfci_diag, &
& dusfc_diag,dvsfc_diag, &
& dtsfc_diag,dqsfc_diag, &
& dusfc_cice,dvsfc_cice, &
& dtsfc_cice,dqsfc_cice, &
& hflx_ocn,qflx_ocn,stress_ocn, &
& oceanfrac,fice,wet,icy,dry, &
& dusfci_cpl,dvsfci_cpl, &
& dtsfci_cpl,dqsfci_cpl, &
& dusfc_cpl,dvsfc_cpl, &
Expand Down Expand Up @@ -175,6 +179,9 @@ SUBROUTINE mynnedmf_wrapper_run( &
REAL, PARAMETER :: TKmin=253.0 !< for total water conversion, Tripoli and Cotton (1981)
REAL, PARAMETER :: tv0=p608*tref, tv1=(1.+p608)*tref, gtr=g/tref, g_inv=1./g

REAL, PARAMETER :: zero=0.0d0, one=1.0d0
REAL, PARAMETER :: huge=9.9692099683868690E36 ! NetCDF float FillValue, same as in GFS_typedefs.F90

character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg

Expand Down Expand Up @@ -279,6 +286,14 @@ SUBROUTINE mynnedmf_wrapper_run( &
& dx,zorl,slmsk,tsurf,qsfc,ps, &
& hflx,qflx,ust,wspd,rb,recmol

real(kind=kind_phys), dimension(im), intent(in) :: &
& dusfc_cice,dvsfc_cice,dtsfc_cice,dqsfc_cice, &
& stress_ocn,hflx_ocn,qflx_ocn, &
& oceanfrac,fice

logical, dimension(im), intent(in) :: &
& wet, dry, icy

real(kind=kind_phys), dimension(im), intent(inout) :: &
& pblh
real(kind=kind_phys), dimension(im), intent(out) :: &
Expand Down Expand Up @@ -509,19 +524,6 @@ SUBROUTINE mynnedmf_wrapper_run( &
dusfc_diag(i) = dusfc_diag(i) + dusfci_diag(i)*delt
dvsfc_diag(i) = dvsfc_diag(i) + dvsfci_diag(i)*delt

! BWG: Coupling insertion
if(cplflx) then
dusfci_cpl(i) = dusfci_diag(i)
dvsfci_cpl(i) = dvsfci_diag(i)
dtsfci_cpl(i) = dtsfci_diag(i)
dqsfci_cpl(i) = dqsfci_diag(i)

dusfc_cpl(i) = dusfc_cpl(i) + dusfci_cpl(i)*delt
dvsfc_cpl(i) = dvsfc_cpl(i) + dvsfci_cpl(i)*delt
dtsfc_cpl(i) = dtsfc_cpl(i) + dtsfci_cpl(i)*delt
dqsfc_cpl(i) = dqsfc_cpl(i) + dqsfci_cpl(i)*delt
endif

znt(i)=zorl(i)*0.01 !cm -> m?
if (do_mynnsfclay) then
rmol(i)=recmol(i)
Expand All @@ -543,6 +545,45 @@ SUBROUTINE mynnedmf_wrapper_run( &
! wspd(i)=wind(i)
enddo

! BWG: Coupling insertion
if (cplflx) then
do i=1,im
if (oceanfrac(i) > zero) then ! Ocean only, NO LAKES
if ( .not. wet(i)) then ! no open water, use results from CICE
dusfci_cpl(i) = dusfc_cice(i)
dvsfci_cpl(i) = dvsfc_cice(i)
dtsfci_cpl(i) = dtsfc_cice(i)
dqsfci_cpl(i) = dqsfc_cice(i)
elseif (icy(i) .or. dry(i)) then ! use stress_ocean for opw component at mixed point
if (wspd(i) > zero) then
dusfci_cpl(i) = -1.*rho(i,1)*stress_ocn(i)*u(i,1)/wspd(i) ! U-momentum flux
dvsfci_cpl(i) = -1.*rho(i,1)*stress_ocn(i)*v(i,1)/wspd(i) ! V-momentum flux
else
dusfci_cpl(i) = zero
dvsfci_cpl(i) = zero
endif
dtsfci_cpl(i) = cp*rho(i,1)*hflx_ocn(i) ! sensible heat flux over open ocean
dqsfci_cpl(i) = XLV*rho(i,1)*qflx_ocn(i) ! latent heat flux over open ocean
else ! use results from this scheme for 100% open ocean
dusfci_cpl(i) = dusfci_diag(i)
dvsfci_cpl(i) = dvsfci_diag(i)
dtsfci_cpl(i) = dtsfci_diag(i)
dqsfci_cpl(i) = dqsfci_diag(i)
endif
!
dusfc_cpl (i) = dusfc_cpl(i) + dusfci_cpl(i) * delt
dvsfc_cpl (i) = dvsfc_cpl(i) + dvsfci_cpl(i) * delt
dtsfc_cpl (i) = dtsfc_cpl(i) + dtsfci_cpl(i) * delt
dqsfc_cpl (i) = dqsfc_cpl(i) + dqsfci_cpl(i) * delt
else ! If no ocean
dusfc_cpl(i) = huge
dvsfc_cpl(i) = huge
dtsfc_cpl(i) = huge
dqsfc_cpl(i) = huge
endif ! Ocean only, NO LAKES
enddo
endif ! End coupling insertion

if (lprnt) then
print*
write(0,*)"===CALLING mynn_bl_driver; input:"
Expand Down
105 changes: 105 additions & 0 deletions physics/module_MYNNPBL_wrapper.meta
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,111 @@
kind = kind_phys
intent = inout
optional = F
[dusfc_cice]
standard_name = surface_x_momentum_flux_for_coupling
long_name = sfc x momentum flux for coupling
units = Pa
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[dvsfc_cice]
standard_name = surface_y_momentum_flux_for_coupling
long_name = sfc y momentum flux for coupling
units = Pa
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[dtsfc_cice]
standard_name = surface_upward_sensible_heat_flux_for_coupling
long_name = sfc sensible heat flux for coupling
units = W m-2
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[dqsfc_cice]
standard_name = surface_upward_latent_heat_flux_for_coupling
long_name = sfc latent heat flux for coupling
units = W m-2
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[hflx_ocn]
standard_name = kinematic_surface_upward_sensible_heat_flux_over_ocean
long_name = kinematic surface upward sensible heat flux over ocean
units = K m s-1
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[qflx_ocn]
standard_name = kinematic_surface_upward_latent_heat_flux_over_ocean
long_name = kinematic surface upward latent heat flux over ocean
units = kg kg-1 m s-1
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[stress_ocn]
standard_name = surface_wind_stress_over_ocean
long_name = surface wind stress over ocean
units = m2 s-2
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[oceanfrac]
standard_name = sea_area_fraction
long_name = fraction of horizontal grid area occupied by ocean
units = frac
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[fice]
standard_name = sea_ice_concentration
long_name = ice fraction over open water
units = frac
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[wet]
standard_name = flag_nonzero_wet_surface_fraction
long_name = flag indicating presence of some ocean or lake surface area fraction
units = flag
dimensions = (horizontal_dimension)
type = logical
intent = in
optional = F
[icy]
standard_name = flag_nonzero_sea_ice_surface_fraction
long_name = flag indicating presence of some sea ice surface area fraction
units = flag
dimensions = (horizontal_dimension)
type = logical
intent = in
optional = F
[dry]
standard_name = flag_nonzero_land_surface_fraction
long_name = flag indicating presence of some land surface area fraction
units = flag
dimensions = (horizontal_dimension)
type = logical
intent = in
optional = F
[dusfci_cpl]
standard_name = instantaneous_surface_x_momentum_flux_for_coupling
long_name = instantaneous sfc u momentum flux
Expand Down
6 changes: 6 additions & 0 deletions physics/module_MYNNSFC_wrapper.F90
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ SUBROUTINE mynnsfc_wrapper_run( &
& fh_ocn, fh_lnd, fh_ice, & !intent(inout)
& fm10_ocn, fm10_lnd, fm10_ice, & !intent(inout)
& fh2_ocn, fh2_lnd, fh2_ice, & !intent(inout)
& hflx_ocn, hflx_lnd, hflx_ice, &
& qflx_ocn, qflx_lnd, qflx_ice, &
& QSFC, qsfc_ruc, USTM, ZOL, MOL, &
& RMOL, WSPD, ch, HFLX, QFLX, LH, &
& FLHC, FLQC, &
Expand Down Expand Up @@ -149,6 +151,8 @@ SUBROUTINE mynnsfc_wrapper_run( &
& fh_ocn, fh_lnd, fh_ice, &
& fm10_ocn, fm10_lnd, fm10_ice, &
& fh2_ocn, fh2_lnd, fh2_ice, &
& hflx_ocn, hflx_lnd, hflx_ice, &
& qflx_ocn, qflx_lnd, qflx_ice, &
& qsfc_ocn, qsfc_lnd, qsfc_ice

!MYNN-2D
Expand Down Expand Up @@ -267,6 +271,8 @@ SUBROUTINE mynnsfc_wrapper_run( &
fh_ocn=fh_ocn, fh_lnd=fh_lnd, fh_ice=fh_ice, & !intent(inout)
fm10_ocn=fm10_ocn, fm10_lnd=fm10_lnd, fm10_ice=fm10_ice, & !intent(inout)
fh2_ocn=fh2_ocn, fh2_lnd=fh2_lnd, fh2_ice=fh2_ice, & !intent(inout)
hflx_ocn=hflx_ocn, hflx_lnd=hflx_lnd, hflx_ice=hflx_ice, &
qflx_ocn=qflx_ocn, qflx_lnd=qflx_lnd, qflx_ice=qflx_ice, &
ch=ch,CHS=chs,CHS2=chs2,CQS2=cqs2,CPM=cpm, &
ZNT=znt,USTM=ustm,ZOL=zol,MOL=mol,RMOL=rmol, &
psim=psim,psih=psih, &
Expand Down
54 changes: 54 additions & 0 deletions physics/module_MYNNSFC_wrapper.meta
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,60 @@
kind = kind_phys
intent = inout
optional = F
[hflx_ocn]
standard_name = kinematic_surface_upward_sensible_heat_flux_over_ocean
long_name = kinematic surface upward sensible heat flux over ocean
units = K m s-1
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[hflx_lnd]
standard_name = kinematic_surface_upward_sensible_heat_flux_over_land
long_name = kinematic surface upward sensible heat flux over land
units = K m s-1
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[hflx_ice]
standard_name = kinematic_surface_upward_sensible_heat_flux_over_ice
long_name = kinematic surface upward sensible heat flux over ice
units = K m s-1
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[qflx_ocn]
standard_name = kinematic_surface_upward_latent_heat_flux_over_ocean
long_name = kinematic surface upward latent heat flux over ocean
units = kg kg-1 m s-1
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[qflx_lnd]
standard_name = kinematic_surface_upward_latent_heat_flux_over_land
long_name = kinematic surface upward latent heat flux over land
units = kg kg-1 m s-1
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[qflx_ice]
standard_name = kinematic_surface_upward_latent_heat_flux_over_ice
long_name = kinematic surface upward latent heat flux over ice
units = kg kg-1 m s-1
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[qsfc]
standard_name = surface_specific_humidity
long_name = surface air saturation specific humidity
Expand Down
Loading

0 comments on commit 022ae37

Please sign in to comment.