I must work with variables originated from WRF, i'm seeing how the climate change affects the pavements design in Chile,
because of that it was made a climate prediction for the period 2030-2059, also a hincast for the period 1970-1999,
all weighting a total of 3 TB (Hincast 1.5 TB, future 1.5 TB).
I need to extract certain variables from the wrftout files (temperature, wind speed, relative humidity and cloud fraction), because of that i created a script
to extract the already stated information, the variables are each 6 hours.
My problem (besides what i commented in the forum) is the script which i have it for 1 folder, the information is arranged in this way:
/hindcast/year/month, because of there are 30 year, 12 month each year (12*30=360), in total there are 360 folders (and 31 files per folder), my question is, is there a way to make the script work inside a folder
and the script automatically moves into the next folder doing its job?
PD: one of the solution i tried was leaving all the wrfout (around 11000 files overall) in one single folder and execute the script, but this collapse
The script that i have is the next one:
-------------------------------------------------------
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
begin
allfiles=systemfunc("ls -1 /users/yhernandez/dominiosyoska/WRFV3/run/wrfout_d03*") + ".nc"
a=addfiles(allfiles, "r")
ListSetType(a,"cat")
tiempos = wrf_user_getvar(a,"times",-1)
print(dimsizes(tiempos))
;coordinates of the point of interest
lat = -38.7486
lon = -72.6207
point = wrf_user_ll_to_ij(a,lon,lat, True)
lon_point=point(0)-1
lat_point=point(1)-1
printVarSummary(lon_point)
printVarSummary(lat_point)
print("X/Y locations are: " + point)
t2 = wrf_user_getvar(a,"T2",-1)
;; t2 temperature is obtained from the point of interest
t2_point =t2(:,lat_point,lon_point)
printVarSummary(t2_point)
;matrix is created with "tiempos" and "t2_point"
datatimes= new((/12,1/),string) ;the length of the variable "tiempos" is 12
datavar = new((/12,1/),float)
datatimes(:,0) = (/tiempos/)
datavar(:,0) = (/t2_point/)
lines = new(12,string)
do i = 0, 12
lines(i) = str_concat(datatimes(i,:)+" "+sprintf("%5.2f ,", datavar(i,:)))
end do
asciiwrite("archive.txt",lines)
end
------------------------------------------------------------
I would be really grateful if you could help me!!