Entradas

Plotting NCAR MUSICA outputs using R

Imagen
  library(ncdf4) library(colorout) library(ggplot2) library(cptcity) fc <- list.files(path = "/glade/scratch/sibarra/SAAP/run",                  pattern = "SAAP.cam.h0.2014",                  full.names = T) nc <- list.files(path = "/glade/scratch/sibarra/SAAP/run",                  pattern = "SAAP.cam.h0.2014") dates <- as.Date(nc, format = "SAAP.cam.h0.%Y-%m-%d-00000.nc") nd <- paste0(strftime(dates, "%Y%m%d"), ".nc") mi <- map_data('world', wrap=c(0,360)) # geo #### lat <- ncvar_get(nc1, varid = "lat") lon <- ncvar_get(nc1, varid = "lon") #PM25 #### x <- ncvar_get(nc1, varid = "PM25") dtx <- data.table::data.table(   lat = lat,   lon = lon,   x = x[, 32]*1e9 ) summary(dtx) rc <- classInt::classIntervals(var = dtx$x,                                n = 100,                                 style = "quantile")$brks ggplot(dtx,         aes(x

Install sf with conda

conda create -n rsf r-units r-udunits2 geos gdal proj netcdf4 git openssl or try conda install r-sf "poppler<0.62" sf 0.5.5

Humidity and airborne viruse (Linsey Marr @linseymarr)

. @DrWanYang and I studied this question in 2011, exploring different removal mechanisms from air as a function of RH. I thought we’d find that at high RH, droplets/aerosols would be a lot larger and settle out quickly. https://t.co/Lu9CQB1AMz /2 — Linsey Marr (@linseymarr) December 27, 2020 This led us on a 10-year quest to understand virus inactivation in droplets/aerosols, still ongoing. Survival can vary by 2-100x between <20% RH vs. 40-80% RH, usually U-shaped relationship between viability and RH for many viruses. https://t.co/gncwvtQpGF with @kaisen_lin /4 pic.twitter.com/Z93CqKnTbo — Linsey Marr (@linseymarr) December 27, 2020 SARS-CoV-2 shows the classic U-shaped relationship between viability and RH that we see with most enveloped viruses in culture media. https://t.co/lFovXAdUkr with @dylanhmorris @amandinegamble @qishenhuang @petervikesland Munster Lloyd-Smith others /6 pic.twitter.com/Ow057Qm77F — Linsey Marr (@linseymarr) December 27, 2020 At low R

Install WRF 4.1 in Ubuntu 19.10 - Solving the problem of libpng12 for WPS ungrib.exe *UPDATE

Assuming that you installed WRF on Ubuntu 19.10 following any of the tutorials , you will face a problem. Apparently everything went good, but when you run ./ungrib.exe, you will see an error. The thing is that Ubuntu has libpng16 and we need libpng12. In few words, following this https://forum.mmm.ucar.edu/phpBB3/viewtopic.php?t=8561 Assuming that the file $DIR/grib2/lib/libpng12.so.0 exists, you could try: export LD_LIBRARY_PATH=$DIR/grib2/lib:$LD_LIBRARY_PATH

algunos comandos bash gnu/linux que me salvan la vida. sustituir text y agregar text en todos los archivos de un directorio

substituir text en todos los archivos de un directorio sed -i -- 's/A/B/g' * insertar text para la linea 1 de todos los archivos de texto del directorio for i in $( ls * .R ) ; do sed -i '1 s/^/library(vein)\n/' $i ; done

Usando exit y cycle en do anidados Fortran

Es interesante ver que cycle y exit pueden ser usados para saltar entre do anidados PROGRAM test_cycle_2 INTEGER :: i, j, product outer: DO i = 1 , 3 inner: DO j = 1 , 3 IF ( j == 2 ) CYCLE outer product = i * j WRITE ( * , * ) i, ' * ' , j, ' = ' , product END DO inner END DO outer END PROGRAM test_cycle_2 que produce            1  *            1  =            1            2  *            1  =            2            3  *            1  =            3  

Formatos y disruptores en Fortran

program t implicit none ! c Column number ! d Number of digits to right of decimal place for real input or output ! m Minimum number of digits to be displayed ! n Number of spaces to skip ! r Repeat count—the number of times to use a descriptor or group of descriptors ! w Field width—the number of characters to use for the input or output ! Integer: rIw or rIw.m INTEGER :: index = - 12 , junk = 4 , number = - 12345 WRITE (*, 100 ) index, junk, number 100 FORMAT (I0, 1X ,I0, 1X ,I0) !will produce the output - 12 4 - 12345 ! Real rFw.d REAL :: a = - 12.3 , b = . 123 , c = 123.456 WRITE (*, 200 ) a, b, c WRITE (*, 210 ) a, b, c 200 FORMAT ( 2F6 . 3 , F8. 3 ) !will produce the output                 ****** 0.123 123.456 ! Exponente rEw.d w ≥ d +7 ! expresses the number as a value between 0.1 and 1.0 times a power of 10. REAL :: a = 1.2346E6 , b = 0.001 , c = - 77.7E10 , d = - 77.7E10 WRITE (*, 200 ) a, b, c, d 200 FORM