Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions src/Applications/GEOSdas_App/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
add_subdirectory(testsuites)
add_subdirectory(jedi)
add_subdirectory(swell)

set(dasscripts
FixUnblocked.csh
Expand Down
99 changes: 85 additions & 14 deletions src/Applications/GEOSdas_App/GEOSdas.csm
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@
# (cost goes down with successive updates)
# - Temporarily leaving test lines commented out
# 8Dec2021 Sienkiewicz - add option for 'cleanup_tail' for aircraft bias correction
# 3Dec2026 Yu - JEDI_AnalysisRun_: selected by GEOSJEDI (FVDAS_Run_Config),
# 1 = GEOSdas_App/jedi (jedi_driver.csh),
# 2 = GEOSdas_App/swell (swell_driver.csh)
# - CoupleAnaToGcm_: with GEOSJEDI=2 and SWELL_IAU_OVERWRITE=1 (4D-IAU), no GSI
# IAU tendencies; the JEDI IAU (swell_mkiau.csh/swell_upd4geos.csh) drives the GCM
#-----------------------------------------------------------------------------

#
Expand Down Expand Up @@ -3318,23 +3323,61 @@ endif
if ( $?ECHO___ ) set echo
#

if ( ! -d $FVHOME/run/jedi ) exit (0)
if ( -e $FVHOME/run/AGCM.BOOTSTRAP.rc.tmpl ) exit (0) # only run from second cycle of experiment onwards
# GEOSJEDI (FVDAS_Run_Config): 1 = JEDI (GEOSdas_App/jedi), 2 = JEDI via swell (GEOSdas_App/swell)
if ( ! $?GEOSJEDI ) then
if ( -d $FVHOME/run/jedi ) then
echo "JEDI_AnalysisRun_: $FVHOME/run/jedi exists, but GEOSJEDI is not set:"
echo "JEDI_AnalysisRun_: experiment set up before the GEOSJEDI switch; add"
echo "JEDI_AnalysisRun_: setenv GEOSJEDI 1"
echo "JEDI_AnalysisRun_: to $FVHOME/run/FVDAS_Run_Config, aborting ..."
Call AbnormalExit_( 1 )
endif
exit (0)
endif
if ( "$GEOSJEDI" != "1" && "$GEOSJEDI" != "2" ) exit (0)

@ idummy = $VAROFFSET * 60
set ana_datetime = ( `tick $gcm_nymd0 $gcm_nhms0 $idummy` )

set this_hh0 = `echo $gcm_nhms0 | cut -c1-2`
set this_hha = `echo $ana_datetime[2] | cut -c1-2`
set drvlog = $FVWORK/$EXPID.jedi_drv.log.${gcm_nymd0}_${this_hh0}z.txt

# first cycle of the experiment: no JEDI analysis
if ( -e $FVHOME/run/AGCM.BOOTSTRAP.rc.tmpl ) then
if ( "$GEOSJEDI" == "1" ) then
exit (0) # only run from second cycle of experiment onwards
else if ( "$GEOSJEDI" == "2" ) then
# no central analysis (no cubed backgrounds yet), but this cycle's
# observations ($SWELL_OBS_SHARE) for the swell ensemble analysis
swell_driver.csh $gcm_nymd0 $gcm_nhms0 $ana_datetime[1] $ana_datetime[2] obsonly |& tee -a $drvlog
set jedi_rc = $status
if ( ! -e $FVWORK/.DONE_swell_driver.csh.obsonly.$ana_datetime[1]$this_hha ) set jedi_rc = 1
if ( $jedi_rc ) then
echo "JEDI observations for the ensemble failed, aborting ..."
Call AbnormalExit_( 1 )
endif
exit (0) # only run the analysis from second cycle of experiment onwards
endif
endif

if ( ! $SKIPGSI && ! -e $FVHOME/run/AGCM.BOOTSTRAP.rc.tmpl ) then
set this_log = $EXPID.ana_jo.log.${ana_datetime[1]}_${this_hha}z.txt
obimp_summary.pl -rc $FVROOT/etc/odsstats4jedi.rc -type diag -josummary -o $this_log $ana_datetime[1] $ana_datetime[2]
endif


jedi_driver.csh $gcm_nymd0 $gcm_nhms0 $ana_datetime[1] $ana_datetime[2] 0 |& tee -a $FVWORK/$EXPID.jedi_drv.log.${gcm_nymd0}_${this_hh0}z.txt
if ( $status ) then
# (endif resets $status: keep the driver's status)
set jedi_rc = 0
if ( "$GEOSJEDI" == "1" ) then
jedi_driver.csh $gcm_nymd0 $gcm_nhms0 $ana_datetime[1] $ana_datetime[2] 0 |& tee -a $drvlog
set jedi_rc = $status
else if ( "$GEOSJEDI" == "2" ) then
swell_driver.csh $gcm_nymd0 $gcm_nhms0 $ana_datetime[1] $ana_datetime[2] |& tee -a $drvlog
set jedi_rc = $status
if ( ! -e $FVWORK/.DONE_swell_driver.csh.$ana_datetime[1]$this_hha ) set jedi_rc = 1
endif
if ( $jedi_rc ) then
echo "JEDI analysis failed, aborting ..."
Call AbnormalExit_( 1 )
endif
Expand Down Expand Up @@ -3541,6 +3584,27 @@ endif
if ( $DO4DIAU ) then # Perform 4D-analysis update (from GSI increments) &
# generate 4D-GCM forcing terms (IAU tendencies)

# GEOSJEDI=2 with SWELL_IAU_OVERWRITE=1 (run/swell/swell_config.csh), after the
# first cycle: the JEDI analysis drives the GCM. GSI still makes its ana.eta, but
# no IAU tendencies; swell_mkiau.csh/swell_upd4geos.csh (JEDI_AnalysisRun_) make
# the IAU tendencies, agcm09/ana09 and the central analysis of the ensemble.
set jedi_iau = 0
if ( $?GEOSJEDI ) then
if ( "$GEOSJEDI" == "1" ) then
# GEOSdas_App/jedi: GSI IAU tendencies as before
else if ( "$GEOSJEDI" == "2" ) then
if ( ! -e $FVHOME/run/AGCM.BOOTSTRAP.rc.tmpl && -e $FVHOME/run/swell/swell_config.csh ) then
set jedi_iau = `csh -fc 'source $FVHOME/run/swell/swell_config.csh; printenv SWELL_IAU_OVERWRITE'`
endif
endif
endif
if ( "$jedi_iau" != "1" ) set jedi_iau = 0
set iauopt = ( -iau )
if ( $jedi_iau ) then
set iauopt = ( )
echo "CoupleAnaToGcm_: GEOSJEDI=2, SWELL_IAU_OVERWRITE=1: no GSI IAU, GEOS will use the JEDI IAU"
endif

#_RT if ( -e $anafile ) then
#_RT # get original analysis out of the way (it will be re-created)
#_RT /bin/mv $anafile $anafile.orig
Expand All @@ -3555,7 +3619,7 @@ endif
end
endif

ana4dupd.pl -ncpus 7 -iau -iter $Viter_ -rcdir . $updrst0 \
ana4dupd.pl -ncpus 7 $iauopt -iter $Viter_ -rcdir . $updrst0 \
$EXPID $beg_ana[1] $beg_ana[2] \
$end_ana[1] $end_ana[2] $ASYNBKG
set my_status = $status
Expand All @@ -3571,10 +3635,12 @@ endif
end
endif

set agcmfn = `echorc.x -template $EXPID $beg_ana[1] $beg_ana[2] iau_tendency_filename`
/bin/ln -sf $agcmfn agcm_import_rst
if ( ! $jedi_iau ) then
set agcmfn = `echorc.x -template $EXPID $beg_ana[1] $beg_ana[2] iau_tendency_filename`
/bin/ln -sf $agcmfn agcm_import_rst
endif

if ( ($HYBRIDGSI != "/dev/null") && (! -e $FVHOME/run/atmens_replay.acq) ) then
if ( ($HYBRIDGSI != "/dev/null") && (! -e $FVHOME/run/atmens_replay.acq) && (! $jedi_iau) ) then
if ( $Final_ && ($STAGE4HYBGSI != "/dev/null") ) then
rndasfiles -stage $STAGE4HYBGSI $EXPID ana.eta $beg_ana[1] $beg_ana[2] \
$end_ana[1] $end_ana[2] $ASYNBKG 99
Expand All @@ -3584,17 +3650,22 @@ endif
endif

# save ana/xinc files at end time-slot before these are overwritten by cycle
set ana09upa = `echorc.x -template $EXPID $end_ana[1] $end_ana[2] upper-air_ana09_filename`
set ana_upa = `echorc.x -template $EXPID $end_ana[1] $end_ana[2] upper-air_ana_filename`
/bin/cp $ana_upa $ana09upa
# (with the JEDI IAU, swell_upd4geos.csh saves the JEDI ana09 and agcm09)
if ( ! $jedi_iau ) then
set ana09upa = `echorc.x -template $EXPID $end_ana[1] $end_ana[2] upper-air_ana09_filename`
set ana_upa = `echorc.x -template $EXPID $end_ana[1] $end_ana[2] upper-air_ana_filename`
/bin/cp $ana_upa $ana09upa
endif

set xinc09upa = `echorc.x -template $EXPID $end_ana[1] $end_ana[2] upper-air_xinc09_filename`
set xinc_upa = `echorc.x -template $EXPID $end_ana[1] $end_ana[2] upper-air_xinc_filename`
/bin/cp $xinc_upa $xinc09upa

set iau09inc = `echorc.x -template $EXPID $end_ana[1] $end_ana[2] iau09_tendency_filename`
set iau_inc = `echorc.x -template $EXPID $end_ana[1] $end_ana[2] iau_tendency_filename`
/bin/cp $iau_inc $iau09inc
if ( ! $jedi_iau ) then
set iau09inc = `echorc.x -template $EXPID $end_ana[1] $end_ana[2] iau09_tendency_filename`
set iau_inc = `echorc.x -template $EXPID $end_ana[1] $end_ana[2] iau_tendency_filename`
/bin/cp $iau_inc $iau09inc
endif

else # Regular (3D) IAU

Expand Down
Loading