Initialization for Real Data Cases Dave Gill [email protected].

16
Initialization for Initialization for Real Data Cases Real Data Cases Dave Gill Dave Gill [email protected] [email protected] wrf-model.org wrf-model.org

Transcript of Initialization for Real Data Cases Dave Gill [email protected].

Page 1: Initialization for Real Data Cases Dave Gill gill@ucar.eduwrf-model.org.

Initialization for Real Data CasesInitialization for Real Data Cases

Dave GillDave Gill

[email protected]@ucar.edu

wrf-model.orgwrf-model.org

Page 2: Initialization for Real Data Cases Dave Gill gill@ucar.eduwrf-model.org.
Page 3: Initialization for Real Data Cases Dave Gill gill@ucar.eduwrf-model.org.

PandasPandas

Ingest only bamboo Ingest only bamboo shootsshoots

Lethargic, indifferent Lethargic, indifferent mating habitsmating habits

real.exereal.exe

Ingests only SI dataIngests only SI data

Doesn’t screw you very Doesn’t screw you very oftenoften

Page 4: Initialization for Real Data Cases Dave Gill gill@ucar.eduwrf-model.org.

WRF real-data initWRF real-data init

NECESSARY – the minimum changes:NECESSARY – the minimum changes:How to run real data initializationHow to run real data initialization1)1) Fix namelistFix namelist2)2) Put SI data in right placePut SI data in right place3)3) Run real.exeRun real.exe

Rest of things to take up time slotRest of things to take up time slotFiles you see before and afterFiles you see before and afterNecessary fieldsNecessary fieldsBalancingBalancingList of gotcha’sList of gotcha’sProgram flowProgram flow

Page 5: Initialization for Real Data Cases Dave Gill gill@ucar.eduwrf-model.org.

Running real-data initRunning real-data init

Real.exe controlled by namelist file (same one as Real.exe controlled by namelist file (same one as WRF). Located in WRF). Located in ./WRFV1/test/em_real./WRFV1/test/em_real directorydirectory

Modify times to process:Modify times to process:time_step_maxtime_step_max

Domain size (maximal dimensions for C-grid)Domain size (maximal dimensions for C-grid)s_we, e_wes_we, e_we

s_sn, e_sns_sn, e_sn

s_vert, e_verts_vert, e_vert

Page 6: Initialization for Real Data Cases Dave Gill gill@ucar.eduwrf-model.org.

Running real-data initRunning real-data init

Domain grid configuration:Domain grid configuration:dx, dydx, dydt, ztopdt, ztop

Times to process:Times to process:start_year, start_month, start_year, start_month, start_day, start_hourstart_day, start_hour

end_year, end_month, end_day, end_year, end_month, end_day, end_hourend_hour

interval_secondsinterval_seconds

Page 7: Initialization for Real Data Cases Dave Gill gill@ucar.eduwrf-model.org.

Running real-data initRunning real-data init

Get SI-output data in place – Get SI-output data in place – # cd ./WRFV1/test/em_real# cd ./WRFV1/test/em_real# ln –s ${SI_LOC}/data/siprd/real_input_em.* .# ln –s ${SI_LOC}/data/siprd/real_input_em.* .Expect to have a single file for each time period Expect to have a single file for each time period

to be processed + the metadata fileto be processed + the metadata file

Run the executable in this directoryRun the executable in this directory # ./real.exe# ./real.exe

Single processor onlySingle processor only

Page 8: Initialization for Real Data Cases Dave Gill gill@ucar.eduwrf-model.org.

Data Files before and afterData Files before and after

Before: Before: Foreach time period - Foreach time period -

real_input_em_d01.2002-06-27_18:00:00real_input_em_d01.2002-06-27_18:00:00

Only once -Only once -

real_input_em.global.metadatareal_input_em.global.metadata From SI system, final output from vinterpFrom SI system, final output from vinterp

Page 9: Initialization for Real Data Cases Dave Gill gill@ucar.eduwrf-model.org.

Data Files before and afterData Files before and after

After:After:wrfinput, wrfbdywrfinput, wrfbdy

Currently, in netCDF format, view with Currently, in netCDF format, view with ncdumpncdump utility utility

Page 10: Initialization for Real Data Cases Dave Gill gill@ucar.eduwrf-model.org.

Necessary FieldsNecessary Fields

SI provides 3d, 2d, 1d, and constantsSI provides 3d, 2d, 1d, and constants3d: u, v, mixing ratio, potential temperature3d: u, v, mixing ratio, potential temperature

