;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; wrfout_to_nc.ncl ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; -NCL script to read an ARW wrfout NetCDF file on staggered model ; grid and to output unstaggered values in NetCDF CF compliant format ; - ; -Assistance in creating the original script was provided by Dennis Shea ; ; command syntax: ; ncl 'file_in="wrfout.nc"' 'file_out="wrfpost.nc"' wrfout_to_cf.ncl ; ; Ver. 1.0.0 - May 2, 2008 ; 1.0.1 - May 6, 2008 ; -several minor changes including the handling of lat/lon to make ; the output CF compliant ; 1.1.0 - May 12, 2008 ; -change the input to use the (/.../) to strip all attributes/coords. ; -added sub-procedure to add basic attributes ; -re-ordered the attributes for each variable ; -added the output variables (i.e. out2dMet, outPressure) to allow ; the user to select the variables which they want processed/output ; -add if-then-endif for all of the output variables ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; load in the libraries load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; procedure to process the attributes in creating CF compliant WRF output procedure assignVarAttCoord(x:numeric, time[*]:numeric, vert[*]:numeric, \ fl_vert:numeric) ; x:numeric -variable to process the attributes ; time[*]:numeric -array with time values for adding coordinates ; vert[*]:numeric -array with vertical values for adding coordinates ; Note: set to 0 if no vertical coordinate ; fl_vert:numeric -flag indicating vertical coordinate type ; 0 = no vertical coordinate (x,y only) ; 1 = pressure ; 2 = eta ; 3 = soil begin ; set time for all variables x!0 = "time" x&time = time ; set the vertical coordinate depending on fl_vert if (fl_vert .eq. 1) then ;pressure as vertical coordinate x!1 = "pressure" x&pressure = vert end if if (fl_vert .eq. 2) then ;eta as vertical coordinate x!1 = "eta" x&eta = vert end if if (fl_vert .eq. 3) then ;soil as vertical coordinate x!1 = "soil" x&soil = vert end if ; set the horizontal coordinates if (fl_vert .eq. 0) then ;no vertical coordinate x!1 = "south_north" x!2 = "west_east" else ;with vertical coordinate x!2 = "south_north" x!3 = "west_east" end if ; set the mapping coordinates x@coordinates = "lon lat" end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; start the primary wrfout_to_cf.ncl program begin ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; configuration settings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; set the units for time TimeUnits = "hours since 1997-01-01 00:00:00" ; set the values for pressure to be interpolated pressure = (/1000.,925.,850.,700.,500.,300.,200./) ; set the limits for the output range ; 0 = beginning of dataset ; 9999 = end of dataset ; Note: remember that the array is zero-based limTime = (/0,9999/) limS_N = (/0,9999/) limW_E = (/0,9999/) limPres = (/0,9999/) limEta = (/0,9999/) limSoil = (/0,9999/) ; set default values for file_in, dir_in, and file_out, if not specified if (.not.isvar("file_in")) then ;file_in = "_file_in" file_in = "wrfout_d01_1997-12-31_00:00:00" end if if (.not.isvar("dir_in")) then ;dir_in = "_dir_in/wrf/" dir_in = "./" end if if (.not.isvar("file_out")) then ;file_out = "_file_out" file_out = "wrfpost.nc" end if ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; output settings axis = True projection = True outPtop = True ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; time / date variables outDateTime = True outUTCDate = True ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; two-dimensional near-surface / surface met variables out2dMet = True out2dMet@SST = True out2dMet@T_sfc = True out2dMet@p_sfc = True out2dMet@slp = True out2dMet@T_2m = True out2dMet@Td_2m = True out2dMet@Th_2m = True out2dMet@q_2m = True out2dMet@u_10m_gr = True out2dMet@v_10m_gr = True out2dMet@precip_g = True out2dMet@precip_c = True ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; two-dimensional surface energy budget / radiation variables out2dRadFlx = True out2dRadFlx@SW_d = True out2dRadFlx@LW_d = True out2dRadFlx@LW_toa = True out2dRadFlx@albedo = True out2dRadFlx@SHFlx = True out2dRadFlx@LHFlx = True out2dRadFlx@MFlx = True out2dRadFlx@u_star = True ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; two-dimensional surface/soil variables out2dLandSoil = True out2dLandSoil@LandMask = True out2dLandSoil@LandUse = True out2dLandSoil@SoilT_L = True out2dLandSoil@SoilT_B = True out2dLandSoil@GroundFlx = True out2dLandSoil@SnowHgt = True out2dLandSoil@SnowWater = True out2dLandSoil@SnowDens = True out2dLandSoil@SnowFlx = True out2dLandSoil@SeaIce = True ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; three-dimensional upper-level (pressure) metorology variables outPressure = True outPressure@p_p = True outPressure@Z_p = True outPressure@T_p = True outPressure@q_p = True outPressure@rh_p = True outPressure@u_gr_p = True outPressure@v_gr_p = True outPressure@w_p = True outPressure@pp_p = True outPressure@q_cloud_p = False outPressure@q_rain_p = False outPressure@q_ice_p = False outPressure@q_snow_p = False outPressure@q_graup_p = False ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; three-dimensional upper-level (eta) metorology variables outEta = True outEta@p_e = True outEta@Z_e = True outEta@T_e = True outEta@q_e = True outEta@rh_e = True outEta@u_gr_e = True outEta@v_gr_e = True outEta@w_e = True outEta@pp_e = True outEta@q_cloud = True outEta@q_rain = True outEta@q_ice = True outEta@q_snow = True outEta@q_graup = True ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; three-dimensional soil variables outSoil = True outSoil@SoilTemp = True outSoil@SoilMoist = True outSoil@SoilWater = True ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; open the input netcdf file (wrfout file) wrfout = addfile(dir_in+file_in+".nc","r") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; time coordinate ; -the time in wrfout is in an odd character format TimeChar = wrfout->Times ; -determine the number of dimensions for time DimTimeChar = dimsizes(TimeChar) nTime = DimTimeChar(0) ; -convert the wrfout time to a CF compliant time ; "hours since 1901-01-01 00:00:00" time_in = wrf_times_c(TimeChar, 1) ; -create an array indicating the year, month, day, hour, minute, second utc_date = doubletoint(ut_calendar(time_in, 0)) ; -create the final variable for time with the units selected time = (/ut_inv_calendar(utc_date(:,0), utc_date(:,1), utc_date(:,2), \ utc_date(:,3), utc_date(:,4), utc_date(:,5), \ TimeUnits, 0)/) ;time time@long_name = "Time" time@standard_name = "time" time@units = TimeUnits time@calendar = "standard" time!0 = "time" time&time = time utc_date!0 = "time" ;utc_date utc_date&time = time year = utc_date(:,0) year@long_name = "Year" year!0 = "time" year&time = time month = utc_date(:,1) month@long_name = "Month" month!0 = "time" month&time = time day = utc_date(:,2) day@long_name = "Day" day!0 = "time" day&time = time hour = utc_date(:,3) hour@long_name = "Hour" hour!0 = "time" hour&time = time minute = utc_date(:,4) minute@long_name = "Minutes" minute!0 = "time" minute&time = time ; -convert the wrfout time to a DateTime integer for easy reading if (outDateTime) then DateTime = (/wrf_times_c(TimeChar, 3)/) ;time DateTime@long_name = "Date and Time" DateTime!0 = "time" DateTime&time = time end if ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; vertical variables / coordinates ; Note: pressure levels are assigned in the beginning section if (outPressure) then nPressure = dimsizes(pressure) ;pressure vertical coordinate pressure@long_name = "Pressure Levels" pressure@standard_name = "air_pressure" pressure@units = "hPa" pressure@positive = "down" pressure!0 = "pressure" pressure&pressure = pressure end if if (outEta .or. outPressure) eta = (/wrfout->ZNU(0,:)/) ;eta values on half-levels (mass) nEta = dimsizes(eta) eta@long_name = "Eta Levels (mass points)" eta@standard_name = "atmosphere_sigma_coordinate" eta@units = "1" eta@positive = "down" eta@formula_terms = "sigma: eta ps: p_sfc ptop: p_top" eta!0 = "eta" eta&eta = eta end if if (outSoil) then soil = (/wrfout->ZS(0,:)/) ;depths of center of soil layers nSoil = dimsizes(soil) soil@long_name = "Soil Levels (depth)" soil@standard_name = "depth" soil@units = "m" soil@positive = "down" soil!0 = "soil" soil&soil = soil end if ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; one-dimensional general model variables p_top = (/wrfout->P_TOP(0)/)/100. ;pressure at top of model p_top@long_name = "Pressure at Top of the Model" p_top@standard_name = "air_pressure" p_top@units = "hPa" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; two-dimensional mapping variables lat = (/wrfout->XLAT(0,:,:)/) ;lat (mass) DimLat = dimsizes(lat) nS_N = DimLat(0) ;S_N dimension nW_E = DimLat(1) ;W_E dimension lat@long_name = "Latitude" lat@standard_name = "latitude" lat@units = "degrees_north" lat!0 = "south_north" lat!1 = "west_east" lon = (/wrfout->XLONG(0,:,:)/) ;lon (mass) lon@long_name = "Longitude" lon@standard_name = "longitude" lon@units = "degrees_east" lon!0 = "south_north" lon!1 = "west_east" Z_sfc = (/wrfout->HGT(0,:,:)/) ;Z_sfc Z_sfc@long_name = "Terrain Height" Z_sfc@standard_name = "height" Z_sfc@units = "m" Z_sfc@coordinates = "lon lat" Z_sfc!0 = "south_north" Z_sfc!1 = "west_east" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; one-dimensional coordinate system if (axis) then south_north = ispan(0,nS_N-1,1) ;south_north south_north@long_name = "y-coordinate in Cartesian system" south_north@axis = "Y" south_north@units = "m" south_north!0 = "south_north" west_east = ispan(0,nW_E-1,1) ;west_east west_east@long_name = "x-coordinate in Cartesian system" west_east@axis = "X" west_east@units = "m" west_east!0 = "west_east" end if ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; two-dimensional near-surface / surface met variables if (out2dMet) then if (out2dMet@SST) then SST = (/wrfout->SST/) ;SST SST@long_name = "Sea-Surface Temperature" SST@standard_name = "sea_surface_temperature" SST@units = "K" assignVarAttCoord(SST,time,0,0) end if if (out2dMet@T_sfc) then T_sfc = (/wrfout->TSK/) ;T_sfc T_sfc@long_name = "Temperature at the Surface" T_sfc@standard_name = "surface_temperature" T_sfc@units = "K" assignVarAttCoord(T_sfc,time,0,0) end if if (out2dMet@p_sfc) then p_sfc = (/wrfout->PSFC/)/100. ;p_sfc p_sfc@long_name = "Pressure at the Surface" p_sfc@standard_name = "surface_air_pressure" p_sfc@units = "hPa" assignVarAttCoord(p_sfc,time,0,0) end if if (out2dMet@T_2m) then T_2m = (/wrfout->T2/) - 273.15 ;T_2m T_2m@long_name = "Temperature at 2 m" T_2m@standard_name = "air_temperature" T_2m@units = "degC" assignVarAttCoord(T_2m,time,0,0) end if if (out2dMet@Th_2m) then Th_2m = (/wrfout->TH2/) ;Th_2m Th_2m@long_name = "Potential Temperature at 2 m" Th_2m@standard_name = "air_potential_temperature" Th_2m@units = "K" assignVarAttCoord(Th_2m,time,0,0) end if if (out2dMet@q_2m) then q_2m = (/wrfout->Q2/) ;q_2m q_2m@long_name = "Mixing Ratio at 2 m" q_2m@standard_name = "humidity_mixing_ratio" q_2m@units = "kg kg-1" assignVarAttCoord(q_2m,time,0,0) end if if (out2dMet@u_10m_gr) then u_10m_gr = (/wrfout->U10/) ;u_10m_gr u_10m_gr@long_name = "u-Component at 10 m (grid)" u_10m_gr@standard_name = "eastward_wind" u_10m_gr@units = "m s-1" assignVarAttCoord(u_10m_gr,time,0,0) end if if (out2dMet@v_10m_gr) then v_10m_gr = (/wrfout->V10/) ;v_10m_gr v_10m_gr@long_name = "v-Component at 10 m (grid)" v_10m_gr@standard_name = "northward_wind" v_10m_gr@units = "m s-1" assignVarAttCoord(v_10m_gr,time,0,0) end if if (out2dMet@precip_g) then precip_g = (/wrfout->RAINNC/) ;accumulated total grid scale precip precip_g@long_name = "Accumulated Total Grid Scale Precipitation" precip_g@standard_name = "large_scale_precipitation_amount" precip_g@units = "mm" assignVarAttCoord(precip_g,time,0,0) end if if (out2dMet@precip_c) then precip_c = (/wrfout->RAINC/) ;accumulated total cumulus precip precip_c@long_name = "Accumulated Total Cumulus Precipitation" precip_c@standard_name = "convective_precipitation_amount" precip_c@units = "mm" assignVarAttCoord(precip_c,time,0,0) end if ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; two-dimensional near-surface / surface met variables (derived/diagnostic) ; -create variables if (out2dMet@slp) then slp = new((/nTime,nS_N,nW_E/), "float", "No_FillValue") ;slp end if if (out2dMet@Td_2m) then Td_2m = new((/nTime,nS_N,nW_E/), "float", "No_FillValue") ;Td_2m end if ; -read in the values using wrf_user_getvar do n = 0, nTime-1 if (out2dMet@slp) then slp(n,:,:) = (/wrf_user_getvar(wrfout,"slp",n)/) end if if (out2dMet@Td_2m) then Td_2m(n,:,:) = (/wrf_user_getvar(wrfout,"td2",n)/) end if end do if (out2dMet@slp) then slp@long_name = "Sea-Level Pressure" slp@standard_name = "air_pressure_at_sea_level" slp@units = "hPa" assignVarAttCoord(slp,time,0,0) ;slp end if if (out2dMet@Td_2m) then Td_2m@long_name = "Dewpoint Temperature at 2 m" Td_2m@standard_name = "dew_point_temperature" Td_2m@units = "degC" assignVarAttCoord(Td_2m,time,0,0) ;Td_2m end if end if ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; three-dimensional upper-level (eta) metorology variables if (outEta .or. outPressure) if (outEta@pp_e .or. outPressure@pp_p) then pp_e = (/wrfout->P/)/100. ;pp_e pp_e@long_name = "Pressure Perturbation at Eta Levels" pp_e@standard_name = "pressure_perturbation" pp_e@units = "hPa" assignVarAttCoord(pp_e,time,eta,2) end if if (outEta@q_e .or. outPressure@q_p) then q_e = (/wrfout->QVAPOR/) ;q_e q_e@long_name = "Mixing Ratio - Water Vapor" q_e@standard_name = "humidity_mixing_ratio" q_e@units = "kg kg-1" assignVarAttCoord(q_e,time,eta,2) end if if (outEta@q_cloud .or. outPressure@q_cloud_p) then q_cloud = (/wrfout->QCLOUD/) ;q_cloud q_cloud@long_name = "Mixing Ratio - Cloud" q_cloud@standard_name = "mass_fraction_of_cloud_condensed_water_in_air" q_cloud@units = "kg kg-1" assignVarAttCoord(q_cloud,time,eta,2) end if if (outEta@q_rain .or. outPressure@q_rain_p) then q_rain = (/wrfout->QRAIN/) ;q_rain q_rain@long_name = "Mixing Ratio - Rain" q_rain@standard_name = "mass_fraction_of_rain_in_air" q_rain@units = "kg kg-1" assignVarAttCoord(q_rain,time,eta,2) end if if ((outEta@q_ice .or. outPressure@q_ice_p) .and. \ isfilevar(wrfout, "QICE")) then q_ice = (/wrfout->QICE/) q_ice@long_name = "Mixing Ratio - Ice" q_ice@standard_name = "mass_fraction_of_ice_in_air" q_ice@units = "kg kg-1" assignVarAttCoord(q_ice,time,eta,2) end if if ((outEta@q_snow .or. outPressure@q_snow_p) .and. \ isfilevar(wrfout, "QSNOW")) then q_snow = (/wrfout->QSNOW/) ;q_snow q_snow@long_name = "Mixing Ratio - Snow" q_snow@standard_name = "mass_fraction_of_snow_in_air" q_snow@units = "kg kg-1" assignVarAttCoord(q_snow,time,eta,2) end if if ((outEta@q_graup .or. outPressure@q_graup_p) .and. \ isfilevar(wrfout, "QGRAUP")) then q_graup = (/wrfout->QGRAUP/) q_graup@long_name = "Mixing Ratio - Graupel" q_graup@standard_name = "mass_fraction_of_graupel_in_air" q_graup@units = "kg kg-1" assignVarAttCoord(q_graup,time,eta,2) end if ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; two-dimensional upper-level (eta) metorology variables ; -derived/diagnostic fields using wrf_user_getvar ; -create variables if (outEta@p_e .or. outPressure@p_p) then p_e = new((/nTime,nEta,nS_N,nW_E/), "float", "No_FillValue") ;p_e end if if (outEta@Z_e .or. outPressure@Z_p) then Z_e = new((/nTime,nEta,nS_N,nW_E/), "float", "No_FillValue") ;Z_e end if if (outEta@T_e .or. outPressure@T_p) then T_e = new((/nTime,nEta,nS_N,nW_E/), "float", "No_FillValue") ;T_e end if if (outEta@rh_e .or. outPressure@rh_p) then rh_e = new((/nTime,nEta,nS_N,nW_E/), "float", "No_FillValue") ;rh_e end if if (outEta@u_gr_e .or. outPressure@u_gr_p) then u_gr_e = new((/nTime,nEta,nS_N,nW_E/), "float", "No_FillValue") ;u_gr_e end if if (outEta@v_gr_e .or. outPressure@v_gr_p) then v_gr_e = new((/nTime,nEta,nS_N,nW_E/), "float", "No_FillValue") ;v_gr_e end if if (outEta@w_e .or. outPressure@w_p) then w_e = new((/nTime,nEta,nS_N,nW_E/), "float", "No_FillValue") ;w_e end if ; -read in the values using wrf_user_getvar do n = 0, nTime-1 if (outEta@p_e .or. outPressure@p_p) then p_e(n,:,:,:) = (/wrf_user_getvar(wrfout,"pressure",n)/) ;p_e end if if (outEta@Z_e .or. outPressure@Z_p) then Z_e(n,:,:,:) = (/wrf_user_getvar(wrfout,"z",n)/) ;Z_e end if if (outEta@T_e .or. outPressure@T_p) then T_e(n,:,:,:) = (/wrf_user_getvar(wrfout,"tk",n)/) ;T_e end if if (outEta@rh_e .or. outPressure@rh_p) then rh_e(n,:,:,:) = (/wrf_user_getvar(wrfout,"rh",n)/) ;rh_e end if if (outEta@u_gr_e .or. outPressure@u_gr_p) then u_gr_e(n,:,:,:) = (/wrf_user_getvar(wrfout,"ua",n)/) ;u_gr_e end if if (outEta@v_gr_e .or. outPressure@v_gr_p) then v_gr_e(n,:,:,:) = (/wrf_user_getvar(wrfout,"va",n)/) ;v_gr_e end if if (outEta@w_e .or. outPressure@w_p) then w_e(n,:,:,:) =(/wrf_user_getvar(wrfout,"wa",n)/) ;w_e end if end do if (outEta@p_e .or. outPressure@p_p) then p_e@long_name = "Pressure at Eta Levels" p_e@standard_name = "air_pressure" p_e@units = "hPa" assignVarAttCoord(p_e,time,eta,2) end if if (outEta@Z_e .or. outPressure@Z_p) then Z_e@long_name = "Geopotential Height at Eta Levels" Z_e@standard_name = "geopotential_height" Z_e@units = "m" assignVarAttCoord(Z_e,time,eta,2) end if if (outEta@T_e .or. outPressure@T_p) then T_e@long_name = "Temperature at Eta Levels" T_e@standard_name = "air_temperature" T_e@units = "K" assignVarAttCoord(T_e,time,eta,2) end if if (outEta@rh_e .or. outPressure@rh_p) then rh_e@long_name = "Relative Humidity at Eta Levels" rh_e@standard_name = "relative_humidity" rh_e@units = "percent" assignVarAttCoord(rh_e,time,eta,2) end if if (outEta@u_gr_e .or. outPressure@u_gr_p) then u_gr_e@long_name = "u-Component at Eta Levels (grid)" u_gr_e@standard_name = "eastward_wind" u_gr_e@units = "m s-1" assignVarAttCoord(u_gr_e,time,eta,2) end if if (outEta@v_gr_e .or. outPressure@v_gr_p) then v_gr_e@long_name = "v-Component at Eta Levels (grid)" v_gr_e@standard_name = "northward_wind" v_gr_e@units = "m s-1" assignVarAttCoord(v_gr_e,time,eta,2) end if if (outEta@w_e .or. outPressure@w_p) then w_e@long_name = "w-Component at Eta Levels" w_e@standard_name = "upward_wind" w_e@units = "m s-1" assignVarAttCoord(w_e,time,eta,2) end if end if ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; three-dimensional upper-level (pressure) metorology variables ; (variables on selected pressure levels) ; -derived/diagnostic fields using wrf_user_getvar ; -create the variables if (outPressure) then if (outPressure@Z_p) then Z_p = new((/nTime,nPressure,nS_N,nW_E/), "float", "No_FillValue") ;Z_p end if if (outPressure@T_p) then T_p = new((/nTime,nPressure,nS_N,nW_E/), "float", "No_FillValue") ;T_p end if if (outPressure@q_p) then q_p = new((/nTime,nPressure,nS_N,nW_E/), "float", "No_FillValue") ;q_p end if if (outPressure@rh_p) then rh_p = new((/nTime,nPressure,nS_N,nW_E/), "float", "No_FillValue") ;rh_p end if if (outPressure@u_gr_p) then u_gr_p = new((/nTime,nPressure,nS_N,nW_E/),"float","No_FillValue") ;u_gr_p end if if (outPressure@v_gr_p) then v_gr_p = new((/nTime,nPressure,nS_N,nW_E/),"float","No_FillValue") ;v_gr_p end if if (outPressure@w_p) then w_p = new((/nTime,nPressure,nS_N,nW_E/), "float", "No_FillValue") ;w_p end if if (outPressure@pp_p) then pp_p = new((/nTime,nPressure,nS_N,nW_E/), "float", "No_FillValue") ;pp_p end if if ((outPressure@q_cloud_p) .and. (isfilevar(wrfout, "QCLOUD"))) then q_cloud_p = new((/nTime,nPressure,nS_N,nW_E/),"float","No_FillValue") end if if ((outPressure@q_rain_p) .and. (isfilevar(wrfout, "QRAIN"))) then q_rain_p = new((/nTime,nPressure,nS_N,nW_E/),"float","No_FillValue") end if if ((outPressure@q_ice_p) .and. (isfilevar(wrfout, "QICE"))) then q_ice_p = new((/nTime,nPressure,nS_N,nW_E/),"float","No_FillValue") end if if ((outPressure@q_snow_p) .and. (isfilevar(wrfout, "QSNOW"))) then q_snow_p = new((/nTime,nPressure,nS_N,nW_E/),"float","No_FillValue") end if if ((outPressure@q_graup_p) .and. (isfilevar(wrfout, "QGRAUP"))) then q_graup_p = new((/nTime,nPressure,nS_N,nW_E/),"float","No_FillValue") end if do n = 0, nTime-1 ; loop through the times in the wrfout file do p = 0, nPressure-1 ; loop through the selected pressure levels if (outPressure@Z_p) then Z_p(n,p,:,:) = (/wrf_user_intrp3d(Z_e(n,:,:,:),p_e(n,:,:,:), \ ;Z_p "h",pressure(p),0,False)/) end if if (outPressure@T_p) then T_p(n,p,:,:) = (/wrf_user_intrp3d(T_e(n,:,:,:),p_e(n,:,:,:), \ ;T_p "h",pressure(p),0,False)/) end if if (outPressure@q_p) then q_p(n,p,:,:) = (/wrf_user_intrp3d(q_e(n,:,:,:),p_e(n,:,:,:), \;q_p "h",pressure(p),0,False)/) end if if (outPressure@rh_p) then rh_p(n,p,:,:) = (/wrf_user_intrp3d(rh_e(n,:,:,:),p_e(n,:,:,:), \;rh_p "h",pressure(p),0,False)/) end if if (outPressure@u_gr_p) then u_gr_p(n,p,:,:) = (/wrf_user_intrp3d(u_gr_e(n,:,:,:),p_e(n,:,:,:), \;u "h",pressure(p),0,False)/) end if if (outPressure@v_gr_p) then v_gr_p(n,p,:,:) = (/wrf_user_intrp3d(v_gr_e(n,:,:,:),p_e(n,:,:,:), \;v "h",pressure(p),0,False)/) end if if (outPressure@w_p) then w_p(n,p,:,:) = (/wrf_user_intrp3d(w_e(n,:,:,:),p_e(n,:,:,:), \ ;w_p "h",pressure(p),0,False)/) end if if (outPressure@pp_p) then pp_p(n,p,:,:) = (/wrf_user_intrp3d(pp_e(n,:,:,:),p_e(n,:,:,:), \ ;pp_p "h",pressure(p),0,False)/) end if if ((outPressure@q_cloud_p) .and. (isfilevar(wrfout, "QCLOUD"))) then q_cloud_p(n,p,:,:)=(/wrf_user_intrp3d(q_cloud(n,:,:,:),p_e(n,:,:,:), \ "h",pressure(p),0,False)/) end if if ((outPressure@q_rain_p) .and. (isfilevar(wrfout, "QRAIN"))) then q_rain_p(n,p,:,:) = (/wrf_user_intrp3d(q_rain(n,:,:,:),p_e(n,:,:,:), \ "h",pressure(p),0,False)/) end if if ((outPressure@q_ice_p) .and. (isfilevar(wrfout, "QICE"))) then q_ice_p(n,p,:,:) = (/wrf_user_intrp3d(q_ice(n,:,:,:),p_e(n,:,:,:), \ "h",pressure(p),0,False)/) end if if ((outPressure@q_snow_p) .and. (isfilevar(wrfout, "QSNOW"))) then q_snow_p(n,p,:,:) = (/wrf_user_intrp3d(q_snow(n,:,:,:),p_e(n,:,:,:), \ "h",pressure(p),0,False)/) end if if ((outPressure@q_graup_p) .and. (isfilevar(wrfout, "QGRAUP"))) then q_graup_p(n,p,:,:)=(/wrf_user_intrp3d(q_graup(n,:,:,:),p_e(n,:,:,:), \ "h",pressure(p),0,False)/) end if end do end do if (outPressure@Z_p) then Z_p@long_name = "Geopotential Height at Pressure Levels" Z_p@standard_name = "geopotential_height" Z_p@units = "m" assignVarAttCoord(Z_p,time,pressure,1) ;Z_p end if if (outPressure@T_p) then T_p@long_name = "Temperature at Pressure Levels" T_p@standard_name = "air_temperature" T_p@units = "K" assignVarAttCoord(T_p,time,pressure,1) ;T_p end if if (outPressure@q_p) then q_p@long_name = "Mixing Ratio at Pressure Levels" q_p@standard_name = "humidity_mixing_ratio" q_p@units = "kg kg-1" assignVarAttCoord(q_p,time,pressure,1) ;q_p end if if (outPressure@rh_p) then rh_p@long_name = "Relative Humidity at Pressure Levels" rh_p@standard_name = "relative_humidity" rh_p@units = "percent" assignVarAttCoord(rh_p,time,pressure,1) ;rh_p end if if (outPressure@u_gr_p) then u_gr_p@long_name = "u-Component at Pressure Levels (grid)" u_gr_p@standard_name = "eastward_wind" u_gr_p@units = "m s-1" assignVarAttCoord(u_gr_p,time,pressure,1) ;u_gr_p end if if (outPressure@v_gr_p) then v_gr_p@long_name = "v-Component at Pressure Levels (grid)" v_gr_p@standard_name = "northward_wind" v_gr_p@units = "m s-1" assignVarAttCoord(v_gr_p,time,pressure,1) ;v_gr_p end if if (outPressure@w_p) then w_p@long_name = "w-Component at Pressure Levels" w_p@standard_name = "upward_wind" w_p@units = "m s-1" assignVarAttCoord(w_p,time,pressure,1) ;w_p end if if (outPressure@pp_p) then pp_p@long_name = "Pressure-Perturbation at Pressure levels" pp_p@standard_name = "pressure_perturbation" pp_p@units = "hPa" assignVarAttCoord(pp_p,time,pressure,1) ;pp_p end if if ((outPressure@q_cloud_p) .and. (isfilevar(wrfout, "QCLOUD"))) then q_cloud_p@long_name = "Mixing Ratio - Cloud at Pressure Levels" q_cloud_p@standard_name ="mass_fraction_of_cloud_condensed_water_in_air" q_cloud_p@units = "kg kg-1" assignVarAttCoord(q_cloud_p,time,pressure,1) end if if ((outPressure@q_rain_p) .and. (isfilevar(wrfout, "QRAIN"))) then q_rain_p@long_name = "Mixing Ratio - Rain at Pressure Levels" q_rain_p@standard_name = "mass_fraction_of_rain_in_air" q_rain_p@units = "kg kg-1" assignVarAttCoord(q_rain_p,time,pressure,1) end if if ((outPressure@q_ice_p) .and. (isfilevar(wrfout, "QICE"))) then q_ice_p@long_name = "Mixing Ratio - Ice at Pressure Levels" q_ice_p@standard_name = "mass_fraction_of_ice_in_air" q_ice_p@units = "kg kg-1" assignVarAttCoord(q_ice_p,time,pressure,1) end if if ((outPressure@q_snow_p) .and. (isfilevar(wrfout, "QSNOW"))) then q_snow_p@long_name = "Mixing Ratio - Snow at Pressure Levels" q_snow_p@standard_name = "mass_fraction_of_snow_in_air" q_snow_p@units = "kg kg-1" assignVarAttCoord(q_snow_p,time,pressure,1) end if if ((outPressure@q_graup_p) .and. (isfilevar(wrfout, "QGRAUP"))) then q_graup_p@long_name = "Mixing Ratio - Graupel at Pressure Levels" q_graup_p@standard_name = "mass_fraction_of_graupel_in_air" q_graup_p@units = "kg kg-1" assignVarAttCoord(q_graup_p,time,pressure,1) end if end if ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; two-dimensional surface energy budget / radiation variables if (out2dRadFlx) then if (out2dRadFlx@SW_d) then SW_d = (/wrfout->SWDOWN/) ;downward shortwave flux at surface SW_d@long_name = "Shortwave Flux - Downward - at surface" SW_d@standard_name = "surface_downwelling_shortwave_flux" SW_d@units = "W m-2" assignVarAttCoord(SW_d,time,0,0) end if if (out2dRadFlx@LW_d) then LW_d = (/wrfout->GLW/) ;downward longwave flux at surface LW_d@long_name = "Longwave Flux - Downward - at surface" LW_d@standard_name = "surface_downwelling_longwave_flux" LW_d@units = "W m-2" assignVarAttCoord(LW_d,time,0,0) end if if (out2dRadFlx@LW_toa .and. isfilevar(wrfout, "OLR")) then LW_toa = (/wrfout->OLR/) ;top-of-atmosphere outgoing longwave LW_toa@long_name = "Longwave Flux - Outgoing - TOA" LW_toa@standard_name = "toa_outgoing_longwave_flux" LW_toa@units = "W m-2" assignVarAttCoord(LW_toa,time,0,0) end if if (out2dRadFlx@albedo) then albedo = (/wrfout->ALBEDO/) ;albedo albedo@long_name = "Albedo" albedo@standard_name = "surface_albedo" albedo@units = "" assignVarAttCoord(albedo,time,0,0) end if if (out2dRadFlx@SHFlx) then SHFlx = (/wrfout->HFX/) ;sensible heat flux at the surface SHFlx@long_name = "Sensible Heat Flux - Upward - at surface" SHFlx@standard_name = "surface_upward_sensible_heat_flux" SHFlx@units = "W m-2" assignVarAttCoord(SHFlx,time,0,0) end if if (out2dRadFlx@LHFlx) then LHFlx = (/wrfout->LH/) ;latent heat flux at the surface LHFlx@long_name = "Latent Heat Flux - Upward - at surface" LHFlx@standard_name = "surface_upward_latent_heat_flux" LHFlx@units = "W m-2" assignVarAttCoord(LHFlx,time,0,0) end if if (out2dRadFlx@MFlx) then MFlx = (/wrfout->QFX/) ;moisture heat flux at the surface MFlx@long_name = "Moisture Heat Flux - Upward - at surface" MFlx@standard_name = "surface_upward_water_flux" MFlx@units = "kg m-2 s-1" assignVarAttCoord(MFlx,time,0,0) end if if (out2dRadFlx@u_star .and. isfilevar(wrfout, "UST")) then u_star = (/wrfout->UST/) ;friction velocity (similarity) u_star@long_name = "Friction Velocity (u*)" u_star@standard_name = "" u_star@units = "m s-1" assignVarAttCoord(u_star,time,0,0) end if end if ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; two-dimensional surface/soil variables if (out2dLandSoil) then if (out2dLandSoil@LandMask) then LandMask = (/wrfout->LANDMASK/) ;land mask (1 - land, 0 - water) LandMask@long_name = "Land Mask" LandMask@standard_name = "land_binary_mask" LandMask@units = "" LandMask@notes = "1=land, 0=water" assignVarAttCoord(LandMask,time,0,0) end if if (out2dLandSoil@LandUse) then LandUse = (/wrfout->LU_INDEX/) ;land use category LandUse@long_name = "Land Use Category" LandUse@standard_name = "land_cover" LandUse@units = "" assignVarAttCoord(LandUse,time,0,0) end if if (out2dLandSoil@SoilT_L) then SoilT_L = (/wrfout->TMN/) ;soil temperature at lower boundary SoilT_L@long_name = "Soil Temperature - at lower boundery" SoilT_L@standard_name = "soil_temperature" SoilT_L@units = "K" assignVarAttCoord(SoilT_L,time,0,0) end if if ((out2dLandSoil@SoilT_B) .and. isfilevar(wrfout, "SOILTB")) then SoilT_B = (/wrfout->SOILTB/) ;bottom soil temperature SoilT_B@long_name = "Soil Temperature - bottom" SoilT_B@standard_name = "soil_temperature" SoilT_B@units = "K" assignVarAttCoord(SoilT_B,time,0,0) end if if (out2dLandSoil@GroundFlx) then GroundFlx = (/wrfout->GRDFLX/) ;ground heat flux GroundFlx@long_name = "Ground Heat Flux" GroundFlx@standard_name = "upward_heat_flux_at_ground_level_in_soil" GroundFlx@units = "W m-2" assignVarAttCoord(GroundFlx,time,0,0) end if if (out2dLandSoil@SnowHgt) then SnowHgt = (/wrfout->SNOWH/) ;snow height SnowHgt@long_name = "Snow Height" SnowHgt@standard_name = "surface_snow_thickness" SnowHgt@units = "m" assignVarAttCoord(SnowHgt,time,0,0) end if if (out2dLandSoil@SnowWater) then SnowWater = (/wrfout->SNOW/) ;snow water equivalent SnowWater@long_name = "Snow Water Equivalent" SnowWater@standard_name = "surface_snow_amount" SnowWater@units = "kg m-2" assignVarAttCoord(SnowWater,time,0,0) end if if ((out2dLandSoil@SnowDens) .and. isfilevar(wrfout, "RHOSN")) then SnowDens = (/wrfout->RHOSN/) ;snow density SnowDens@long_name = "Snow Density" SnowDens@standard_name = "snow_density" SnowDens@units = "kg m-3" assignVarAttCoord(SnowDens,time,0,0) end if if ((out2dLandSoil@SnowFlx) .and. isfilevar(wrfout, "SNOPCX")) then SnowFlx = (/wrfout->SNOPCX/) ;snow phase change heat flux SnowFlx@long_name = "Snow Phase Change Heat Flux" SnowFlx@standard_name = "surface_snow_melt_and_sublimation_heat_flux" SnowFlx@units = "W m-2" assignVarAttCoord(SnowFlx,time,0,0) end if if ((out2dLandSoil@SeaIce) .and. isfilevar(wrfout, "SEAICE")) then SeaIce = (/wrfout->SEAICE/) ;sea ice flag SeaIce@long_name = "Sea Ice Flag" SeaIce@standard_name = "seaice_binary_mask" SeaIce@units = "" SeaIce@notes = "1=seaice, 0=water" assignVarAttCoord(SeaIce,time,0,0) end if end if ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; three-dimensional soil variables ; (variables on staggered soil levels) if (outSoil) then if (outSoil@SoilTemp) then SoilTemp = (/wrfout->TSLB/) ;soil temperature SoilTemp@long_name = "Soil Temperature" SoilTemp@standard_name = "soil_temperature" SoilTemp@units = "K" assignVarAttCoord(SoilTemp,time,soil,3) end if if (outSoil@SoilTemp) then SoilMoist = (/wrfout->SMOIS/) ;soil moisture SoilMoist@long_name = "Soil Moisture" SoilMoist@standard_name = "soil_moisture_content" SoilMoist@units = "m3 m-3" assignVarAttCoord(SoilMoist,time,soil,3) end if if ((outSoil@SoilWater) .and. isfilevar(wrfout, "SH20")) then SoilWater = (/wrfout->SH20/) ;soil liquid water SoilWater@long_name = "Soil Liquid Water" SoilWater@standard_name = "soil_liquid_water_content" SoilWater@units = "m3 m-3" assignVarAttCoord(SoilWater,time,soil,3) end if end if ; -for some reason the time attribute is added to the eta levels during ; the interpolation routines - delete these attributes if (isvar("pressure") .and. isatt(pressure, "pressure")) then delete(pressure@pressure) end if if (isvar("Z_e") .and. isatt(Z_e, "time")) then delete(Z_e@time) end if if (isvar("p_e") .and. isatt(p_e, "time")) then delete(p_e@time) end if if (isvar("T_e") .and. isatt(T_e, "time")) then delete(T_e@time) end if if (isvar("u_gr_e") .and. isatt(u_gr_e, "time")) then delete(u_gr_e@time) end if if (isvar("v_gr_e") .and. isatt(v_gr_e, "time")) then delete(v_gr_e@time) end if if (isvar("w_e") .and. isatt(w_e, "time")) then delete(w_e@time) end if if (isvar("q_e") .and. isatt(q_e, "time")) then delete(q_e@time) end if if (isvar("pp_e") .and. isatt(pp_e, "time")) then delete(pp_e@time) end if if (isvar("rh_e") .and. isatt(rh_e, "time")) then delete(rh_e@time) end if if (isvar("q_cloud") .and. isatt(q_cloud, "time")) then delete(q_cloud@time) end if if (isvar("q_rain") .and. isatt(q_rain, "time")) then delete(q_rain@time) end if if (isvar("q_snow") .and. isatt(q_snow, "time")) then delete(q_snow@time) end if if (isvar("q_ice") .and. isatt(q_ice, "time")) then delete(q_ice@time) end if if (isvar("q_graup") .and. isatt(q_graup, "time")) then delete(q_graup@time) end if if (isvar("Z_p") .and. isatt(Z_p, "_FillValue")) then delete(Z_p@_FillValue) end if if (isvar("T_p") .and. isatt(T_p, "_FillValue")) then delete(T_p@_FillValue) end if if (isvar("q_p") .and. isatt(q_p, "_FillValue")) then delete(q_p@_FillValue) end if if (isvar("rh_p") .and. isatt(rh_p, "_FillValue")) then delete(rh_p@_FillValue) end if if (isvar("u_gr_p") .and. isatt(u_gr_p, "_FillValue")) then delete(u_gr_p@_FillValue) end if if (isvar("v_gr_p") .and. isatt(v_gr_p, "_FillValue")) then delete(v_gr_p@_FillValue) end if if (isvar("w_p") .and. isatt(w_p, "_FillValue")) then delete(w_p@_FillValue) end if if (isvar("pp_p") .and. isatt(pp_p, "_FillValue")) then delete(pp_p@_FillValue) end if if (isvar("q_cloud_p") .and. isatt(q_cloud_p, "_FillValue")) then delete(q_cloud_p@_FillValue) end if if (isvar("q_rain_p") .and. isatt(q_rain_p, "_FillValue")) then delete(q_rain_p@_FillValue) end if if (isvar("q_snow_p") .and. isatt(q_snow_p, "_FillValue")) then delete(q_snow_p@_FillValue) end if if (isvar("q_ice_p") .and. isatt(q_ice_p, "_FillValue")) then delete(q_ice_p@_FillValue) end if if (isvar("q_graup_p") .and. isatt(q_graup_p, "_FillValue")) then delete(q_graup_p@_FillValue) end if ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;check the limits for the output arrays, set 9999 to end of dataset if (limTime(1) .eq. 9999) then limTime(1) = nTime-1 end if if (limS_N(1) .eq. 9999) then limS_N(1) = nS_N-1 end if if (limW_E(1) .eq. 9999) then limW_E(1) = nW_E-1 end if if (outPressure) then if (limPres(1) .eq. 9999) then limPres(1) = nPressure-1 end if end if if (outEta) then if (limEta(1) .eq. 9999) then limEta(1) = nEta-1 end if end if if (outSoil) then if (limSoil(1) .eq. 9999) then limSoil(1) = nSoil-1 end if end if ;create filename and open post-processed netCDF file system ("rm "+file_out) ;remove any pre-exisiting file wrfpost = addfile(file_out,"c") ;create new netCDF file filedimdef (wrfpost, "time", nTime, True) ; create the global attributes ; establish a variable for a new line in the attributes nl = integertochar(10) ; newline character fileAtt = True fileAtt@creation_date = systemfunc("date") fileAtt@institution = "University of Colorado at Boulder - CIRES" fileAtt@created_by = "Mark Seefeldt - mark.seefeldt@colorado.edu" fileAtt@notes = "Created with NCL script: wrfout_to_cf.ncl v1.1.0" fileAtt@source = file_in fileAtt@Conventions = "CF-1.0" fileAtt@title = file_out fileattdef(wrfpost, fileAtt) ;write post-processed WRF data to netCDF file ; -date and time variables wrfpost->time=time(limTime(0):limTime(1)) if (outDateTime) then wrfpost->DateTime=DateTime(limTime(0):limTime(1)) end if if (outUTCDate) then wrfpost->year = year(limTime(0):limTime(1)) wrfpost->month = month(limTime(0):limTime(1)) wrfpost->day = day(limTime(0):limTime(1)) wrfpost->hour = hour(limTime(0):limTime(1)) wrfpost->minute = minute(limTime(0):limTime(1)) end if ; -vertical coordinate variables if (outPressure) then wrfpost->pressure=pressure(limPres(0):limPres(1)) end if if (outEta) then wrfpost->eta=eta(limEta(0):limEta(1)) end if if (outSoil) then wrfpost->soil=soil(limSoil(0):limSoil(1)) end if ; -one-dimensional coordinate variables if (axis) then wrfpost->south_north=south_north(limS_N(0):limS_N(1)) wrfpost->west_east=west_east(limW_E(0):limW_E(1)) end if ; -one-dimensional general model variables if (outPtop) then wrfpost->p_top=p_top(0) end if ; -two-dimensional mapping variables wrfpost->lat=lat(limS_N(0):limS_N(1),limW_E(0):limW_E(1)) wrfpost->lon=lon(limS_N(0):limS_N(1),limW_E(0):limW_E(1)) wrfpost->Z_sfc=Z_sfc(limS_N(0):limS_N(1),limW_E(0):limW_E(1)) ; -two-dimensional near-surface / surface met variables if (isvar("SST")) then wrfpost->SST=SST(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if if (isvar("T_sfc")) then wrfpost->T_sfc=T_sfc(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if if (isvar("p_sfc")) then wrfpost->p_sfc=p_sfc(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if if (isvar("slp")) then wrfpost->slp=slp(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if if (isvar("T_2m")) then wrfpost->T_2m=T_2m(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if if (isvar("Th_2m")) then wrfpost->Th_2m=Th_2m(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if if (isvar("Td_2m")) then wrfpost->Td_2m=Td_2m(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if if (isvar("q_2m")) then wrfpost->q_2m=q_2m(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if if (isvar("u_10m_gr")) then wrfpost->u_10m_gr=u_10m_gr(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if if (isvar("v_10m_gr")) then wrfpost->v_10m_gr=v_10m_gr(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if if (isvar("precip_g")) then wrfpost->precip_g=precip_g(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if if (isvar("precip_c")) then wrfpost->precip_c=precip_c(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if ; -three-dimensional upper-level (pressure) meteorology variables if (isvar("Z_p")) then wrfpost->Z_p=Z_p(limTime(0):limTime(1),limPres(0):limPres(1), \ limS_N(0):limS_N(1),limW_E(0):limW_E(1)) end if if (isvar("T_p")) then wrfpost->T_p=T_p(limTime(0):limTime(1),limPres(0):limPres(1), \ limS_N(0):limS_N(1),limW_E(0):limW_E(1)) end if if (isvar("q_p")) then wrfpost->q_p=q_p(limTime(0):limTime(1),limPres(0):limPres(1), \ limS_N(0):limS_N(1),limW_E(0):limW_E(1)) end if if (isvar("rh_p")) then wrfpost->rh_p=rh_p(limTime(0):limTime(1),limPres(0):limPres(1), \ limS_N(0):limS_N(1),limW_E(0):limW_E(1)) end if if (isvar("u_gr_p")) then wrfpost->u_gr_p=u_gr_p(limTime(0):limTime(1),limPres(0):limPres(1), \ limS_N(0):limS_N(1),limW_E(0):limW_E(1)) end if if (isvar("v_gr_p")) then wrfpost->v_gr_p=v_gr_p(limTime(0):limTime(1),limPres(0):limPres(1), \ limS_N(0):limS_N(1),limW_E(0):limW_E(1)) end if if (isvar("w_p")) then wrfpost->w_p=w_p(limTime(0):limTime(1),limPres(0):limPres(1), \ limS_N(0):limS_N(1),limW_E(0):limW_E(1)) end if if (isvar("pp_p")) then wrfpost->pp_p=pp_p(limTime(0):limTime(1),limPres(0):limPres(1), \ limS_N(0):limS_N(1),limW_E(0):limW_E(1)) end if ; -three-dimensional upper-level (eta) meteorology variables if (isvar("Z_e") .and. (outEta@Z_e)) then wrfpost->Z_e=Z_e(limTime(0):limTime(1),limEta(0):limEta(1), \ limS_N(0):limS_N(1),limW_E(0):limW_E(1)) end if if (isvar("p_e") .and. (outEta@p_e)) then wrfpost->p_e=p_e(limTime(0):limTime(1),limEta(0):limEta(1), \ limS_N(0):limS_N(1),limW_E(0):limW_E(1)) end if if (isvar("T_e") .and. (outEta@T_e)) then wrfpost->T_e=T_e(limTime(0):limTime(1),limEta(0):limEta(1), \ limS_N(0):limS_N(1),limW_E(0):limW_E(1)) end if if (isvar("q_e") .and. (outEta@q_e)) then wrfpost->q_e=q_e(limTime(0):limTime(1),limEta(0):limEta(1), \ limS_N(0):limS_N(1),limW_E(0):limW_E(1)) end if if (isvar("rh_e") .and. (outEta@rh_e)) then wrfpost->rh_e=rh_e(limTime(0):limTime(1),limEta(0):limEta(1), \ limS_N(0):limS_N(1),limW_E(0):limW_E(1)) end if if (isvar("u_gr_e") .and. (outEta@u_gr_e)) then wrfpost->u_gr_e=u_gr_e(limTime(0):limTime(1),limEta(0):limEta(1), \ limS_N(0):limS_N(1),limW_E(0):limW_E(1)) end if if (isvar("v_gr_e") .and. (outEta@v_gr_e)) then wrfpost->v_gr_e=v_gr_e(limTime(0):limTime(1),limEta(0):limEta(1), \ limS_N(0):limS_N(1),limW_E(0):limW_E(1)) end if if (isvar("w_e") .and. (outEta@w_e)) then wrfpost->w_e=w_e(limTime(0):limTime(1),limEta(0):limEta(1), \ limS_N(0):limS_N(1),limW_E(0):limW_E(1)) end if if (isvar("pp_e") .and. (outEta@pp_e)) then wrfpost->pp_e=pp_e(limTime(0):limTime(1),limEta(0):limEta(1), \ limS_N(0):limS_N(1),limW_E(0):limW_E(1)) end if if (isvar("q_cloud") .and. (outEta@q_cloud)) then wrfpost->q_cloud=q_cloud(limTime(0):limTime(1),limEta(0):limEta(1), \ limS_N(0):limS_N(1),limW_E(0):limW_E(1)) end if if (isvar("q_rain") .and. (outEta@q_rain)) then wrfpost->q_rain=q_rain(limTime(0):limTime(1),limEta(0):limEta(1), \ limS_N(0):limS_N(1),limW_E(0):limW_E(1)) end if if (isvar("q_ice") .and. (outEta@q_ice)) then wrfpost->q_ice=q_ice(limTime(0):limTime(1),limEta(0):limEta(1), \ limS_N(0):limS_N(1),limW_E(0):limW_E(1)) end if if (isvar("q_snow") .and. (outEta@q_snow)) then wrfpost->q_snow=q_snow(limTime(0):limTime(1),limEta(0):limEta(1), \ limS_N(0):limS_N(1),limW_E(0):limW_E(1)) end if if (isvar("q_graup") .and. (outEta@q_graup)) then wrfpost->q_graup=q_graup(limTime(0):limTime(1),limEta(0):limEta(1), \ limS_N(0):limS_N(1),limW_E(0):limW_E(1)) end if ; -two-dimensional surface energy budget / radiation variables if (isvar("SW_d")) then wrfpost->SW_d=SW_d(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if if (isvar("LW_d")) then wrfpost->LW_d=LW_d(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if if isvar("LW_toa") then wrfpost->LW_toa=LW_toa(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if if (isvar("albedo")) then wrfpost->albedo=albedo(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if if (isvar("SHFlx")) then wrfpost->SHFlx=SHFlx(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if if (isvar("LHFlx")) then wrfpost->LHFlx=LHFlx(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if if (isvar("MFlx")) then wrfpost->MFlx=MFlx(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if if isvar("u_star") then wrfpost->u_star=u_star(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if if (isvar("LandMask")) then wrfpost->LandMask=LandMask(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if if (isvar("LandUse")) then wrfpost->LandUse=LandUse(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if if (isvar("SoilT_L")) then wrfpost->SoilT_L=SoilT_L(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if if isvar("SoilT_B") then wrfpost->SoilT_B=SoilT_B(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if if (isvar("GroundFlx")) then wrfpost->GroundFlx=GroundFlx(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if if (isvar("SnowHgt")) then wrfpost->SnowHgt=SnowHgt(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if if (isvar("SnowWater")) then wrfpost->SnowWater=SnowWater(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if if isvar("SnowDens") then wrfpost->SnowDens=SnowDens(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if if isvar("SnowFlx") then wrfpost->SnowFlx=SnowFlx(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if if isvar("SeaIce") then wrfpost->SeaIce=SeaIce(limTime(0):limTime(1),limS_N(0):limS_N(1), \ limW_E(0):limW_E(1)) end if ; -three-dimensional soil variables if (isvar("SoilTemp")) then wrfpost->SoilTemp=SoilTemp(limTime(0):limTime(1),limSoil(0):limSoil(1), \ limS_N(0):limS_N(1),limW_E(0):limW_E(1)) end if if (isvar("SoilMoist")) then wrfpost->SoilMoist=SoilMoist(limTime(0):limTime(1),limSoil(0):limSoil(1), \ limS_N(0):limS_N(1),limW_E(0):limW_E(1)) end if if isvar("SoilWater") then wrfpost->SoilWater=SoilWater(limTime(0):limTime(1),limSoil(0):limSoil(1), \ limS_N(0):limS_N(1),limW_E(0):limW_E(1)) end if end