Skip to content

Commit

Permalink
check ref time before running GEOSldas.x
Browse files Browse the repository at this point in the history
  • Loading branch information
weiyuan-jiang committed Aug 17, 2020
1 parent 7119dce commit ef239ed
Showing 1 changed file with 39 additions and 25 deletions.
64 changes: 39 additions & 25 deletions src/Applications/LDAS_App/lenkf.j.template
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,45 @@ if( ${LSMCHOICE} == 2 ) then # CatchCN Only
ln -s /discover/nobackup/projects/gmao/ssd/land/l_data/LandBCs_files_for_mkCatchParam/V001/FPAR_CDF_Params-M09.nc4
endif

#######################################################################
# Create HISTORY Collection Directories
#######################################################################

set collections = ''
foreach line ("`cat HISTORY.rc`")
set firstword = `echo $line | awk '{print $1}'`
set firstchar = `echo $firstword | cut -c1`
set secondword = `echo $line | awk '{print $2}'`

if ( $firstword == "::" ) goto done

if ( $firstchar != "#" ) then
set collection = `echo $firstword | sed -e "s/'//g"`
set collections = `echo $collections $collection`
if ( $secondword == :: ) goto done
endif

if ( $firstword == COLLECTIONS: ) then
set collections = `echo $secondword | sed -e "s/'//g"`
endif
end

done:

@ n_c = 0
if ($POSTPROC_HIST > 0) then
foreach ThisCol ($collections)
set ref_t = `cat HISTORY.rc | grep ${ThisCol}.ref_time: | cut -d':' -f2 | cut -d',' -f1`
if ( $ref_t != '000000' ) then
echo ${ThisCol}.ref_time should be '000000'
@ n_c = $n_c + 1
endif
end
endif
if ($n_c >= 1) then
exit
endif

#######################################################################
# Domain Decomposition
#######################################################################
Expand Down Expand Up @@ -368,30 +407,6 @@ while ( $counter <= ${NUM_SGMT} )
endif
end
wait
#######################################################################
# Create HISTORY Collection Directories
#######################################################################

set collections = ''
foreach line ("`cat HISTORY.rc`")
set firstword = `echo $line | awk '{print $1}'`
set firstchar = `echo $firstword | cut -c1`
set secondword = `echo $line | awk '{print $2}'`

if ( $firstword == "::" ) goto done

if ( $firstchar != "#" ) then
set collection = `echo $firstword | sed -e "s/'//g"`
set collections = `echo $collections $collection`
if ( $secondword == :: ) goto done
endif

if ( $firstword == COLLECTIONS: ) then
set collections = `echo $secondword | sed -e "s/'//g"`
endif
end

done:

#######################################################################
# Post-Process model diagnostic output
Expand Down Expand Up @@ -422,7 +437,6 @@ while ( $counter <= ${NUM_SGMT} )
foreach ThisCol ($collections)

set ref_t = `cat HISTORY.rc | grep ${ThisCol}.ref_time: | cut -d':' -f2 | cut -d',' -f1`
if ( $ref_t != '000000' ) continue
# if monthly exists, move on to the next collection
if (-f $EXPID.${ThisCol}.monthly.$YYYY$MM.nc4) continue

Expand Down

0 comments on commit ef239ed

Please sign in to comment.