Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

getvar returns ['GSW' is not a valid variable name]; extract_vars returns [got multiple values for argument 'timeidx']

Abierto
#238 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python
Área
data

Línea de trabajo

El informe menciona wrf.getvar, wrf.extract_vars y routines.py alrededor de la línea 352. Lee esos puntos de entrada y reproduce ambas llamadas con un archivo wrfout que contenga GSW; se considera terminado cuando el comportamiento de extracción compatible esté claro y el fallo de invalid-name o duplicate-timeidx se haya resuelto o documentado.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Dear all,

I'm now working on an issue that needs the net heat flux at surface.
To calculate it, I need the variables including GSW, GLW, TSK, EMISS, GRDFLX, HFX, and LH.
The others are easily obtainded by wrf.getvar function, but I failed in getting the variable GSW, and the error message is here:

gsw = wrf.getvar(wrflist, "GSW", timeidx=t,  @method="cat")
  File "/Users/abc/anaconda3/envs/pygmt/lib/python3.10/site-packages/wrf/ro
utines.py", line 352, in getvar
    raise ValueError("'{}' is not a valid variable name".format(varname))
ValueError: 'GSW' is not a valid variable name

I checked the wrfout file and confirmed there is a variable named 'GSW' (I could also plot it):

float GSW(Time, south_north, west_east) ;
		GSW:FieldType = 104 ;
		GSW:MemoryOrder = "XY " ;
		GSW:description = "NET SHORT WAVE FLUX AT GROUND SURFACE" ;
		GSW:units = "W m-2" ;
		GSW:stagger = "" ;
		GSW:coordinates = "XLONG XLAT XTIME" ;

After that, I tried to use wrf.extract_vars to get the variables that originally embedded in the wrfout file, but I also got error

gsw = wrf.extract_vars(wrflist, "GSW", timeidx=t, method="cat")
TypeError: extract_vars() got multiple values for argument 'timeidx'

The argument 'timeidx=t' works fine in other variables such as GLW, etc.

Is this a bug or I need special way to extract GSW? For now, I could only get 'SWDOWN' and 'ALBEDO' seperately and calculate GSW by myself.

Lenguaje dominante
Python
Estrellas
498
Forks
178
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de NCAR/wrf-python

Todos los issues de NCAR/wrf-python

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.