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
31 changes: 10 additions & 21 deletions physics/module_MYNNSFC_wrapper.F90
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ SUBROUTINE mynnsfc_wrapper_run( &
& sigmaf,vegtype,shdmax,ivegsrc, & !intent(in)
& z0pert,ztpert, & !intent(in)
& redrag,sfc_z0_type, & !intent(in)
& isftcflx,iz0tlnd, & !intent(in)
& sfclay_compute_flux, & !intent(in)
& sfclay_compute_diag, & !intent(in)
& delt,dx, &
& u, v, t3d, qvsh, qc, prsl, phii, &
& exner, ps, PBLH, slmsk, &
Expand Down Expand Up @@ -98,19 +101,6 @@ SUBROUTINE mynnsfc_wrapper_run( &
! should be moved to inside the mynn:
use machine , only : kind_phys

! use physcons, only : cp => con_cp, &
! & g => con_g, &
! & r_d => con_rd, &
! & r_v => con_rv, &
! & cpv => con_cvap, &
! & cliq => con_cliq, &
! & Cice => con_csol, &
! & rcp => con_rocp, &
! & XLV => con_hvap, &
! & XLF => con_hfus, &
! & EP_1 => con_fvirt, &
! & EP_2 => con_eps

! USE module_sf_mynn, only : SFCLAY_mynn
!tgs - info on iterations:
! flag_iter- logical, execution or not (im)
Expand Down Expand Up @@ -143,11 +133,9 @@ SUBROUTINE mynnsfc_wrapper_run( &
integer, intent(out) :: errflg

!MISC CONFIGURATION OPTIONS
INTEGER, PARAMETER :: &
& isftcflx = 0, & !control: 0
& iz0tlnd = 0, & !control: 0
& isfflx = 1

INTEGER, PARAMETER :: isfflx = 1
logical, intent(in) :: sfclay_compute_flux,sfclay_compute_diag
integer, intent(in) :: isftcflx,iz0tlnd
integer, intent(in) :: im, levs
integer, intent(in) :: iter, itimestep, lsm, lsm_ruc
logical, dimension(:), intent(in) :: flag_iter
Expand Down Expand Up @@ -311,9 +299,10 @@ SUBROUTINE mynnsfc_wrapper_run( &
EP1=ep_1,EP2=ep_2,KARMAN=karman, &
ISFFLX=isfflx,isftcflx=isftcflx,LSM=lsm,LSM_RUC=lsm_ruc, &
iz0tlnd=iz0tlnd,psi_opt=psi_opt, &
& sigmaf=sigmaf,vegtype=vegtype,shdmax=shdmax,ivegsrc=ivegsrc, & !intent(in)
& z0pert=z0pert,ztpert=ztpert, & !intent(in)
& redrag=redrag,sfc_z0_type=sfc_z0_type, & !intent(in)
compute_flux=sfclay_compute_flux,compute_diag=sfclay_compute_diag,&
sigmaf=sigmaf,vegtype=vegtype,shdmax=shdmax,ivegsrc=ivegsrc, & !intent(in)
z0pert=z0pert,ztpert=ztpert, & !intent(in)
redrag=redrag,sfc_z0_type=sfc_z0_type, & !intent(in)
itimestep=itimestep,iter=iter,flag_iter=flag_iter, &
wet=wet, dry=dry, icy=icy, & !intent(in)
tskin_wat=tskin_wat, tskin_lnd=tskin_lnd, tskin_ice=tskin_ice, & !intent(in)
Expand Down
28 changes: 28 additions & 0 deletions physics/module_MYNNSFC_wrapper.meta
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,34 @@
dimensions = ()
type = integer
intent = in
[isftcflx]
standard_name = flag_for_thermal_roughness_lengths_over_water_in_mynnsfclay
long_name = flag for thermal roughness lengths over water in mynnsfclay
units = flag
dimensions = ()
type = integer
intent = in
[iz0tlnd]
standard_name = flag_for_thermal_roughness_lengths_over_land_in_mynnsfclay
long_name = flag for thermal roughness lengths over land in mynnsfclay
units = flag
dimensions = ()
type = integer
intent = in
[sfclay_compute_flux]
standard_name = flag_for_computing_surface_scalar_fluxes_in_mynnsfclay
long_name = flag for computing surface scalar fluxes in mynnsfclay
units = flag
dimensions = ()
type = logical
intent = in
[sfclay_compute_diag]
standard_name = flag_for_computing_surface_diagnostics_in_mynnsfclay
long_name = flag for computing surface diagnostics in mynnsfclay
units = flag
dimensions = ()
type = logical
intent = in
[delt]
standard_name = timestep_for_physics
long_name = time step for physics
Expand Down
40 changes: 22 additions & 18 deletions physics/module_sf_mynn.F90
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,6 @@ MODULE module_sf_mynn
INTEGER, PARAMETER :: debug_code = 0 !0: no extra ouput
!1: check input
!2: everything - heavy I/O
LOGICAL, PARAMETER :: compute_diag = .false.
LOGICAL, PARAMETER :: compute_flux = .true. !shouldn't need compute
! these in FV3. They will be written over anyway.
! Computing the fluxes here is leftover from the WRF world.

REAL, DIMENSION(0:1000 ),SAVE :: psim_stab,psim_unstab, &
psih_stab,psih_unstab
Expand All @@ -132,10 +128,11 @@ SUBROUTINE SFCLAY_mynn( &
CP,G,ROVCP,R,XLV, & !in
SVP1,SVP2,SVP3,SVPT0,EP1,EP2,KARMAN, & !in
ISFFLX,isftcflx,lsm,lsm_ruc, & !in
compute_flux,compute_diag, & !in
iz0tlnd,psi_opt, & !in
& sigmaf,vegtype,shdmax,ivegsrc, & !intent(in)
& z0pert,ztpert, & !intent(in)
& redrag,sfc_z0_type, & !intent(in)
sigmaf,vegtype,shdmax,ivegsrc, & !intent(in)
z0pert,ztpert, & !intent(in)
redrag,sfc_z0_type, & !intent(in)
itimestep,iter,flag_iter, & !in
wet, dry, icy, & !intent(in)
tskin_wat, tskin_lnd, tskin_ice, & !intent(in)
Expand Down Expand Up @@ -273,8 +270,9 @@ SUBROUTINE SFCLAY_mynn( &
REAL, INTENT(IN) :: CP,G,ROVCP,R,XLV !,DX
!NAMELIST/CONFIGURATION OPTIONS:
INTEGER, INTENT(IN) :: ISFFLX, LSM, LSM_RUC
INTEGER, OPTIONAL, INTENT(IN) :: ISFTCFLX, IZ0TLND
INTEGER, OPTIONAL, INTENT(IN) :: spp_sfc, psi_opt
INTEGER, OPTIONAL, INTENT(IN) :: ISFTCFLX, IZ0TLND
INTEGER, OPTIONAL, INTENT(IN) :: spp_sfc, psi_opt
logical, intent(in) :: compute_flux,compute_diag
integer, intent(in) :: ivegsrc
integer, intent(in) :: sfc_z0_type ! option for calculating surface roughness length over ocean
logical, intent(in) :: redrag ! reduced drag coeff. flag for high wind over sea (j.han)
Expand Down Expand Up @@ -441,6 +439,7 @@ SUBROUTINE SFCLAY_mynn( &
CP,G,ROVCP,R,XLV,SVP1,SVP2,SVP3,SVPT0, &
EP1,EP2,KARMAN, &
ISFFLX,isftcflx,iz0tlnd,psi_opt, &
compute_flux,compute_diag, &
sigmaf,vegtype,shdmax,ivegsrc, & !intent(in)
z0pert,ztpert, & !intent(in)
redrag,sfc_z0_type, & !intent(in)
Expand Down Expand Up @@ -488,6 +487,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, &
CP,G,ROVCP,R,XLV,SVP1,SVP2,SVP3,SVPT0, &
EP1,EP2,KARMAN, &
ISFFLX,isftcflx,iz0tlnd,psi_opt, &
compute_flux,compute_diag, &
sigmaf,vegtype,shdmax,ivegsrc, & !intent(in)
z0pert,ztpert, & !intent(in)
redrag,sfc_z0_type, & !intent(in)
Expand Down Expand Up @@ -543,6 +543,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, &
!-----------------------------
INTEGER, INTENT(IN) :: ISFFLX
INTEGER, OPTIONAL, INTENT(IN ) :: ISFTCFLX, IZ0TLND
logical, intent(in) :: compute_flux,compute_diag
INTEGER, INTENT(IN) :: spp_sfc, psi_opt
integer, intent(in) :: ivegsrc
integer, intent(in) :: sfc_z0_type ! option for calculating surface roughness length over ocean
Expand Down Expand Up @@ -847,8 +848,8 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, &

DO I=its,ite
! CONVERT LOWEST LAYER TEMPERATURE TO POTENTIAL TEMPERATURE:
TH1D(I)=T1D(I)*THCON(I) !(Theta, K)
TC1D(I)=T1D(I)-273.15 !(T, Celsius)
TH1D(I)=T1D(I)**(100000./P1D(I))**ROVCP !(Theta, K)
TC1D(I)=T1D(I)-273.15 !(T, Celsius)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joeolson42 Joe, this PR got the "buggy" MYNN surface layer scheme in. It looks like it did not get into the RRFS_dev branch

ENDDO

DO I=its,ite
Expand All @@ -858,7 +859,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, &
ENDDO

DO I=its,ite
RHO1D(I)=PSFCPA(I)/(R*TV1D(I)) !now using value calculated in sfc driver
RHO1D(I)=P1D(I)/(R*TV1D(I)) !now using value calculated in sfc driver
ZA(I)=0.5*dz8w1d(I) !height of first half-sigma level
ZA2(I)=dz8w1d(I) + 0.5*dz2w1d(I) !height of 2nd half-sigma level
GOVRTH(I)=G/TH1D(I)
Expand Down Expand Up @@ -1723,9 +1724,9 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, &
IF (wet(I)) THEN
! TO PREVENT OSCILLATIONS AVERAGE WITH OLD VALUE
OLDUST = UST_wat(I)
UST_wat(I)=0.5*UST_wat(I)+0.5*KARMAN*WSPD(I)/PSIX_wat(I)
!UST_wat(I)=0.5*UST_wat(I)+0.5*KARMAN*WSPD(I)/PSIX_wat(I)
!NON-AVERAGED:
!UST_wat(I)=KARMAN*WSPD(I)/PSIX_wat(I)
UST_wat(I)=KARMAN*WSPD(I)/PSIX_wat(I)
stress_wat(i)=ust_wat(i)**2

! Compute u* without vconv for use in HFX calc when isftcflx > 0
Expand Down Expand Up @@ -1890,7 +1891,8 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, &
!----------------------------------
! COMPUTE SURFACE HEAT FLUX:
!----------------------------------
HFX(I)=FLHC(I)*(THSK_lnd(I)-TH1D(I))
!HFX(I)=FLHC(I)*(THSK_lnd(I)-TH1D(I))
HFX(I)=RHO1D(I)*CPM(I)*KARMAN*WSPD(i)/PSIX_lnd(I)*KARMAN/PSIT_lnd(I)*(THSK_lnd(I)-TH1D(i))
HFX(I)=MAX(HFX(I),-250.)
! BWG, 2020-06-17: Mod next 2 lines for fractional
HFLX_lnd(I)=HFX(I)/(RHO1D(I)*cpm(I))
Expand Down Expand Up @@ -1934,7 +1936,8 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, &
!----------------------------------
! COMPUTE SURFACE HEAT FLUX:
!----------------------------------
HFX(I)=FLHC(I)*(THSK_wat(I)-TH1D(I))
!HFX(I)=FLHC(I)*(THSK_wat(I)-TH1D(I))
HFX(I)=RHO1D(I)*CPM(I)*KARMAN*WSPD(i)/PSIX_wat(I)*KARMAN/PSIT_wat(I)*(THSK_wat(I)-TH1D(i))
IF ( PRESENT(ISFTCFLX) ) THEN
IF ( ISFTCFLX.NE.0 ) THEN
! AHW: add dissipative heating term
Expand Down Expand Up @@ -1981,7 +1984,8 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, &
!----------------------------------
! COMPUTE SURFACE HEAT FLUX:
!----------------------------------
HFX(I)=FLHC(I)*(THSK_ice(I)-TH1D(I))
!HFX(I)=FLHC(I)*(THSK_ice(I)-TH1D(I))
HFX(I)=RHO1D(I)*CPM(I)*KARMAN*WSPD(i)/PSIX_ice(I)*KARMAN/PSIT_ice(I)*(THSK_ice(I)-TH1D(i))
HFX(I)=MAX(HFX(I),-250.)
! BWG, 2020-06-17: Mod next 2 lines for fractional
HFLX_ice(I)=HFX(I)/(RHO1D(I)*cpm(I))
Expand Down Expand Up @@ -2418,7 +2422,7 @@ SUBROUTINE edson_etal_2013(Z_0,ustar,wsp10,visc,zu)
REAL, INTENT(IN) :: ustar, visc, wsp10, zu
REAL, INTENT(OUT) :: Z_0
REAL, PARAMETER :: G=9.81
REAL, PARAMETER :: m=0.017, b=-0.005
REAL, PARAMETER :: m=0.0017, b=-0.005

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change the reason the regression tests failed?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see how the code could reach this point since COARE_OPT is hard-coded to 3.0, so this subroutine is never called.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's currently hard-coded to the COARE 3.0 algorithm, so this isn't the reason for the failure. This change does make COARE 3.5 competitive with COARE 3.0. Beforehand, COARE 3.5 has a large negative 10-m wind speed bias:

Screen Shot 2022-03-29 at 5 26 11 PM

REAL :: CZC ! variable charnock "constant"
REAL :: wsp10m ! logarithmically calculated 10 m

Expand Down