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

Use 2m T/Q as background for surface observations analysis. #11

Merged
merged 2 commits into from
Mar 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
8 changes: 7 additions & 1 deletion src/gsi/cplr_read_wrf_mass_guess.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1188,10 +1188,14 @@ subroutine read_wrf_mass_binary_guess_wrf(this,mype)
ges_xlat(j,i,it)=real(all_loc(j,i,i_xlat),r_kind)/rad2deg_single
endif
if(l_gsd_soilTQ_nudge) then
ges_th2_it(j,i)=real(all_loc(j,i,i_th2),r_kind)
ges_tsk_it(j,i)=real(all_loc(j,i,i_tsk),r_kind)
ges_soilt1_it(j,i)=real(all_loc(j,i,i_soilt1),r_kind)
endif
if(i_use_2mt4b > 0 ) then
ges_th2_it(j,i)=real(all_loc(j,i,i_th2),r_kind)
! convert from potential to sensible temperature
ges_th2_it(j,i)=ges_th2_it(j,i)*(ges_ps_it(j,i)/r100)**rd_over_cp_mass
endif
if(i_use_2mq4b>0) then
ges_q2_it(j,i)=real(all_loc(j,i,i_q2),r_kind)
! Convert 2m guess mixing ratio to specific humidity
Expand Down Expand Up @@ -2252,6 +2256,8 @@ subroutine read_wrf_mass_netcdf_guess_wrf(this,mype)
sfc_rough(j,i,it)=rough_default
if(i_use_2mt4b > 0 ) then
ges_th2_it(j,i)=real(all_loc(j,i,i_0+i_th2),r_kind)
! convert from potential to sensible temperature
ges_th2_it(j,i)=ges_th2_it(j,i)*(ges_ps_it(j,i)/r100)**rd_over_cp_mass
endif
! for GSD soil nudging
if(l_gsd_soilTQ_nudge) then
Expand Down
20 changes: 15 additions & 5 deletions src/gsi/cplr_wrwrfmassa.f90
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ subroutine wrwrfmassa_binary_wrf(this,mype)
use constants, only: soilmoistmin
use gsi_io, only: lendian_in,verbose
use rapidrefresh_cldsurf_mod, only: l_hydrometeor_bkio,l_gsd_soilTQ_nudge,&
i_use_2mq4b
i_use_2mq4b,i_use_2mt4b
use wrf_mass_guess_mod, only: destroy_cld_grids
use gsi_bundlemod, only: GSI_BundleGetPointer
use gsi_metguess_mod, only: gsi_metguess_get,GSI_MetGuess_Bundle
Expand Down Expand Up @@ -751,8 +751,6 @@ subroutine wrwrfmassa_binary_wrf(this,mype)
end do
end do
ier=0
call GSI_BundleGetPointer ( GSI_MetGuess_Bundle(it), 'th2m', ges_th2, istatus );ier=ier+istatus
call GSI_BundleGetPointer ( GSI_MetGuess_Bundle(it), 'q2m' , ges_q2, istatus );ier=ier+istatus
call GSI_BundleGetPointer ( GSI_MetGuess_Bundle(it), 'tsoil', ges_soilt1, istatus );ier=ier+istatus
call GSI_BundleGetPointer ( GSI_MetGuess_Bundle(it), 'tskn' , ges_tsk , istatus );ier=ier+istatus
if (ier/=0) then ! doesn't have to die - code can be generalized to bypass missing vars
Expand All @@ -764,12 +762,23 @@ subroutine wrwrfmassa_binary_wrf(this,mype)
do j=1,lat1
jp1=j+1
all_loc(j,i,i_tsk)=ges_tsk(jp1,ip1)
all_loc(j,i,i_th2)=ges_th2(jp1,ip1)
all_loc(j,i,i_soilt1)=ges_soilt1(jp1,ip1)
end do
end do
endif ! l_gsd_soilTQ_nudge
if(i_use_2mt4b > 0 ) then
call GSI_BundleGetPointer ( GSI_MetGuess_Bundle(it), 'th2m', ges_th2, istatus );ier=ier+istatus
do i=1,lon1
ip1=i+1
do j=1,lat1
! Convert 2m sensible T to potential T
jp1=j+1
all_loc(j,i,i_th2)=ges_th2(jp1,ip1)*(r100/ges_ps(jp1,ip1))**rd_over_cp_mass
end do
end do
endif
if (i_use_2mq4b > 0) then
call GSI_BundleGetPointer ( GSI_MetGuess_Bundle(it), 'q2m' , ges_q2, istatus );ier=ier+istatus
do i=1,lon1
ip1=i+1
do j=1,lat1
Expand Down Expand Up @@ -2559,9 +2568,10 @@ subroutine wrwrfmassa_netcdf_wrf(this,mype)
write(6,*)'wrwrfmassa_netcdf: getpointer failed, cannot retrieve th2'
call stop2(999)
endif
! convert to potential T
do i=1,lon2
do j=1,lat2
all_loc(j,i,i_th2)=ges_th2(j,i)
all_loc(j,i,i_th2)=ges_th2(j,i)*(r100/ges_ps(j,i))**rd_over_cp_mass
end do
end do
endif
Expand Down
11 changes: 5 additions & 6 deletions src/gsi/gsd_update_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,8 @@ subroutine gsd_update_th2(tinc,it)
use jfunc, only: tsensible
use constants, only: zero,one,fv,rd_over_cp_mass,one_tenth
use gridmod, only: lat2,lon2,aeta1_ll,pt_ll,aeta2_ll
! use guess_grids, only: nfldsig
use guess_grids, only:ges_prsi
use constants, only: half

implicit none

Expand Down Expand Up @@ -552,11 +553,9 @@ subroutine gsd_update_th2(tinc,it)
if(ihaveq/=0) cycle
dth2=tinc(i,j)/(one+fv*ges_q(i,j,1))
endif
! Convert sensible temperature to potential temperature
work_prsl = one_tenth*(aeta1_ll(1)*(r10*ges_ps(i,j)-pt_ll)+ &
aeta2_ll(1) + pt_ll)
work_prslk = (work_prsl/r100)**rd_over_cp_mass
ges_th2(i,j) = ges_th2(i,j) + dth2/work_prslk

! do not need to convert sensible temperature to potential temperature
ges_th2(i,j) = ges_th2(i,j) + dth2
end do
end do
! end do
Expand Down
Loading