Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fixes for EXPID names containing periods #103

Merged
merged 3 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Deprecated

## [2.1.3] - 2024-10-08

### Fixed

- Plots package bug fixes for EXPID names containing periods and TEM diagnostics

## [2.1.2] - 2024-07-30

### Changed
Expand Down
2 changes: 1 addition & 1 deletion plots/res/epflx.gs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ endif

' set string 1 c 6 '
' set strsiz 0.12 '
' draw string 5.60501 8.4 Eliassen-Palm Flux Divergence from 'desc
' draw string 5.60501 8.4 Eliassen-Palm Flux Divergence from 'expid
' set strsiz 0.12 '
' draw string 5.60501 8.1 'season' ('nseasons') ('begdate' - 'enddate')'

Expand Down
4 changes: 2 additions & 2 deletions plots/res/epflx_diff.gs
Original file line number Diff line number Diff line change
Expand Up @@ -494,11 +494,11 @@ endif

' set strsiz 0.10 '
' set string 4 c 6 '
' draw string 2.85 8.2 'desc
' draw string 2.85 8.2 'expid
' set string 1 c 6 '
' draw string 5.6 8.2 minus'
' set string 5 c 6 '
' draw string 8.35 8.2 'desc2
' draw string 8.35 8.2 'cmpid
' set string 1 c 6 '

' set strsiz 0.10 '
Expand Down
87 changes: 39 additions & 48 deletions plots/res/plot_season.gs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ function plot_season (args)
'run getenv ENDDATE'
enddate = result

* Test to see if Source Experiment is an ANALYSIS
* -----------------------------------------------
'run getenv "ANALYSIS"'
analysis = result


'q gxout'
gxout = sublin(result,4)
gxout = subwrd(gxout,6)
Expand Down Expand Up @@ -154,7 +160,7 @@ while( num <= numrc )
basename = result
length = strlen(basename) - 3
say 'original length = 'length
'!echo 'basename' | cut -b1-'length' | cut -d. -f2 > CMPID.txt'
'!echo 'basename' | cut -b14-'length' > CMPID.txt'
'run getenv CMPID '
CMPID.num = result

Expand All @@ -167,53 +173,15 @@ while( num <= numrc )
'run getenv "TEM_NAME"'
TEM_NAME.num = result
say 'TEM_Collection = 'TEM_NAME.num
* pause

num = num + 1
endwhile

n = 1
while( n<=numfiles )
'set dfile 'n
'getinfo desc'
desc = result
node = ''
m = 1
'!remove NODE.txt'
'!basename 'desc' | cut -d. -f'm' >> NODE.txt'
'run getenv "NODE"'
node = result
EXP.n = node
say 'EXP'n' = 'EXP.n
m = m + 1
'!remove NODE.txt'
'!basename 'desc' | cut -d. -f'm' >> NODE.txt'
'run getenv "NODE"'
node = result

TEM_Collection = TEM_NAME.n
say 'NODE = 'node
say 'TEM_Collection = 'TEM_Collection

while( node != TEM_Collection )

EXP.n = EXP.n'.'node
say 'EXP'n' = 'EXP.n
m = m + 1
'!remove NODE.txt'
'!basename 'desc' | cut -d. -f'm' >> NODE.txt'
'run getenv "NODE"'
node = result
endwhile

* Generate and Use WSTAR files stored in OUTPUT directory
* -------------------------------------------------------
FILE.n = 'WSTAR_'talats'.'EXP.n
LOCATION = '../'
LOCATION = ''
FILE.num = 'WSTAR_'talats'.'CMPID.num
LOCATION = '../'
LOCATION = ''

n = n + 1
endwhile
num = num + 1
endwhile

axmax = -1e15
axmin = 1e15
Expand All @@ -228,6 +196,7 @@ n = 1
while( n<=numfiles )

'set dfile 'n
if( (analysis = true) | ( (analysis != true) & (CMPID.n != 'MERRA-2') ) )

'run getdates'
'getinfo tmin'
Expand Down Expand Up @@ -476,6 +445,10 @@ while( n<=numfiles )
* ------------------------------------------------------------------------
* ------------------------------------------------------------------------

* End if( ANALYSIS ) test
* -----------------------
endif

* End File Loop
* -------------
n = n + 1
Expand Down Expand Up @@ -613,6 +586,7 @@ while( n<=numfiles )
if( pltfile.m = n )

'set dfile 'n
if( (analysis = true) | ( (analysis != true) & (CMPID.n != 'MERRA-2') ) )
'run getdates'
'getinfo tmin'
tmin = result
Expand Down Expand Up @@ -666,6 +640,11 @@ while( n<=numfiles )
endif

endif

* ENDIF for ANALYSIS Test
* -----------------------
endif

