Skip to content

Commit

Permalink
Inline post Updates (NOAA-EMC#880)
Browse files Browse the repository at this point in the history
* 1)update upp hash; 2)update inline post interface.

* update upp hash to ce258fca
  • Loading branch information
WenMeng-NOAA authored Nov 21, 2024
1 parent 8f7cab2 commit 71a4729
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 4 deletions.
1 change: 1 addition & 0 deletions io/module_write_internal_state.F90
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ module write_internal_state
integer :: ncld !< Number of hydrometeors.
integer :: nsoil !< Number of soil layers.
integer :: imp_physics !< Choice of microphysics scheme.
integer :: landsfcmdl !< Choice of land surface model.
integer :: dtp !< Physics timestep.
real,dimension(:),allocatable :: ak !< a parameter for sigma pressure level calculations.
real,dimension(:),allocatable :: bk !< b parameter for sigma pressure level calculations.
Expand Down
43 changes: 40 additions & 3 deletions io/post_fv3.F90
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,9 @@ subroutine post_getattr_fv3(wrt_int_state,grid_id)
if (trim(attName) == 'ncnsto') wrt_int_state%ntrac=varival
if (trim(attName) == 'ncld') wrt_int_state%ncld=varival
if (trim(attName) == 'nsoil') wrt_int_state%nsoil=varival
if (trim(attName) == 'fhzero') wrt_int_state%fhzero=varival
if (trim(attName) == 'imp_physics') wrt_int_state%imp_physics=varival
if (trim(attName) == 'landsfcmdl') wrt_int_state%landsfcmdl=varival
endif
else if (typekind==ESMF_TYPEKIND_R4) then
if(n==1) then
Expand Down Expand Up @@ -554,7 +556,7 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp)
no3cb, nh4cb, dusmass, ducmass, dusmass25,ducmass25, &
snownc, graupelnc, qrmax, hail_maxhailcast, &
smoke_ave,dust_ave,coarsepm_ave,swddif,swddni, &
xlaixy
xlaixy,wspd10umax,wspd10vmax
use soil, only: sldpth, sh2o, smc, stc, sllevel
use masks, only: lmv, lmh, htm, vtm, gdlat, gdlon, dx, dy, hbm2, sm, sice
use ctlblk_mod, only: im, jm, lm, lp1, jsta, jend, jsta_2l, jend_2u, jsta_m,jend_m, &
Expand Down Expand Up @@ -628,7 +630,7 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp)
!
imp_physics = wrt_int_state%imp_physics !set GFS mp physics to 99 for Zhao scheme
dtp = wrt_int_state%dtp
iSF_SURFACE_PHYSICS = 2
iSF_SURFACE_PHYSICS = wrt_int_state%landsfcmdl
spval = 9.99e20
!
! nems gfs has zhour defined
Expand Down Expand Up @@ -1367,13 +1369,48 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp)
enddo
endif

! max temporal 10m agl wind speed
if (modelname =='GFS')then
if(trim(fieldname)=='wind10m_max') then
!$omp parallel do default(none) private(i,j) shared(jsta,jend,ista,iend,spval,wspd10max,arrayr42d,sm,fillValue)
do j=jsta,jend
do i=ista, iend
wspd10max(i,j) = arrayr42d(i,j)
if (abs(arrayr42d(i,j)-fillValue) < small) wspd10max(i,j) = spval
enddo
enddo
endif
else
! max hourly 10m agl wind speed
if(trim(fieldname)=='spd10max') then
!$omp parallel do default(none) private(i,j) shared(jsta,jend,ista,iend,spval,wspd10max,arrayr42d,sm,fillValue)
do j=jsta,jend
do j=jsta,jend
do i=ista, iend
wspd10max(i,j) = arrayr42d(i,j)
if (abs(arrayr42d(i,j)-fillValue) < small) wspd10max(i,j) = spval
enddo
enddo
endif
endif !end modelname

! u comp of temporal max 10m agl wind speed
if(trim(fieldname)=='u10m_max') then
!$omp parallel do default(none) private(i,j) shared(jsta,jend,ista,iend,spval,wspd10umax,arrayr42d,sm,fillValue)
do j=jsta,jend
do i=ista, iend
wspd10umax(i,j) = arrayr42d(i,j)
if (abs(arrayr42d(i,j)-fillValue) < small) wspd10umax(i,j) = spval
enddo
enddo
endif

! v comp of temporal max 10m agl wind speed
if(trim(fieldname)=='v10m_max') then
!$omp parallel do default(none) private(i,j) shared(jsta,jend,ista,iend,spval,wspd10vmax,arrayr42d,sm,fillValue)
do j=jsta,jend
do i=ista, iend
wspd10vmax(i,j) = arrayr42d(i,j)
if (abs(arrayr42d(i,j)-fillValue) < small) wspd10vmax(i,j) = spval
enddo
enddo
endif
Expand Down

0 comments on commit 71a4729

Please sign in to comment.