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

RUC LSM is split into land and ice parts. #21

Merged
merged 8 commits into from
May 24, 2024
Merged
21 changes: 9 additions & 12 deletions src/core_atmosphere/physics/mpas_atmphys_driver.F
Original file line number Diff line number Diff line change
Expand Up @@ -271,27 +271,24 @@ subroutine physics_driver(domain,itimestep,xtime_s)

!call to land-surface scheme:
if(config_lsm_scheme .ne. 'off') then
call allocate_lsm(config_frac_seaice,config_lsm_scheme)
call allocate_lsm(config_lsm_scheme)
!$OMP PARALLEL DO
do thread=1,nThreads
call driver_lsm(itimestep,block%configs,mesh,diag_physics,sfc_input, &
cellSolveThreadStart(thread), cellSolveThreadEnd(thread))
end do
!$OMP END PARALLEL DO
call deallocate_lsm(config_frac_seaice,config_lsm_scheme)
call deallocate_lsm(config_lsm_scheme)

if(config_lsm_scheme .ne. 'sf_ruc') then
call allocate_seaice
call allocate_seaice(config_lsm_scheme)
!$OMP PARALLEL DO
do thread=1,nThreads
call driver_seaice(block%configs,diag_physics,sfc_input, &
cellSolveThreadStart(thread),cellSolveThreadEnd(thread))
enddo
do thread=1,nThreads
call driver_seaice(itimestep,block%configs,diag_physics,sfc_input, &
cellSolveThreadStart(thread),cellSolveThreadEnd(thread))
enddo
!$OMP END PARALLEL DO
call deallocate_seaice
endif ! sf_ruc
endif ! lsm off

call deallocate_seaice(config_lsm_scheme)
endif

!call to pbl schemes:
if(config_pbl_scheme .ne. 'off' .and. config_sfclayer_scheme .ne. 'off') then
Expand Down
86 changes: 6 additions & 80 deletions src/core_atmosphere/physics/mpas_atmphys_driver_lsm.F
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ module mpas_atmphys_driver_lsm
!wrf physics
use module_sf_noahdrv
use module_sf_noah_seaice_drv
use module_sf_ruclsm
use module_ruc_land
use module_sf_sfcdiags
use module_sf_sfcdiags_ruclsm
implicit none
private
public:: init_lsm, &
Expand Down Expand Up @@ -122,9 +121,8 @@ module mpas_atmphys_driver_lsm


!=================================================================================================================
subroutine allocate_lsm(config_frac_seaice,config_lsm_scheme)
subroutine allocate_lsm(config_lsm_scheme)
!=================================================================================================================
logical,intent(in) :: config_frac_seaice
character(len=StrKIND),pointer, intent(in) :: config_lsm_scheme
!-----------------------------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -199,13 +197,6 @@ subroutine allocate_lsm(config_frac_seaice,config_lsm_scheme)
if(.not.allocated(ust_urb_p) ) allocate(ust_urb_p(ims:ime,jms:jme) )
if(.not.allocated(utype_urb_p) ) allocate(utype_urb_p(ims:ime,jms:jme) )

if(config_frac_seaice) then
if(.not.allocated(tsk_sea) ) allocate(tsk_sea(ims:ime,jms:jme) )
if(.not.allocated(tsk_ice) ) allocate(tsk_ice(ims:ime,jms:jme) )
if(.not.allocated(albsi_p) ) allocate(albsi_p(ims:ime,jms:jme) )
if(.not.allocated(icedepth_p)) allocate(icedepth_p(ims:ime,jms:jme))
if(.not.allocated(snowsi_p) ) allocate(snowsi_p(ims:ime,jms:jme) )
endif

if(config_lsm_scheme=='sf_ruc') then
if(.not.allocated(rhosnf_p) ) allocate(rhosnf_p(ims:ime,jms:jme) )
Expand Down Expand Up @@ -237,10 +228,9 @@ subroutine allocate_lsm(config_frac_seaice,config_lsm_scheme)
end subroutine allocate_lsm

!=================================================================================================================
subroutine deallocate_lsm(config_frac_seaice,config_lsm_scheme)
subroutine deallocate_lsm(config_lsm_scheme)
!=================================================================================================================

logical,intent(in) :: config_frac_seaice
character(len=StrKIND),pointer, intent(in) :: config_lsm_scheme

!-----------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -316,22 +306,6 @@ subroutine deallocate_lsm(config_frac_seaice,config_lsm_scheme)
if(allocated(ust_urb_p) ) deallocate(ust_urb_p )
if(allocated(utype_urb_p) ) deallocate(utype_urb_p )

