Skip to content

Commit

Permalink
1. Cleanup and improve read_fed and setup_fed codes
Browse files Browse the repository at this point in the history
   for examples, remove fed bufr obs reader, and hardcoded fed height(6500m)
2. Add namelist parameter checks
	modified:   gsi_rfv3io_mod.f90
	modified:   gsimod.F90
	modified:   obsmod.F90
	modified:   read_fed.f90
	modified:   setupfed.f90
  • Loading branch information
hongli-wang committed Oct 20, 2023
1 parent 0b470db commit 7938612
Show file tree
Hide file tree
Showing 5 changed files with 223 additions and 361 deletions.
2 changes: 1 addition & 1 deletion src/gsi/gsi_rfv3io_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2939,7 +2939,7 @@ subroutine gsi_fv3ncdf_read_ens_parallel_over_ens(filenamein,fv3filenamegin, &
end if
if( present(dbz) .and. present(fed) )then ! phyvars: dbz, fed
allocate(varname_files(2))
varname_files = (/'ref_f3d','flash_extent_density'/)
varname_files = (/'ref_f3d ','flash_extent_density'/)
elseif( present(dbz) )then ! phyvars: dbz
allocate(varname_files(1))
varname_files = (/'ref_f3d'/)
Expand Down
14 changes: 10 additions & 4 deletions src/gsi/gsimod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ module gsimod
rmesh_vr,zmesh_dbz,zmesh_vr,if_vterminal, if_model_dbz,if_model_fed,innov_use_model_fed,if_vrobs_raw,if_use_w_vr,&
minobrangedbz,maxobrangedbz,maxobrangevr,maxtiltvr,missing_to_nopcp,&
ntilt_radarfiles,whichradar,&
minobrangevr,maxtiltdbz,mintiltvr,mintiltdbz,l2rwthin,hurricane_radar
minobrangevr,maxtiltdbz,mintiltvr,mintiltdbz,l2rwthin,hurricane_radar,&
r_hgt_fed

use obsmod, only: lwrite_predterms, &
lwrite_peakwt,use_limit,lrun_subdirs,l_foreaft_thin,lobsdiag_forenkf,&
Expand Down Expand Up @@ -202,7 +203,7 @@ module gsimod
use gsi_nstcouplermod, only: gsi_nstcoupler_init_nml
use gsi_nstcouplermod, only: nst_gsi,nstinfo,zsea1,zsea2,fac_dtl,fac_tsl
use ncepnems_io, only: init_nems,imp_physics,lupp
use wrf_vars_mod, only: init_wrf_vars
use wrf_vars_mod, only: init_wrf_vars,fed_exist
use gsi_rfv3io_mod,only : fv3sar_bg_opt
use radarz_cst, only: mphyopt, MFflg
use radarz_iface, only: init_mphyopt
Expand Down Expand Up @@ -788,7 +789,8 @@ module gsimod
write_fv3_incr,incvars_to_zero,incvars_zero_strat,incvars_efold,diag_version,&
cao_check,lcalc_gfdl_cfrac,tau_fcst,efsoi_order,lupdqc,lqcoef,cnvw_option,l2rwthin,hurricane_radar,&
l_reg_update_hydro_delz, l_obsprvdiag,&
l_use_dbz_directDA, l_use_rw_columntilt, ta2tb, optconv
l_use_dbz_directDA, l_use_rw_columntilt, ta2tb, optconv, &
r_hgt_fed

! GRIDOPTS (grid setup variables,including regional specific variables):
! jcap - spectral resolution
Expand Down Expand Up @@ -1989,9 +1991,13 @@ subroutine gsimain_initialize

if (innov_use_model_fed .and. .not.if_model_fed) then
if(mype==0) write(6,*)' GSIMOD: invalid innov_use_model_fed=.true. but if_model_fed=.false.'
call die(myname_,'invalid if_model_fed, check namelist settings',335)
call die(myname_,'invalid innov_use_model_fed,if_model_fed, check namelist settings',332)
end if

if (miter > 0 .and. if_model_fed .and. .not. fed_exist) then
if(mype==0) write(6,*)' GSIMOD: invalid miter > 0 and if_model_fed=.true. but fed is not in anavinfo file'
call die(myname_,'Please add fed in anavinfo when miter > 0 and if_model_fed=.true.',334)
end if

! Ensure valid number of horizontal scales
if (nhscrf<0 .or. nhscrf>3) then
Expand Down
5 changes: 4 additions & 1 deletion src/gsi/obsmod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ module obsmod
! the obs operator in GSI
! def if_model_fed - namelist logical. True: Read in FED from background
! including from ensemble.
! def r_hgt_fed - height of fed observations
! def reduce_diag - namelist logical to produce reduced radiance diagnostic files
! def use_limit - parameter set equal to -1 if diag files produced or 0 if not diag files or reduce_diag
! def obs_setup - prefix for files passing pe relative obs data to setup routines
Expand Down Expand Up @@ -495,6 +496,7 @@ module obsmod

! ==== FED DA ===
public :: if_model_fed, innov_use_model_fed
public :: r_hgt_fed
public :: iout_fed, mype_fed
public :: dofedoneob
! --- FED DA ---
Expand Down Expand Up @@ -587,7 +589,7 @@ module obsmod

real(r_kind) perturb_fact,time_window_max,time_offset,time_window_rad
real(r_kind),dimension(50):: dmesh

real(r_kind) r_hgt_fed
integer(i_kind) nchan_total,ianldate
integer(i_kind) ndat,ndat_types,ndat_times,nprof_gps
integer(i_kind) lunobs_obs,nloz_v6,nloz_v8,nobskeep,nloz_omi
Expand Down Expand Up @@ -772,6 +774,7 @@ subroutine init_obsmod_dflts

oneobradid="KKKK"
doradaroneob=.false.
r_hgt_fed=6500_r_kind
dofedoneob=.false.
oneoblat=-999_r_kind
oneoblon=-999_r_kind
Expand Down
Loading

0 comments on commit 7938612

Please sign in to comment.