-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3052 from DongchenZ/SDA_dongchen
Sda dongchen
- Loading branch information
Showing
14 changed files
with
238 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash -l | ||
|
||
# redirect output | ||
exec 3>&1 | ||
exec &> "@OUTDIR@/logfile.txt" | ||
|
||
# host specific setup | ||
@HOST_SETUP@ | ||
@CDO_SETUP@ | ||
|
||
# create output folder | ||
mkdir -p "@OUTDIR@" | ||
|
||
# see if application needs running | ||
if [ ! -e "@OUTDIR@/sipnet.out" ]; then | ||
cd "@RUNDIR@" | ||
ln -s "@SITE_MET@" sipnet.clim | ||
|
||
"@BINARY@" | ||
STATUS=$? | ||
|
||
# copy output | ||
mv "@RUNDIR@/sipnet.out" "@OUTDIR@" | ||
|
||
# check the status | ||
if [ $STATUS -ne 0 ]; then | ||
echo -e "ERROR IN MODEL RUN\nLogfile is located at '@OUTDIR@/logfile.txt'" >&3 | ||
exit $STATUS | ||
fi | ||
|
||
# convert to MsTMIP | ||
echo "require (PEcAn.SIPNET) | ||
model2netcdf.SIPNET('@OUTDIR@', @SITE_LAT@, @SITE_LON@, '@START_DATE@', '@END_DATE@', @DELETE.RAW@, '@REVISION@', '@PREFIX@', @OVERWRITE@, @CONFLICT@) | ||
" | R --no-save | ||
fi | ||
|
||
# copy readme with specs to output | ||
cp "@RUNDIR@/README.txt" "@OUTDIR@/README.txt" | ||
|
||
# run getdata to extract right variables | ||
|
||
# host specific teardown | ||
@HOST_TEARDOWN@ | ||
|
||
# all done | ||
echo -e "MODEL FINISHED\nLogfile is located at '@OUTDIR@/logfile.txt'" >&3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.