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

Merge gsd/develop, drag suite update and other bug fixes #339

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
48 changes: 28 additions & 20 deletions physics/GFS_MP_generic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt
enddo
enddo

! Conversion factor mm per physics timestep to m per day
! Conversion factor from mm per day to m per physics timestep
tem = dtp * con_p001 / con_day

!> - For GFDL and Thompson MP scheme, determine convective snow by surface temperature;
Expand All @@ -280,26 +280,34 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt
if (imp_physics == imp_physics_gfdl .or. imp_physics == imp_physics_thompson) then
! determine convective rain/snow by surface temperature
! determine large-scale rain/snow by rain/snow coming out directly from MP
do i = 1, im
!tprcp(i) = max(0.0, rain(i) )! clu: rain -> tprcp ! DH now lines 245-250
srflag(i) = 0. ! clu: default srflag as 'rain' (i.e. 0)
if (tsfc(i) >= 273.15) then
crain = rainc(i)
csnow = 0.0
else
crain = 0.0
csnow = rainc(i)
endif
! if (snow0(i,1)+ice0(i,1)+graupel0(i,1)+csnow > rain0(i,1)+crain) then
! if (snow0(i)+ice0(i)+graupel0(i)+csnow > 0.0) then
! Sfcprop%srflag(i) = 1. ! clu: set srflag to 'snow' (i.e. 1)
! endif

