-
Notifications
You must be signed in to change notification settings - Fork 0
/
GenerateColdStartIC.csh
executable file
·64 lines (52 loc) · 1.71 KB
/
GenerateColdStartIC.csh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/csh -f
date
# Setup environment
# =================
source config/filestructure.csh
source config/modeldata.csh
source config/mpas/${MPASGridDescriptor}/mesh.csh
source config/builds.csh
source config/environment.csh
set yymmdd = `echo ${CYLC_TASK_CYCLE_POINT} | cut -c 1-8`
set hh = `echo ${CYLC_TASK_CYCLE_POINT} | cut -c 10-11`
set thisCycleDate = ${yymmdd}${hh}
set thisValidDate = ${thisCycleDate}
source ./getCycleVars.csh
# static work directory
echo "WorkDir = ${InitICDir}"
mkdir -p ${InitICDir}
cd ${InitICDir}
# ================================================================================================
## link MPAS mesh graph info and static field
rm ./x1.${MPASnCellsOuter}.graph.info*
ln -sfv $GraphInfoDir/x1.${MPASnCellsOuter}.graph.info* .
ln -sfv $GraphInfoDir/x1.${MPASnCellsOuter}.static.nc .
## link lookup tables
foreach fileGlob ($MPASLookupFileGlobs)
rm ./*${fileGlob}
ln -sfv ${MPASLookupDir}/*${fileGlob} .
end
## copy/modify dynamic streams file
rm ${StreamsFileInit}
cp -v ${initModelConfigDir}/${StreamsFileInit} .
sed -i 's@nCells@'${MPASnCellsOuter}'@' ${StreamsFileInit}
sed -i 's@forecastPrecision@'${forecastPrecision}'@' ${StreamsFileInit}
## copy/modify dynamic namelist
rm ${NamelistFileInit}
cp -v ${initModelConfigDir}/${NamelistFileInit} .
sed -i 's@startTime@'${NMLDate}'@' $NamelistFileInit
sed -i 's@nCells@'${MPASnCellsOuter}'@' $NamelistFileInit
# Run the executable
# ==================
rm ./${InitEXE}
ln -sfv ${InitBuildDir}/${InitEXE} ./
mpiexec ./${InitEXE}
# Check status
# ============
grep "Finished running the init_${MPASCore} core" log.init_${MPASCore}.0000.out
if ( $status != 0 ) then
echo "ERROR in $0 : MPAS-init failed" > ./FAIL
exit 1
endif
date
exit 0