working code: _generate_tables_for_publication.Rmd
10% critical value
Rt ~T2m
This site is to serve as my note-book and to effectively communicate with my students and collaborators. Every now and then, a blog may be of interest to other researchers or teachers. Views in this blog are my own. All rights of research results and findings on this blog are reserved. See also http://youtube.com/c/hongqin @hongqin
working code: _generate_tables_for_publication.Rmd
10% critical value
Rt ~T2m
NOAA dewpoint correlate weakly with RH, R2=0.11 for Hamilton, TN
ERA5 dewpoint correlates with NOAA dewpoint well. R2 = 0.97
Call:
lm(formula = tb_comp$K ~ tb_comp$air_temp)
Residuals:
Min 1Q Median 3Q Max
-4.7346 -0.9967 -0.0165 0.9527 7.6325
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 271.41583 0.14303 1897.6 <2e-16 ***
tb_comp$air_temp 0.96368 0.00688 140.1 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 1.492 on 597 degrees of freedom
Multiple R-squared: 0.9705, Adjusted R-squared: 0.9704
F-statistic: 1.962e+04 on 1 and 597 DF, p-value: < 2.2e-16
The template pbs is:
-bash-4.2$ cat ts_grib_job_template.pbs
#!/bin/bash -l
#$ -S /bin/bash
#$ -N pygrib_NUMBER
#$ -cwd
. /etc/profile.d/modules.sh
module load anaconda
source activate grib
python parse_grib_4JHU-debug.py STARTINDEX ENDINDEX
-bash-4.2$
Qin used a python code to generate pbs jobs, and then submit them using shell script.
-bash-4.2$ cat generate_PBS_bash.py
import os
import re
filebatchshell = "submit_PBS.sh"
fshell = open(filebatchshell, "w")
step = 15
for i in range( 0, 600, step):
fin = open("ts_grib_job_template.pbs", "r")
LinesIn = fin.readlines()
fin.close()
LinesIn[2] = "#$ -N pygrib_" + str(i) + "\n"
LinesIn[7] = "python parse_grib_4JHU.py " + str(i) + " " + str(i + step) + " \n"
fileout = "ts_" + str(i) + ".pbs"
fout = open(fileout, "w")
for line in LinesIn:
fout.write(line)
fout.close()
buffer = "qsub " + fileout + "\n"
fshell.write(buffer)
fshell.close()
To parse the 2m-dew point, I used generate_PBS_bash_dewpoint.py
This is a 7-day run. The last t2m output is on Nov 20, and the last dewpoint file output is on Nov 21.
On Nov 21, I use github to backup running logs, and output csv files
grbs = pygrib.open('2020-2021NovT2m-dewpoint.grib') #does not work
grbs = pygrib.open('2019-2020June10.grib') #works
It would be strange if grib format changed. I need to redownload the grib file. again
6pm, Qin found out that remove the time selection, and the codes runs on 2021 GRIB file.
ERA5 land hours data was last updated on July 12.
I selected all 2020, all day, and all hours, it is 45.8 GB, which will take 12 hours to download at home.
I ssh into my simcenter workstation,
wget url,
which runs with an estimated time of a little over 2 hours.