if (lsm/=lsm_ruc) then
do i = 1, im
!tprcp(i) = max(0.0, rain(i) )! clu: rain -> tprcp ! DH now lines 245-250
srflag(i) = 0. ! clu: default srflag as 'rain' (i.e. 0)
if (tsfc(i) >= 273.15) then
crain = rainc(i)
csnow = 0.0
else
crain = 0.0
csnow = rainc(i)
endif
! if (snow0(i,1)+ice0(i,1)+graupel0(i,1)+csnow > rain0(i,1)+crain) then
! if (snow0(i)+ice0(i)+graupel0(i)+csnow > 0.0) then
! Sfcprop%srflag(i) = 1. ! clu: set srflag to 'snow' (i.e. 1)
! endif
! compute fractional srflag
total_precip = snow0(i)+ice0(i)+graupel0(i)+rain0(i)+rainc(i)
if (total_precip > rainmin) then
srflag(i) = (snow0(i)+ice0(i)+graupel0(i)+csnow)/total_precip
endif
enddo
total_precip = snow0(i)+ice0(i)+graupel0(i)+rain0(i)+rainc(i)
if (total_precip > rainmin) then
srflag(i) = (snow0(i)+ice0(i)+graupel0(i)+csnow)/total_precip
endif
enddo
else
! only for RUC LSM
do i=1,im
srflag(i) = sr(i)
enddo
endif ! lsm==lsm_ruc
elseif( .not. cal_pre) then
if (imp_physics == imp_physics_mg) then ! MG microphysics
do i=1,im
Expand Down
20 changes: 10 additions & 10 deletions physics/cires_ugwp_post.F90
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ subroutine cires_ugwp_post_run (ldiag_ugwp, dtf, im, levs, &
real(kind=kind_phys), intent(in) :: dtf
logical, intent(in) :: ldiag_ugwp !< flag for CIRES UGWP Diagnostics

real(kind=kind_phys), intent(in), dimension(im) :: zmtb, zlwb, zogw
real(kind=kind_phys), intent(in), dimension(im) :: tau_mtb, tau_ogw, tau_tofd, tau_ngw
real(kind=kind_phys), intent(inout), dimension(im) :: tot_mtb, tot_ogw, tot_tofd, tot_ngw
real(kind=kind_phys), intent(inout), dimension(im) :: tot_zmtb, tot_zlwb, tot_zogw
real(kind=kind_phys), intent(in), dimension(im, levs) :: gw_dtdt, gw_dudt, gw_dvdt, dudt_mtb, dudt_ogw, dudt_tms
real(kind=kind_phys), intent(inout), dimension(im, levs) :: du3dt_mtb, du3dt_ogw, du3dt_tms, du3dt_ngw, dv3dt_ngw
real(kind=kind_phys), intent(inout), dimension(im, levs) :: dtdt, dudt, dvdt
real(kind=kind_phys), intent(in), dimension(:) :: zmtb, zlwb, zogw
real(kind=kind_phys), intent(in), dimension(:) :: tau_mtb, tau_ogw, tau_tofd, tau_ngw
real(kind=kind_phys), intent(inout), dimension(:) :: tot_mtb, tot_ogw, tot_tofd, tot_ngw
real(kind=kind_phys), intent(inout), dimension(:) :: tot_zmtb, tot_zlwb, tot_zogw
real(kind=kind_phys), intent(in), dimension(:,:) :: gw_dtdt, gw_dudt, gw_dvdt, dudt_mtb, dudt_ogw, dudt_tms
real(kind=kind_phys), intent(inout), dimension(:,:) :: du3dt_mtb, du3dt_ogw, du3dt_tms, du3dt_ngw, dv3dt_ngw
real(kind=kind_phys), intent(inout), dimension(:,:) :: dtdt, dudt, dvdt

! For if (lssav) block, originally in gwdps_post_run
logical, intent(in) :: lssav, ldiag3d
real(kind=kind_phys), intent(in), dimension(im) :: dusfcg, dvsfcg
real(kind=kind_phys), intent(inout), dimension(im) :: dugwd, dvgwd
real(kind=kind_phys), intent(inout), dimension(im, levs) :: du3dt, dv3dt, dt3dt
real(kind=kind_phys), intent(in), dimension(:) :: dusfcg, dvsfcg
real(kind=kind_phys), intent(inout), dimension(:) :: dugwd, dvgwd
real(kind=kind_phys), intent(inout), dimension(:,:) :: du3dt, dv3dt, dt3dt

character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg
Expand Down
8 changes: 2 additions & 6 deletions physics/gwdps.f
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,8 @@ subroutine gwdps_run( &
! Interface variables
integer, intent(in) :: im, ix, km, imx, kdt, ipr, me
integer, intent(in) :: KPBL(IM) ! Index for the PBL top layer!
! DH* adding intent(in) information for the following variables
! changes the results on Theia/Intel - skip for bit-for-bit results *DH
! real(kind=kind_phys), intent(in) :: &
! & deltim, G, CP, RD, RV, cdmbgwd(2)
real(kind=kind_phys) deltim, G, CP, RD, RV, cdmbgwd(4)
! *DH
real(kind=kind_phys), intent(in) :: &
& deltim, G, CP, RD, RV, cdmbgwd(4)
real(kind=kind_phys), intent(inout) :: &
& A(IX,KM), B(IX,KM), C(IX,KM)
real(kind=kind_phys), intent(in) :: &
Expand Down
2 changes: 1 addition & 1 deletion physics/mp_thompson.F90
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, &
graupel = max(0.0, delta_graupel_mp/1000.0_kind_phys)
ice = max(0.0, delta_ice_mp/1000.0_kind_phys)
snow = max(0.0, delta_snow_mp/1000.0_kind_phys)
rain = max(0.0, delta_rain_mp - (delta_graupel_mp + delta_ice_mp + delta_snow_mp)/1000.0_kind_phys)
rain = max(0.0, (delta_rain_mp - (delta_graupel_mp + delta_ice_mp + delta_snow_mp))/1000.0_kind_phys)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'll never forget "Please Excuse My Dear Aunt Sally"...

I bet this was a tough one to catch.


end subroutine mp_thompson_run
!>@}
Expand Down
7 changes: 4 additions & 3 deletions physics/sfc_drv_ruc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ subroutine lsm_ruc_run & ! inputs
& sfcemis, dlwflx, dswsfc, snet, delt, tg3, cm, ch, &
& prsl1, zf, ddvel, shdmin, shdmax, alvwf, alnwf, &
& snoalb, sfalb, flag_iter, flag_guess, isot, ivegsrc, fice, &
& smc, stc, slc, lsm_ruc, lsm, land, &
& smc, stc, slc, lsm_ruc, lsm, land, islimsk, &
& imp_physics, imp_physics_gfdl, imp_physics_thompson, &
& smcwlt2, smcref2, wspd, do_mynnsfclay, &
& con_cp, con_rv, con_rd, con_g, con_pi, con_hvap, con_fvirt,& ! constants
Expand Down Expand Up @@ -184,6 +184,7 @@ subroutine lsm_ruc_run & ! inputs
con_hvap, con_fvirt

logical, dimension(im), intent(in) :: flag_iter, flag_guess, land
integer, dimension(im), intent(in) :: islimsk ! sea/land/ice mask (=0/1/2)
logical, intent(in) :: do_mynnsfclay

! --- in/out:
Expand Down Expand Up @@ -384,7 +385,7 @@ subroutine lsm_ruc_run & ! inputs
!> - Set flag for land and ice points.
!- 10may19 - ice points are turned off.
flag(i) = land(i)
if (land(i) .and. (vegtype(i)==iswater .or. vegtype(i)==isice)) then
if (land(i) .and. (vegtype(i)==iswater .or. (vegtype(i)==isice.and.islimsk(i)==2))) then
!write(errmsg,'(a,i0,a,i0)') 'Logic error in sfc_drv_ruc_run: for i=', i, &
! ', land(i) is true but vegtype(i) is water or ice: ', vegtype(i)
!errflg = 1
Expand Down Expand Up @@ -897,7 +898,7 @@ subroutine lsm_ruc_run & ! inputs
sfcdew(i) = dew(i,j)
qsurf(i) = qsfc(i,j)
sncovr1(i) = sncovr(i,j)
stm(i) = soilm(i,j) * 1000.0 ! unit conversion (from m to kg m-2)
stm(i) = soilm(i,j)
tsurf(i) = soilt(i,j)
tice(i) = tsurf(i)

Expand Down
8 changes: 8 additions & 0 deletions physics/sfc_drv_ruc.meta
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,14 @@
type = logical
intent = in
optional = F
[islimsk]
standard_name = sea_land_ice_mask
long_name = sea/land/ice mask (=0/1/2)
units = flag
dimensions = (horizontal_dimension)
type = integer
intent = in
optional = F
[rainnc]
standard_name = lwe_thickness_of_explicit_rainfall_amount_from_previous_timestep
long_name = explicit rainfall from previous timestep
Expand Down