Skip to content

Commit

Permalink
Updates for TEM_Diag to include ALL Times
Browse files Browse the repository at this point in the history
  • Loading branch information
lltakacs committed Nov 9, 2024
1 parent 1c88bb9 commit c3a4bda
Show file tree
Hide file tree
Showing 9 changed files with 339 additions and 164 deletions.
26 changes: 14 additions & 12 deletions plots/grads_util/pause.gs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@ function pause (args)
'numargs 'args
numargs = result
if( numargs > 0 )
string = subwrd(args,1)
num = 2
while ( num <= numargs )
string = string' 'subwrd(args,num)
num = num + 1
endwhile
say string
string = subwrd(args,1)
num = 2
while ( num <= numargs )
string = string' 'subwrd(args,num)
num = num + 1
endwhile
say string
endif
say 'Paused, Hit ENTER to Continue (or c to Clear and Continue) ...'
pull flag
if( flag = 'c' )
'c'
endif
return
pull flag
'run uppercase 'flag
flag = result
if( flag = 'C' )
'c'
endif
return
3 changes: 2 additions & 1 deletion plots/portrait.script
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ if( $plot == residual ) then

setenv ORIENTATION LANDSCAPE
$grads $batch -l -c "run $GEOSUTIL/plots/res/res $expid $output $debug $seasons "
$grads $batch -l -c "run $GEOSUTIL/plots/res/setup_wstar $source $expid $output $seasons "
$grads $batch -l -c "run $GEOSUTIL/plots/res/setup_wstar $source $expid $output B $seasons "
$grads $batch -l -c "run $GEOSUTIL/plots/res/setup_wstar $source $expid $output A $seasons "
$grads $batch -l -c "run $GEOSUTIL/plots/res/setup_epflx $source $expid $output $debug $seasons "
$grads $batch -l -c "run $GEOSUTIL/plots/zcmp/zcmp $expid $output $seasons "
endif
Expand Down
1 change: 1 addition & 0 deletions plots/quickplot
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ else
setenv CMPEXP "$cmpops $cmpexp"
endif
endif
setenv DEBUG "$debug"

# ECHO Setup
# ----------
Expand Down
6 changes: 3 additions & 3 deletions plots/res/epflx_diff.gs
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ say 'Defined Variables:'
say '------------------'
'q define'
say result
pause
*pause
'makezdif -q1 epfdiv'num''season''time' -file1 'num' -q2 epfdiv'num2''season''time' -file2 'num2' -name epdiff -ptop 1' ; 'run getenv ZDIFILE' ; epfile = result

say 'makezdif -q1 epfy'num''season''time' -file1 'num' -q2 epfy'num2''season''time' -file2 'num2' -name epydiff -ptop 1' ; 'run getenv ZDIFILE' ; epyfile = result
pause
*pause
'makezdif -q1 epfy'num''season''time' -file1 'num' -q2 epfy'num2''season''time' -file2 'num2' -name epydiff -ptop 1' ; 'run getenv ZDIFILE' ; epyfile = result

say 'makezdif -q1 epfz'num''season''time' -file1 'num' -q2 epfz'num2''season''time' -file2 'num2' -name epzdiff -ptop 1' ; 'run getenv ZDIFILE' ; epzfile = result
pause
*pause
'makezdif -q1 epfz'num''season''time' -file1 'num' -q2 epfz'num2''season''time' -file2 'num2' -name epzdiff -ptop 1' ; 'run getenv ZDIFILE' ; epzfile = result

'set dfile 'epfile
Expand Down
160 changes: 107 additions & 53 deletions plots/res/plot_season.gs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ function plot_season (args)
* -----------------------------------------------
'run getenv "ANALYSIS"'
analysis = result


'q gxout'
gxout = sublin(result,4)
gxout = subwrd(gxout,6)
Expand Down Expand Up @@ -70,7 +68,6 @@ function plot_season (args)
RSLV = (result-1)/2
CRSLV = C''RSLV


tags = ''
exps = ''
if( numargs=2 )
Expand Down Expand Up @@ -196,9 +193,18 @@ n = 1
while( n<=numfiles )

'set dfile 'n
'q file'
say 'File #'n' 'result

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

if( time = B )
'sett'
'run setdates'
endif
'run getdates'
'run getenv BEGDATE'
begdate = result
'getinfo tmin'
tmin = result
'getinfo tmax'
Expand Down Expand Up @@ -278,7 +284,6 @@ while( n<=numfiles )
if(dmin < axmin ) ; axmin = dmin ; endif
'q dims'
say result
* pause

* End if( talats=indv | talats=avrg | talats=hard ) test
* ------------------------------------------------------
Expand All @@ -292,25 +297,25 @@ while( n<=numfiles )

* Create CTL File for Each Experiment
* -----------------------------------
ioflag = 1-sublin( read(LOCATION''FILE.n'.ctl'),1 )
say 'ioflag for 'LOCATION''FILE.n'.ctl: 'ioflag
* pause
ioflag = 1-sublin( read(LOCATION''FILE.n'.'time'.ctl'),1 )
say 'ioflag for 'LOCATION''FILE.n'.'time'.ctl: 'ioflag

