In my simple code I extract one variable named bet from the NETCDF file and then I write it out of the NETCDF file as here:
import os, glob
print(filenamels)
for fn in filenamels:
outputFile = fn[:len(fn)-3]+'_ull_st.dat'
os.system( gdalcmd)
There are other variables feg,dis,lam, named ,in these NETCDF files and I do not want to run the code for each variable.I wonder how we can write a loop to extract these variables at once.