if(config_frac_seaice) then
if(allocated(chs_sea) ) deallocate(chs_sea )
if(allocated(chs2_sea) ) deallocate(chs2_sea )
if(allocated(cqs2_sea) ) deallocate(cqs2_sea )
if(allocated(cpm_sea) ) deallocate(cpm_sea )
if(allocated(hfx_sea) ) deallocate(hfx_sea )
if(allocated(qfx_sea) ) deallocate(qfx_sea )
if(allocated(qgh_sea) ) deallocate(qgh_sea )
if(allocated(qsfc_sea) ) deallocate(qsfc_sea )
if(allocated(lh_sea) ) deallocate(lh_sea )
if(allocated(tsk_sea) ) deallocate(tsk_sea )
if(allocated(tsk_ice) ) deallocate(tsk_ice )
if(allocated(albsi_p) ) deallocate(albsi_p )
if(allocated(icedepth_p)) deallocate(icedepth_p)
if(allocated(snowsi_p) ) deallocate(snowsi_p )
endif

if (config_lsm_scheme == "sf_ruc") then
if(allocated(rhosnf_p) ) deallocate(rhosnf_p )
Expand Down Expand Up @@ -374,7 +348,6 @@ subroutine lsm_from_MPAS(configs,mesh,diag_physics,sfc_input,its,ite)
integer,intent(in):: its,ite

!local pointers:
logical, pointer :: config_frac_seaice
character(len=StrKIND),pointer:: config_microp_scheme, &
config_convection_scheme, &
config_lsm_scheme
Expand Down Expand Up @@ -406,7 +379,6 @@ subroutine lsm_from_MPAS(configs,mesh,diag_physics,sfc_input,its,ite)
call mpas_pool_get_config(configs,'config_convection_scheme',config_convection_scheme)
call mpas_pool_get_config(configs,'config_microp_scheme' ,config_microp_scheme )
call mpas_pool_get_config(configs,'config_lsm_scheme' ,config_lsm_scheme )
call mpas_pool_get_config(configs,'config_frac_seaice' ,config_frac_seaice )

call mpas_pool_get_array(diag_physics,'acsnom' ,acsnom )
call mpas_pool_get_array(diag_physics,'acsnow' ,acsnow )
Expand Down Expand Up @@ -627,20 +599,6 @@ subroutine lsm_from_MPAS(configs,mesh,diag_physics,sfc_input,its,ite)



if(config_frac_seaice) then
do j = jts,jte
do i = its,ite
!modify the surface albedo and surface emissivity, and surface temperatures over sea-ice points:
if(xice(i).ge.xice_threshold .and. xice(i).le.1._RKIND) then
sfc_albedo_p(i,j) = (sfc_albedo(i) - 0.08_RKIND*(1._RKIND-xice(i))) / xice(i)
sfc_emiss_p(i,j) = (sfc_emiss(i) - 0.98_RKIND*(1._RKIND-xice(i))) / xice(i)
else
sfc_albedo_p(i,j) = sfc_albedo(i)
sfc_emiss_p(i,j) = sfc_emiss(i)
endif
enddo
enddo

!calculate sea-surface and sea-ice temperatures over sea-ice grid cells:
call correct_tsk_over_seaice(ims,ime,jms,jme,its,ite,jts,jte,xice_threshold,xice_p, &
tsk_p,tsk_sea,tsk_ice)
Expand All @@ -660,7 +618,6 @@ subroutine lsm_from_MPAS(configs,mesh,diag_physics,sfc_input,its,ite)
snowsi_p(i,j) = seaice_snowdepth_min
enddo
enddo
endif

do j = jts,jte
do i = its,ite
Expand Down Expand Up @@ -711,7 +668,6 @@ subroutine lsm_to_MPAS(configs,mesh,diag_physics,sfc_input,its,ite)
integer,intent(in):: its,ite

!local pointers:
logical,pointer:: config_frac_seaice

character(len=StrKIND),pointer:: config_microp_scheme, &
config_lsm_scheme
Expand Down Expand Up @@ -740,7 +696,6 @@ subroutine lsm_to_MPAS(configs,mesh,diag_physics,sfc_input,its,ite)

call mpas_pool_get_config(configs,'config_microp_scheme',config_microp_scheme)
call mpas_pool_get_config(configs,'config_lsm_scheme',config_lsm_scheme)
call mpas_pool_get_config(configs,'config_frac_seaice',config_frac_seaice)

call mpas_pool_get_array(diag_physics,'acsnom' ,acsnom )
call mpas_pool_get_array(diag_physics,'acsnow' ,acsnow )
Expand Down Expand Up @@ -909,26 +864,6 @@ subroutine lsm_to_MPAS(configs,mesh,diag_physics,sfc_input,its,ite)