if( ioflag = 0 )

'!remove 'LOCATION''FILE.n'.ctl'
'!touch 'LOCATION''FILE.n'.ctl'
'!echo dset ^'FILE.n'.data >> 'LOCATION''FILE.n'.ctl'
'!echo title WSTAR >> 'LOCATION''FILE.n'.ctl'
'!echo undef 1e15 >> 'LOCATION''FILE.n'.ctl'
'!echo xdef 1 linear -180 1 >> 'LOCATION''FILE.n'.ctl'
'!echo ydef 1 linear -90 1 >> 'LOCATION''FILE.n'.ctl'
'!echo zdef 'zdim' levels 'levels' >> 'LOCATION''FILE.n'.ctl'
'!echo tdef 'tdim' linear 'begdate' 1mo >> 'LOCATION''FILE.n'.ctl'
'!echo vars 3 >> 'LOCATION''FILE.n'.ctl'
'!echo minlats 'zdim' 0 minlats >> 'LOCATION''FILE.n'.ctl'
'!echo maxlats 'zdim' 0 maxlats >> 'LOCATION''FILE.n'.ctl'
'!echo wstrlats 'zdim' 0 wstar >> 'LOCATION''FILE.n'.ctl'
'!echo endvars >> 'LOCATION''FILE.n'.ctl'
'!remove 'LOCATION''FILE.n'.'time'.ctl'
'!touch 'LOCATION''FILE.n'.'time'.ctl'
'!echo dset ^'FILE.n'.'time'.data >> 'LOCATION''FILE.n'.'time'.ctl'
'!echo title WSTAR >> 'LOCATION''FILE.n'.'time'.ctl'
'!echo undef 1e15 >> 'LOCATION''FILE.n'.'time'.ctl'
'!echo xdef 1 linear -180 1 >> 'LOCATION''FILE.n'.'time'.ctl'
'!echo ydef 1 linear -90 1 >> 'LOCATION''FILE.n'.'time'.ctl'
'!echo zdef 'zdim' levels 'levels' >> 'LOCATION''FILE.n'.'time'.ctl'
'!echo tdef 'tdim' linear 'begdate' 1mo >> 'LOCATION''FILE.n'.'time'.ctl'
'!echo vars 3 >> 'LOCATION''FILE.n'.'time'.ctl'
'!echo minlats 'zdim' 0 minlats >> 'LOCATION''FILE.n'.'time'.ctl'
'!echo maxlats 'zdim' 0 maxlats >> 'LOCATION''FILE.n'.'time'.ctl'
'!echo wstrlats 'zdim' 0 wstar >> 'LOCATION''FILE.n'.'time'.ctl'
'!echo endvars >> 'LOCATION''FILE.n'.'time'.ctl'

* Loop over Time to create Time-Dependent Level Data
* --------------------------------------------------
Expand Down Expand Up @@ -352,10 +357,9 @@ while( n<=numfiles )
if( a = 1e15 | b = 1e15 )
dumw.t.z = 1e15
else
* say 'd ave(wstar'n',lat='a',lat='b')*1000'
'd ave(wstar'n',lat='a',lat='b')*1000'
result1 = sublin(result,2)
dumw.t.z = subwrd(result1,4)
result1 = sublin(result,2)
dumw.t.z = subwrd(result1,4)
endif

say ' Level: 'level' Lats: 'latmin.t.z' 'latmax.t.z' wstar: 'dumw.t.z
Expand All @@ -375,7 +379,7 @@ while( n<=numfiles )
* ------------------------------------------------------------------------

'set gxout fwrite'
'set fwrite 'LOCATION''FILE.n'.data'
'set fwrite 'LOCATION''FILE.n'.'time'.data'

t = tmin
while( t<= tmax )
Expand Down Expand Up @@ -415,15 +419,28 @@ while( n<=numfiles )

* Note: Scaling will be based on ALL experiments
* ----------------------------------------------
'open 'LOCATION''FILE.n'.ctl'
'!cat 'LOCATION''FILE.n'.'time'.ctl'
say result

say 'open 'LOCATION''FILE.n'.'time'.ctl'
'open 'LOCATION''FILE.n'.'time'.ctl'
'getinfo numfiles'
dumfile = result
'set dfile 'dumfile
'set x 1'
'set y 1'
'setz '

if( time = B )
'sett'
'run setdates'
endif
'run getdates'
* 'run setenv DO_STD TRUE'

'run setenv "DO_STD" 'FALSE
'run getenv "DO_STD" '
DO_STD = result

'seasonal wstrlats 'n

'minmax wstrlats'season''n
Expand Down Expand Up @@ -461,11 +478,12 @@ endwhile
* ------------------------------------------------------------------------
* ------------------------------------------------------------------------

'c'
'set vpage off'
'set parea off'

'set xlopts 1 4 0.10'
'set ylopts 1 4 0.10'
'set xlopts 1 4 0.12'
'set ylopts 1 4 0.12'
'set string 1 c 5'
'set strsiz 0.07'

