Skip to content

Commit

Permalink
Merge branch 'develop' into feature/msienkie/#33_implement_NRL_acqc
Browse files Browse the repository at this point in the history
  • Loading branch information
rtodling authored Dec 13, 2021
2 parents 705d931 + 0fab182 commit 68479b0
Show file tree
Hide file tree
Showing 7 changed files with 205 additions and 45 deletions.
18 changes: 14 additions & 4 deletions src/Applications/GEOSdas_App/GEOSdas.csm
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
# - Revise multi-incremental approach for 4d-analysis
# (cost goes down with successive updates)
# - Temporarily leaving test lines commented out
# 8Dec2021 Sienkiewicz - add option for 'cleanup_tail' for aircraft bias correction
#-----------------------------------------------------------------------------

#
Expand Down Expand Up @@ -115,6 +116,7 @@
if ( !($?BOOTSTRAP) ) setenv BOOTSTRAP 0
if ( !($?CENTRAL_AGCM_PARALLEL) ) setenv CENTRAL_AGCM_PARALLEL 0
if ( !($?CHECK_DMF) ) setenv CHECK_DMF 1
if ( !($?CLEANUP_TAIL) ) setenv CLEANUP_TAIL 0
if ( !($?CONVPROG) ) setenv CONVPROG 0
if ( !($?CONVSFC) ) setenv CONVSFC 0
if ( !($?CONVUPA) ) setenv CONVUPA 0
Expand Down Expand Up @@ -913,11 +915,15 @@ exit 1
echo 'Setting aircraft_t_bc_ext to true, using external bias correction'
breaksw
case 2:
echo "s/>>>AIRCFT_BIAS<<</aircraft_t_bc=.true.,/g" >> sed_file
set cftstring = "aircraft_t_bc=.true.,"
if ( $CLEANUP_TAIL ) set cftstring = "$cftstring cleanup_tail=.true.,"
echo "s/>>>AIRCFT_BIAS<<</$cftstring/g" >> sed_file
echo 'Setting aircraft_t_bc to true, using VV.VV^2 bias correction'
breaksw
case 3:
echo "s/>>>AIRCFT_BIAS<<</aircraft_t_bc_pof=.true.,/g" >> sed_file
set cftstring = "aircraft_t_bc_pof=.true.,"
if ( $CLEANUP_TAIL ) set cftstring = "$cftstring cleanup_tail=.true.,"
echo "s/>>>AIRCFT_BIAS<<</$cftstring/g" >> sed_file
echo 'Setting aircraft_t_bc_pof to true, using POF bias correction'
breaksw
default:
Expand Down Expand Up @@ -1128,11 +1134,15 @@ exit 1
echo 'Setting aircraft_t_bc_ext to true, using external bias correction'
breaksw
case 2:
echo "s/>>>AIRCFT_BIAS<<</aircraft_t_bc=.true.,/g" >> sed_file
set cftstring = "aircraft_t_bc=.true.,"
if ( $CLEANUP_TAIL ) set cftstring = "$cftstring cleanup_tail=.true.,"
echo "s/>>>AIRCFT_BIAS<<</$cftstring/g" >> sed_file
echo 'Setting aircraft_t_bc to true, using VV.VV^2 bias correction'
breaksw
case 3:
echo "s/>>>AIRCFT_BIAS<<</aircraft_t_bc_pof=.true.,/g" >> sed_file
set cftstring = "aircraft_t_bc_pof.true.,"
if ( $CLEANUP_TAIL ) set cftstring = "$cftstring cleanup_tail=.true.,"
echo "s/>>>AIRCFT_BIAS<<</$cftstring/g" >> sed_file
echo 'Setting aircraft_t_bc_pof to true, using POF bias correction'
breaksw
default:
Expand Down
18 changes: 14 additions & 4 deletions src/Applications/GSI_App/fvssi
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
if ( !($?ANA4DUPD_IAU0_ONLY) ) setenv ANA4DUPD_IAU0_ONLY 0 # assume 4d increment
if ( !($?ANGLEBC) ) setenv ANGLEBC 0
if ( !($?BATCH_SUBCMD) ) setenv BATCH_SUBCMD "sbatch"
if ( !($?CLEANUP_TAIL) ) setenv CLEANUP_TAIL 0
if ( !($?DATAMOVE_CONSTRAINT) ) setenv DATAMOVE_CONSTRAINT NULL
if ( !($?INCSENS) ) setenv INCSENS 0
if ( !($?GSI_NETCDF_DIAG) ) setenv GSI_NETCDF_DIAG 0
Expand Down Expand Up @@ -742,11 +743,15 @@
echo 'Setting aircraft_t_bc_ext to true, using external bias correction'
breaksw
case 2:
echo "s/>>>AIRCFT_BIAS<<</aircraft_t_bc=.true.,/g" >> sed_file
set cftstring = "aircraft_t_bc=.true.,"
if ( $CLEANUP_TAIL ) set cftstring = "$cftstring cleanup_tail=.true.,"
echo "s/>>>AIRCFT_BIAS<<</$cftstring/g" >> sed_file
echo 'Setting aircraft_t_bc to true, using VV.VV^2 bias correction'
breaksw
case 3:
echo "s/>>>AIRCFT_BIAS<<</aircraft_t_bc_pof=.true.,/g" >> sed_file
set cftstring = "aircraft_t_bc_pof=.true.,"
if ( $CLEANUP_TAIL ) set cftstring = "$cftstring cleanup_tail=.true.,"
echo "s/>>>AIRCFT_BIAS<<</$cftstring/g" >> sed_file
echo 'Setting aircraft_t_bc_pof to true, using POF bias correction'
breaksw
default:
Expand Down Expand Up @@ -842,11 +847,15 @@
echo 'Setting aircraft_t_bc_ext to true, using external bias correction'
breaksw
case 2:
echo "s/>>>AIRCFT_BIAS<<</aircraft_t_bc=.true.,/g" >> sed_file
set cftstring = "aircraft_t_bc=.true.,"
if ( $CLEANUP_TAIL ) set cftstring = "$cftstring cleanup_tail=.true.,"
echo "s/>>>AIRCFT_BIAS<<</$cftstring/g" >> sed_file
echo 'Setting aircraft_t_bc to true, using VV.VV^2 bias correction'
breaksw
case 3:
echo "s/>>>AIRCFT_BIAS<<</aircraft_t_bc_pof=.true.,/g" >> sed_file
set cftstring = "aircraft_t_bc_pof=.true.,"
if ( $CLEANUP_TAIL ) set cftstring = "$cftstring cleanup_tail=.true.,"
echo "s/>>>AIRCFT_BIAS<<</$cftstring/g" >> sed_file
echo 'Setting aircraft_t_bc_pof to true, using POF bias correction'
breaksw
default:
Expand Down Expand Up @@ -984,6 +993,7 @@ ENVIRONMENT VARIABLES
ENVIRONMENT VARIABLES (optional)
ACFTBIAS sets aircraft bias correction
CLEANUP_TAIL triggers cleanup of aircraft coefficient file
ANASENS trigger for analysis sensitivity (obs impact)
INCSENS allows running adjoint GSI with analysis increment for input
DO4DVAR trigger for 4DVAR-related features
Expand Down
2 changes: 1 addition & 1 deletion src/Applications/NCEP_Etc/NCEP_bkgecov/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ esma_add_library (${this}
DEPENDENCIES NCEP_bacio_r4i4 NCEP_w3_r4i4 NCEP_sp_r4i4 GMAO_gfio_r8 GMAO_hermes GMAO_transf ${MKL_LIBRARIES}
)

