From ef239edf489027f2d8be9f492b37ed50475afdfb Mon Sep 17 00:00:00 2001 From: Weiyuan Jiang Date: Mon, 17 Aug 2020 09:45:17 -0400 Subject: [PATCH] check ref time before running GEOSldas.x --- src/Applications/LDAS_App/lenkf.j.template | 64 +++++++++++++--------- 1 file changed, 39 insertions(+), 25 deletions(-) diff --git a/src/Applications/LDAS_App/lenkf.j.template b/src/Applications/LDAS_App/lenkf.j.template index e7a81d92..126e228d 100644 --- a/src/Applications/LDAS_App/lenkf.j.template +++ b/src/Applications/LDAS_App/lenkf.j.template @@ -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 ####################################################################### @@ -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 @@ -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