#! /bin/csh
#
# Runscript for pom08:
# NOTE: the # is a comment line
#
# The shellscript (runscript) "runpom08_*" on a linux machine collects
# files, compiles and executes pom08.f. For the standard POM test
# cases (iproblem below), this is the only file you need to touch.
# You may need to change places indicated by "---change---".
# One that you MUST change is the root directory which in the example
# below (for my case) is called /archive/lyo/gfdexwithpom/wmo09training/anIntroCourseNumOceanExpsUsingPOM
# So change this to something like /home/YourUserName/wmo09training/anIntroCourseNumOceanExpsUsingPOM
#
# Set run number ----------change---
# runnum=1 for 1st run, =2 for 2nd to be continued from the 1st etc
# The "runnum" should match the number on this runscript filename;
# i.e. runpom08_01 for runnum=1, ..., runpom08_36 for runnum=36 etc
set runnum = 1
#
# Set iproblem for various cases ----------change---
# Copy the iproblem you want & put after all others (e.g.below iproblem=41)
set iproblem = 1 #SEAMOUNT
set iproblem = 2 #BOX
set iproblem = 3 #COAST: requires *.dat
set iproblem = 41 #WADSEAMOUNT
set iproblem = 51 #GFD Exp 1-1a: wind in a periodic channel
set iproblem = 52 #GFD Exp 1-3a: windcurl on an f-channel
set iproblem = 53 #GFD Exp 1-3b: Taylor-Proudman Theorem
set iproblem = 101 #GFD Exp, Kuroshio-NETaiwan Interaction
set iproblem = 102 #GFD-Exp_trwvalley02_vsc1pe-4_2p5_horc; requires *.dat
set iproblem = 103 #GFD-Exp_xzupwell--eda; requires *.dat
set iproblem = 2 #BOX
#
# Set compiler ----------change---
# Put the compiler you want in the 2nd line below
set comp = pgf90
set comp = ifort
#
# Define variables bef, aft and now ------------
# to be used below to denote runs "bef"ore, "aft"er
# and this run (i.e. "now")
set now = $runnum
set bef = $now
@ bef = $bef - 1
if ($bef < 10) set bef=0$bef
set aft = $now
@ aft = $aft + 1
if ($aft < 10) set aft=0$aft
if ($now < 10) set now=0$now
echo $bef $now $aft
set inread = 1
if ( $runnum == "1" ) then
set inread = 0
endif
#
# Define various directory names ----------change---
# The following examples use the same root directory
# called /archive/lyo/gfdexwithpom/wmo09training/anIntroCourseNumOceanExpsUsingPOM
#
# rundir = directory where program will be run:
set rundir=/archive/lyo/gfdexwithpom/wmo09training/anIntroCourseNumOceanExpsUsingPOM/run_{$iproblem}
# outdir = directory where outputs will be put after program ends:
set outdir=/archive/lyo/gfdexwithpom/wmo09training/anIntroCourseNumOceanExpsUsingPOM/out_{$iproblem}
# homdir = home directory where *.f, *.nf, & *.c files are:
set homdir=/archive/lyo/gfdexwithpom/wmo09training/anIntroCourseNumOceanExpsUsingPOM
# gridandparamsdir = directory where grid* & params* are:
set gridandparamsdir=/archive/lyo/gfdexwithpom/wmo09training/anIntroCourseNumOceanExpsUsingPOM
# bconddir = directory where bcond* programs are:
set bconddir=/archive/lyo/gfdexwithpom/wmo09training/anIntroCourseNumOceanExpsUsingPOM
# runscriptdir = directory where this runscript is:
set runscriptdir=/archive/lyo/gfdexwithpom/wmo09training/anIntroCourseNumOceanExpsUsingPOM
#
# Create the run and output directories to make sure they exist ------------
mkdir $rundir
mkdir $outdir
#
# Change to the run directory ------------
cd $rundir
#
# Remove ALL files in run directory to make sure fresh (new) run ------------
rm -f *
#
# Choose netcdf or no netcdf outputs ----------change---
# Set netcdffile=pom08.nc for netcdf output, filename=pom08.nc
# Set netcdffile=nonetcdf for no netcdf output
# To make either choice, comment/uncomment the following 2 lines:
#set netcdffile=nonetcdf
set netcdffile=pom08.nc
#
# Copy the appropriate netcdf subroutine(s) ------------
cp -f $homdir/pom08.n pom08.nf
if ( $netcdffile == 'nonetcdf' ) then
rm -f pom08.nf
cp $homdir/dummy_write_netcdf.f pom08.nf
endif
#
# Copy *.f & *.c to this run directory to compile later ------------
cp $homdir/pom08.f_master pom08.f
cp $homdir/pom08.c .
#
# Copy the runscript to be moved later to outdir
cp $runscriptdir/runpom08_{$now}_assignment1 .
#
# Copy the appropriate grid & params files ------------
# "params" replaces default values set in pom08.f
cp $gridandparamsdir/grid_{$iproblem} grid
cp $gridandparamsdir/params_{$iproblem} params
#
# Copy the appropriate bcond* files ------------
cp $bconddir/bcond_standrd.f bcond.f
if ( $iproblem == "52" ) then
rm -f bcond.f
cp $bconddir/bcond_0gradbc.f bcond.f
endif
if ( $iproblem == "103" ) then
rm -f bcond.f
cp $bconddir/bcond_0gradbc.f bcond.f
endif
#
# Append nread to params ------------
echo ' nread='$inread >>params
#
# Compile ------------
if ( $netcdffile == 'nonetcdf' ) then
$comp pom08.f -o pom08.run
endif
if ( $netcdffile == 'pom08.nc' ) then
$comp pom08.f -o pom08.run /usr/local/lib/libnetcdf.a
#$comp pom08.f -o pom08.run /usr/sayre/netcdf-3.6.0/lib/libnetcdf.a
endif
#
# Copy initial cond. or other file for some iproblem ------------
if ( $iproblem == "3" ) then
cp IC.dat fort.40
endif
if ( $iproblem == "102" ) then
cp /archive/lyo/idl/mms/xhcast/pom08_trwvalley_2p5.dat .
endif
if ( $iproblem == "103" ) then
cp h.dat .
cp erf.dat .
endif
#
# Get restart file from a previous run if necessary ------------
if ( $inread == "1" ) then
rm -f fort.70 #Must remove to make sure.
ln -s $outdir/fort.71_$bef fort.70
endif
#
# Run ------------
./pom08.run > pom08.out # ASCII printout file
#
# OUTPUT FILES ------------
# pom08.nc # netCDF output file if netcdffile=pom08.nc
# pom08.out # ASCII printout; last line should say "JOB SUCCESSFULLY COMPLT.."
# # if job is successful
# fort.71 # Restart file for next run to continue this one
# fort.61 # Random-access binary file created by subr.savfield;
# # useful if pom08.nc is not created; may be turned
# # off by setting the 2nd argument list to zero in:
# # call savfield(iint,0, ...) in pom08.f
# fort.11 # ASCII print-out from subr.savfield, ra-binary write info
# fort.92 # Vorticity analysis random-access binary file
# fort.10 # ASCII print-out from vorticity analysis
#
mv -f pom08.out $outdir/pom08.out_$now
mv -f pom08.nc $outdir/pom08.nc_$now
mv -f fort.10 $outdir/fort.10_$now
mv -f fort.92 $outdir/fort.92_$now
mv -f fort.11 $outdir/fort.11_$now
mv -f fort.61 $outdir/fort.61_$now
mv -f fort.71 $outdir/fort.71_$now
mv -f params $outdir/params_$now
mv -f pom08.f $outdir/pom08.f_$now
mv -f grid $outdir/grid_$now
mv -f bcond.f $outdir/bcond.f_$now
mv -f pom08.c $outdir/pom08.c_$now
mv -f pom08.nf $outdir/pom08.nf_$now
mv -f runpom08_{$now}_assignment1 $outdir/.
mv -f fort.* $outdir/. #make sure that other outputs are also moved
#
# Clean up ------------
rm -f pom08.run
rm -f pom08.o
#
# Check to continue next run ------------
cd $runscriptdir
if (-e $outdir/fort.71_$now) then
#qsub runpom08_${aft}_assignment1
else
echo ' RESTART FILE IS NOT FOUND, NEXT JOB SUBMIT IS CANCELLED !!!!! '
endif
#
#THE END ----------------------
我用 time ./runpom08*&运行的时候说
lenovo@ubuntu:~/pom1$ time ./runpom08*&
[1] 7350
lenovo@ubuntu:~/pom1$ 00 01 02
mkdir: 无法创建目录"/archive/lyo/gfdexwithpom/wmo09training/anIntroCourseNumOceanExpsUsingPOM/run_2": 没有那个文件或目录
mkdir: 无法创建目录"/archive/lyo/gfdexwithpom/wmo09training/anIntroCourseNumOceanExpsUsingPOM/out_2": 没有那个文件或目录
/archive/lyo/gfdexwithpom/wmo09training/anIntroCourseNumOceanExpsUsingPOM/run_2: 没有那个文件或目录.
real 0m0.021s
user 0m0.000s
sys 0m0.012s
大侠们帮帮忙啦!!!跪求解决,急用!!
-
- 帖子: 5
- 注册时间: 2012-04-03 9:32
大侠们帮帮忙啦!!!跪求解决,急用!!
上次由 August920907 在 2012-04-05 11:42,总共编辑 1 次。
- 枫叶饭团
- 帖子: 14683
- 注册时间: 2010-06-16 1:05
- 系统: Mac OS X
- 来自: Tencent
- 联系:
Re: 大侠们帮帮忙啦!!!跪求解决,急用!!
在所有的mkdir加上-p参数应该就能把这报错消除了吧
-
- 帖子: 5
- 注册时间: 2012-04-03 9:32
Re: 大侠们帮帮忙啦!!!跪求解决,急用!!
加-p后,又出现有些文件无法获取。。。。
- 枫叶饭团
- 帖子: 14683
- 注册时间: 2010-06-16 1:05
- 系统: Mac OS X
- 来自: Tencent
- 联系:
Re: 大侠们帮帮忙啦!!!跪求解决,急用!!
我只是提了个解决报错的方法而已。这脚本看起来就像专业脚本,报错不应该是脚本本身。应该是你本身配置问题吧←_←August920907 写了:加-p后,又出现有些文件无法获取。。。。
-
- 帖子: 5
- 注册时间: 2012-04-03 9:32
Re: 大侠们帮帮忙啦!!!跪求解决,急用!!
还是要谢谢啦!!