Skip to content

Commit

Permalink
Merge pull request #41 from bertinia/waccm_update
Browse files Browse the repository at this point in the history
Waccm update
  • Loading branch information
bertinia authored Oct 13, 2016
2 parents 3b8e91e + b5e823b commit 240839e
Show file tree
Hide file tree
Showing 16 changed files with 2,323 additions and 408 deletions.
27 changes: 27 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,33 @@
This file describes what tags were created and why
================================================================================

Originator: aliceb
Date: 12 October 2016
Model: CESM_postprocessing
Version: CESM_postprocessing_v0.1.3
One-line: add additional WACCM datasets. Closes github issue #37.

modified: copy_html
modified: ../atm_diag/functions_waccm.ncl
modified: ../atm_diag/html/model-obs/wset2/wset2_2.htm
modified: ../atm_diag/html/model-obs/wset3/wset3_2.htm
modified: ../atm_diag/html/model-obs/wset4/wset4_2.htm
modified: ../atm_diag/html/model-obs/wset5/wset5_2.htm
modified: ../atm_diag/html/model1-model2/wset3/wset3_2.htm
modified: ../atm_diag/html/model1-model2/wset4/wset4_2.htm
modified: ../atm_diag/html/model1-model2/wset5/wset5_2.htm
modified: ../atm_diag/plot_waccm_cycle.ncl
modified: ../atm_diag/plot_waccm_map.ncl
modified: ../atm_diag/plot_waccm_vcycle.ncl
modified: ../atm_diag/plot_waccm_vzonal.ncl
modified: ../atm_diag/tables_waccm.ncl
modified: ../diagnostics/diagnostics/atm/atm_avg_generator.py

add: ../averager/pp_tests/control_ocn_series.py
add: ../averager/pp_tests/runAvg_ocn_mpi.sh

================================================================================

Originator: aliceb
Date: 11 October 2016
Model: CESM_postprocessing
Expand Down
2 changes: 1 addition & 1 deletion Tools/copy_html
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def check_ssh_key(env):
shell=True)
except subprocess.CalledProcessError as e:
print('WARNING: unable to connect to remote web host {0}@{1} without a password'.format(env['GLOBAL_WEBLOGIN'],env['GLOBAL_WEBHOST']))
print(' You will be prompted for a password in order to copy the files')
print(' You will be prompted for a password multiple times in order to copy the files.')


#=======================================================================
Expand Down
155 changes: 151 additions & 4 deletions atm_diag/functions_waccm.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ begin
delete(tmp)

tmp = vinth2p(ivar, hyam, hybm, lev, ps, interp, p0, 1, extrap)
tmp@long_name = ivar@long_name
tmp@units = ivar@units

; This still allows extrapolation beyond the top of the model, so set those
; to the fill value.
Expand Down Expand Up @@ -65,6 +67,74 @@ begin
end


; Scale mixing ratio and length variables.
procedure waccm_scaleunits(varname, iunits, varmin, varmax, scale, ounits)

begin

; Adjust units
scale = 1.
ounits = iunits

if ((iunits .eq. "mol/mol") .or. (iunits .eq. "kg/kg")) then
if (varmax .lt. 1e-12) then
scale = 1e15
ounits = "ppq"
else
if (varmax .lt. 1e-9) then
scale = 1e12
ounits = "ppt"
else
if (varmax .lt. 1e-6) then
scale = 1e9
ounits = "ppb"
else
if (varmax .lt. 1e-3) then
scale = 1e6
ounits = "ppm"
end if
end if
end if
end if

; For water vapor, always want ppm for WACCM
if (varname .eq. "H2O") then
scale = 1e6
ounits = "ppm"
end if

; For carbon monoxide, always want ppm for WACCM
if (varname .eq. "CO") then
scale = 1e6
ounits = "ppm"
end if

if (scale .ne. 1.) then
if (iunits .eq. "mol/mol") then
ounits = ounits + "v"
end if
end if
end if

if (iunits .eq. "m") then
if (varmax .gt. 1e3) then
scale = 1e-3
ounits = "km"
else
if (varmax .lt. 1e-2) then
scale = 1e6
ounits = "um"
else
if (varmax .lt. 1.) then
scale = 1e2
ounits = "cm"
end if
end if
end if
end if
end


; Does a vertical interpolation of the supplied data to pressure
; levels.
;
Expand Down Expand Up @@ -95,6 +165,8 @@ begin
delete(tmp)

tmp = vinth2p(ivar, hyam, hybm, lev, ps, interp, p0, 1, extrap)
tmp@long_name = ivar@long_name
tmp@units = ivar@units

; This still allows extrapolation beyond the top of the model, so set those
; to the fill value.
Expand Down Expand Up @@ -145,8 +217,84 @@ begin
end


undef("nice_mnmxintvl_log")
function nice_mnmxintvl_log(minval, maxval, numlevs, drange)

local minabs, maxabs, nicelevs, epos, eneg

begin

; Default drange to cover full range if nothing was provided.
if (drange .eq. 0) then
drange = abs(log10(max(abs(maxval))) - log10(max(abs(minval))))

if (drange < 3) then
drange = 3
end if

if (drange > 15) then
drange = 15
end if
end if


; Does the range span 0?
if (minval * maxval .lt. 0.) then

; Pick a spacing based upon the largest value.
maxabs = max((/ abs(minval), abs(maxval) /))
minabs = maxabs / (10^(drange))

maxmin = nice_mnmxintvl(log10(minabs), log10(maxabs), numlevs / 2, False)

nicelevs = tointeger((maxmin(1) - maxmin(0)) / maxmin(2) + 1)

eneg = fspan(maxmin(1), maxmin(0), nicelevs)
eneg = -1 * (10.^eneg)

