Skip to content

Commit

Permalink
Updating modifyprm.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
natgeo-wong committed Mar 23, 2024
1 parent de31c46 commit b4e4be6
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions scripts/modifysam/modifyprm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ schname = "DGW"
expname = "P1282km300V64"

if schname == "DGW"
pwrvec = [0.02,0.05,0.1,0.2,0.5,1,2,5,10,20,50,100,200,500]
wtgvec = [0.02,0.05,0.1,0.2,0.5,1,2,5,10,20,50,100,200,500]
else
pwrvec = [sqrt(2),2,2*sqrt(2.5),5,5*sqrt(2)]
pwrvec = vcat(pwrvec/10,1,pwrvec,10,pwrvec*10)
wtgvec = [sqrt(2),2,2*sqrt(2.5),5,5*sqrt(2)]
wtgvec = vcat(pwrvec/10,1,pwrvec,10,pwrvec*10)
end

tprm = projectdir("exp","tmp.prm")

for powerii in pwrvec
for wtgii in wtgvec

pwrname = dampingstrprnt(powerii)
wtgstring = dampingstrprnt(wtgii)
if schname == "DGW"
wtgdmp = wtgii; wtgrlx = 1
else; wtgrlx = wtgii; wtgdmp = 1
end

mkpath(projectdir("exp","prm",schname,expname,pwrname))
mkpath(projectdir("exp","prm",schname,expname,wtgstring))
for imember = 1 : 15
mstr = @sprintf("%02d",imember)
oprm = projectdir("run","modifysam","prmtemplates","$(schname)_$(expname).prm")
nprm = projectdir("exp","prm",schname,expname,pwrname,"member$(mstr).prm")
nprm = projectdir("exp","prm",schname,expname,wtgstring,"member$(mstr).prm")
open(tprm,"w") do fprm
open(oprm,"r") do rprm
s = read(rprm,String)
Expand All @@ -41,9 +41,9 @@ for powerii in pwrvec
write(fprm,s)
end
end
mkpath(projectdir("exp","prm",schname,expname,pwrname))
mkpath(projectdir("exp","prm",schname,expname,wtgstring))
mv(tprm,nprm,force=true)
@info "Creating new prm file for $schname $expname $pwrname ensemble member $imember"
@info "Creating new prm file for $schname $expname $wtgstring ensemble member $imember"
end

end

0 comments on commit b4e4be6

Please sign in to comment.