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

Recover the capability of handling model fields from operation gfs.v16.3 #785

Merged
merged 3 commits into from
Aug 22, 2024
Merged
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
177 changes: 89 additions & 88 deletions src/gsi/general_read_gfsatm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3588,99 +3588,100 @@ subroutine general_read_gfsatm_allhydro_nc(grd,sp_a,filename,uvflag,vordivflag,z
if ( icount == icm .or. k==nlevs) then
call general_reload2(grd,g_z,g_ps,g_tv,g_vor,g_div,g_u,g_v,g_q,g_oz, &
g_ql,g_qi,g_qr,g_qs,g_qg,icount,iflag,ilev,work,uvflag,vordivflag,g_ni,g_nr)
endif
enddo ! do k=1,nlevs

do k=1,nlevs
icount=icount+1
iflag(icount)=15
ilev(icount)=k
kr = levs+1-k ! netcdf is top to bottom, need to flip
endif
enddo ! do k=1,nlevs
RussTreadon-NOAA marked this conversation as resolved.
Show resolved Hide resolved

if (mype==mype_use(icount)) then
call read_vardata(filges, 'nccice', rwork3d0, nslice=kr, slicedim=3)
! cloud ice water number concentration.
if ( diff_res ) then
grid_b=rwork3d0(:,:,1)
vector(1)=.false.
call fill2_ns(grid_b,grid_c(:,:,1),latb+2,lonb)
call g_egrid2agrid(p_high,grid_c,grid2,1,1,vector)
do kk=1,grd%itotsub
i=grd%ltosi_s(kk)
j=grd%ltosj_s(kk)
work(kk)=grid2(i,j,1)
enddo
else
grid=rwork3d0(:,:,1)
call general_fill_ns(grd,grid,work)
endif
endif
if ( icount == icm .or. k==nlevs ) then
call general_reload2(grd,g_z,g_ps,g_tv,g_vor,g_div,g_u,g_v,g_q,g_oz, &
g_ql,g_qi,g_qr,g_qs,g_qg,icount,iflag,ilev,work,uvflag,vordivflag,g_ni,g_nr)
endif
enddo ! do k=1,nlevs
! Read fields specific to Thompson microphysics
if (imp_physics == 8) then
RussTreadon-NOAA marked this conversation as resolved.
Show resolved Hide resolved
do k=1,nlevs
icount=icount+1
iflag(icount)=15
ilev(icount)=k
kr = levs+1-k ! netcdf is top to bottom, need to flip

do k=1,nlevs
icount=icount+1
iflag(icount)=16
ilev(icount)=k
kr = levs+1-k ! netcdf is top to bottom, need to flip
if (mype==mype_use(icount)) then
call read_vardata(filges, 'nccice', rwork3d0, nslice=kr, slicedim=3)
! cloud ice water number concentration.
if ( diff_res ) then
grid_b=rwork3d0(:,:,1)
vector(1)=.false.
call fill2_ns(grid_b,grid_c(:,:,1),latb+2,lonb)
call g_egrid2agrid(p_high,grid_c,grid2,1,1,vector)
do kk=1,grd%itotsub
i=grd%ltosi_s(kk)
j=grd%ltosj_s(kk)
work(kk)=grid2(i,j,1)
enddo
else
grid=rwork3d0(:,:,1)
call general_fill_ns(grd,grid,work)
endif
endif
if ( icount == icm .or. k==nlevs ) then
call general_reload2(grd,g_z,g_ps,g_tv,g_vor,g_div,g_u,g_v,g_q,g_oz, &
g_ql,g_qi,g_qr,g_qs,g_qg,icount,iflag,ilev,work,uvflag,vordivflag,g_ni,g_nr)
endif
enddo ! do k=1,nlevs

if (mype==mype_use(icount)) then
call read_vardata(filges, 'nconrd', rwork3d0, nslice=kr, slicedim=3)
! rain number concentration.
if ( diff_res ) then
grid_b=rwork3d0(:,:,1)
vector(1)=.false.
call fill2_ns(grid_b,grid_c(:,:,1),latb+2,lonb)
call g_egrid2agrid(p_high,grid_c,grid2,1,1,vector)
do kk=1,grd%itotsub
i=grd%ltosi_s(kk)
j=grd%ltosj_s(kk)
work(kk)=grid2(i,j,1)
enddo
else
grid=rwork3d0(:,:,1)
call general_fill_ns(grd,grid,work)
endif
endif
if ( icount == icm .or. k==nlevs) then
call general_reload2(grd,g_z,g_ps,g_tv,g_vor,g_div,g_u,g_v,g_q,g_oz, &
g_ql,g_qi,g_qr,g_qs,g_qg,icount,iflag,ilev,work,uvflag,vordivflag,g_ni,g_nr)
endif
enddo ! do k=1,nlevs
do k=1,nlevs
icount=icount+1
iflag(icount)=16
ilev(icount)=k
kr = levs+1-k ! netcdf is top to bottom, need to flip

! do k=1,nlevs
! icount=icount+1
! iflag(icount)=17
! ilev(icount)=k
! kr = levs+1-k ! netcdf is top to bottom, need to flip
!
! if (mype==mype_use(icount)) then
! call read_vardata(filges, 'cld_amt', rwork3d0, nslice=kr, slicedim=3)
! ! Cloud amount (cloud fraction).
! if ( diff_res ) then
! grid_b=rwork3d0(:,:,1)
! vector(1)=.false.
! call fill2_ns(grid_b,grid_c(:,:,1),latb+2,lonb)
! call g_egrid2agrid(p_high,grid_c,grid2,1,1,vector)
! do kk=1,grd%itotsub
! i=grd%ltosi_s(kk)
! j=grd%ltosj_s(kk)
! work(kk)=grid2(i,j,1)
! enddo
! else
! grid=rwork3d0(:,:,1)
! call general_fill_ns(grd,grid,work)
! endif
if (mype==mype_use(icount)) then
call read_vardata(filges, 'nconrd', rwork3d0, nslice=kr, slicedim=3)
! rain number concentration.
if ( diff_res ) then
grid_b=rwork3d0(:,:,1)
vector(1)=.false.
call fill2_ns(grid_b,grid_c(:,:,1),latb+2,lonb)
call g_egrid2agrid(p_high,grid_c,grid2,1,1,vector)
do kk=1,grd%itotsub
i=grd%ltosi_s(kk)
j=grd%ltosj_s(kk)
work(kk)=grid2(i,j,1)
enddo
else
grid=rwork3d0(:,:,1)
call general_fill_ns(grd,grid,work)
endif
endif
if ( icount == icm .or. k==nlevs) then
call general_reload2(grd,g_z,g_ps,g_tv,g_vor,g_div,g_u,g_v,g_q,g_oz, &
g_ql,g_qi,g_qr,g_qs,g_qg,icount,iflag,ilev,work,uvflag,vordivflag,g_ni,g_nr)
endif
enddo ! do k=1,nlevs
endif ! imp_physics
! do k=1,nlevs
RussTreadon-NOAA marked this conversation as resolved.
Show resolved Hide resolved
! icount=icount+1
! iflag(icount)=17
! ilev(icount)=k
! kr = levs+1-k ! netcdf is top to bottom, need to flip
!
! endif
! if ( icount == icm .or. k==nlevs ) then
! call general_reload2(grd,g_z,g_ps,g_tv,g_vor,g_div,g_u,g_v,g_q,g_oz, &
! g_ql,g_qi,g_qr,g_qs,g_qg,icount,iflag,ilev,work,uvflag,vordivflag,g_cf)
! endif
! enddo ! do k=1,nlevs
! if (mype==mype_use(icount)) then
! call read_vardata(filges, 'cld_amt', rwork3d0, nslice=kr, slicedim=3)
! ! Cloud amount (cloud fraction).
! if ( diff_res ) then
! grid_b=rwork3d0(:,:,1)
! vector(1)=.false.
! call fill2_ns(grid_b,grid_c(:,:,1),latb+2,lonb)
! call g_egrid2agrid(p_high,grid_c,grid2,1,1,vector)
! do kk=1,grd%itotsub
! i=grd%ltosi_s(kk)
! j=grd%ltosj_s(kk)
! work(kk)=grid2(i,j,1)
! enddo
! else
! grid=rwork3d0(:,:,1)
! call general_fill_ns(grd,grid,work)
! endif
! endif
! if ( icount == icm .or. k==nlevs ) then
! call general_reload2(grd,g_z,g_ps,g_tv,g_vor,g_div,g_u,g_v,g_q,g_oz, &
! g_ql,g_qi,g_qr,g_qs,g_qg,icount,iflag,ilev,work,uvflag,vordivflag,g_cf)
! endif
! enddo ! do k=1,nlevs

else ! read_2m

Expand Down
Loading