m = m + 1
endwhile
n = n + 1
Expand Down Expand Up @@ -696,6 +675,7 @@ while( n<=numfiles )
while( m<=numfiles )
if( pltfile.m = n )
'set dfile 'n
if( (analysis = true) | ( (analysis != true) & (CMPID.n != 'MERRA-2') ) )

'set grid off'
'set xlopts 1 3 0.06'
Expand Down Expand Up @@ -857,6 +837,11 @@ while( n<=numfiles )
say 'ydif: 'ydif

endif

* ENDIF for ANALYSIS Test
* -----------------------
endif

m = m + 1
endwhile
n = n + 1
Expand Down Expand Up @@ -899,16 +884,17 @@ endif
m = 1
while( m<=numfiles )
if( pltfile.m = n )
'set dfile 'n
if( (analysis = true) | ( (analysis != true) & (CMPID.n != 'MERRA-2') ) )
if( numargs>2 )
index = id.n
tags = tags''index
if( exps = '' )
exps = EXP.n
exps = CMPID.n
else
exps = exps'.'EXP.n
exps = exps'.'CMPID.n
endif
endif
'set dfile 'n

'run getenv BEGDATE'
begdate = result
Expand Down Expand Up @@ -937,8 +923,13 @@ endif
k = 1
'!echo 'k' 6 'color.n' >> plot_'season'.stack'

'!echo \('id.n'\) ' EXP.n' >> plot_'season'.stack'
'!echo \('id.n'\) ' CMPID.n' >> plot_'season'.stack'
endif

* ENDIF for ANALYSIS Test
* -----------------------
endif

m = m + 1
endwhile
n = n + 1
Expand Down
47 changes: 35 additions & 12 deletions plots/res/setup_epflx.gs
Original file line number Diff line number Diff line change
Expand Up @@ -53,39 +53,62 @@ while( num <= numrc )
basename = result
length = strlen(basename) - 3
say 'original length = 'length
'!echo 'basename' | cut -b1-'length' > CMPID.txt'
'!echo 'basename' | cut -b14-'length' > CMPID.txt'
'run getenv CMPID '
CMPID.num = result

say ' CMPID #'num' = 'CMPID.num
say 'CTLFILE #'num' = 'CTLFILE.num

* Determine TEM Collection name
* -----------------------------
'!remove BASE.txt'
'!basename 'CTLFILE.num' >> BASE.txt'
'run getenv "BASE"'
BASE = result

m = 1
'!remove NODE.txt'
'!basename 'CTLFILE.num' | cut -d. -f'm' >> NODE.txt'
'run getenv "NODE"'
node = result
EXP = node
say 'M: 'm' EXP = 'EXP

while( EXP != CMPID.num )
m = m + 1
'!remove NODE.txt'
'!basename 'CTLFILE.num' | cut -d. -f'm' >> NODE.txt'
'run getenv "NODE"'
node = result
EXP = EXP'.'node
say 'M: 'm' EXP = 'EXP
endwhile

say 'Final EXP: 'EXP
m = m + 1

'!remove TEM_NAME.txt.'
'!basename 'CTLFILE.num' | cut -d. -f2 > TEM_NAME.txt'
'!basename 'CTLFILE.num' | cut -d. -f'm' > TEM_NAME.txt'
say 'run getenv "TEM_NAME"'
'run getenv "TEM_NAME"'
TEM_NAME.num = result
say 'TEM_Collection = 'TEM_NAME.num

'!remove EXPID.txt.'
'!echo 'CMPID.num' | cut -d. -f2 > EXPID.txt'
say 'run getenv "EXPID"'
'run getenv "EXPID"'
expid.num = result


'run setenv DFILE DFILE.'num
'run getenv DFILE'
DFILE = result
'run setenv 'DFILE' 'num


expid.num = CMPID.num
say 'EXPID.'num' = 'expid.num
say 'DFILE.'num' = 'num
pause

'xdfopen 'CTLFILE.num
if( CMPID.num = 'VERIFICATION.'expid ) ; nexpid = num ; endif
if( CMPID.num = expid ) ; nexpid = num ; endif
num = num + 1
endwhile

Expand Down Expand Up @@ -362,8 +385,8 @@ while( k > 0 )
season = subwrd(seasons,k)
if( season != '' )
k = k+1
say 'Running: epflx.gs 'expid.n' 'season' 'n'A 'output
say '-------------------------------------------------'
say 'Running epflx.gs: 'expid.n' 'TEM_NAME.n' 'season' 'n'A 'output
say '--------------------------------------------------------------'
'set x 1'
'sety'
'setz'
Expand All @@ -390,7 +413,7 @@ while( k > 0 )

n = 1
while( n<=numfiles )
if( CMPID.n != 'VERIFICATION.'expid )
if( CMPID.n != expid )
k = 1
while( k > 0 )
season = subwrd(seasons,k)
Expand Down
Loading
Loading