epos = -1 * eneg(::-1)

elevels = array_append_record(eneg, epos, 0)

delete(eneg)
delete(epos)
else

; One sided, so just take the log and build a scale.
if ((minval .eq. 0.) .or. (maxval .eq. 0.)) then

; Since we can't go to zero, use the drange.
; Could look for largest non-zero value.
if (maxval .eq. 0.) then
maxval = minval / (10^(drange))
else
minval = maxval / (10^(drange))
end if
end if

if (minval .lt. 0.) then
maxmin = nice_mnmxintvl(log10(abs(maxval)), log10(abs(minval)), numlevs, False)
else
maxmin = nice_mnmxintvl(log10(abs(minval)), log10(abs(maxval)), numlevs, False)
end if

nicelevs = tointeger((maxmin(1) - maxmin(0)) / maxmin(2) + 1)

elevels = fspan(maxmin(0), maxmin(1), nicelevs)
elevels = 10.^elevels

if (minval .lt. 0.) then
elevels = elevels(::-1) * -1
end if
end if

return(elevels)
end



;***********************************************************************;
; Procedure : gsn_set_pres_hgt_axes ;
; Procedure : set_pres_hgt_axes ;
; pres: numeric ;
; res: logical ;
; add_hgt: logical ;
Expand All @@ -161,15 +309,14 @@ end
; values, and the right for height values. The pressure values are ;
; assumed to be in millibars. ;
;***********************************************************************;

undef("set_pres_hgt_axes")
procedure set_pres_hgt_axes(pres:numeric,res:logical,add_hgt:logical)
local hgt, hnice, pnice, ptmp
begin
if(pres(0).lt.pres(dimsizes(pres)-1))
ptmp = tofloat(pres(::-1)) ; reverse values so descending order
ptmp = tofloat_wunits(pres(::-1)) ; reverse values so descending order
else
ptmp = tofloat(pres) ; Make sure values are floating point.
ptmp = tofloat_wunits(pres) ; Make sure values are floating point.
end if

if(.not.(isatt(res,"sfYCStartV").and.isatt(res,"sfYCEndV")))
Expand Down
24 changes: 0 additions & 24 deletions atm_diag/html/model-obs/wset2/wset2_2.htm
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,6 @@
<TH ALIGN=LEFT><A HREF="wset2_ERAI_T_EQ_TRP_obsc.xxx">plot</a>
<TH ALIGN=LEFT><A HREF="wset2_ERAI_T_NM_TRP_obsc.xxx">plot</a>
<TH ALIGN=LEFT><A HREF="wset2_ERAI_T_NP_TRP_obsc.xxx">plot</a>
<TR>
<TH ALIGN=LEFT>T, Mesopause
<TH ALIGN=LEFT>Temperature
<TH ALIGN=LEFT><A HREF="wset2_ERAI_T_SP_MSP_obsc.xxx">plot</a>
<TH ALIGN=LEFT><A HREF="wset2_ERAI_T_SM_MSP_obsc.xxx">plot</a>
<TH ALIGN=LEFT><A HREF="wset2_ERAI_T_EQ_MSP_obsc.xxx">plot</a>
<TH ALIGN=LEFT><A HREF="wset2_ERAI_T_NM_MSP_obsc.xxx">plot</a>
<TH ALIGN=LEFT><A HREF="wset2_ERAI_T_NP_MSP_obsc.xxx">plot</a>
<TR>
<TH><BR>
<TH><BR>
Expand Down Expand Up @@ -108,14 +100,6 @@
<TH ALIGN=LEFT><A HREF="wset2_MERRA_T_EQ_TRP_obsc.xxx">plot</a>
<TH ALIGN=LEFT><A HREF="wset2_MERRA_T_NM_TRP_obsc.xxx">plot</a>
<TH ALIGN=LEFT><A HREF="wset2_MERRA_T_NP_TRP_obsc.xxx">plot</a>
<TR>
<TH ALIGN=LEFT>T, Mesopause
<TH ALIGN=LEFT>Temperature
<TH ALIGN=LEFT><A HREF="wset2_MERRA_T_SP_MSP_obsc.xxx">plot</a>
<TH ALIGN=LEFT><A HREF="wset2_MERRA_T_SM_MSP_obsc.xxx">plot</a>
<TH ALIGN=LEFT><A HREF="wset2_MERRA_T_EQ_MSP_obsc.xxx">plot</a>
<TH ALIGN=LEFT><A HREF="wset2_MERRA_T_NM_MSP_obsc.xxx">plot</a>
<TH ALIGN=LEFT><A HREF="wset2_MERRA_T_NP_MSP_obsc.xxx">plot</a>
<TR>
<TH><BR>
<TH><BR>
Expand All @@ -134,14 +118,6 @@
<TH>10S-10N
<TH>55N-65N
<TH>60N-90N
<TR>
<TH ALIGN=LEFT>U, 10 Hpa
<TH ALIGN=LEFT>Zonal Wind
<TH ALIGN=LEFT><A HREF="wset2_MLS_U_SP_10_obsc.xxx">plot</a>
<TH ALIGN=LEFT><A HREF="wset2_MLS_U_SM_10_obsc.xxx">plot</a>
<TH ALIGN=LEFT><A HREF="wset2_MLS_U_EQ_10_obsc.xxx">plot</a>
<TH ALIGN=LEFT><A HREF="wset2_MLS_U_NM_10_obsc.xxx">plot</a>
<TH ALIGN=LEFT><A HREF="wset2_MLS_U_NP_10_obsc.xxx">plot</a>
<TR>
<TH ALIGN=LEFT>H2O, 85 hPa
<TH ALIGN=LEFT>Water Vapor
Expand Down
Loading

0 comments on commit 240839e

Please sign in to comment.