diff --git a/GEOSaana_GridComp/GSI_GridComp/aircraftinfo.f90 b/GEOSaana_GridComp/GSI_GridComp/aircraftinfo.f90 index 44ca331..21f15e9 100644 --- a/GEOSaana_GridComp/GSI_GridComp/aircraftinfo.f90 +++ b/GEOSaana_GridComp/GSI_GridComp/aircraftinfo.f90 @@ -55,19 +55,19 @@ module aircraftinfo logical :: aircraft_t_bc_ext ! logical to turn off or on the externally supplied aircraft bias correction logical :: cleanup_tail ! logical to remove tail number no longer used logical :: upd_aircraft ! indicator if update bias at 06Z & 18Z - - integer(i_kind), parameter :: max_tail=15000 ! max tail numbers + + integer(i_kind) max_tail ! max tail numbers integer(i_kind) npredt ! predictor number integer(i_kind) ntail ! total tail number integer(i_kind) ntail_update ! new total tail number - integer(i_kind) mype_airobst ! processor reading in aircraft profile data + integer(i_kind) mype_airobst ! processor reading in aircraft profile data integer(i_kind) nsort ! used in sorting tail number - - character(len=10),dimension(max_tail):: taillist ! tail number - character(len=1),dimension(max_tail):: itail_sort ! used in sorting tail number - integer(i_kind),dimension(max_tail):: idx_tail ! index of tail - integer(i_kind),dimension(max_tail):: idx_sort ! used in sorting tail number - integer(i_kind),dimension(max_tail):: timelist ! time stamp + + character(len=10),allocatable,dimension(:):: taillist ! tail number + character(len=1),allocatable,dimension(:):: itail_sort ! used in sorting tail number + integer(i_kind),allocatable,dimension(:):: idx_tail ! index of tail + integer(i_kind),allocatable,dimension(:):: idx_sort ! used in sorting tail number + integer(i_kind),allocatable,dimension(:):: timelist ! time stamp real(r_kind):: biaspredt ! berror var for temperature bias correction coefficients real(r_kind):: upd_pred_t ! =1 update bias; =0 no update real(r_kind):: hdist_aircraft ! horizontal distance threshold for errormod_aircraft @@ -94,6 +94,8 @@ subroutine init_aircraft ! program history log: ! 2013-05-17 Zhu ! 2014-03-04 Sienkiewicz - added aircraft_t_bc_ext option +! 2024-12-10 Sienkiewicz - arrays dimensioned by 'max_tail' changed to +! allocatable arrays so 'max_tail' can be set via a namelist ! ! input argument list: ! @@ -115,7 +117,7 @@ subroutine init_aircraft aircraft_t_bc = .false. ! .true.=turn on bias correction aircraft_t_bc_pof = .false. ! .true.=turn on bias correction aircraft_t_bc_ext = .false. ! .true.=turn on bias correction - cleanup_tail = .false. ! no removal of tail number + cleanup_tail = .false. ! no removal of tail number mype_airobst = 0 upd_aircraft=.true. @@ -123,6 +125,8 @@ subroutine init_aircraft hdist_aircraft=60000.0_r_kind + max_tail = 20000 + end subroutine init_aircraft @@ -176,7 +180,7 @@ subroutine aircraftinfo_read if(verbose .and. mype == 0)print_verbose=.true. ! Determine number of entries in aircraft bias file inquire(file='aircftbias_in',exist=pcexist) - if (.not. pcexist) then + if (.not. pcexist) then write(6,*)'AIRCRAFTINFO_READ: ***ERROR*** aircftbias_in not found' call stop2(340) end if @@ -204,7 +208,7 @@ subroutine aircraftinfo_read write(6,120) ntail 120 format('AIRCRAFTINFO_READ: ntail=',1x,i6) endif - if (ntail > max_tail) then + if (ntail > max_tail) then write(6,*)'AIRCRAFTINFO_READ: ***ERROR*** ntail exceeds max_tail' write(6,*)'AIRCRAFTINFO_READ: stop program execution' call stop2(340) @@ -221,6 +225,9 @@ subroutine aircraftinfo_read ostats_t = zero_quad rstats_t = zero_quad + allocate(taillist(max_tail),itail_sort(max_tail),idx_tail(max_tail), & + idx_sort(max_tail),timelist(max_tail)) + j=0 do k=1,nlines read(lunin,100) cflg,crecord @@ -241,7 +248,7 @@ subroutine aircraftinfo_read 110 format(a10,1x,i5,9(1x,f12.6),1x,i8) ! Do not update aircraft temperature bias at 6Z and 18Z - if (.not. upd_aircraft) then + if (.not. upd_aircraft) then anal_time = iadate(4) if (anal_time==6 .or. anal_time==18) upd_pred_t = zero if (mype==0) print*, 'aircraft_info anal_time upd_pred_t=', anal_time, upd_pred_t @@ -258,7 +265,7 @@ subroutine aircraftinfo_read itail_sort(isort) = cb idx_sort(isort) = k cb0 = cb - end if + end if end do nsort = isort if (mype==0) print*, 'nsort = ', nsort @@ -279,6 +286,8 @@ subroutine aircraftinfo_write ! ! program history log: ! 2013-05-17 Yanqiu Zhu +! 2024-12-10 Sienkiewicz - arrays dimensioned by 'max_tail' changed to +! allocatable arrays so 'max_tail' can be set via a namelist ! ! input argument list: ! @@ -327,13 +336,13 @@ subroutine aircraftinfo_write end do do i=1,ntail_update csort(i) = taillist(i) - end do + end do ! cleanup tailnumber in the aircraft bias file obsolete = 0 if (cleanup_tail) then iyyyymm = iadate(1)*100+iadate(2) do i=1,ntail_update - if (abs(iyyyymm-timelist(i))>=100) then + if (abs(iyyyymm-timelist(i))>=100) then csort(i) = 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz' obsolete = obsolete+1 end if @@ -349,6 +358,7 @@ subroutine aircraftinfo_write end do close(lunout) + deallocate(taillist,itail_sort,idx_tail,idx_sort,timelist) deallocate(predt) deallocate(ostats_t,rstats_t,varA_t) @@ -420,7 +430,7 @@ subroutine indexc40(n,carrin,indx) l = n/2 + 1 ir = n - do + do if(l.gt.1) then l = l - 1 indxt = indx(l) @@ -439,7 +449,7 @@ subroutine indexc40(n,carrin,indx) i = l j = l * 2 - do + do if(j.le.ir) then if(j.lt.ir) then if(carrin(indx(j)).lt.carrin(indx(j+1))) j = j + 1 diff --git a/GEOSaana_GridComp/GSI_GridComp/etc/gsi.rc.tmpl b/GEOSaana_GridComp/GSI_GridComp/etc/gsi.rc.tmpl index 031cf30..209166a 100755 --- a/GEOSaana_GridComp/GSI_GridComp/etc/gsi.rc.tmpl +++ b/GEOSaana_GridComp/GSI_GridComp/etc/gsi.rc.tmpl @@ -62,7 +62,7 @@ &OBSQC dfact=0.75,dfact1=3.0,noiqc=.false.,oberrflg=.true.,c_varqc=0.02,blacklst=.true., use_poq7=.true.,qc_noirjaco3=.false.,qc_satwnds=.false.,cld_det_dec2bin=.true., - half_goesr_err=.false., + half_goesr_err=.false.,max_tail=15000, ! tcp_ermin=0.75,tcp_ermax=0.75, >>>AIRCFT_BIAS<<< / diff --git a/GEOSaana_GridComp/GSI_GridComp/etc/gsi_fdda_1.rc.tmpl b/GEOSaana_GridComp/GSI_GridComp/etc/gsi_fdda_1.rc.tmpl index 7e67a2c..ed67b85 100755 --- a/GEOSaana_GridComp/GSI_GridComp/etc/gsi_fdda_1.rc.tmpl +++ b/GEOSaana_GridComp/GSI_GridComp/etc/gsi_fdda_1.rc.tmpl @@ -61,16 +61,16 @@ &OBSQC dfact=0.75,dfact1=3.0,noiqc=.false.,oberrflg=.true.,c_varqc=0.02,blacklst=.true., use_poq7=.true.,qc_noirjaco3=.false.,qc_satwnds=.false.,cld_det_dec2bin=.true., - half_goesr_err=.false., + half_goesr_err=.false.,max_tail=15000, ! tcp_ermin=0.75,tcp_ermax=0.75, >>>AIRCFT_BIAS<<< / &OBS_INPUT - dmesh(1)=145.0,dmesh(2)=150.0,dmesh(3)=180.0,time_window_max=3.0, + dmesh(1)=145.0,dmesh(2)=150.0,dmesh(3)=180.0,time_window_max=3.0, / OBS_INPUT:: ! dfile dtype dplat dsis dval dthin dsfcalc obsclass - prepbufr ps null ps 0.0 0 0 ncep_prep_bufr + prepbufr ps null ps 0.0 0 0 ncep_prep_bufr prepbufr t null t 0.0 0 0 ncep_prep_bufr prepbufr_profl t null t 0.0 0 0 ncep_acftpfl_bufr prepbufr q null q 0.0 0 0 ncep_prep_bufr diff --git a/GEOSaana_GridComp/GSI_GridComp/etc/gsi_fdda_2.rc.tmpl b/GEOSaana_GridComp/GSI_GridComp/etc/gsi_fdda_2.rc.tmpl index 7e67a2c..ed67b85 100755 --- a/GEOSaana_GridComp/GSI_GridComp/etc/gsi_fdda_2.rc.tmpl +++ b/GEOSaana_GridComp/GSI_GridComp/etc/gsi_fdda_2.rc.tmpl @@ -61,16 +61,16 @@ &OBSQC dfact=0.75,dfact1=3.0,noiqc=.false.,oberrflg=.true.,c_varqc=0.02,blacklst=.true., use_poq7=.true.,qc_noirjaco3=.false.,qc_satwnds=.false.,cld_det_dec2bin=.true., - half_goesr_err=.false., + half_goesr_err=.false.,max_tail=15000, ! tcp_ermin=0.75,tcp_ermax=0.75, >>>AIRCFT_BIAS<<< / &OBS_INPUT - dmesh(1)=145.0,dmesh(2)=150.0,dmesh(3)=180.0,time_window_max=3.0, + dmesh(1)=145.0,dmesh(2)=150.0,dmesh(3)=180.0,time_window_max=3.0, / OBS_INPUT:: ! dfile dtype dplat dsis dval dthin dsfcalc obsclass - prepbufr ps null ps 0.0 0 0 ncep_prep_bufr + prepbufr ps null ps 0.0 0 0 ncep_prep_bufr prepbufr t null t 0.0 0 0 ncep_prep_bufr prepbufr_profl t null t 0.0 0 0 ncep_acftpfl_bufr prepbufr q null q 0.0 0 0 ncep_prep_bufr diff --git a/GEOSaana_GridComp/GSI_GridComp/etc/gsi_fgat_1.rc.tmpl b/GEOSaana_GridComp/GSI_GridComp/etc/gsi_fgat_1.rc.tmpl index fd5287d..434fd15 100755 --- a/GEOSaana_GridComp/GSI_GridComp/etc/gsi_fgat_1.rc.tmpl +++ b/GEOSaana_GridComp/GSI_GridComp/etc/gsi_fgat_1.rc.tmpl @@ -59,16 +59,16 @@ &OBSQC dfact=0.75,dfact1=3.0,noiqc=.false.,oberrflg=.true.,c_varqc=0.02,blacklst=.true., use_poq7=.true.,qc_noirjaco3=.false.,qc_satwnds=.false.,cld_det_dec2bin=.true., - half_goesr_err=.false., + half_goesr_err=.false.,max_tail=15000, ! tcp_ermin=0.75,tcp_ermax=0.75, >>>AIRCFT_BIAS<<< / &OBS_INPUT - dmesh(1)=145.0,dmesh(2)=150.0,dmesh(3)=180.0,time_window_max=3.0, + dmesh(1)=145.0,dmesh(2)=150.0,dmesh(3)=180.0,time_window_max=3.0, / OBS_INPUT:: ! dfile dtype dplat dsis dval dthin dsfcalc obsclass - prepbufr ps null ps 0.0 0 0 ncep_prep_bufr + prepbufr ps null ps 0.0 0 0 ncep_prep_bufr prepbufr t null t 0.0 0 0 ncep_prep_bufr prepbufr_profl t null t 0.0 0 0 ncep_acftpfl_bufr prepbufr q null q 0.0 0 0 ncep_prep_bufr diff --git a/GEOSaana_GridComp/GSI_GridComp/etc/gsi_fgat_2.rc.tmpl b/GEOSaana_GridComp/GSI_GridComp/etc/gsi_fgat_2.rc.tmpl index fd5287d..434fd15 100755 --- a/GEOSaana_GridComp/GSI_GridComp/etc/gsi_fgat_2.rc.tmpl +++ b/GEOSaana_GridComp/GSI_GridComp/etc/gsi_fgat_2.rc.tmpl @@ -59,16 +59,16 @@ &OBSQC dfact=0.75,dfact1=3.0,noiqc=.false.,oberrflg=.true.,c_varqc=0.02,blacklst=.true., use_poq7=.true.,qc_noirjaco3=.false.,qc_satwnds=.false.,cld_det_dec2bin=.true., - half_goesr_err=.false., + half_goesr_err=.false.,max_tail=15000, ! tcp_ermin=0.75,tcp_ermax=0.75, >>>AIRCFT_BIAS<<< / &OBS_INPUT - dmesh(1)=145.0,dmesh(2)=150.0,dmesh(3)=180.0,time_window_max=3.0, + dmesh(1)=145.0,dmesh(2)=150.0,dmesh(3)=180.0,time_window_max=3.0, / OBS_INPUT:: ! dfile dtype dplat dsis dval dthin dsfcalc obsclass - prepbufr ps null ps 0.0 0 0 ncep_prep_bufr + prepbufr ps null ps 0.0 0 0 ncep_prep_bufr prepbufr t null t 0.0 0 0 ncep_prep_bufr prepbufr_profl t null t 0.0 0 0 ncep_acftpfl_bufr prepbufr q null q 0.0 0 0 ncep_prep_bufr diff --git a/GEOSaana_GridComp/GSI_GridComp/etc/gsi_sens.rc.tmpl b/GEOSaana_GridComp/GSI_GridComp/etc/gsi_sens.rc.tmpl index 08faae0..72f0a6f 100755 --- a/GEOSaana_GridComp/GSI_GridComp/etc/gsi_sens.rc.tmpl +++ b/GEOSaana_GridComp/GSI_GridComp/etc/gsi_sens.rc.tmpl @@ -68,7 +68,7 @@ &OBSQC dfact=0.75,dfact1=3.0,noiqc=.false.,oberrflg=.true.,c_varqc=0.02,blacklst=.true., use_poq7=.true.,qc_noirjaco3=.false.,qc_satwnds=.false.,cld_det_dec2bin=.true., - half_goesr_err=.false., + half_goesr_err=.false.,max_tail=15000, ! tcp_ermin=0.75,tcp_ermax=0.75, >>>AIRCFT_BIAS<<< / diff --git a/GEOSaana_GridComp/GSI_GridComp/etc/obs.rc.tmpl b/GEOSaana_GridComp/GSI_GridComp/etc/obs.rc.tmpl index 2c5e2ee..b66420d 100755 --- a/GEOSaana_GridComp/GSI_GridComp/etc/obs.rc.tmpl +++ b/GEOSaana_GridComp/GSI_GridComp/etc/obs.rc.tmpl @@ -58,16 +58,16 @@ &OBSQC dfact=0.75,dfact1=3.0,noiqc=.false.,oberrflg=.true.,c_varqc=0.02,blacklst=.true., use_poq7=.true.,qc_noirjaco3=.false.,qc_satwnds=.false.,cld_det_dec2bin=.true., - half_goesr_err=.false., + half_goesr_err=.false.,max_tail=15000, ! tcp_ermin=0.75,tcp_ermax=0.75, >>>AIRCFT_BIAS<<< / &OBS_INPUT - dmesh(1)=145.0,dmesh(2)=150.0,dmesh(3)=180.0,time_window_max=3.0, + dmesh(1)=145.0,dmesh(2)=150.0,dmesh(3)=180.0,time_window_max=3.0, / OBS_INPUT:: ! dfile dtype dplat dsis dval dthin dsfcalc obsclass - prepbufr ps null ps 0.0 0 0 ncep_prep_bufr + prepbufr ps null ps 0.0 0 0 ncep_prep_bufr prepbufr t null t 0.0 0 0 ncep_prep_bufr prepbufr_profl t null t 0.0 0 0 ncep_acftpfl_bufr prepbufr q null q 0.0 0 0 ncep_prep_bufr diff --git a/GEOSaana_GridComp/GSI_GridComp/gsimod.F90 b/GEOSaana_GridComp/GSI_GridComp/gsimod.F90 index fb6c7d1..147e679 100644 --- a/GEOSaana_GridComp/GSI_GridComp/gsimod.F90 +++ b/GEOSaana_GridComp/GSI_GridComp/gsimod.F90 @@ -37,7 +37,7 @@ module gsimod use obsmod, only: l_wcp_cwm use obsmod, only: wrtgeovals use aircraftinfo, only: init_aircraft,hdist_aircraft,aircraft_t_bc_pof,aircraft_t_bc, & - aircraft_t_bc_ext,biaspredt,upd_aircraft,cleanup_tail + aircraft_t_bc_ext,max_tail,biaspredt,upd_aircraft,cleanup_tail use obs_sensitivity, only: lobsensfc,lobsensincr,lobsensjb,lsensrecompute, & lobsensadj,lobsensmin,iobsconv,llancdone,init_obsens use gsi_4dvar, only: setup_4dvar,init_4dvar,nhr_assimilation,min_offset, & @@ -77,14 +77,14 @@ module gsimod pvis,pcldch,scale_cv,estvisoe,estcldchoe,vis_thres,cldch_thres,cao_check,half_goesr_err use pcpinfo, only: npredp,diag_pcp,dtphys,deltim,init_pcp use jfunc, only: iout_iter,iguess,miter,factqmin,factqmax, & - factql,factqi,factqr,factqs,factqg, & + factql,factqi,factqr,factqs,factqg, & factv,factl,factp,factg,factw10m,facthowv,factcldch,niter,niter_no_qc,biascor,& init_jfunc,qoption,cwoption,switch_on_derivatives,tendsflag,jiterstart,jiterend,R_option,& bcoption,diurnalbc,print_diag_pcg,tsensible,lgschmidt,diag_precon,step_start,pseudo_q2,& clip_supersaturation use state_vectors, only: init_anasv,final_anasv use control_vectors, only: init_anacv,final_anacv,nrf,nvars,nrf_3d,cvars3d,cvars2d,& - nrf_var,lcalc_gfdl_cfrac + nrf_var,lcalc_gfdl_cfrac use derivsmod, only: init_anadv use berror, only: norh,ndeg,vs,bw,init_berror,hzscl,hswgt,pert_berr,pert_berr_fct,& bkgv_flowdep,bkgv_rewgtfct,bkgv_write,fpsproj,nhscrf,adjustozvar,fut2ps,cwcoveqqcov,adjustozhscl @@ -94,7 +94,7 @@ module gsimod rtma_subdomain_option,rtma_bkerr_sub2slab,nsmooth,nsmooth_shapiro,& pf2aP1,pf2aP2,pf2aP3,afact0,covmap,lreadnorm use compact_diffs, only: noq,init_compact_diffs - use jcmod, only: init_jcvars,ljcdfi,alphajc,ljcpdry,bamp_jcpdry,eps_eer,ljc4tlevs,ljclimqc + use jcmod, only: init_jcvars,ljcdfi,alphajc,ljcpdry,bamp_jcpdry,eps_eer,ljc4tlevs,ljclimqc use tendsmod, only: ctph0,stph0,tlm0 use mod_vtrans, only: nvmodes_keep,init_vtrans use mod_strong, only: l_tlnmc,reg_tlnmc_type,nstrong,tlnmc_option,& @@ -142,7 +142,7 @@ module gsimod l_cleansnow_warmts,l_conserve_thetaV,r_cleansnow_warmts_threshold, & i_conserve_thetav_iternum,l_gsd_soiltq_nudge,l_cld_bld, cld_bld_hgt, & build_cloud_frac_p, clear_cloud_frac_p, & - l_hydrometeor_bkio,nesdis_npts_rad, & + l_hydrometeor_bkio,nesdis_npts_rad, & iclean_hydro_withRef,iclean_hydro_withRef_allcol, & i_use_2mq4b,i_use_2mt4b,i_gsdcldanal_type,i_gsdsfc_uselist, & i_lightpcp,i_sfct_gross,l_use_hydroretrieval_all,l_numconc,l_closeobs,& @@ -189,8 +189,8 @@ module gsimod ! In non-ESMF mode (see below) a main program is assembled by calling these 3 ! routines in ! sequence. - - + + ! This file can be compiled in 2 different modes: an ESMF and a non-ESMF mode. ! When HAVE_ESMF ! is defined (ESMF mode), a few I/O related statements are skipped during @@ -211,7 +211,7 @@ module gsimod ! 03Oct2007 Tremolet Add DFI and lanczos-save ! 04Jan2008 Tremolet Add forecast sensitivity to observations options ! 10Sep2008 Guo Add CRTM files directory path -! 02Dec2008 Todling Remove reference to old TLM of analysis +! 02Dec2008 Todling Remove reference to old TLM of analysis ! 20Nov2008 Todling Add lferrscale to scale OMF w/ Rinv (actual fcst not guess) ! 08Dec2008 Todling Placed switch_on_derivatives,tendsflag in jcopts namelist ! 28Jan2009 Todling Remove original GMAO interface @@ -222,7 +222,7 @@ module gsimod ! 09-22-2009 Parrish Add read of namelist/hybrid_ensemble/. contains parameters used for hybrid ! ensemble option. ! 10-09-2009 Wu replace nhr_offset with min_offset since it''s 1.5 hr for regional -! 02-17-2010 Parrish add nlon_ens, nlat_ens, jcap_ens to namelist/hybrid_ensemble/, in preparation for +! 02-17-2010 Parrish add nlon_ens, nlat_ens, jcap_ens to namelist/hybrid_ensemble/, in preparation for ! dual resolution capability when running gsi in hybrid ensemble mode. ! 02-20-2010 Zhu Add init_anacv,nrf,nvars,nrf_3d for control variables; ! 02-21-2010 Parrish add jcap_ens_test to namelist/hybrid_ensemble/ so can simulate lower resolution @@ -231,7 +231,7 @@ module gsimod ! 02-25-2010 Zhu Remove berror_nvars ! 03-06-2010 Parrish add flag use_gfs_ozone to namelist SETUP--allows read of gfs ozone for regional runs ! 03-09-2010 Parrish add flag check_gfs_ozone_date to namelist SETUP--if true, date check gfs ozone -! 03-15-2010 Parrish add flag regional_ozone to namelist SETUP--if true, then turn on ozone in +! 03-15-2010 Parrish add flag regional_ozone to namelist SETUP--if true, then turn on ozone in ! regional analysis ! 03-17-2010 todling add knob for analysis error estimate (jsiga) ! 03-17-2010 Zhu Add nc3d and nvars in init_grid_vars interface @@ -253,7 +253,7 @@ module gsimod ! 05-30-2010 Todling reposition init of control and state vectors; add init_anasv; update chem ! 06-04-2010 Todling update interface to init_grid_vars ! 06-05-2010 Todling remove as,tsfc_sdv,an_amp0 from bkgerr namelist (now in anavinfo table) -! 08-10-2010 Wu add nvege_type to gridopts namelist +! 08-10-2010 Wu add nvege_type to gridopts namelist ! 08-24-2010 hcHuang add diag_aero and init_aero for aerosol observations ! 08-26-2010 Cucurull add use_compress to setup namelist, add a call to gps_constants ! 09-06-2010 Todling add Errico-Ehrendorfer parameter for E-norm used in DFI @@ -290,11 +290,11 @@ module gsimod ! 4 options ! 02-08-2012 kleist add parameters to control new 4d-ensemble-var features. ! 02-17-2012 tong add parameter merge_two_grid_ensperts to merge ensemble perturbations -! from two forecast domains to analysis domain +! from two forecast domains to analysis domain ! 05-25-2012 li/wang add TDR fore/aft sweep separation for thinning,xuguang.wang@ou.edu ! 06-12-2012 parrish remove calls to subroutines init_mpi_vars, destroy_mpi_vars. ! add calls to init_general_commvars, destroy_general_commvars. -! 10-11-2012 eliu add wrf_nmm_regional in determining logic for use_gfs_stratosphere +! 10-11-2012 eliu add wrf_nmm_regional in determining logic for use_gfs_stratosphere ! 05-14-2012 wargan add adjustozvar to adjust ozone in stratosphere ! 05-14-2012 todling defense to set nstinfo only when nst_gsi>0 ! 05-23-2012 todling add lnested_loops option @@ -310,7 +310,7 @@ module gsimod ! tdrgross_fact for tdr gross error adjustment ! 05-31-2013 wu write ext_sonde output to standard out ! 07-02-2013 parrish change tlnmc_type to reg_tlnmc_type. tlnmc_type no -! longer used for global analysis. +! longer used for global analysis. ! for regional analysis, reg_tlnmc_type=1 or 2 for two ! different regional balance methods. ! 07-10-2013 zhu add upd_pred as bias update indicator for radiance bias correction @@ -350,7 +350,7 @@ module gsimod ! 01-13-2015 Ladwig added option l_numconc ! 09-01-2015 Hu added option l_closeobs ! 10-01-2015 guo option to redistribute observations in 4d observer mode -! 07-20-2015 zhu re-structure codes for enabling all-sky/aerosol radiance assimilation, +! 07-20-2015 zhu re-structure codes for enabling all-sky/aerosol radiance assimilation, ! add radiance_mode_init, radiance_mode_destroy & radiance_obstype_destroy ! 01-28-2016 mccarty add netcdf_diag capability ! 03-02-2016 s.liu/carley - remove use_reflectivity and use i_gsdcldanal_type @@ -381,10 +381,10 @@ module gsimod ! from GSD (for RAP/HRRR application) ! 02-15-2016 Y. Wang, Johnson, X. Wang - added additional options if_vterminal, if_model_dbz, ! for radar DA, POC: xuguang.wang@ou.edu -! 08-31-2017 Li add sfcnst_comb for option to read sfc & nst combined file +! 08-31-2017 Li add sfcnst_comb for option to read sfc & nst combined file ! 10-10-2017 Wu,W added option fv3_regional and rid_ratio_fv3_regional, setup FV3, earthuv ! 01-11-2018 Yang add namelist variables required by the nonlinear transform to vis and cldch -! (Jim Purser 2018). Add estvisoe and estcldchoe to replace the hardwired +! (Jim Purser 2018). Add estvisoe and estcldchoe to replace the hardwired ! prescribed vis/cldch obs. errort in read_prepbufr. (tentatively?) ! 03-22-2018 Yang remove "logical closest_obs", previously applied to the analysis of vis and cldch. ! The option to use only the closest ob to the analysis time is now handled @@ -398,7 +398,7 @@ module gsimod ! 03-11-2019 Collard Introduce ec_amv_qc as temporary control of GOES-16/17 AMVS ! 03-14-2019 eliu add logic to turn on using full set of hydrometeors in ! obs operator and analysis -! 03-14-2019 eliu add precipitation component +! 03-14-2019 eliu add precipitation component ! 05-09-2019 mtong move initializing derivative vector here ! 06-19-2019 Hu Add option reset_bad_radbc for reseting radiance bias correction when it is bad ! 06-25-2019 Hu Add option print_obs_para to turn on OBS_PARA list @@ -407,7 +407,7 @@ module gsimod ! 08-14-2019 W. Gu add lupdqc to replace the obs errors from satinfo with diag of est(R) ! 08-14-2019 W. Gu add lqcoef to combine the inflation coefficients generated by qc with est(R) ! 10-15-2019 Wei/Martin added option lread_ext_aerosol to read in aerfXX file for NEMS aerosols; -! added option use_fv3_aero to choose between NGAC and FV3GFS-GSDChem +! added option use_fv3_aero to choose between NGAC and FV3GFS-GSDChem ! 07-14-2020 todling add adjustozhscl to scale ozone hscales (>0 will scale by this number) ! !EOP @@ -532,7 +532,7 @@ module gsimod ! (default 0.1K) ! use_compress - option to turn on the use of compressibility factors in geopotential heights ! nsig_ext - number of layers above the model top which are necessary to compute the bending angle for gpsro -! gpstop - maximum height for gpsro data assimilation. Reject anything above this height. +! gpstop - maximum height for gpsro data assimilation. Reject anything above this height. ! use_gfs_nemsio - option to use nemsio to read global model NEMS/GFS first guess ! use_fv3_aero - option to use FV3-Chem vs NGAC for global aerosol analysis ! sfcnst_comb - option to use nemsio sfc history file by regriding FV3 grid @@ -585,10 +585,10 @@ module gsimod ! lobsdiag_forenkf - if true, save linearized H operator (jacobian) in ! diagnostic file on 1st outer iteration. The Jacobian can then be used by ! the EnKF to compute ensemble perturbations in observation space. -! luse_obsdiag - use obsdiags (useful when running EnKF observers; e.g., echo Jo table) +! luse_obsdiag - use obsdiags (useful when running EnKF observers; e.g., echo Jo table) ! imp_physics - type of GFS microphysics ! lupp - if T, UPP is used and extra variables are output -! lcalc_gfdl_cfrac - if T, calculate and use GFDL cloud fraction in observation operator +! lcalc_gfdl_cfrac - if T, calculate and use GFDL cloud fraction in observation operator ! cao_check - if T, turn on cold-air-outbreak screening for quality control ! binary_diag - trigger binary diag-file output (being phased out) ! netcdf_diag - trigger netcdf diag-file output @@ -607,7 +607,7 @@ module gsimod ! add use of guess file later for regional mode. namelist/setup/gencode,factqmin,factqmax,clip_supersaturation, & - factql,factqi,factqr,factqs,factqg, & + factql,factqi,factqr,factqs,factqg, & factv,factl,factp,factg,factw10m,facthowv,factcldch,R_option,deltim,dtphys,& biascor,bcoption,diurnalbc,& niter,niter_no_qc,miter,qoption,cwoption,nhr_assimilation,& @@ -653,7 +653,7 @@ module gsimod ! nlat - number of latitudes ! nlon - number of longitudes ! hybrid - logical hybrid data file flag true=hybrid -! nlon_regional - +! nlon_regional - ! nlat_regional ! diagnostic_reg - logical for regional debugging ! update_regsfc - logical to write out updated surface fields to the @@ -679,7 +679,7 @@ module gsimod ! prior to calling radiative transfer model ! jcap_gfs - spectral truncation used to transform high wavenumber ! spectral coefficients to a coarser resolution grid, -! when use_gfs_ozone = .true. or use_gfs_stratosphere = .true. +! when use_gfs_ozone = .true. or use_gfs_stratosphere = .true. ! use_sp_eqspac - if .true., then ensemble grid is equal spaced, staggered 1/2 grid unit off ! poles. if .false., then gaussian grid assumed for ensemble (global only) ! wrf_mass_hybridcord - logical for using WRF MASS CORE with hybrid vertical coordinate @@ -779,7 +779,7 @@ module gsimod ! namelist/jcopts/ljcdfi,alphajc,switch_on_derivatives,tendsflag,ljcpdry,bamp_jcpdry,eps_eer,& - ljc4tlevs,ljclimqc + ljc4tlevs,ljclimqc ! STRONGOPTS (strong dynamic constraint) ! reg_tlnmc_type - =1 for 1st version of regional strong constraint @@ -793,7 +793,7 @@ module gsimod ! initialization (units = hours) ! period_width - defines width of transition zone from included to excluded gravity waves ! nvmodes_keep - number of vertical modes to use in implicit normal mode initialization -! baldiag_full +! baldiag_full ! baldiag_inc ! tlnmc_option : integer flag for strong constraint (various capabilities for hybrid) ! =0: no TLNMC @@ -837,6 +837,7 @@ module gsimod ! is used for predictor ! aircraft_t_bc - logical for aircraft temperature bias correction ! aircraft_t_bc_ext - logical for reading aircraft temperature bias correction from external file +! max_tail - size of aircraft bias coefficient arrays ! buddycheck_t - When true, run buddy check algorithm on temperature observations ! buddydiag_save - When true, output files containing buddy check QC info for all ! obs run through the buddy check @@ -844,7 +845,7 @@ module gsimod ! vqc - when true, use ECMWF''s non linear QC ! multiple observations at a station. Currently only applied to Ceiling ! height and visibility. -! pvis - power parameter in nonlinear transformation for vis +! pvis - power parameter in nonlinear transformation for vis ! pcldch - power parameter in nonlinear transformation for cldch ! scale_cv - scaling constant in meter ! estvisoe - estimate of vis observation error @@ -856,7 +857,7 @@ module gsimod namelist/obsqc/dfact,dfact1,erradar_inflate,tdrerr_inflate,oberrflg,& vadfile,noiqc,c_varqc,blacklst,use_poq7,hilbert_curve,tcp_refps,tcp_width,& tcp_ermin,tcp_ermax,qc_noirjaco3,qc_noirjaco3_pole,qc_satwnds,njqc,vqc,& - aircraft_t_bc_pof,aircraft_t_bc,aircraft_t_bc_ext,biaspredt,upd_aircraft,cleanup_tail,& + aircraft_t_bc_pof,aircraft_t_bc,aircraft_t_bc_ext,max_tail,biaspredt,upd_aircraft,cleanup_tail,& hdist_aircraft,buddycheck_t,buddydiag_save,vadwnd_l2rw_qc, & pvis,pcldch,scale_cv,estvisoe,estcldchoe,vis_thres,cldch_thres,cld_det_dec2bin,half_goesr_err @@ -881,10 +882,10 @@ module gsimod ! obhourset - observation delta time from analysis time ! pctswitch - if .true. innovation & oberr are relative (%) of background value ! (level ozone only) -! virtmp - if .true. temperature ob is virtual temperature, +! virtmp - if .true. temperature ob is virtual temperature, ! if .false. (default) temperature ob is sensible temperature ! obchan - if > 0, selects the channel number. If <= zero, it will use -! all channels that pass qc in setuprad. +! all channels that pass qc in setuprad. namelist/singleob_test/maginnov,magoberr,oneob_type,& oblat,oblon,obpres,obdattim,obhourset,pctswitch,virtmp,& @@ -933,8 +934,8 @@ module gsimod ! 0 <= beta_s0 <= 1, tuned for optimal performance ! =1, then ensemble information turned off ! =0, then static background turned off -! the weights are applied per vertical level such that : -! beta_s(:) = beta_s0 , vertically varying weights given to static B ; +! the weights are applied per vertical level such that : +! beta_s(:) = beta_s0 , vertically varying weights given to static B ; ! beta_e(:) = 1 - beta_s0 , vertically varying weights given ensemble derived covariance. ! If (readin_beta) then beta_s and beta_e are read from a file and beta_s0 is not used. ! s_ens_h - homogeneous isotropic horizontal ensemble localization scale (km) @@ -964,7 +965,7 @@ module gsimod ! default value = 1 (dual resolution off) ! i_en_perts_io - flag to read in ensemble perturbations in ensemble grid. ! This is to speed up RAP/HRRR hybrid runs because the -! same ensemble perturbations are used in 6 cycles +! same ensemble perturbations are used in 6 cycles ! =0: No ensemble perturbations IO (default) ! =2: skip get_gefs_for_regional and read in ensemble ! perturbations from saved files. @@ -978,10 +979,10 @@ module gsimod ! ens_fast_read - read ensemble in parallel; default '.false.' ! sst_staticB - use only static background error covariance for SST statistic ! bens_recenter - center Bens around background/guess -! upd_ens_spread - update ens spread with recentering around guess +! upd_ens_spread - update ens spread with recentering around guess ! upd_ens_localization - update ens localizations (goes together w/ upd_ens_spread) -! -! +! +! namelist/hybrid_ensemble/l_hyb_ens,uv_hyb_ens,q_hyb_ens,aniso_a_en,generate_ens,n_ens,nlon_ens,nlat_ens,jcap_ens,& pseudo_hybens,merge_two_grid_ensperts,regional_ensemble_option,full_ensemble,pwgtflg,& jcap_ens_test,beta_s0,s_ens_h,s_ens_v,readin_localization,eqspace_ensgrid,readin_beta,& @@ -990,7 +991,7 @@ module gsimod i_en_perts_io,l_ens_in_diff_time,ensemble_path,ens_fast_read,sst_staticB,& bens_recenter,upd_ens_spread,upd_ens_localization -! rapidrefresh_cldsurf (options for cloud analysis and surface +! rapidrefresh_cldsurf (options for cloud analysis and surface ! enhancement for RR appilcation ): ! dfi_radar_latent_heat_time_period - DFI forward integration window in minutes ! metar_impact_radius - metar low cloud observation impact radius in grid number @@ -1001,14 +1002,14 @@ module gsimod ! l_pbl_pseudo_surfobsq - if .true. produce pseudo-obs in PBL layer based on surface obs Q ! l_pbl_pseudo_surfobsuv - if .true. produce pseudo-obs in PBL layer based on surface obs UV ! pblh_ration - percent of the PBL height within which to add pseudo-obs (default:0.75) -! pps_press_incr - pressure increase for each additional pseudo-obs +! pps_press_incr - pressure increase for each additional pseudo-obs ! on top of previous level (default:30hPa) ! l_gsd_limit_ocean_q - if .true. do GSD limitation of Q over ocean ! l_pw_hgt_adjust - if .true. do GSD PW adjustment for model vs. obs station height ! l_limit_pw_innov - if .true. do GSD limitation of PW obs ! max_innov_pct - sets limit of PW ob to a percent of the background value (0-1) ! l_cleansnow_warmts - if .true. do GSD limitation of using retrieved snow over warn area -! (Ts > r_cleansnow_warmts_threshold) +! (Ts > r_cleansnow_warmts_threshold) ! r_cleansnow_warmts_threshold - threshold for using retrieved snow over warn area ! l_conserve_thetaV - if .true. conserve thetaV during moisture adjustment in cloud analysis ! i_conserve_thetav_iternum - iteration number for conserving thetaV during moisture adjustment @@ -1025,13 +1026,13 @@ module gsimod ! clean ! i_use_2mq4b - background used for calculate surface moisture observation ! innovation -! =0 Use Q from the 1st model level. (default) +! =0 Use Q from the 1st model level. (default) ! =1 use 2m Q as part of background -! i_use_2mt4b - background used for calculate surface temperature +! i_use_2mt4b - background used for calculate surface temperature ! observation innovation ! =0 Use T from the 1st model level. (default) -! =1 use 2m T as part of background -! i_gsdcldanal_type - options for how GSD cloud analysis should be conducted +! =1 use 2m T as part of background +! i_gsdcldanal_type - options for how GSD cloud analysis should be conducted ! =0. no cloud analysis (default) ! =1. cloud analysis after var analysis for WRF_ARW ! =2. cloud analysis after var analysis for NMMB @@ -1056,7 +1057,7 @@ module gsimod ! enlarged to bring more large negative innovation into ! analysis. ! l_numconc - namelist logical to update cloud water and cloud ice -! number concentrations. +! number concentrations. ! =false do not update num conc ! =true update num conc ! l_use_hydroretrieval_all - the precipitation analysis use reflectivity @@ -1076,7 +1077,7 @@ module gsimod ! =0 turn off ! =2 turn on ! qv_max_inc - threshold to limit the maximum water vapor increment -! ioption - interpolation option for satellite mapping +! ioption - interpolation option for satellite mapping ! =1 if selection is nearest neighbor ! =2 if selection is median of samples ! l_precip_clear_only - the precipitation analysis only clears; it does not @@ -1085,7 +1086,7 @@ module gsimod ! cld_bld_coverage - cloud coverage required for qc/qi building ! cld_clr_coverage - cloud coverage required for qc/qi clearing ! i_cloud_q_innovation - integer to choose if and how cloud obs are used -! 0= no innovations +! 0= no innovations ! 1= cloud total innovations ! 2= water vapor innovations ! 3= cloud total & water vapor innovations @@ -1226,7 +1227,7 @@ subroutine gsimain_initialize call init_grid call init_turbl call init_compact_diffs - call init_smooth_polcas + call init_smooth_polcas call init_jcvars call init_strongvars call initialize_superob_radar @@ -1245,14 +1246,14 @@ subroutine gsimain_initialize use_gfs_stratosphere,nems_nmmb_regional -! Read user input from namelists. All processor elements +! Read user input from namelists. All processor elements ! read the namelist input. SGI MPI FORTRAN does not allow ! all tasks to read from standard in (unit 5). Hence, open -! namelist to different unit number and have each task read +! namelist to different unit number and have each task read ! namelist file. #ifdef ibm_sp ! Initialize table of instruments and data types - read(5,setup) + read(5,setup) read(5,gridopts) ! call to obsmod_init_instr_table must be after setup and gridopts are read in @@ -1274,7 +1275,7 @@ subroutine gsimain_initialize call obsmod_init_instr_table(nhr_assimilation,ndat,rcname='gsiparm.anl') open(11,file='gsiparm.anl') read(11,setup,iostat=ios) - if(ios/=0) call die(myname_,'read(setup)',ios) + if(ios/=0) call die(myname_,'read(setup)',ios) close(11) open(11,file='gsiparm.anl') @@ -1359,7 +1360,7 @@ subroutine gsimain_initialize if (l4dvar) then if(reduce_diag) & call die(myname_,'Options l4dvar and reduce_diag not allowed together',99) - end if + end if ! Diagonal preconditioning is necessary for new bias correction if(newpc4pred .and. .not. diag_precon)then @@ -1368,7 +1369,7 @@ subroutine gsimain_initialize end if if( (.not.l4dvar) .and. (.not.l4densvar) ) ljcdfi=.false. - + if (l4dvar.and.lsensrecompute) then lobsensfc =lobsensfc .and.(jiterstart==jiterend) lobsensjb =lobsensjb .and.(jiterstart==jiterend) @@ -1397,9 +1398,9 @@ subroutine gsimain_initialize regional=regional.or.fv3_regional ! Currently only able to have use_gfs_stratosphere=.true. for nems_nmmb_regional=.true. - use_gfs_stratosphere=use_gfs_stratosphere.and.(nems_nmmb_regional.or.wrf_nmm_regional) - if(mype==0) write(6,*) 'in gsimod: use_gfs_stratosphere,nems_nmmb_regional,wrf_nmm_regional= ', & - use_gfs_stratosphere,nems_nmmb_regional,wrf_nmm_regional + use_gfs_stratosphere=use_gfs_stratosphere.and.(nems_nmmb_regional.or.wrf_nmm_regional) + if(mype==0) write(6,*) 'in gsimod: use_gfs_stratosphere,nems_nmmb_regional,wrf_nmm_regional= ', & + use_gfs_stratosphere,nems_nmmb_regional,wrf_nmm_regional ! Given the requested resolution, set dependent resolution parameters if(jcap_gfs == 1534)then nlat_gfs=1538 @@ -1547,8 +1548,8 @@ subroutine gsimain_initialize end do end if -! Turn off uv option if hybrid/ensemble options is false for purposes -! of TLNMC +! Turn off uv option if hybrid/ensemble options is false for purposes +! of TLNMC if (.not.l_hyb_ens) uv_hyb_ens=.false. ! Turn on derivatives if using dynamic constraint @@ -1630,14 +1631,14 @@ subroutine gsimain_initialize ! Single radiance assimilation case if (lsingleradob) then -#ifdef ibm_sp +#ifdef ibm_sp read(5,singleob_test) -#else +#else open(11,file='gsiparm.anl') read(11,singleob_test,iostat=ios) if(ios/=0) call die(myname_,'read(singleob_test)',ios) close(11) -#endif +#endif endif ! Write namelist output to standard out @@ -1697,21 +1698,21 @@ subroutine gsimain_initialize if(i_gsdcldanal_type.ne.6) call regional_io%convert_regional_guess(mype,ctph0,stph0,tlm0) endif endif - + if (regional.and.use_gfs_stratosphere) call broadcast_gfs_stratosphere_vars ! Initialize variables, create/initialize arrays call init_reg_glob_ll(mype,lendian_in) call init_grid_vars(jcap,npe,cvars3d,cvars2d,nrf_var,mype) - if (switch_on_derivatives) call init_anadv ! moved from derivsmod + if (switch_on_derivatives) call init_anadv ! moved from derivsmod call init_general_commvars call create_obsmod_vars call gpsStats_create() ! extracted from obsmod::create_obsmod_vars() call obsdiags_create() ! extracted from obsmod::create_obsmod_vars() if (passive_bc) call prad_create() ! replacing -- call obsmod::create_passive_obsmod_vars() - + ! Initialize values in radinfo call init_rad_vars @@ -1741,7 +1742,7 @@ subroutine gsimain_run(init_pass,last_pass) !--------------------------------------------------------------------------- logical :: init_pass_ logical :: last_pass_ - + init_pass_ =.false. if(present(init_pass)) init_pass_=init_pass last_pass_ =.false. @@ -1802,9 +1803,9 @@ subroutine gsimain_finalize ! Done with GSI. if (mype==0) call w3tage('GSI_ANL') - + call mpi_finalize(ierror) - + end subroutine gsimain_finalize end module gsimod