target_compile_definitions(${this} PRIVATE _LAPACK_ gmao_intf)
add_definitions (-D_LAPACK_ -Dgmao_intf)

ecbuild_add_executable(TARGET calcstats.x SOURCES statsmain.F90 LIBS ${this} ${MKL_LIBRARIES})
ecbuild_add_executable(TARGET write_berror_global.x SOURCES write_berror_global.f90 LIBS ${this} ${MKL_LIBRARIES})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
! note: biasrm=.false. means do bias correction - go figure!
fnm0=>>>NMODES<<<,vectype=5,biasrm=.false.,laddoz=.false.,
LBAL=.true.,
nreaders=8,
nreaders=16,
readperts=.true.,
! Debug only:
! calchrzscl=.false.,
Expand Down
65 changes: 38 additions & 27 deletions src/Applications/NCEP_Etc/NCEP_bkgecov/ut_gen_berrcov.j
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/csh -x
#SBATCH --account=g0613
#SBATCH --constraint=hasw
#SBATCH --ntasks=1
#SBATCH --constraint=sky
#_SBATCH --ntasks=8
#_SBATCH --ntasks=24
#_SBATCH --ntasks=96
#_SBATCH --ntasks=384
#SBATCH --ntasks=672
#_SBATCH --ntasks-per-node=24
#SBATCH --time=12:00:00
#SBATCH --qos=dastest
Expand All @@ -22,7 +22,7 @@

