Skip to content

Commit

Permalink
Merge branch 'feature/v16x_allsky' of https://github.com/emilyhcliu/GSI
Browse files Browse the repository at this point in the history
… into feature/v16x_allsky
  • Loading branch information
emilyhcliu committed Apr 20, 2022
2 parents 935a64b + 5bf6001 commit 33b8a04
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 81 deletions.
2 changes: 0 additions & 2 deletions modulefiles/modulefile.ProdGSI.hera
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#module-whatis " NOAA-EMC/GSI whatis description"

setenv CRTM_FIX /scratch2/NCEPDEV/nwprod/NCEPLIBS/fix/crtm_v2.3.0
#setenv CRTM_FIX /scratch2/NCEPDEV/nwprod/hpc-stack/libs/hpc-stack/intel-18.0.5.274/crtm/2.4.0/fix

# Load cmake
module use -a /contrib/cmake/modulefiles
Expand Down Expand Up @@ -42,6 +41,5 @@ module load w3nco/2.4.1
module load w3emc/2.7.3
module load bacio/2.4.1
module load crtm/2.3.0
#module load crtm/2.4.0
module load netcdf/4.7.4
module load wrf_io/1.2.0
9 changes: 6 additions & 3 deletions src/gsi/antcorr_application.f90
Original file line number Diff line number Diff line change
Expand Up @@ -225,16 +225,19 @@ END SUBROUTINE Remove_AntCorr
SUBROUTINE Apply_AntCorr( AC , & ! Input
iFOV, & ! Input
T ) ! In/Output

use kinds,only: i_kind, r_kind

implicit none

! Arguments
TYPE(ACCoeff_type), INTENT(IN) :: AC
INTEGER , INTENT(IN) :: iFOV
REAL(fp) , INTENT(IN OUT) :: T(:)
INTEGER(i_kind) , INTENT(IN) :: iFOV
REAL(r_kind) , INTENT(IN OUT) :: T(:)
! Local parameters
CHARACTER(*), PARAMETER :: ROUTINE_NAME = 'Apply_AntCorr'
! Local variables
INTEGER :: l
INTEGER(i_kind) :: l