if(config_frac_seaice) then
do j = jts,jte
do i = its,ite
if(xice_p(i,j).ge.xice_threshold .and. xice_p(i,j).le.1._RKIND) then
chs(i) = xice_p(i,j)*chs_p(i,j) + (1._RKIND-xice_p(i,j))*chs_sea(i,j)
chs2(i) = xice_p(i,j)*chs2_p(i,j) + (1._RKIND-xice_p(i,j))*chs2_sea(i,j)
cqs2(i) = xice_p(i,j)*cqs2_p(i,j) + (1._RKIND-xice_p(i,j))*cqs2_sea(i,j)
cpm(i) = xice_p(i,j)*cpm_p(i,j) + (1._RKIND-xice_p(i,j))*cpm_sea(i,j)
hfx(i) = xice_p(i,j)*hfx_p(i,j) + (1._RKIND-xice_p(i,j))*hfx_sea(i,j)
lh(i) = xice_p(i,j)*lh_p(i,j) + (1._RKIND-xice_p(i,j))*lh_sea(i,j)
qfx(i) = xice_p(i,j)*qfx_p(i,j) + (1._RKIND-xice_p(i,j))*qfx_sea(i,j)
qgh(i) = xice_p(i,j)*qgh_p(i,j) + (1._RKIND-xice_p(i,j))*qgh_sea(i,j)
qsfc(i) = xice_p(i,j)*qsfc_p(i,j) + (1._RKIND-xice_p(i,j))*qsfc_sea(i,j)
skintemp(i) = xice_p(i,j)*tsk_p(i,j) + (1._RKIND-xice_p(i,j))*tsk_sea(i,j)
sfc_albedo(i) = xice_p(i,j)*sfc_albedo_p(i,j) + (1._RKIND-xice_p(i,j))*0.08_RKIND
sfc_emiss(i) = xice_p(i,j)*sfc_emiss_p(i,j) + (1._RKIND-xice_p(i,j))*0.98_RKIND
endif
enddo
enddo
endif

if(config_microp_scheme .ne. 'off') then
call mpas_pool_get_array(diag_physics,'sr',sr)
Expand Down Expand Up @@ -1072,15 +1007,15 @@ subroutine driver_lsm(itimestep,configs,mesh,diag_physics,sfc_input,its,ite)
call mpas_timer_start('sf_ruc')
myjpbl = .false.

call lsmruc( spp_lsm = spp_lsm_loc , lakemodel = lakemodel , lakemask = lakemask_p, &
call ruc_land( spp_lsm = spp_lsm_loc , lakemodel = lakemodel , lakemask = lakemask_p, &
rhosnf = rhosnf_p , precipfr = precipfr_p , mosaic_lu = mosaic_lu, &
qsg = qsg_p , qvg = qvg_p , dew = dew_p, &
soilt1 = soilt1_p , tsnav = tsnav_p , acrunoff = acrunoff_p, &
snowfallac = snowfallac_p , keepfr3dflag = keepfr3d_p , stbolt = stbolt, &
graupelncv = graupelncv_p , snowncv = snowncv_p , rainncv = rainncv_p, &
qcg = qcg_p , flqc = flqc_p , flhc = flhc_p, &
landusef = landusef_p , nlcat = num_landcat , soilctop = soilf_p, &
nscat = num_soilcat , iswater = iswater , chklowq = chklowq_p, &
nscat = num_soilcat , iswater = iswater , chklowq = chklowq_p, &
sfcexc = sfcexc_p , sfcevp = sfcevp_p , myjpbl = myjpbl, &
dt = dt_pbl , ktau = itimestep , nsl = num_soils, &
rainbl = rainbl_p , snow = snow_p , snowh = snowh_p, &
Expand All @@ -1107,16 +1042,7 @@ subroutine driver_lsm(itimestep,configs,mesh,diag_physics,sfc_input,its,ite)
ims = ims , ime = ime , jms = jms , jme = jme , kms = kms , kme = kme , &
its = its , ite = ite , jts = jts , jte = jte , kts = kts , kte = kte &
)
call sfcdiags_ruclsm( &
hfx = hfx_p , qfx = qfx_p , tsk = tsk_p , qsfc = qsfc_p , chs = chs_p , &
chs2 = chs2_p , cqs2 = cqs2_p , t2 = t2m_p , th2 = th2m_p , q2 = q2_p , &
psfc2d = psfc_p , t3d = t_p , qv3d = qv_p , dz = dz_p , cp = cp , R_d = R_d , &
rovcp = rcp , rho3d = rho_p , p3d = pres2_hyd_p , snow = snow_p , cqs = cqs_p, &
ids = ids , ide = ide , jds = jds , jde = jde , kds = kds , kde = kde , &
ims = ims , ime = ime , jms = jms , jme = jme , kms = kms , kme = kme , &
its = its , ite = ite , jts = jts , jte = jte , kts = kts , kte = kte &
)
call mpas_timer_stop('sf_ruc')

case default

end select lsm_select
Expand Down
Loading