Skip to content

Commit

Permalink
Update some scripts and functions
Browse files Browse the repository at this point in the history
  • Loading branch information
natgeo-wong committed Nov 2, 2024
1 parent 2a3d946 commit 30add2c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions scripts/modifysam/modifyprm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ include(srcdir("sam.jl"))
schname = "DGW"
expname = "P1282km300V64"

if (schname == "DGW") || (schname == "LGW")
if checkschemeDGW(schname)
wtgvec = [0.02,0.05,0.1,0.2,0.5,1,2,5,10,20,50,100,200,500]
else
wtgvec = [sqrt(2),2,2*sqrt(2.5),5,5*sqrt(2)]
Expand All @@ -20,7 +20,7 @@ tprm = projectdir("exp","tmp.prm")
for wtgii in wtgvec

wtgstring = powername(wtgii,schname)
if (schname == "DGW") || (schname == "LGW")
if checkschemeDGW(schname)
wtgdmp = wtgii; wtgrlx = 1
else; wtgrlx = wtgii; wtgdmp = 1
end
Expand Down
2 changes: 1 addition & 1 deletion scripts/modifysam/modifyrun.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ expname = "P1282km300V64"
email = ""
doBuild = true

if (schname == "DGW") || (schname == "LGW")
if checkschemeDGW(schname)
pwrvec = [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)]
Expand Down
12 changes: 10 additions & 2 deletions src/sam.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,23 @@ function powername(
power :: Real,
scheme :: AbstractString
)

if (scheme == "DGW") || (scheme == "LGW")
if checkschemeDGW(scheme)
return dampingstrprnt(power)
else
return relaxscalestrprnt(power)
end

end

function checkschemeDGW(scheme::AbstractString)
if (scheme == "DGW") || (scheme == "KGW") || (scheme == "TDG")
return true
else
return false
end
end

function outstatname(
scheme :: AbstractString,
expname :: AbstractString,
Expand Down

0 comments on commit 30add2c

Please sign in to comment.