Expand Down Expand Up @@ -497,10 +515,14 @@ endwhile
endif
endif

* Set Hardwired Values
* --------------------
* axmin = 0.21509
* axmax = 0.44501
* axmax = -0.39901

say 'Final axmin: 'axmin' axmax: 'axmax
say ' '
* axmin = 0.21509
* axmax = 0.44501
'set axlim 'axmin' 'axmax

id.1 = 'a'
Expand Down Expand Up @@ -569,9 +591,9 @@ color.15 = 68
color.6 = 7
color.7 = 12

* color.1 = 4
* color.2 = 5
* color.3 = 3
* color.1 = 2
* color.2 = 3
* color.3 = 4
* color.4 = 1
* color.5 = 1
* color.6 = 3
Expand All @@ -587,6 +609,10 @@ while( n<=numfiles )

'set dfile 'n
if( (analysis = true) | ( (analysis != true) & (CMPID.n != 'MERRA-2') ) )
if( time = B )
'sett'
'run setdates'
endif
'run getdates'
'getinfo tmin'
tmin = result
Expand All @@ -609,6 +635,9 @@ while( n<=numfiles )
k = n - 3 * math_int(n/3) + 1
'set cstyle 'k
'set cstyle '1

* if( color.n = 4 ) ; 'set cstyle 2' ; endif

'set cmark 0'

* Plot wstar based on Level-Dependent Turn-Around Latitudes
Expand All @@ -618,16 +647,19 @@ while( n<=numfiles )
'd wstrlats'season''n

* Add Standard Deviation to selected experiments
* ----------------------------------------------
* if( n=4 )
* 'set cstyle 3'
* 'set cthick 1'
* 'set ccolor 1'
* 'd wstrlats'season''n' + wstrlats'season'std'n
* 'set cstyle 3'
* 'set cthick 1'
* 'set ccolor 1'
* 'd wstrlats'season''n' - wstrlats'season'std'n
* Note: Must use DO_STD TRUE when calculating seasonal
* -----------------------------------------------------
* if( DO_STD = TRUE )
* if( n=4 )
* 'set cstyle 3'
* 'set cthick 1'
* 'set ccolor 1'
* 'd wstrlats'season''n' + wstrlats'season'std'n
* 'set cstyle 3'
* 'set cthick 1'
* 'set ccolor 1'
* 'd wstrlats'season''n' - wstrlats'season'std'n
* endif
* endif

else
Expand Down Expand Up @@ -808,7 +840,7 @@ while( n<=numfiles )

else

'open 'LOCATION''FILE.n'.ctl'
'open 'LOCATION''FILE.n'.'time'.ctl'
'getinfo numfiles'
newfile = result
'set dfile 'newfile
Expand Down Expand Up @@ -896,22 +928,32 @@ endif
endif
endif

if( time = B )
'sett'
'run setdates'
endif
'run getdates'
'run getenv BEGDATE'
begdate = result
bdate = substr(result,6,7)
bdate.n = substr(result,6,7)
'run getenv ENDDATE'
enddate = result
edate = substr(result,6,7)
edate.n = substr(result,6,7)
if( maskfile != 'NULL' )
'run count.gs "'season'" 'begdate' 'enddate' -field w'type'.'maskfile
nseasons = result
nseasons.n = result
else
'run count.gs "'season'" 'begdate' 'enddate
nseasons = result
nseasons.n = result
endif

'set strsiz 0.12'
'draw string 3.94 8.15 'bdate' 'edate' 'season' ('nseasons') 'CRSLV
if( time = A )
'draw string 3.94 8.15 'bdate.n' 'edate.n' 'season' ('nseasons.n') 'CRSLV
endif
if( time = B )
'draw string 3.94 8.15 'season' 'CRSLV
endif

'getinfo desc'
desc.n = result
Expand All @@ -923,7 +965,12 @@ endif
k = 1
'!echo 'k' 6 'color.n' >> plot_'season'.stack'

if( time = A )
'!echo \('id.n'\) ' CMPID.n' >> plot_'season'.stack'
endif
if( time = B )
'!echo \('id.n'\) ' CMPID.n' \('bdate.n' 'edate.n' \: 'nseasons.n' \) >> plot_'season'.stack'
endif
endif

* ENDIF for ANALYSIS Test
Expand Down Expand Up @@ -965,11 +1012,18 @@ endif
'set vpage off'
'set parea off'

if( time = A )
header = 'WSTAR'
endif
if( time = B )
header = 'WSTAR_B'
endif

if( tags = '' )
filename = 'WSTAR_using_'talatsz'_TALATS.'season
filename = header'_using_'talatsz'_TALATS.'season
else
* filename = 'WSTAR_using_'talatsz'_TALATS.'tags'.'season
filename = 'WSTAR_using_'talatsz'_TALATS.'exps'.'season
* filename = header'_using_'talatsz'_TALATS.'tags'.'season
filename = header'_using_'talatsz'_TALATS.'exps'.'season
endif

'myprint -name 'output'/'filename
Expand Down
Loading

0 comments on commit c3a4bda

Please sign in to comment.