setenv DRYRUN #echo
setenv SKIPSETTING 0
setenv MYNCPUS 4
setenv MYNCPUS 8
# Set initial time and number of samples required
setenv EXPID x0039_p5_REPLAY_L132
setenv EXPID x41Lrt
Expand All @@ -32,33 +32,38 @@
setenv EXPID f525_p7_fp
setenv EXPID f522_fp
setenv EXPID f525_fp
setenv EXPID f5271_fp
#setenv FVHOME /home/dao_ops/$EXPID
#setenv ARCROOT /home/dao_ops/$EXPID/run/.../archive/prog
#setenv FVHOME /discover/nobackup/projects/gmao/obsdev/rtodling/$EXPID
#setenv FVHOME /discover/nobackup/projects/gmao/obsdev/rtodling/x0041
setenv FVHOME /discover/nobackup/projects/gmao/dadev/rtodling/x0043rt
setenv FVHOME /discover/nobackup/projects/gmao/dadev/rtodling/prePP
setenv FVROOT `cat $FVHOME/.FVROOT`
setenv PLAINDIR 0
setenv ARCROOT /archive/u/$user/$EXPID/prog
if ( $EXPID == "x0041" ) then
setenv ARCROOT /archive/u/dao_it/$EXPID/prog
endif
if ( $EXPID == "f521_fp" || $EXPID == "f522_fp" || $EXPID == "f525_fp" || $EXPID == "f525_p5_fp" || $EXPID == "f525_p7_fp" ) then
if ( $EXPID == "f521_fp" || $EXPID == "f522_fp" || $EXPID == "f525_fp" || $EXPID == "f525_p5_fp" || $EXPID == "f525_p7_fp" || $EXPID == "f5271_fp" ) then
setenv ARCROOT /home/dao_ops/$EXPID/run/.../archive/prog
endif
if ($EXPID == "x0039_p5_REPLAY_L132") then
setenv ARCROOT /gpfsm/dnb78s1/projects/p18/ltakacs/REPLAY_Experiments/x0039_p5_REPLAY_L132/forecasts/Regular_RPLFRQ:7200_ANA:x0039_p5
setenv PLAINDIR 1
endif
setenv DMGET 0
setenv GET_SET 1
setenv DMGET 0
setenv GET_SET 0

setenv DO_ACQUIRE 1
setenv GEN_NMCDIFFS 1
setenv DO_ACQUIRE 0
setenv GEN_NMCDIFFS 0

setenv GET_BERROR 0
setenv GET_BERROR 1
setenv BERROR_NMODES 25

set JCAP = 512
set NLON = 576
set NLAT = 361

# Basic settings (weak dependency on version of DAS)
# --------------------------------------------------
set path = ( . $FVROOT/bin $path )
Expand All @@ -72,9 +77,9 @@ setenv FCSTWORK /discover/nobackup/projects/gmao/obsdev/$user/fcst4berrcov.$EXPI
setenv FCSTWORK /discover/nobackup/projects/gmao/dadev/$user/fcst4berrcov.$EXPID