! Check input
IF ( iFOV < 1 .OR. iFOV > AC%n_FOVS ) THEN
Expand Down
6 changes: 3 additions & 3 deletions src/gsi/cplr_gfs_ensmod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1057,8 +1057,8 @@ subroutine parallel_read_gfsnc_state_(en_full,m_cvars2d,m_cvars3d,nlon,nlat,nsig
enddo
deallocate(rwork3d1)

! if (k3u==0.or.k3v==0.or.k3t==0.or.k3q==0.or.k3cw==0.or.k3oz==0) & !orig
if (k3u==0.or.k3v==0.or.k3t==0.or.k3q==0.or.k3oz==0) & !emily
! if (k3u==0.or.k3v==0.or.k3t==0.or.k3q==0.or.k3cw==0.or.k3oz==0) &
if (k3u==0.or.k3v==0.or.k3t==0.or.k3q==0.or.k3oz==0) &
write(6,'(" WARNING, problem with one of k3-")')

do k=1,nsig
Expand Down Expand Up @@ -1361,7 +1361,7 @@ subroutine get_gfs_ens(this,grd,member,ntindex,atm_bundle,iret)
else if ( use_gfs_ncio ) then
if (fv3_full_hydro) then
call general_read_gfsatm_allhydro_nc(grd,sp_ens,filename,uv_hyb_ens,.false., &
zflag,atm_bundle,.true.,iret)
zflag,atm_bundle,iret)
else
call general_read_gfsatm_nc(grd,sp_ens,filename,uv_hyb_ens,.false., &
zflag,atm_bundle,.true.,iret)
Expand Down
6 changes: 2 additions & 4 deletions src/gsi/general_read_gfsatm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2571,7 +2571,7 @@ subroutine general_read_gfsatm_nc(grd,sp_a,filename,uvflag,vordivflag,zflag, &

end subroutine general_read_gfsatm_nc
subroutine general_read_gfsatm_allhydro_nc(grd,sp_a,filename,uvflag,vordivflag,zflag, &
gfs_bundle,init_head,iret_read)
gfs_bundle,iret_read)
!$$$ subprogram documentation block
! . . . .
! subprogram: general_read_gfsatm_nc adaptation of read_gfsatm for general resolutions
Expand All @@ -2595,8 +2595,6 @@ subroutine general_read_gfsatm_allhydro_nc(grd,sp_a,filename,uvflag,vordivflag,z
! vordivflag - logical to determine if routine should output vorticity and
! divergence
! zflag - logical to determine if surface height field should be output
! init_head- flag to read header record. Usually .true. unless repeatedly
! reading similar files (ensembles)
!
! output argument list:
! gfs_bundle - bundle carrying guess fields
Expand Down Expand Up @@ -2632,7 +2630,7 @@ subroutine general_read_gfsatm_allhydro_nc(grd,sp_a,filename,uvflag,vordivflag,z
type(sub2grid_info) ,intent(in ) :: grd
type(spec_vars) ,intent(in ) :: sp_a
character(*) ,intent(in ) :: filename
logical ,intent(in ) :: uvflag,zflag,vordivflag,init_head
logical ,intent(in ) :: uvflag,zflag,vordivflag
integer(i_kind) ,intent( out) :: iret_read
type(gsi_bundle) ,intent(inout) :: gfs_bundle

Expand Down
4 changes: 1 addition & 3 deletions src/gsi/netcdfgfs_io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ subroutine read_
use kinds, only: i_kind,r_kind
use constants, only: qcmin
use gridmod, only: sp_a,grd_a,lat2,lon2,nsig
! use guess_grids, only: ifilesig,nfldsig
use guess_grids, only: ifilesig,nfldsig,ntguessig
use gsi_metguess_mod, only: gsi_metguess_bundle
use gsi_bundlemod, only: gsi_bundlegetpointer
Expand All @@ -137,7 +136,6 @@ subroutine read_
character(len=*),parameter::myname_=myname//'*read_'
character(24) filename
integer(i_kind):: it, istatus, inner_vars, num_fields
integer(i_kind):: iret_ql,iret_qi,iret_qr,iret_qs,iret_qg
integer(i_kind):: i,j,k


Expand Down Expand Up @@ -206,7 +204,7 @@ subroutine read_
if (fv3_full_hydro) then
if (mype==0) write(*,*) 'calling general_read_gfsatm_allhydro_nc', it
call general_read_gfsatm_allhydro_nc(grd_t,sp_a,filename,.true.,.true.,.true.,&
atm_bundle,.true.,istatus) ! this loads cloud and precip
atm_bundle,istatus) ! this loads cloud and precip
if (mype==0) write(*,*) 'done with general_read_gfsatm_allhydro_nc', it
else
if (mype==0) write(*,*) 'calling general_read_gfsatm_nc'
Expand Down
16 changes: 9 additions & 7 deletions src/gsi/qcmod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2807,9 +2807,9 @@ subroutine qc_avhrr(nchanl,is,ndat,nsig,ich,sea,land,ice,snow,luse, &
end subroutine qc_avhrr

subroutine qc_amsua(nchanl,is,ndat,nsig,npred,sea,land,ice,snow,mixed,luse, &
zsges,cenlat,tb_obsbc1,si_mean,cosza,clw,tbc,ptau5,emissivity_k,ts, &
zsges,cenlat,tb_obsbc1,cosza,clw,tbc,ptau5,emissivity_k,ts, &
pred,predchan,id_qc,aivals,errf,errf0,clwp_amsua,varinv,cldeff_obs,cldeff_fg,factch6, &
cld_rbc_idx,sfc_speed,error0,clw_guess_retrieval,scatp,radmod)
cld_rbc_idx,sfc_speed,error0,clw_guess_retrieval,scatp,radmod,si_mean)

!$$$ subprogram documentation block
! . . .
Expand Down Expand Up @@ -2890,7 +2890,8 @@ subroutine qc_amsua(nchanl,is,ndat,nsig,npred,sea,land,ice,snow,mixed,luse, &
logical, intent(in ) :: sea,land,ice,snow,mixed,luse
integer(i_kind), intent(in ) :: ndat,nsig,npred,nchanl,is
integer(i_kind),dimension(nchanl), intent(inout) :: id_qc
real(r_kind), intent(in ) :: zsges,cenlat,tb_obsbc1,si_mean
real(r_kind), intent(in ) :: zsges,cenlat,tb_obsbc1
real(r_kind), optional, intent(in ) :: si_mean
real(r_kind),dimension(nchanl), intent(in ) :: cldeff_obs,cldeff_fg
real(r_kind), intent(in ) :: cosza,clw,clwp_amsua,clw_guess_retrieval
real(r_kind), intent(in ) :: sfc_speed,scatp
Expand Down Expand Up @@ -3614,9 +3615,9 @@ subroutine qc_mhs(nchanl,ndat,nsig,is,sea,land,ice,snow,mhs,luse, &

end subroutine qc_mhs
subroutine qc_atms(nchanl,is,ndat,nsig,npred,sea,land,ice,snow,mixed,luse, &
zsges,cenlat,tb_obsbc1,si_mean,cosza,clw,tbc,ptau5,emissivity_k,ts, &
zsges,cenlat,tb_obsbc1,cosza,clw,tbc,ptau5,emissivity_k,ts, &
pred,predchan,id_qc,aivals,errf,errf0,clwp_amsua,varinv,cldeff_obs,cldeff_fg,factch6, &
cld_rbc_idx,sfc_speed,error0,clw_guess_retrieval,scatp,radmod)
cld_rbc_idx,sfc_speed,error0,clw_guess_retrieval,scatp,radmod,si_mean)

!$$$ subprogram documentation block
! . . .
Expand Down Expand Up @@ -3687,7 +3688,8 @@ subroutine qc_atms(nchanl,is,ndat,nsig,npred,sea,land,ice,snow,mixed,luse, &
logical, intent(in ) :: sea,land,ice,snow,mixed,luse
integer(i_kind), intent(in ) :: nchanl,is,ndat,nsig,npred
integer(i_kind),dimension(nchanl), intent(inout) :: id_qc
real(r_kind), intent(in ) :: zsges,cenlat,tb_obsbc1,si_mean
real(r_kind), intent(in ) :: zsges,cenlat,tb_obsbc1
real(r_kind), optional, intent(in ) :: si_mean
real(r_kind),dimension(nchanl), intent(in ) :: cldeff_obs, cldeff_fg
real(r_kind), intent(in ) :: cosza,clw,clwp_amsua,clw_guess_retrieval
real(r_kind), intent(in ) :: sfc_speed,scatp
Expand All @@ -3703,7 +3705,7 @@ subroutine qc_atms(nchanl,is,ndat,nsig,npred,sea,land,ice,snow,mixed,luse, &

! For now, just pass all channels to qc_amsua
call qc_amsua (nchanl,is,ndat,nsig,npred,sea,land,ice,snow,mixed,luse, &
zsges,cenlat,tb_obsbc1,si_mean,cosza,clw,tbc,ptau5,emissivity_k,ts, &
zsges,cenlat,tb_obsbc1,cosza,clw,tbc,ptau5,emissivity_k,ts, &
pred,predchan,id_qc,aivals,errf,errf0,clwp_amsua,varinv,cldeff_obs,cldeff_fg,factch6, &
cld_rbc_idx,sfc_speed,error0,clw_guess_retrieval,scatp,radmod)

Expand Down
4 changes: 2 additions & 2 deletions src/gsi/setuprad.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1373,7 +1373,7 @@ subroutine setuprad(obsLL,odiagLL,lunin,mype,aivals,stats,nchanl,nreal,nobs,&
end if

call qc_amsua(nchanl,is,ndat,nsig,npred,sea,land,ice,snow,mixed,luse(n), &
zsges,cenlat,tb_obsbc1,si_mean,cosza,clw_obs,tbc,ptau5,emissivity_k,ts, &
zsges,cenlat,tb_obsbc1,cosza,clw_obs,tbc,ptau5,emissivity_k,ts, &
pred,predchan,id_qc,aivals,errf,errf0,clw_obs,varinv,cldeff_obs,cldeff_fg,factch6, &
cld_rbc_idx,sfc_speed,error0,clw_guess_retrieval,scatp,radmod)

Expand Down Expand Up @@ -1414,7 +1414,7 @@ subroutine setuprad(obsLL,odiagLL,lunin,mype,aivals,stats,nchanl,nreal,nobs,&
si_mean= half*(si_obs+si_fg)

call qc_atms(nchanl,is,ndat,nsig,npred,sea,land,ice,snow,mixed,luse(n), &
zsges,cenlat,tb_obsbc1,si_mean,cosza,clw_obs,tbc,ptau5,emissivity_k,ts, &
zsges,cenlat,tb_obsbc1,cosza,clw_obs,tbc,ptau5,emissivity_k,ts, &
pred,predchan,id_qc,aivals,errf,errf0,clw_obs,varinv,cldeff_obs,cldeff_fg,factch6, &
cld_rbc_idx,sfc_speed,error0,clw_guess_retrieval,scatp,radmod)

Expand Down
114 changes: 57 additions & 57 deletions src/gsi/write_incr.f90
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ subroutine write_fv3_inc_ (grd,sp_a,filename,mype_out,gfs_bundle,ibin)
use obsmod, only: ianldate
use state_vectors, only: allocate_state, deallocate_state

use state_vectors, only: svars3d, ns3d
use state_vectors, only: svars3d
use mpeu_util, only: getindex

implicit none
Expand Down Expand Up @@ -134,7 +134,7 @@ subroutine write_fv3_inc_ (grd,sp_a,filename,mype_out,gfs_bundle,ibin)
hyaivarid, hybivarid, uvarid, vvarid, delpvarid, delzvarid, &
tvarid, sphumvarid, liqwatvarid, o3varid, icvarid, &
qrvarid, qsvarid, qgvarid
integer(i_kind) :: icw,iql,iqi,iqr,iqs,iqg
integer(i_kind) :: iql,iqi,iqr,iqs,iqg
integer(i_kind) :: dimids3(3),nccount(3),ncstart(3), cnksize(3), j1, j2

type(gsi_bundle) :: svalinc(nobs_bins)
Expand Down Expand Up @@ -446,17 +446,17 @@ subroutine write_fv3_inc_ (grd,sp_a,filename,mype_out,gfs_bundle,ibin)
call mpi_barrier(mpi_comm_world,ierror)
! liquid water increment
if (iql>0) then
do k=1,grd%nsig
krev = grd%nsig+1-k
if (zero_increment_strat('liq_wat_inc')) then
call zero_inc_strat(qlsm(:,:,k), k, troplev)
end if
if (should_zero_increments_for('liq_wat_inc')) qlsm(:,:,k) = 0.0_r_kind
out3d(:,:,krev) = transpose(qlsm(j1:j2,:,k))
end do
call nccheck_incr(nf90_put_var(ncid_out, liqwatvarid, sngl(out3d), &
start = ncstart, count = nccount))
call mpi_barrier(mpi_comm_world,ierror)
do k=1,grd%nsig
krev = grd%nsig+1-k
if (zero_increment_strat('liq_wat_inc')) then
call zero_inc_strat(qlsm(:,:,k), k, troplev)
end if
if (should_zero_increments_for('liq_wat_inc')) qlsm(:,:,k) = 0.0_r_kind
out3d(:,:,krev) = transpose(qlsm(j1:j2,:,k))
end do
call nccheck_incr(nf90_put_var(ncid_out, liqwatvarid, sngl(out3d), &
start = ncstart, count = nccount))
call mpi_barrier(mpi_comm_world,ierror)
endif
! ozone increment
do k=1,grd%nsig
Expand All @@ -472,59 +472,59 @@ subroutine write_fv3_inc_ (grd,sp_a,filename,mype_out,gfs_bundle,ibin)
call mpi_barrier(mpi_comm_world,ierror)
! ice mixing ratio increment
if (iqi>0) then
do k=1,grd%nsig
krev = grd%nsig+1-k
if (zero_increment_strat('icmr_inc')) then
call zero_inc_strat(qism(:,:,k), k, troplev)
end if
if (should_zero_increments_for('icmr_inc')) qism(:,:,k) = 0.0_r_kind
out3d(:,:,krev) = transpose(qism(j1:j2,:,k))
end do
call nccheck_incr(nf90_put_var(ncid_out, icvarid, sngl(out3d), &
start = ncstart, count = nccount))
call mpi_barrier(mpi_comm_world,ierror)
do k=1,grd%nsig
krev = grd%nsig+1-k
if (zero_increment_strat('icmr_inc')) then
call zero_inc_strat(qism(:,:,k), k, troplev)
end if
if (should_zero_increments_for('icmr_inc')) qism(:,:,k) = 0.0_r_kind
out3d(:,:,krev) = transpose(qism(j1:j2,:,k))
end do
call nccheck_incr(nf90_put_var(ncid_out, icvarid, sngl(out3d), &
start = ncstart, count = nccount))
call mpi_barrier(mpi_comm_world,ierror)
endif
! rain water mixing ratio increment
if (iqr>0) then
do k=1,grd%nsig
krev = grd%nsig+1-k
if (zero_increment_strat('rwmr_inc')) then
call zero_inc_strat(qrsm(:,:,k), k, troplev)
end if
if (should_zero_increments_for('rwmr_inc')) qrsm(:,:,k) = 0.0_r_kind
out3d(:,:,krev) = transpose(qrsm(j1:j2,:,k))
end do
call nccheck_incr(nf90_put_var(ncid_out, qrvarid, sngl(out3d), &
start = ncstart, count = nccount))
call mpi_barrier(mpi_comm_world,ierror)
do k=1,grd%nsig
krev = grd%nsig+1-k
if (zero_increment_strat('rwmr_inc')) then
call zero_inc_strat(qrsm(:,:,k), k, troplev)
end if
if (should_zero_increments_for('rwmr_inc')) qrsm(:,:,k) = 0.0_r_kind
out3d(:,:,krev) = transpose(qrsm(j1:j2,:,k))
end do
call nccheck_incr(nf90_put_var(ncid_out, qrvarid, sngl(out3d), &
start = ncstart, count = nccount))
call mpi_barrier(mpi_comm_world,ierror)
endif
! snow water mixing ratio increment
if (iqs>0) then
do k=1,grd%nsig
krev = grd%nsig+1-k
if (zero_increment_strat('snmr_inc')) then
call zero_inc_strat(qssm(:,:,k), k, troplev)
end if
if (should_zero_increments_for('snmr_inc')) qssm(:,:,k) = 0.0_r_kind
out3d(:,:,krev) = transpose(qssm(j1:j2,:,k))
end do
call nccheck_incr(nf90_put_var(ncid_out, qsvarid, sngl(out3d), &
start = ncstart, count = nccount))
call mpi_barrier(mpi_comm_world,ierror)
do k=1,grd%nsig
krev = grd%nsig+1-k
if (zero_increment_strat('snmr_inc')) then
call zero_inc_strat(qssm(:,:,k), k, troplev)
end if
if (should_zero_increments_for('snmr_inc')) qssm(:,:,k) = 0.0_r_kind
out3d(:,:,krev) = transpose(qssm(j1:j2,:,k))
end do
call nccheck_incr(nf90_put_var(ncid_out, qsvarid, sngl(out3d), &
start = ncstart, count = nccount))
call mpi_barrier(mpi_comm_world,ierror)
endif
! graupel mixing ratio increment
if (iqg>0) then
do k=1,grd%nsig
krev = grd%nsig+1-k
if (zero_increment_strat('grle_inc')) then
call zero_inc_strat(qgsm(:,:,k), k, troplev)
end if
if (should_zero_increments_for('grle_inc')) qgsm(:,:,k) = 0.0_r_kind
out3d(:,:,krev) = transpose(qgsm(j1:j2,:,k))
end do
call nccheck_incr(nf90_put_var(ncid_out, qgvarid, sngl(out3d), &
start = ncstart, count = nccount))
call mpi_barrier(mpi_comm_world,ierror)
do k=1,grd%nsig
krev = grd%nsig+1-k
if (zero_increment_strat('grle_inc')) then
call zero_inc_strat(qgsm(:,:,k), k, troplev)
end if
if (should_zero_increments_for('grle_inc')) qgsm(:,:,k) = 0.0_r_kind
out3d(:,:,krev) = transpose(qgsm(j1:j2,:,k))
end do
call nccheck_incr(nf90_put_var(ncid_out, qgvarid, sngl(out3d), &
start = ncstart, count = nccount))
call mpi_barrier(mpi_comm_world,ierror)
endif
! ! cleanup and exit
call nccheck_incr(nf90_close(ncid_out))
Expand Down

0 comments on commit 33b8a04

Please sign in to comment.