2d: map factors, Coriolis, lat/lon, map rotations, ground 2d: map factors, Coriolis, lat/lon, map rotations, ground temp, skin temp, dry surface pressure, land use temp, skin temp, dry surface pressure, land use categories, terraincategories, terrain

1d: eta (vertical coordinate)1d: eta (vertical coordinate)

Already on correct vertical coordinate, each Already on correct vertical coordinate, each variable is in its correct staggering location, all variable is in its correct staggering location, all maximally dimensioned (i,j,k) orderingmaximally dimensioned (i,j,k) ordering

Generic reader routineGeneric reader routine

Page 11: Initialization for Real Data Cases Dave Gill gill@ucar.eduwrf-model.org.

Balancing - baseBalancing - base

1.1. Define base state surface pressure, function of Define base state surface pressure, function of elevationelevation

2.2. pb = znu(psurf-ptop) + ptoppb = znu(psurf-ptop) + ptop

3.3. tb = (t00 + A ln(pb/p00) * (p00/pb)^(R/Cp) tb = (t00 + A ln(pb/p00) * (p00/pb)^(R/Cp)

4.4. alb = (R/p1000)*tb*(pb/p1000)^cvpmalb = (R/p1000)*tb*(pb/p1000)^cvpm

5.5. mub = psurf – ptop; mu = pdsurf - psurfmub = psurf – ptop; mu = pdsurf - psurf

6.6. phb = phb phb = phb k-1k-1 – 1/znu * mub * alb – 1/znu * mub * alb

The The codecode

Page 12: Initialization for Real Data Cases Dave Gill gill@ucar.eduwrf-model.org.

BalancingBalancing

Top level:Top level:p = -0.5 (mu + q * mub * 1/znu)p = -0.5 (mu + q * mub * 1/znu)

qv = 1 + 1.61 qqv = 1 + 1.61 q

alt = (R/p1000)*t*qv((p+pb)/p1000)^cvpmalt = (R/p1000)*t*qv((p+pb)/p1000)^cvpm

al = alt – albal = alt – alb

The The codecode

Page 13: Initialization for Real Data Cases Dave Gill gill@ucar.eduwrf-model.org.

BalancingBalancing

Integrate down:Integrate down:p, moisture, inverse density p, moisture, inverse density

ph = ph ph = ph k-1k-1 – dnw * ( mub + mu*alt ) – dnw * ( mub + mu*alt )

u,v as input; w=0u,v as input; w=0 No other moisture initialized than mixing No other moisture initialized than mixing

ratioratio

Page 14: Initialization for Real Data Cases Dave Gill gill@ucar.eduwrf-model.org.

List of Gotcha’sList of Gotcha’s

LSM: LSM: num_soil_layers = 4num_soil_layers = 4, must re-, must re-run real.exe if swapping run real.exe if swapping bl_surface_physicsbl_surface_physics

Dates must match SI output files, SI files Dates must match SI output files, SI files must be in working directorymust be in working directory

Domain size and various grid Domain size and various grid configurations are compared to the namelist configurations are compared to the namelist values – don’t share the global metadata filevalues – don’t share the global metadata file

Single processor onlySingle processor only mm52wrf only works for ehmm52wrf only works for eh

Page 15: Initialization for Real Data Cases Dave Gill gill@ucar.eduwrf-model.org.

Program FlowProgram Flow

All main programs are in ./WRFV1/mainAll main programs are in ./WRFV1/mainDo-it-once items: namelist, allocate spaceDo-it-once items: namelist, allocate spaceTime loopTime loop

initialize domain for current timeinitialize domain for current timeif time=0, output ICif time=0, output ICcouple u,v,t,ph,q for lateral BCcouple u,v,t,ph,q for lateral BCcompute tendencies, output if time > 0compute tendencies, output if time > 0

End Time loopEnd Time loop

Page 16: Initialization for Real Data Cases Dave Gill gill@ucar.eduwrf-model.org.

Program FlowProgram Flow

Inside each time loopInside each time loop

Read SI input file (flat, binary, Fortran)Read SI input file (flat, binary, Fortran)

Assign 2d arrays – be careful of array sizesAssign 2d arrays – be careful of array sizes

Logic to determine which fields to use based on Logic to determine which fields to use based on which fields you have and physics options which fields you have and physics options selectedselected

Soil data initialization and adjustment, % categoricalSoil data initialization and adjustment, % categorical

Base state computationsBase state computations

Diagnose balanced fields for input to WRFDiagnose balanced fields for input to WRF