if ($?I_MPI_ROOT ) then
setenv MPIRUN_CALCSTATS "mpirun -np 32 calcstats.x"
setenv MPIRUN_CALCSTATS "mpirun -np 96 calcstats.x"
else
setenv MPIRUN_CALCSTATS "mpirun_exec -np 32 calcstats.x"
setenv MPIRUN_CALCSTATS "mpirun_exec -np 96 calcstats.x"
endif
#
# initial verification date and number of samples (will get samples ahead of initial date)
Expand All @@ -85,6 +90,8 @@ set vnymd0 = 20181101
set vnymd0 = 20200203
set vnymd0 = 20200401
set vnymd0 = 20200301
set vnymd0 = 20210203 # start
set vnymd0 = 20210305
#if ( $EXPID == "f522_fp") then
# set vnymd0 = 20190304
# @ nsamples = 350
Expand All @@ -94,8 +101,8 @@ set vnymd0 = 20200301
#endif
set vnhms0 = 000000
@ nsamples = 31
setenv FCSTWRK $FCSTWORK.$vnymd0.$vnhms0
mkdir -p $FCSTWRK/BERROR.WORK
#setenv FCSTWRK $FCSTWORK.$vnymd0.$vnhms0
setenv FCSTWRK $FCSTWORK.all
set diren = `dirname $FCSTWRK`
set spool = "-s $diren/spool "

Expand All @@ -106,8 +113,8 @@ if ( $GET_SET ) then
set foffset_hr = 3 # offset in initial time from synoptic hour
set nmc_hrv = 24 # begin time of NMC method / verification time
set nmc_hrf = 48 # end time of NMC method / fcst time
set vmn = 00 # either black or 00
set vmn = # either black or 00
set vmn = 00 # either black or 00

# ----------------------------------
# No user change from this part down
Expand Down Expand Up @@ -181,8 +188,13 @@ if ( $GET_SET ) then
set inidate = ( `tick $inidate $gap_sc` )
end

set lst = `cat $acqfile`
if (-e missing.txt ) /bin/rm missing.txt
touch missing.txt
foreach fn ($lst)
if (! -e $fn ) echo $fn >> missing.txt
end
if ( $DMGET ) then
set lst = `cat $acqfile`
echo $lst
dmget $lst
exit
Expand Down Expand Up @@ -295,32 +307,31 @@ endif # GEN_NMCDIFFS
if ( $GET_BERROR ) then

if ( ! -d $FCSTWRK/BERROR.WORK ) mkdir -p $FCSTWRK/BERROR.WORK
cd $FCSTWRK/BERROR.WORK

# Get positioned and set namelist parameters
# ------------------------------------------
cd $FCSTWRK/BERROR.WORK/

mkdir samples
cd samples
ln -sf $FCSTWRK/NMC48m24/*f48m24*nc4 .
cd -

# Get set to run berror stats code
# --------------------------------
if (-e infiles ) /bin/rm infiles
cat $FCSTWRK/shrt_fcst.txt >> infiles
cat $FCSTWRK/long_fcst.txt >> infiles
# cat $FCSTWRK/shrt_fcst.txt >> infiles
# cat $FCSTWRK/long_fcst.txt >> infiles
ls samples/*f48m24*nc4 > infiles
ln -sf infiles fort.10

# just for the record ...
ls -lrt samples

# Figure out dimensions of forecast files (assumes that checking one suffices)
# ----------------------------------------------------------------------------
set fcst_files = (`cat samples`)
set fcst_files = (`cat infiles`)
set fcst_res = (`getgfiodim.x $fcst_files[1]`)

# wire for now
set JCAP = 512
set NSIG = $fcst_res[3]
set NLON = 576
set NLAT = 361

# Prepare resource files
set this_param = $FVROOT/etc/berror_stats.nml.tmpl
Expand Down
Loading

0 comments on commit 68479b0

Please sign in to comment.