From c07042ba35ab24f669871b1d0b22fc512c47b9ba Mon Sep 17 00:00:00 2001 From: fdandria Date: Thu, 2 Oct 2014 17:39:29 +0200 Subject: [PATCH] [megs-meris-ac] added prd handling --- src/main/app-resources/megs/run.sh | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/main/app-resources/megs/run.sh b/src/main/app-resources/megs/run.sh index 9fa6e6d..ff1fc42 100755 --- a/src/main/app-resources/megs/run.sh +++ b/src/main/app-resources/megs/run.sh @@ -49,6 +49,7 @@ ciop-log "DEBUG" "Output dir: ${TMPDIR}/megs/output" megsDir=${TMPDIR}/megs/processors/MEGS_8.1/ inputDir=${megsDir}/input outputDir=${megsDir}/output +prdurls="`ciop-getparam prdurls`" mkdir -p $megsDir @@ -69,6 +70,8 @@ do then file=`basename $file` + filetype=`echo $file | cut -c 1-10` + #prepares the environment ciop-log "DEBUG" "copying templates to megsdir" mkdir -p ${megsDir}/configurations/Reference_Configuration @@ -78,32 +81,27 @@ do mkdir -p job_groups/myjob cd job_groups/myjob cp -Rv /usr/local/MEGS_8.1/templates/* . + + #sets the correct modifiers.db and value.txt + cp run/value.${filetype}.txt run/value.txt + cp run/modifiers.${filetype}.db run/modifiers.db sed -i "s#inputfile: #inputfile: $inputDir/$file#g" $megsDir/configurations/Reference_Configuration/job_groups/myjob/job.conf - sed -i "s#export DATABASE_DIR=.*#export DATABASE_DIR=$megsDir/configurations/Reference_Configuration/job_groups/myjob/run/database#g" $megsDir/configurations/Reference_Configuration/job_groups/myjob/run/run_megs.sh ciop-log "INFO" "Starting megs processor" cd $megsDir/configurations/Reference_Configuration/job_groups/myjob/run - sh run_megs.sh $inputDir/$file - #mv ../output/*.nc ${outputDir}/ - mv ../output*.N1 ${outputDir}/ + ln -s ${outputDir} output + sh run_megs.sh "$inputDir/$file" "$prdurls" cd $outputDir ciop-log "INFO" "Publishing output" - - #ciop-publish -m $outputDir/*.nc - ciop-publish -m $outputDir/*.N1 - - + ciop-publish -m $outputDir/*.* ciop-log "DEBUG" "ciop-publish exited with $?" - else ciop-log "ERROR" "Error ciop-copy output is empty" fi #clears the directory for the next file - #rm -rf $megsDir/* + rm -rf $megsDir/* done - -cp -Rv ${TMPDIR}/megs /tmp