Download presentation
Presentation is loading. Please wait.
Published byKristina Richard Modified over 9 years ago
1
Physics Implementation Three_level Structure What you might need to do
WRF Model: Physics Implementation Shu-hua Chen NCAR/AFWA (UC Davis, Sep.) OUTLINE F S C I Y H P R W Physics Schemes Three_level Structure Rules for WRF physics WRF Physics Features WRF Language What you might need to do
2
Scheme Selection W F R Simple schemes for operation
Y H P R W Simple schemes for operation Complicated schemes for research
3
Physics Schemes W F R P I H C Y S Physical Process Available
Microphysics Kessler, Lin et al. , Ncloud3, Ncloud5 Cumulus KF, BMJ Subgrid scale turbulence TKE, Smagrinsky, Constant K Radiation RRTM(L), Dudhia(S), Goddard(S) PBL MRF Surface layer Similarity theory Land-surface layer layer soil temperature
4
• Physics Interface Design W F R Simple User friendly
Different dynamics cores Three-level structure =>
5
Three-level Structure
F S C I Y H P R W Solver Physics_driver SELECT CASE (CHOICE) CASE ( NOPHY ) CASE ( SCHEME1 ) CALL XXX CASE ( SCHEME2 ) CALL YYY . CASE DEFAULT END SELECT Individual physics scheme ( XXX )
6
W F R . . . P I H C Y S phy_prep phy_init Radiation_driver pbl_driver
… microphysics_driver Radiation_driver Cumulus_driver pbl_driver INIT . WRF solve_rk … moist_physics_prep ADV TENDENCIES . ADVANCE VARS .
7
phy_prep & moist_physics_prep
F S C I Y H P R W • Decouple variables • Convert variables from C grid to A grid
8
Three-level Structure
F S C I Y H P R W Solver Physics_driver SELECT CASE (CHOICE) CASE ( NOPHY ) CASE ( SCHEME1 ) CALL XXX CASE ( SCHEME2 ) CALL YYY . CASE DEFAULT END SELECT Individual physics scheme ( XXX )
9
Physics Standard Interface
W SELECT CASE (CHOICE) CASE ( NOPHY ) CASE ( SCHEME1 ) CALL XXX(…) CASE ( SCHEME2 ) CALL YYY(…) . CASE DEFAULT END SELECT Physics_driver
10
Three-level Structure
F S C I Y H P R W Solver Physics_driver SELECT CASE (CHOICE) CASE ( NOPHY ) CASE ( SCHEME1 ) CALL XXX CASE ( SCHEME2 ) CALL YYY . CASE DEFAULT END SELECT Individual physics scheme ( XXX )
11
Three Sets of Dimensions
C I Y H P R W Domain size: ids, ide, jds, jde, kds, kde Memory size: ims, ime, jms, jme, kms, kme Tile size: its, ite, jts, jte, kts, kte
12
Logical Domain (ids,kds,jds)
F S C I Y H P R W (ids,ide)
13
Memory size (ims,kms,jms)
F S C I Y H P R W patch (ids,ide) halo (ims,ime)
14
Tile size (its,kts,jds) W F R P I H C Y S tile (its,ite) (ims,ime)
halo (ims,ime) tile (its,ite)
15
W F R . . . P I H C Y S phy_prep phy_init Radiation_driver pbl_driver
… microphysics_driver Radiation_driver Cumulus_driver pbl_driver INIT . WRF solve_rk … moist_physics_prep ADV TENDENCIES . ADVANCE VARS .
16
Rules for WRF Physics F S C I Y H P R W Coding rules
17
Coding Rules W F R P I H C Y S 1. F90
Replace continuation characters in the 6th column with f90 continuation `&‘ at end of previous line Subroutine kessler(QV, T, & its,ite,jts,jte,kts,kte, & ims,ime,jms,jme,kms,kme, & ids,ide,jds,jde,kds,kde) F77 Subroutine kessler(QV, T, & its,ite,jts,jte,kts,kte,& ims,ime,jms,jme,kms,kme,& ids,ide,jds,jde,kds,kde ) F90
18
Coding Rules W F R P I H C Y S 1. F90
Replace continuation characters in the 6th column with f90 continuation `&‘ at end of previous line b)Replace the 1st column `C` for comment with `!` c This is a test F77 ! This is a test F90
19
Coding Rules W F R P I H C Y S 1. F90 2. No common block
Replace continuation characters in the 6th column with f90 continuation `&‘ at end of previous line b)Replace the 1st column `C` for comment with `!` 2. No common block 3. Use “ implicit none ” 4. Use “ intent ” 5. Variable dimensions and do loops
20
Rules for WRF Physics W F R Coding rules One scheme one module P I H C
Naming rules
21
Naming Rules W ex, module_cu_kf.F F R cu is for cumulus
Y H P R W module_yy_xxx.F (module) yy = ra is for radiation bl is for PBL cu is for cumulus mp is for microphysics. xxx = individual scheme ex, module_cu_kf.F
22
Naming Rules W F R ex, RTHBLTEN P I H C Y S cu is for cumulus
RXXYYTEN (tendencies) XX = variable (th, u, v, qv, qc, … ) YY = ra is for radiation bl is for PBL cu is for cumulus ex, RTHBLTEN
23
Rules for WRF Physics W F R One scheme one module Naming rules P I H C
Coding rules One scheme one module Naming rules Vectorized code preferred ( might depend on which physics component )
24
WRF Physics Features W F R • Unified global constatnts P I H C Y S
(module_model_constants.F) REAL , PARAMETER :: r_d = 287. REAL , PARAMETER :: r_v = 461.6 REAL , PARAMETER :: cp = 7.*r_d/2. REAL , PARAMETER :: cv = cp-r_d .
25
WRF Physics Features W F R • Unified global constatnts
(module_model_constants.F) • Unified common calculations (saturation mixing ratio) • Vertical index (kms is at the bottom)
26
Three-level Structure
F S C I Y H P R W Solver Physics_driver SELECT CASE (CHOICE) CASE ( NOPHY ) CASE ( SCHEME1 ) CALL XXX CASE ( SCHEME2 ) CALL YYY . CASE DEFAULT END SELECT Individual physics scheme ( XXX )
27
WRF Physics Features W F R • Unified global constatnts
(module_model_constants.F) • Unified common calculations (saturation mixing ratio) • Vertical index (kms is at bottom) • kme = kte + 1 (physics) kme = kte (dynamics)
28
WRF Language W F R • Patch, tile, ….
S C I Y H P R W • Patch, tile, …. • Moisture field, moist(i,k,j,?), is 4D • ? = P_QV, P_QC, P_QR, P_QI,P_QS, P_QG (module_state_description.F) • PARAM_FIRST_SCALAR IF ( P_QI .ge. PARAM_FIRST_SCALAR ) . . .
29
W P_QV, P_QC, P_QR, … F R Registry P I H C Y S
package kesslerscheme mp_physics==1 - moist:qv,qc,qr package linscheme mp_physics== moist:qv,qc,qr,qi,qs,qg package ncepcloud mp_physics==3 - moist:qv,qc,qr package ncepcloud mp_physics==4 - moist:qv,qc,
30
What you might need to do ?
F S C I Y H P R W Run existing codes (namelist.input) Physics Buffet mp_physics = 2, ra_lw_physics = 1, ra_sw_physics = 1, bl_sfclay_physics = 1, bl_surface_physics = 1, bl_pbl_physics = 1, cu_physics = 1,
31
What you might need to do ?
F S C I Y H P R W Run existing codes Modify existing codes Plug in your own codes
32
WRF Development Team F S C I Y H P R W
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.