diff --git a/WRF.COMMON/WRFV3/Registry/Registry.EM b/WRF.COMMON/WRFV3/Registry/Registry.EM index 20d7e8f5..f484568d 100644 --- a/WRF.COMMON/WRFV3/Registry/Registry.EM +++ b/WRF.COMMON/WRFV3/Registry/Registry.EM @@ -70,6 +70,121 @@ dimspec v - constant=1 z one ################################################################################ ################################################################################ + +####MARS MARS MARS MARS MARS +####MARS MARS MARS MARS MARS +#### +#### variables physiques ecrites dans les fichiers WRF +#### - h indique l'ecriture +#### +#### +#### RADIATIVE TRANSFER +state real HR_SW ikj misc 1 - - "HR_SW" "HEATING RATE SW" "K/s" +state real HR_LW ikj misc 1 - - "HR_LW" "HEATING RATE LW" "K/s" +state real HR_DYN ikj misc 1 - - "HR_DYN" "HEATING RATE DYN" "K/s" +state real DDT ikj misc 1 - - "DDT" "TEMPERATURE TENDENCY" "K/s" +state real DT_RAD ikj misc 1 - - "DT_RAD" "RADIATIVE TEMPERATURE TENDENCY" "K/s" +state real DT_VDF ikj misc 1 - - "DT_VDF" "PBL CLMAIN TEMPERATURE TENDENCY" "K/s" +state real DT_AJS ikj misc 1 - - "DT_AJS" "AJUSTEMENT SEC TEMPERATURE TENDENCY" "K/s" + +state real SWDOWNZ ij misc 1 - - "SWDOWNZ" "DOWNWARD SW FLUX AT SURFACE" "W m-2" +#### DUST CYCLE +state real TAU_DUST ij misc 1 - - "TAU_DUST" "REFERENCE VISIBLE DUST OPACITY" "" +state real RDUST ikj misc 1 - - "RDUST" "DUST RADIUS" "m" +state real QSURFDUST ij misc 1 - - "QSURFDUST" "DUST MASS AT SURFACE" "kg m-2" +#### CLOUDS +state real MTOT ij misc 1 - - "MTOT" "TOTAL MASS WATER VAPOR in pmic" "pmic" +state real ICETOT ij misc 1 - - "ICETOT" "TOTAL MASS WATER ICE" "kg m-2" +state real VMR_ICE ikj misc 1 - - "VMR_ICE" "VOL. MIXING RATIO ICE" "ppm" +state real TAU_ICE ij misc 1 - - "TAU_ICE" "CLOUD OD at 825 cm-1 TES" "" +state real RICE ikj misc 1 - - "RICE" "ICE RADIUS" "m" +#### THERMALS +state real ZMAX ij misc 1 - - "ZMAX" "MAXIMUM LEVEL THERMALS" "m" +state real HFMAX ij misc 1 - - "HFMAX" "MAXIMUM PBL HEAT FLUX" "m.K/s" +#### GENERIC OUTPUTS +state real CLOUDFRAC ikj misc 1 - - "CLOUDFRAC" "CLOUD FRACTION" "" +state real TOTCLOUDFRAC ij misc 1 - - "TOTCLOUDFRAC" "COLUMN CLOUD FRACTION" "" +state real GRAIN ikj misc 1 - - "RAIN" "RAIN kg/kg.s-1" "" +state real GSNOW ikj misc 1 - - "SNOW" "SNOW kg/kg.s-1" "" +state real ALBEQ ij misc 1 - - "ALBEQ" "ALBEDO EQUIVALENT" "" +state real FLUXTOP_DN ij misc 1 - - "FLUXTOP_DN" "Incoming SW radiation at the TOA" "W.m-2" +state real FLUXABS_SW ij misc 1 - - "FLUXABS_SW" "Absorbed SW flux" "W.m-2" +state real FLUXTOP_LW ij misc 1 - - "FLUXTOP_LW" "Outgoing LW flux TOA" "W.m-2" +state real FLUXSURF_SW ij misc 1 - - "FLUXSURF_SW" "SW Surface flux" "W.m-2" +state real FLUXSURF_LW ij misc 1 - - "FLUXSURF_LW" "LW Surface flux" "W.m-2" +state real FLXGRD ij misc 1 - h "FLXGRD" "heat flux from ground" "W.m-2" +state real LSCEZ ikj misc 1 - - "LSCEZ" "heat from largescale" "W.m-2" +state real H2OICE_REFF ikj misc 1 - - "H2OICE_REFF" "Radii of H2O ice" "m" +state real LATENT_HF ij misc 1 - - "LATENT_HF" "Latent heat flux" "W.m-2" +state real REEVAP ij misc 1 - - "REEVAP" "Re-evaporation flux of precipitation (integrated over the atmospheric column)" +state real SURFRAIN ij misc 1 - - "SURFRAIN" "Rainfall" "kg m-2 s-1" + +#### +#### +####MARS MARS MARS MARS MARS +####MARS MARS MARS MARS MARS + +####MARS MARS MARS MARS MARS +####MARS MARS MARS MARS MARS +#### +#### +#### TRACEURS: POUR L'INSTANT NE PAS CHANGER L'ORDRE (>> mais l'ordre n'est-il pas defini plus bas ? dans les options mars ?) +#### - effacer le h si l'on veut eviter les sorties +#### +state real - ikjftb scalar 1 - - - +state real QH2O ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QH2O" "Water vapor mixing ratio" "kg kg-1" +state real QH2O_ICE ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QH2O_ICE" "Water ice mixing ratio" "kg kg-1" +state real qdust ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QDUST" "Dust mixing ratio" "kg kg-1" +state real qdustn ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QDUSTN" "Dust number density" " m-3 " +state real qtrac1 ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "qtrac1" "Decaying tracer 1" "kg kg-1" +state real qccn ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QCCN" "CCN mixing ratio" "kg kg-1" +state real qccnn ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QCCNN" "CCN number mixing ratio" "kg kg-1" +#### +#### +####MARS MARS MARS MARS MARS +####MARS MARS MARS MARS MARS +###VENUS TRACER +state real qco2 ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QCO2" "CO2 number mixing ratio" "kg kg-1" +state real qco ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QCO" "CO number mixing ratio" "kg kg-1" +state real qh2 ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QH2" "H2 number mixing ratio" "kg kg-1" +state real qo1d ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QO1D" "O1d number mixing ratio" "kg kg-1" +state real qo ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QO" "O number mixing ratio" "kg kg-1" +state real qo2 ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QO2" "O2 number mixing ratio" "kg kg-1" +state real qo2dg ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QO2dg" "O2dg number mixing ratio" "kg kg-1" +state real qo3 ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QO3" "O3 number mixing ratio" "kg kg-1" +state real qh ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QH" "H number mixing ratio" "kg kg-1" +state real qoh ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QOH" "OH number mixing ratio" "kg kg-1" +state real qho2 ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QHO2" "HO2 number mixing ratio" "kg kg-1" +state real qh2o2 ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QH2O2" "H2O2 number mixing ratio" "kg kg-1" +state real qcl ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QCL" "Cl number mixing ratio" "kg kg-1" +state real qclo ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QCLO" "ClO number mixing ratio" "kg kg-1" +state real qcl2 ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QCL2" "Cl2 number mixing ratio" "kg kg-1" +state real qhcl ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QHCL" "HCl number mixing ratio" "kg kg-1" +state real qhocl ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QHOCL" "HOCl number mixing ratio" "kg kg-1" +state real qclco ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QCLCO" "ClCO number mixing ratio" "kg kg-1" +state real qclco3 ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QCLCO3" "ClCO3 number mixing ratio" "kg kg-1" +state real qcocl2 ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QCOCL2" "COCl2 number mixing ratio" "kg kg-1" +state real qss ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QS" "S number mixing ratio" "kg kg-1" +state real qso ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QSO" "SO number mixing ratio" "kg kg-1" +state real qso2 ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QSO2" "SO2 number mixing ratio" "kg kg-1" +state real qso3 ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QSO3" "SO3 number mixing ratio" "kg kg-1" +state real qs2o2 ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QS2O2" "S2O2 number mixing ratio" "kg kg-1" +state real qocs ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QOCS" "OCS number mixing ratio" "kg kg-1" +state real qhso3 ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QHSO3" "HSO3 number mixing ratio" "kg kg-1" +state real qh2so4 ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QH2SO4" "H2SO4 number mixing ratio" "kg kg-1" +state real qs2 ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QS2" "S2 number mixing ratio" "kg kg-1" +state real qclso2 ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QCLSO2" "ClSO2 number mixing ratio" "kg kg-1" +state real qoscl ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QOSCL" "OSCl number mixing ratio" "kg kg-1" +state real qh2oliq ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QH2OLIQ" "H2O liq number mixing ratio" "kg kg-1" +state real qh2so4liq ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QH2SO4LIQ" "H2SO4 liq number mixing ratio" "kg kg-1" + + + + + + + + #state real floob ikjb dyn_em 1 - #state real floob_x ikjx dyn_em 1 - #state real floob_y ikjy dyn_em 1 - @@ -90,7 +205,7 @@ dimspec v - constant=1 z one # interpolated with a mask, as lu_index supplies that mask. # this next 1 is for the HFSoLE/PET demo; writing these to auxhist1 output over MCEL for coupling # with wave model, only if compiled with -DMCELIO, JM 2003/05/29 -state real LU_INDEX ij misc 1 - i02rh01d=(interp_fcnm)u=(copy_fcnm) "LU_INDEX" "LAND USE CATEGORY" "" +state real LU_INDEX ij misc 1 - i02r01d=(interp_fcnm)u=(copy_fcnm) "LU_INDEX" "LAND USE CATEGORY" "" state real LU_MASK ij misc 1 - i3h1 "LU_MASK" "0 land 1 water" "" # znw, znu, dzs, and zs must be listed before any 3-d fields @@ -101,8 +216,8 @@ state real LU_MASK ij misc 1 - i3h1 "LU state real znu k dyn_em 1 - irh "znu" "eta values on half (mass) levels" "" state real znw k dyn_em 1 Z i01rh "znw" "eta values on full (w) levels" "" -state real ZS l misc - Z irh "ZS" "DEPTHS OF CENTERS OF SOIL LAYERS" "m" -state real DZS l misc - Z irh "DZS" "THICKNESSES OF SOIL LAYERS" "m" +state real ZS l misc - Z ir "ZS" "DEPTHS OF CENTERS OF SOIL LAYERS" "m" +state real DZS l misc - Z ir "DZS" "THICKNESSES OF SOIL LAYERS" "m" # # Variables from WPS @@ -136,12 +251,58 @@ state real qg_gc igj dyn_em 1 Z i1 "QG" " state real qni_gc igj dyn_em 1 Z i1 "QNI" "ice no concentration" "m-3" endif +####MARS MARS MARS MARS MARS +####MARS MARS MARS MARS MARS +#### +#### INITIALISATION +#### +#### variables dans real +#### + +state real albedo_gcm_gc ij dyn_em 1 - i1 "ALBEDO_GCM" "albedo of naked ground" "0 - 1 fraction" +state real therm_inert_gc ij dyn_em 1 - i1 "THERMAL_INERTIA" "thermal inertia" "J/m2/K/s0.5" +state real z0_gc ij dyn_em 1 - i1 "SURF_ROUGHNESS" "surface roughness" "cm" +state real slpx_gc ij dyn_em 1 - i1 "SLPX" "slope x direction" "rad" +state real slpy_gc ij dyn_em 1 - i1 "SLPY" "slope y direction" "rad" +state real hv_gc igj dyn_em 1 Z i1 "HV" "water vapor" "kg/kg" +state real hi_gc igj dyn_em 1 Z i1 "HI" "water ice" "kg/kg" +state real tsoil_gc igj dyn_em 1 Z i1 "TSOIL" "soil temperatures" "K" +state real isoil_gc igj dyn_em 1 Z i1 "ISOIL" "soil thermal inertia" "tiu" +state real dsoil_gc igj dyn_em 1 Z i1 "DSOIL" "soil depths" "m" +#### +#### variables dans wrf +#### +#### 'm_' prefix is to avoid redundancies with possible existing terrestrial variables +#### +#### vvvv nom pour module_initialize, solve_em, lmd_driver (interne fortran) +#### vvvv nom fichier netCDF (important initialisation +################################################################################################################ +state real m_albedo ij misc 1 - i012rd "MARS_ALB" "albedo of naked ground" "0 - 1 fraction" +state real m_ti ij misc 1 - i012rd "MARS_TI" "thermal inertia" "J/m2/K/s0.5" +state real m_z0 ij misc 1 - i012rd "MARS_Z0" "surface roughness" "m" +state real slpx ij misc 1 - i012rd "SLOPEX" "slope x direction" "rad" +state real slpy ij misc 1 - i012rd "SLOPEY" "slope y direction" "rad" +state real m_emiss ij misc 1 - i012rd "MARS_EMISS" "emissivity" "0 - 1 fraction" +state real m_co2ice ij misc 1 - i012rd "MARS_CICE" "co2 ground ice" "kg/m2" +state real m_h2oice ij misc 1 - i012rd "MARS_WICE" "h2o ground ice" "kg/m2" +state real m_fluxrad ij misc 1 - i012rd "MARS_FLUXRAD" "net rad flux at surf" "W.m-2" +state real m_wstar ij misc 1 - i012rd "MARS_WSTAR" "free convection velocity" "m.s-1" +state real m_tsurf ij misc 1 - i012rhd "MARS_TSURF" "surface temperature" "K" +state real m_tsoil ilj misc 1 - i012rd "MARS_TSOIL" "soil temperatures" "K" +state real m_q2 ikj misc 1 Z i012rd "MARS_Q2" "parameterized TKE" "kg.m-3" +state real m_isoil ilj misc 1 - i012rd "MARS_ISOIL" "soil thermal inertia" "tiu" +state real m_dsoil ilj misc 1 - i012rd "MARS_DSOIL" "soil depths" "m" +state real m_gw ilj misc 1 - i012rd "MARS_GW" "gwparam" " " +#### +#### +####MARS MARS MARS MARS MARS +####MARS MARS MARS MARS MARS + #----------------------------------------------------------------------------------------------------------------------------------------------------------------- # # Variables for Eulerian mass coordinate dynamics # - # Velocities # # U Vel @@ -176,14 +337,18 @@ i1 real w_save ikj dyn_em 1 Z # Geopotential state real ph ikjb dyn_em 2 Z \ - irhusdf=(bdy_interp:dt) "ph" "perturbation geopotential" "m2 s-2" -state real phb ikj dyn_em 1 Z irhdus "phb" "base-state geopotential" "m2 s-2" + irusdf=(bdy_interp:dt) "ph" "perturbation geopotential" "m2 s-2" +state real phb ikj dyn_em 1 Z irdus "phb" "base-state geopotential" "m2 s-2" state real phb_fine ikj dyn_em 1 Z - "phb_fine" "for nesting, temp holding interpolated coarse grid phb" "m2 s-2" state real ph0 ikj dyn_em 1 Z r "ph0" "initial geopotential" "m2 s-2" state real php ikj dyn_em 1 Z r "php" "geopotential" "m2 s-2" i1 real ph_tend ikj dyn_em 1 Z i1 real ph_tendf ikj dyn_em 1 Z i1 real ph_save ikj dyn_em 1 Z +## +## MARS: TO GET LIGHTER HISTORY FILES +## +state real phtot ikj dyn_em 1 Z irh "PHTOT" "total geopotential" "m2 s-2" # Potential Temperature state real t ikjb dyn_em 2 - \ @@ -195,13 +360,13 @@ i1 real t_tendf ikj dyn_em 1 - state real tp ikj dyn_em 2 - i1 real t_2save ikj dyn_em 1 - state real t_save ikj dyn_em 1 - "t_save" -# - +# +state real tz_init ikj dyn_em 1 - ir "tz_init" "initial potential temperature" "K" # Mass state real mu ijb dyn_em 2 - \ - irhusdf=(bdy_interp:dt) "mu" "perturbation dry air mass in column" "Pa" -state real mub ij dyn_em 1 - irhdus "mub" "base state dry air mass in column" "Pa" + irusdf=(bdy_interp:dt) "mu" "perturbation dry air mass in column" "Pa" +state real mub ij dyn_em 1 - irdus "mub" "base state dry air mass in column" "Pa" state real mub_fine ij dyn_em 1 - - "mub_fine" "nest temp, holds interpolated coarse grid mub" "Pa" state real mub_save ij dyn_em 1 - - "mub_save" "nest temp, holds orig fine grid mub" "Pa" state real mu0 ij dyn_em 1 - i01rdu "mu0" "initial dry mass in column" "Pa" @@ -218,7 +383,7 @@ i1 real mu_tend ij dyn_em 1 - i1 real mu_tendf ij dyn_em 1 - #diagnostic for looking at nest position in output. A mungy version of terrain height. -state real nest_pos ij misc 1 - rhu=(mark_domain) "NEST_POS" +state real nest_pos ij misc 1 - ru=(mark_domain) "NEST_POS" state real nest_mask ij misc 1 - ru=(mark_domain) "NEST_MASK" "LOCATION OF NEST IF ANY" state real ht_coarse ij misc 1 - r - "STORAGE FOR LOW-RES TERRAIN" @@ -228,7 +393,7 @@ state real tke ikj dyn_em 2 - r "t i1 real tke_tend ikj dyn_em 1 - # Pressure and Density -state real p ikj dyn_em 1 - rh "p" "perturbation pressure" "Pa" +state real p ikj dyn_em 1 - r "p" "perturbation pressure" "Pa" state real al ikj dyn_em 1 - r "al" "inverse perturbation density" "m3 kg-1" state real alt ikj dyn_em 1 - r "alt" "inverse density" "m3 kg-1" state real alb ikj dyn_em 1 - rdus "alb" "inverse base density" "m3 kg-1" @@ -236,7 +401,11 @@ state real zx ikj dyn_em 1 X - " state real zy ikj dyn_em 1 Y - " " " " " " state real rdz ikj dyn_em 1 Z - " " " " " " state real rdzw ikj dyn_em 1 Z - " " " " " " -state real pb ikj dyn_em 1 - rhdus "pb" "BASE STATE PRESSURE " "Pa" +state real pb ikj dyn_em 1 - rdus "pb" "BASE STATE PRESSURE " "Pa" +## +## MARS: TO GET LIGHTER HISTORY FILES +## +state real ptot ikj dyn_em 1 - irh "PTOT" "total pressure" "Pa" # # Other dyn @@ -252,34 +421,34 @@ i1 real cqu ikj dyn_em 1 - - i1 real cqv ikj dyn_em 1 - - i1 real cqw ikj dyn_em 1 - - i1 real pm1 ikj dyn_em 1 - - -state real sr ij dyn_em 1 - irh "sr" "fraction of frozen precipitation" -state real potevp ij dyn_em 1 - rh "potevp" "accumulated potential evaporation" "W m-2" -state real snopcx ij dyn_em 1 - rh "snopcx" "snow phase change heat flux" "W m-2" -state real soiltb ij dyn_em 1 - h "soiltb" "bottom soil temperature" "K" -state real fnm k dyn_em 1 - irh "fnm" "upper weight for vertical stretching" "" -state real fnp k dyn_em 1 - irh "fnp" "lower weight for vertical stretching" "" -state real rdnw k dyn_em 1 - irh "rdnw" "inverse d(eta) values between full (w) levels" "" -state real rdn k dyn_em 1 - irh "rdn" "inverse d(eta) values between half (mass) levels" "" -state real dnw k dyn_em 1 - irh "dnw" "d(eta) values between full (w) levels" "" -state real dn k dyn_em 1 - irh "dn " "d(eta) values between half (mass) levels" "" +state real sr ij dyn_em 1 - ir "sr" "fraction of frozen precipitation" +state real potevp ij dyn_em 1 - r "potevp" "accumulated potential evaporation" "W m-2" +state real snopcx ij dyn_em 1 - r "snopcx" "snow phase change heat flux" "W m-2" +state real soiltb ij dyn_em 1 - - "soiltb" "bottom soil temperature" "K" +state real fnm k dyn_em 1 - ir "fnm" "upper weight for vertical stretching" "" +state real fnp k dyn_em 1 - ir "fnp" "lower weight for vertical stretching" "" +state real rdnw k dyn_em 1 - ir "rdnw" "inverse d(eta) values between full (w) levels" "" +state real rdn k dyn_em 1 - ir "rdn" "inverse d(eta) values between half (mass) levels" "" +state real dnw k dyn_em 1 - ir "dnw" "d(eta) values between full (w) levels" "" +state real dn k dyn_em 1 - ir "dn " "d(eta) values between half (mass) levels" "" state real t_base k dyn_em 1 - ir "t_base" "BASE STATE T IN IDEALIZED CASES" "K" state real z ikj dyn_em 1 - - " " " " " " i1 real mu_3d ikj dyn_em 1 - i1 real z_at_w ikj dyn_em 1 Z -state real cfn - misc - - irh "cfn" "extrapolation constant" "" -state real cfn1 - misc - - irh "cfn1" "extrapolation constant" "" +state real cfn - misc - - ir "cfn" "extrapolation constant" "" +state real cfn1 - misc - - ir "cfn1" "extrapolation constant" "" state integer step_number - misc - - ir "step_number" "" # 2m and 10m output diagnostics -state real Q2 ij misc 1 - irhd "Q2" "QV at 2 M" "kg kg-1" -state real T2 ij misc 1 - irhd "T2" "TEMP at 2 M" "K" -state real TH2 ij misc 1 - irhd "TH2" "POT TEMP at 2 M" "K" +state real Q2 ij misc 1 - ird "Q2" "QV at 2 M" "kg kg-1" +state real T2 ij misc 1 - ird "T2" "TEMP at 2 M" "K" +state real TH2 ij misc 1 - ird "TH2" "POT TEMP at 2 M" "K" state real PSFC ij misc 1 - i01rhd "PSFC" "SFC PRESSURE" "Pa" # these next 2 are for the HFSoLE/PET demo; writing these to auxhist1 output over MCEL for coupling # with wave model, only if compiled with -DMCELIO, JM 2003/05/29 -state real U10 ij misc 1 - irh01d "U10" "U at 10 M" "m s-1" -state real V10 ij misc 1 - irh01d "V10" "V at 10 M" "m s-1" +state real U10 ij misc 1 - ir01d "U10" "U at 10 M" "m s-1" +state real V10 ij misc 1 - ir01d "V10" "V at 10 M" "m s-1" # these next 4 are for observational nudging state real uratx ij misc 1 - r "URATX" "Ratio of U over U10 on mass points " "dimensionless" @@ -288,20 +457,20 @@ state real tratx ij misc 1 - r state real obs_savwt hikj dyn_em 1 X - "OBS_SAVWT" # Other -state real rdx - misc - - irh "rdx" "INVERSE X GRID LENGTH" "" -state real rdy - misc - - irh "rdy" "INVERSE Y GRID LENGTH" "" +state real rdx - misc - - ir "rdx" "INVERSE X GRID LENGTH" "" +state real rdy - misc - - ir "rdy" "INVERSE Y GRID LENGTH" "" state real dts - misc - - ir "dts" "SMALL TIMESTEP" "" state real dtseps - misc - - ir "dtseps" "TIME WEIGHT CONSTANT FOR SMALL STEPS" "" -state real resm - misc - - irh "resm" "TIME WEIGHT CONSTANT FOR SMALL STEPS" "" -state real zetatop - misc - - irh "zetatop" "ZETA AT MODEL TOP" "" -state real cf1 - misc - - irh "cf1" "2nd order extrapolation constant" "" -state real cf2 - misc - - irh "cf2" "2nd order extrapolation constant" "" -state real cf3 - misc - - irh "cf3" "2nd order extrapolation constant" "" +state real resm - misc - - ir "resm" "TIME WEIGHT CONSTANT FOR SMALL STEPS" "" +state real zetatop - misc - - ir "zetatop" "ZETA AT MODEL TOP" "" +state real cf1 - misc - - ir "cf1" "2nd order extrapolation constant" "" +state real cf2 - misc - - ir "cf2" "2nd order extrapolation constant" "" +state real cf3 - misc - - ir "cf3" "2nd order extrapolation constant" "" state integer number_at_same_level - - - - - "number_at_same_level" "" "" # State for derived time quantities. -state integer itimestep - - - - rh "itimestep" "" "" -state real xtime - - - - rh "xtime" "minutes since simulation start" "" +state integer itimestep - - - - r "itimestep" "" "" +state real xtime - - - - r "xtime" "minutes since simulation start" "" state real julian - - - - - "julian" "day of year, 0.0 at 0Z on 1 Jan." "days" @@ -338,17 +507,17 @@ state real vc_j - misc - - r # state real - ikjftb moist 1 - - - state real qv ikjftb moist 1 - \ - i01rhusdf=(bdy_interp:dt) "QVAPOR" "Water vapor mixing ratio" "kg kg-1" + i01rusdf=(bdy_interp:dt) "QVAPOR" "Water vapor mixing ratio" "kg kg-1" state real qc ikjftb moist 1 - \ - i01rhusdf=(bdy_interp:dt) "QCLOUD" "Cloud water mixing ratio" "kg kg-1" + i01rusdf=(bdy_interp:dt) "QCLOUD" "Cloud water mixing ratio" "kg kg-1" state real qr ikjftb moist 1 - \ - i01rhusdf=(bdy_interp:dt) "QRAIN" "Rain water mixing ratio" "kg kg-1" + i01rusdf=(bdy_interp:dt) "QRAIN" "Rain water mixing ratio" "kg kg-1" state real qi ikjftb moist 1 - \ - i01rhusdf=(bdy_interp:dt) "QICE" "Ice mixing ratio" "kg kg-1" + i01rusdf=(bdy_interp:dt) "QICE" "Ice mixing ratio" "kg kg-1" state real qs ikjftb moist 1 - \ - i01rhusdf=(bdy_interp:dt) "QSNOW" "Snow mixing ratio" "kg kg-1" + i01rusdf=(bdy_interp:dt) "QSNOW" "Snow mixing ratio" "kg kg-1" state real qg ikjftb moist 1 - \ - i01rhusdf=(bdy_interp:dt) "QGRAUP" "Graupel mixing ratio" "kg kg-1" + i01rusdf=(bdy_interp:dt) "QGRAUP" "Graupel mixing ratio" "kg kg-1" state real - ikjftb dfi_moist 1 - - - state real dfi_qv ikjftb dfi_moist 1 - \ rusdf=(bdy_interp:dt) "DFI_QVAPOR" "Water vapor mixing ratio" "kg kg-1" @@ -370,17 +539,17 @@ state real - ikjftb chem 1 - - - # Other Scalars state real - ikjftb scalar 1 - - - state real qndrop ikjftb scalar 1 - \ - i01rhusdf=(bdy_interp:dt) "QNDROP" "Droplet number mixing ratio" "# kg-1" + i01rusdf=(bdy_interp:dt) "QNDROP" "Droplet number mixing ratio" "# kg-1" state real qni ikjftb scalar 1 - \ - i01rhusdf=(bdy_interp:dt) "QNICE" "Ice Number concentration" "# kg-1" + i01rusdf=(bdy_interp:dt) "QNICE" "Ice Number concentration" "# kg-1" state real qt ikjftb scalar 1 - \ - i01rhusdf=(bdy_interp:dt) "CWM" "Total condensate mixing ratio" "kg kg-1" + i01rusdf=(bdy_interp:dt) "CWM" "Total condensate mixing ratio" "kg kg-1" state real qns ikjftb scalar 1 - \ - i01rhusdf=(bdy_interp:dt) "QNSNOW" "Snow Number concentration" "# kg(-1)" + i01rusdf=(bdy_interp:dt) "QNSNOW" "Snow Number concentration" "# kg(-1)" state real qnr ikjftb scalar 1 - \ - i01rhusdf=(bdy_interp:dt) "QNRAIN" "Rain Number concentration" "# kg(-1)" + i01rusdf=(bdy_interp:dt) "QNRAIN" "Rain Number concentration" "# kg(-1)" state real qng ikjftb scalar 1 - \ - i01rhusdf=(bdy_interp:dt) "QNGRAUPEL" "Graupel Number concentration" "# kg(-1)" + i01rusdf=(bdy_interp:dt) "QNGRAUPEL" "Graupel Number concentration" "# kg(-1)" state real - ikjftb dfi_scalar 1 - - - state real dfi_qndrop ikjftb dfi_scalar 1 - \ rusdf=(bdy_interp:dt) "DFI_QNDROP" "Droplet number mixing ratio" "# kg-1" @@ -452,7 +621,7 @@ state real soilt020 ij misc 1 - i1 "SOIL state real soilt040 ij misc 1 - i1 "SOILT040" "LAYER SOIL TEMPERATURE" "K" state real soilt160 ij misc 1 - i1 "SOILT160" "LAYER SOIL TEMPERATURE" "K" state real soilt300 ij misc 1 - i1 "SOILT300" "LAYER SOIL TEMPERATURE" "K" -state real landmask ij misc 1 - i012rhd=(interp_fcnm)u=(copy_fcnm) "LANDMASK" "LAND MASK (1 FOR LAND, 0 FOR WATER)" "" +state real landmask ij misc 1 - i012rd=(interp_fcnm)u=(copy_fcnm) "LANDMASK" "LAND MASK (1 FOR LAND, 0 FOR WATER)" "" state real topostdv ij misc 1 - i12 "TOPOSTDV" "ELEVATION STD DEV" "m" state real toposlpx ij misc 1 - i12 "TOPOSLPX" "ELEVATION X SLOPE" "" state real toposlpy ij misc 1 - i12 "TOPOSLPY" "ELEVATION Y SLOPE" "" @@ -473,7 +642,7 @@ state real vegcat ij misc 1 - i12 "VEGC # soil model variables (Note that they are marked as staggered in the vertical dimension # because they are "fully dimensioned" -- they use every element in that dim -state real TSLB ilj misc 1 Z i02rhd=(interp_mask_land_field:lu_index)u=(copy_fcnm) "TSLB" "SOIL TEMPERATURE" "K" +state real TSLB ilj misc 1 Z i02rd=(interp_mask_land_field:lu_index)u=(copy_fcnm) "TSLB" "SOIL TEMPERATURE" "K" # Time series variables state real ts_hour ?! misc - - r "TS_HOUR" "Model integration time, hours" @@ -499,29 +668,29 @@ state real DZG l em - Z r "DZ # lsm State Variables -state real SMOIS ilj - 1 Z i02rhd=(interp_mask_land_field:lu_index)u=(copy_fcnm) "SMOIS" "SOIL MOISTURE" "m3 m-3" -state real SH2O ilj - 1 Z i02rhd=(interp_mask_land_field:lu_index)u=(copy_fcnm) "SH2O" "SOIL LIQUID WATER" "m3 m-3" -state real XICE ij misc 1 - i0124rhd=(interp_mask_water_field:lu_index)u=(copy_fcnm) "SEAICE" "SEA ICE FLAG" "" -state real XICEM ij misc 1 - rhd=(interp_mask_water_field:lu_index)u=(copy_fcnm) "XICEM" "SEA ICE FLAG (PREVIOUS STEP)" "" +state real SMOIS ilj - 1 Z i02rd=(interp_mask_land_field:lu_index)u=(copy_fcnm) "SMOIS" "SOIL MOISTURE" "m3 m-3" +state real SH2O ilj - 1 Z i02rd=(interp_mask_land_field:lu_index)u=(copy_fcnm) "SH2O" "SOIL LIQUID WATER" "m3 m-3" +state real XICE ij misc 1 - i0124rd=(interp_mask_water_field:lu_index)u=(copy_fcnm) "SEAICE" "SEA ICE FLAG" "" +state real XICEM ij misc 1 - rd=(interp_mask_water_field:lu_index)u=(copy_fcnm) "XICEM" "SEA ICE FLAG (PREVIOUS STEP)" "" state real SMSTAV ij misc 1 - rd=(interp_mask_land_field:lu_index) "SMSTAV" "MOISTURE AVAILABILITY" "" state real SMSTOT ij misc 1 - r "SMSTOT" "TOTAL SOIL MOISTURE" "m3 m-3" -state real SFCRUNOFF ij misc 1 - rhd=(interp_mask_land_field:lu_index) "SFROFF" "SURFACE RUNOFF" "mm" -state real UDRUNOFF ij misc 1 - rhd=(interp_mask_land_field:lu_index) "UDROFF" "UNDERGROUND RUNOFF" "mm" -state integer IVGTYP ij misc 1 - i02rhd=(interp_fcni)u=(copy_fcni) "IVGTYP" "DOMINANT VEGETATION CATEGORY" "" -state integer ISLTYP ij misc 1 - i02rhd=(interp_fcni)u=(copy_fcni) "ISLTYP" "DOMINANT SOIL CATEGORY" "" -state real VEGFRA ij misc 1 - i0124rhd=(interp_mask_land_field:lu_index)u=(copy_fcnm) "VEGFRA" "VEGETATION FRACTION" "" +state real SFCRUNOFF ij misc 1 - rd=(interp_mask_land_field:lu_index) "SFROFF" "SURFACE RUNOFF" "mm" +state real UDRUNOFF ij misc 1 - rd=(interp_mask_land_field:lu_index) "UDROFF" "UNDERGROUND RUNOFF" "mm" +state integer IVGTYP ij misc 1 - i02rd=(interp_fcni)u=(copy_fcni) "IVGTYP" "DOMINANT VEGETATION CATEGORY" "" +state integer ISLTYP ij misc 1 - i02rd=(interp_fcni)u=(copy_fcni) "ISLTYP" "DOMINANT SOIL CATEGORY" "" +state real VEGFRA ij misc 1 - i0124rd=(interp_mask_land_field:lu_index)u=(copy_fcnm) "VEGFRA" "VEGETATION FRACTION" "" state real SFCEVP ij misc 1 - r "SFCEVP" "SURFACE EVAPORATION" "kg m-2" -state real GRDFLX ij misc 1 - rh "GRDFLX" "GROUND HEAT FLUX" "W m-2" +state real GRDFLX ij misc 1 - r "GRDFLX" "GROUND HEAT FLUX" "W m-2" state real SFCEXC ij misc 1 - r "SFCEXC " "SURFACE EXCHANGE COEFFICIENT" "m s-1" state real ACSNOW ij misc 1 - rd=(interp_mask_land_field:lu_index)u=(copy_fcnm) "ACSNOW" "ACCUMULATED SNOW" "kg m-2" state real ACSNOM ij misc 1 - rd=(interp_mask_land_field:lu_index)u=(copy_fcnm) "ACSNOM" "ACCUMULATED MELTED SNOW" "kg m-2" -state real SNOW ij misc 1 - i012rhd=(interp_mask_land_field:lu_index)u=(copy_fcnm) "SNOW" "SNOW WATER EQUIVALENT" "kg m-2" -state real SNOWH ij misc 1 - i012rhd=(interp_mask_land_field:lu_index)u=(copy_fcnm) "SNOWH" "PHYSICAL SNOW DEPTH" "m" -state real RHOSN ij misc 1 - i012rhd=(interp_mask_land_field:lu_index)u=(copy_fcnm) "RHOSN" " SNOW DENSITY" "kg m-3" -state real CANWAT ij misc 1 - i012rhd=(interp_mask_land_field:lu_index)u=(copy_fcnm) "CANWAT" "CANOPY WATER" "kg m-2" -state real SST ij misc 1 - i0124rhd=(interp_mask_water_field:lu_index) "SST" "SEA SURFACE TEMPERATURE" "K" +state real SNOW ij misc 1 - i012rd=(interp_mask_land_field:lu_index)u=(copy_fcnm) "SNOW" "SNOW WATER EQUIVALENT" "kg m-2" +state real SNOWH ij misc 1 - i012rd=(interp_mask_land_field:lu_index)u=(copy_fcnm) "SNOWH" "PHYSICAL SNOW DEPTH" "m" +state real RHOSN ij misc 1 - i012rd=(interp_mask_land_field:lu_index)u=(copy_fcnm) "RHOSN" " SNOW DENSITY" "kg m-3" +state real CANWAT ij misc 1 - i012rd=(interp_mask_land_field:lu_index)u=(copy_fcnm) "CANWAT" "CANOPY WATER" "kg m-2" +state real SST ij misc 1 - i0124rd=(interp_mask_water_field:lu_index) "SST" "SEA SURFACE TEMPERATURE" "K" state integer IFNDSNOWH - misc 1 - i "FNDSNOWH" "SNOWH_LOGICAL" state integer IFNDSOILW - misc 1 - i "FNDSOILW" "SOILW_LOGICAL" @@ -675,35 +844,35 @@ state real m_hybi d misc 1 - - "m_hybi" "MATCH h state real F_ICE_PHY ikj misc 1 - rdu "F_ICE_PHY" "FRACTION OF ICE" "" state real F_RAIN_PHY ikj misc 1 - rdu "F_RAIN_PHY" "FRACTION OF RAIN " "" state real F_RIMEF_PHY ikj misc 1 - rdu "F_RIMEF_PHY" "MASS RATIO OF RIMED ICE " "" -state real qndropsource ikj misc 1 - h "qndropsource" "Droplet number source" "#/kg/s" +state real qndropsource ikj misc 1 - - "qndropsource" "Droplet number source" "#/kg/s" # Other Misc State Variables state real h_diabatic ikj misc 1 - rdu "h_diabatic" "PREVIOUS TIMESTEP CONDENSATIONAL HEATING" "K s-1" -state real msft ij misc 1 - i012rhdu=(copy_fcnm) "MAPFAC_M" "Map scale factor on mass grid" "" -state real msfu ij misc 1 X i012rhdu=(copy_fcnm) "MAPFAC_U" "Map scale factor on u-grid" "" -state real msfv ij misc 1 Y i012rhdu=(copy_fcnm) "MAPFAC_V" "Map scale factor on v-grid" "" -state real msftx ij misc 1 - i012rhdu=(copy_fcnm) "MAPFAC_MX" "Map scale factor on mass grid, x direction" "" -state real msfty ij misc 1 - i012rhdu=(copy_fcnm) "MAPFAC_MY" "Map scale factor on mass grid, y direction" "" -state real msfux ij misc 1 X i012rhdu=(copy_fcnm) "MAPFAC_UX" "Map scale factor on u-grid, x direction" "" -state real msfuy ij misc 1 X i012rhdu=(copy_fcnm) "MAPFAC_UY" "Map scale factor on u-grid, y direction" "" -state real msfvx ij misc 1 Y i012rhdu=(copy_fcnm) "MAPFAC_VX" "Map scale factor on v-grid, x direction" "" -state real msfvx_inv ij misc 1 Y i012rhdu=(copy_fcnm) "MF_VX_INV" "Inverse map scale factor on v-grid, x direction" "" -state real msfvy ij misc 1 Y i012rhdu=(copy_fcnm) "MAPFAC_VY" "Map scale factor on v-grid, y direction" "" - -state real f ij misc 1 - i012rhdu=(copy_fcnm) "f" "Coriolis sine latitude term" "s-1" -state real e ij misc 1 - i012rhdu=(copy_fcnm) "e" "Coriolis cosine latitude term" "s-1" -state real sina ij misc 1 - i012rhdu=(copy_fcnm) "SINALPHA" "Local sine of map rotation" "" -state real cosa ij misc 1 - i012rhdu=(copy_fcnm) "COSALPHA" "Local cosine of map rotation" "" -state real ht ij misc 1 - i012rhdus "HGT" "Terrain Height" "m" +state real msft ij misc 1 - i012rdu=(copy_fcnm) "MAPFAC_M" "Map scale factor on mass grid" "" +state real msfu ij misc 1 X i012rdu=(copy_fcnm) "MAPFAC_U" "Map scale factor on u-grid" "" +state real msfv ij misc 1 Y i012rdu=(copy_fcnm) "MAPFAC_V" "Map scale factor on v-grid" "" +state real msftx ij misc 1 - i012rdu=(copy_fcnm) "MAPFAC_MX" "Map scale factor on mass grid, x direction" "" +state real msfty ij misc 1 - i012rdu=(copy_fcnm) "MAPFAC_MY" "Map scale factor on mass grid, y direction" "" +state real msfux ij misc 1 X i012rdu=(copy_fcnm) "MAPFAC_UX" "Map scale factor on u-grid, x direction" "" +state real msfuy ij misc 1 X i012rdu=(copy_fcnm) "MAPFAC_UY" "Map scale factor on u-grid, y direction" "" +state real msfvx ij misc 1 Y i012rdu=(copy_fcnm) "MAPFAC_VX" "Map scale factor on v-grid, x direction" "" +state real msfvx_inv ij misc 1 Y i012rdu=(copy_fcnm) "MF_VX_INV" "Inverse map scale factor on v-grid, x direction" "" +state real msfvy ij misc 1 Y i012rdu=(copy_fcnm) "MAPFAC_VY" "Map scale factor on v-grid, y direction" "" + +state real f ij misc 1 - i012rdu=(copy_fcnm) "f" "Coriolis sine latitude term" "s-1" +state real e ij misc 1 - i012rdu=(copy_fcnm) "e" "Coriolis cosine latitude term" "s-1" +state real sina ij misc 1 - i012rdu=(copy_fcnm) "SINALPHA" "Local sine of map rotation" "" +state real cosa ij misc 1 - i012rdu=(copy_fcnm) "COSALPHA" "Local cosine of map rotation" "" +state real ht ij misc 1 - i012rdus "HGT" "Terrain Height" "m" state real ht_fine ij misc 1 - - "HGT_FINE" "Fine Terrain Height" "m" state real ht_int ij misc 1 - - "HGT_INT" "Terrain Height Horizontally Interpolated" "m" state real ht_input ij misc 1 - - "HGT_INPUT" "Terrain Height from FG Input File" "m" -state real ht_shad ijb misc 1 - hdf=(bdy_interp:dt) "HGT_SHAD" "Height of orographic shadow" "m" +state real ht_shad ijb misc 1 - df=(bdy_interp:dt) "HGT_SHAD" "Height of orographic shadow" "m" i1 real ht_loc ij misc 1 - - i1 integer shadowmask ij misc 1 - - state integer min_ptchsz - misc 1 - r -state real TSK ij misc 1 - i012rhdu=(copy_fcnm) "TSK" "SURFACE SKIN TEMPERATURE" "K" +state real TSK ij misc 1 - i012rdu=(copy_fcnm) "TSK" "SURFACE SKIN TEMPERATURE" "K" state real dfi_TSK ij misc 1 - r "TSK_dfi" "saved SURFACE SKIN TEMPERATURE" state real TSK_SAVE ij misc 1 - - "TSK_SAVE" "SURFACE SKIN TEMPERATURE, EXTRA COPY FOR SEA ICE TESTS in REAL" "K" state real u_base k misc 1 - ir "u_base" "BASE STATE X WIND IN IDEALIZED CASES" "" @@ -721,9 +890,9 @@ state real v_frame - misc 1 - ir "v # collision between a metadata name and a field record in the I/O data # resolve this how? Have the real program throw a switch to tell the code to get it # from the metadata? Otherwise it's a field? -state real p_top - misc - - irh "p_top" "PRESSURE TOP OF THE MODEL" "Pa" -state real max_msftx - misc - - rh "max_mstfx" "Max map factor in domain" "" -state real max_msfty - misc - - rh "max_mstfy" "Max map factor in domain" "" +state real p_top - misc - - ir "p_top" "PRESSURE TOP OF THE MODEL" "Pa" +state real max_msftx - misc - - r "max_mstfx" "Max map factor in domain" "" +state real max_msfty - misc - - r "max_mstfy" "Max map factor in domain" "" # Other physics variables @@ -735,14 +904,14 @@ state real RQSCUTEN ikj misc 1 - r "R state real RQICUTEN ikj misc 1 - r "RQICUTEN" "COUPLED Q_I TENDENCY DUE TO CUMULUS SCHEME" "Pa kg kg-1 s-1" state real W0AVG ikj misc 1 - r "W0AVG" "AVERAGE VERTICAL VELOCITY FOR KF CUMULUS SCHEME" "m s-1" -state real RAINC ij misc 1 - rhdu "RAINC" "ACCUMULATED TOTAL CUMULUS PRECIPITATION" "mm" -state real RAINNC ij misc 1 - rhdu "RAINNC" "ACCUMULATED TOTAL GRID SCALE PRECIPITATION" "mm" -state real PRATEC ij misc 1 - rh "PRATEC" "PRECIP RATE FROM CUMULUS SCHEME" "mm s-1" -state real RAINCV ij misc 1 - rh "RAINCV" "TIME-STEP CUMULUS PRECIPITATION" "mm" +state real RAINC ij misc 1 - rdu "RAINC" "ACCUMULATED TOTAL CUMULUS PRECIPITATION" "mm" +state real RAINNC ij misc 1 - rdu "RAINNC" "ACCUMULATED TOTAL GRID SCALE PRECIPITATION" "mm" +state real PRATEC ij misc 1 - r "PRATEC" "PRECIP RATE FROM CUMULUS SCHEME" "mm s-1" +state real RAINCV ij misc 1 - r "RAINCV" "TIME-STEP CUMULUS PRECIPITATION" "mm" state real RAINNCV ij misc 1 - r "RAINNCV" "TIME-STEP NONCONVECTIVE PRECIPITATION" "mm" state real RAINBL ij misc 1 - r "RAINBL" "PBL TIME-STEP TOTAL PRECIPITATION" "mm" -state real SNOWNC ij misc 1 - rhdu "SNOWNC" "ACCUMULATED TOTAL GRID SCALE SNOW AND ICE" "mm" -state real GRAUPELNC ij misc 1 - rhdu "GRAUPELNC" "ACCUMULATED TOTAL GRID SCALE GRAUPEL" "mm" +state real SNOWNC ij misc 1 - rdu "SNOWNC" "ACCUMULATED TOTAL GRID SCALE SNOW AND ICE" "mm" +state real GRAUPELNC ij misc 1 - rdu "GRAUPELNC" "ACCUMULATED TOTAL GRID SCALE GRAUPEL" "mm" state real SNOWNCV ij misc 1 - r "SNOWNCV" "TIME-STEP NONCONVECTIVE SNOW AND ICE" "mm" state real GRAUPELNCV ij misc 1 - r "GRAUPELNCV" "TIME-STEP NONCONVECTIVE GRAUPEL" "mm" state real NCA ij misc 1 - r "NCA" "COUNTER OF THE CLOUD RELAXATION TIME IN KF CUMULUS SCHEME" "" @@ -756,7 +925,7 @@ state real apr_as ij misc 1 - r "AP state real apr_capma ij misc 1 - r "APR_CAPMA" "PRECIP FROM MAX CAP" "mm hour-1" state real apr_capme ij misc 1 - r "APR_CAPME" "PRECIP FROM MEAN CAP" "mm hour-1" state real apr_capmi ij misc 1 - r "APR_CAPMI" "PRECIP FROM MIN CAP" "mm hour-1" -state real edt_out ij misc 1 - h "EDT_OUT" "EDT FROM GD SCHEME" "" +state real edt_out ij misc 1 - - "EDT_OUT" "EDT FROM GD SCHEME" "" state real xf_ens ije misc 1 Z r "XF_ENS" "MASS FLUX PDF IN GRELL CUMULUS SCHEME" "mb hour-1" state real pr_ens ije misc 1 Z r "PR_ENS" "PRECIP RATE PDF IN GRELL CUMULUS SCHEME" "mb hour-1" state real cugd_tten ikj misc 1 - h "CUGD_TTEN" "INITIAL TTENDENCY OUT OFF GRELL CUMULUS SCHEME" "K s-1" @@ -775,10 +944,10 @@ state real RTHRATENLW ikj misc 1 - r "R state real RTHRATENSW ikj misc 1 - r "RTHRATSW" "UNCOUPLED THETA TENDENCY DUE TO SHORT WAVE RADIATION" "K s-1" state real CLDFRA ikj misc 1 - r "CLDFRA" "CLOUD FRACTION" "" -state real SWDOWN ij misc 1 - rhd "SWDOWN" "DOWNWARD SHORT WAVE FLUX AT GROUND SURFACE" "W m-2" +state real SWDOWN ij misc 1 - rd "SWDOWN" "DOWNWARD SHORT WAVE FLUX AT GROUND SURFACE" "W m-2" state real SWDOWNC ij misc 1 - - "SWDOWNC" "DOWNWARD CLEAR-SKY SHORT WAVE FLUX AT GROUND SURFACE" "W m-2" state real GSW ij misc 1 - rd "GSW" "NET SHORT WAVE FLUX AT GROUND SURFACE" "W m-2" -state real GLW ij misc 1 - rhd "GLW" "DOWNWARD LONG WAVE FLUX AT GROUND SURFACE" "W m-2" +state real GLW ij misc 1 - rd "GLW" "DOWNWARD LONG WAVE FLUX AT GROUND SURFACE" "W m-2" # upward and downward clearsky and total diagnostic fluxes for CAM radiation #state real ACSWUPT ij misc 1 - rhdu "ACSWUPT" "ACCUMULATED UPWELLING SHORTWAVE FLUX AT TOP" "J m-2" @@ -816,22 +985,22 @@ state real GLW ij misc 1 - rhd "G state real SWCF ij misc 1 - r "SWCF" "SHORT WAVE CLOUD FORCING AT TOA" "W m-2" state real LWCF ij misc 1 - r "LWCF" "LONG WAVE CLOUD FORCING AT TOA" "W m-2" -state real OLR ij misc 1 - rh "OLR" "TOA OUTGOING LONG WAVE" "W m-2" +state real OLR ij misc 1 - r "OLR" "TOA OUTGOING LONG WAVE" "W m-2" # these next 2 are for the HFSoLE/PET demo; writing these to auxhist1 output over MCEL for coupling # with wave model, only if compiled with -DMCELIO, JM 2003/05/29 -state real XLAT ij misc 1 - i0123rh01du=(copy_fcnm) "XLAT" "LATITUDE, SOUTH IS NEGATIVE" "degree_north" -state real XLONG ij misc 1 - i0123rh01du=(copy_fcnm) "XLONG" "LONGITUDE, WEST IS NEGATIVE" "degree_east" -state real XLAT_U ij dyn_em 1 X i012rh01du=(copy_fcnm) "XLAT_U" "LATITUDE, SOUTH IS NEGATIVE" "degree_north" -state real XLONG_U ij dyn_em 1 X i012rh01du=(copy_fcnm) "XLONG_U" "LONGITUDE, WEST IS NEGATIVE" "degree_east" -state real XLAT_V ij dyn_em 1 Y i012rh01du=(copy_fcnm) "XLAT_V" "LATITUDE, SOUTH IS NEGATIVE" "degree_north" -state real XLONG_V ij dyn_em 1 Y i012rh01du=(copy_fcnm) "XLONG_V" "LONGITUDE, WEST IS NEGATIVE" "degree_east" -state real ALBEDO ij misc 1 - rh "ALBEDO" "ALBEDO" +state real XLAT ij misc 1 - i0123r01du=(copy_fcnm) "XLAT" "LATITUDE, SOUTH IS NEGATIVE" "degree_north" +state real XLONG ij misc 1 - i0123r01du=(copy_fcnm) "XLONG" "LONGITUDE, WEST IS NEGATIVE" "degree_east" +state real XLAT_U ij dyn_em 1 X i012r01du=(copy_fcnm) "XLAT_U" "LATITUDE, SOUTH IS NEGATIVE" "degree_north" +state real XLONG_U ij dyn_em 1 X i012r01du=(copy_fcnm) "XLONG_U" "LONGITUDE, WEST IS NEGATIVE" "degree_east" +state real XLAT_V ij dyn_em 1 Y i012r01du=(copy_fcnm) "XLAT_V" "LATITUDE, SOUTH IS NEGATIVE" "degree_north" +state real XLONG_V ij dyn_em 1 Y i012r01du=(copy_fcnm) "XLONG_V" "LONGITUDE, WEST IS NEGATIVE" "degree_east" +state real ALBEDO ij misc 1 - r "ALBEDO" "ALBEDO" state real CLAT ij misc 1 - i012rdu=(copy_fcnm) "CLAT" "COMPUTATIONAL GRID LATITUDE, SOUTH IS NEGATIVE" "degree_north" state real CLONG ij misc 1 - i012rdu=(copy_fcnm) "CLONG" "COMPUTATIONAL GRID LONGITUDE, WEST IS NEGATIVE" "degree_east" -state real ALBBCK ij misc 1 - i0124rh "ALBBCK" "BACKGROUND ALBEDO" "" +state real ALBBCK ij misc 1 - i0124r "ALBBCK" "BACKGROUND ALBEDO" "" state real EMBCK ij misc 1 - r "EMBCK" "BACKGROUND EMISSIVITY" "" -state real EMISS ij misc 1 - rh "EMISS" "SURFACE EMISSIVITY" "" +state real EMISS ij misc 1 - r "EMISS" "SURFACE EMISSIVITY" "" state real CLDEFI ij misc 1 - r "CLDEFI" "precipitation efficiency in BMJ SCHEME" "" state integer STEPRA - misc 1 - r "STEPRA" "NUMBER OF FUNDAMENTAL TIMESTEPS BETWEEN RADIATION CALLS" "" @@ -869,24 +1038,24 @@ i1 real rho_phy ikj misc 1 - i1 logical CU_ACT_FLAG ij misc 1 - -state real TMN ij misc 1 - i012rhd=(interp_mask_land_field:lu_index)u=(copy_fcnm) "TMN" "SOIL TEMPERATURE AT LOWER BOUNDARY" "K" -state real XLAND ij misc 1 - i02rhd=(interp_fcnm)u=(copy_fcnm) "XLAND" "LAND MASK (1 FOR LAND, 2 FOR WATER)" "" +state real TMN ij misc 1 - i012rd=(interp_mask_land_field:lu_index)u=(copy_fcnm) "TMN" "SOIL TEMPERATURE AT LOWER BOUNDARY" "K" +state real XLAND ij misc 1 - i02rd=(interp_fcnm)u=(copy_fcnm) "XLAND" "LAND MASK (1 FOR LAND, 2 FOR WATER)" "" state real ZNT ij misc 1 - i3r "ZNT" "TIME-VARYING ROUGHNESS LENGTH" "m" state real CK ij misc 1 - r "CK" "ENTHALPY EXCHANGE COEFF AT 10 m" "" state real CKA ij misc 1 - r "CKA" "ENTHALPY EXCHANGE COEFF AT LOWEST MODEL LVL" "" state real CD ij misc 1 - r "CD" "DRAG COEFF AT 10m" "" state real CDA ij misc 1 - r "CDA" "DRAG COEFF AT LOWEST MODEL LVL" "" -state real UST ij misc 1 - rh "UST" "U* IN SIMILARITY THEORY" "m s-1" -state real USTM ij misc 1 - r "USTM" "U* IN SIMILARITY THEORY WITHOUT VCONV" "m s-1" +state real UST ij misc 1 - r "UST" "U* IN SIMILARITY THEORY" "m s-1" +state real USTM ij misc 1 - rh "USTM" "U* IN SIMILARITY THEORY WITHOUT VCONV" "m s-1" #SAVEMARS2 ustar i1 real HOL ij misc 1 - - "HOL" "PBL HEIGHT OVER MONIN-OBUKHOV LENGTH" "" state real RMOL ij misc 1 - r "RMOL" "1./Monin Ob. Length" "" state real MOL ij misc 1 - r "MOL" "T* IN SIMILARITY THEORY" "K" -state real PBLH ij misc 1 - rh "PBLH" "PBL HEIGHT" "m" +state real PBLH ij misc 1 - r "PBLH" "PBL HEIGHT" "m" state real CAPG ij misc 1 - r "CAPG" "HEAT CAPACITY FOR SOIL" "J K-1 m-3" state real THC ij misc 1 - r "THC" "THERMAL INERTIA" "Cal cm-1 K-1 s-0.5" -state real HFX ij misc 1 - rh "HFX" "UPWARD HEAT FLUX AT THE SURFACE" "W m-2" -state real QFX ij misc 1 - rh "QFX" "UPWARD MOISTURE FLUX AT THE SURFACE" "kg m-2 s-1" -state real LH ij misc 1 - rh "LH" "LATENT HEAT FLUX AT THE SURFACE" "W m-2" +state real HFX ij misc 1 - rh "HFX" "UPWARD HEAT FLUX AT THE SURFACE" "W m-2" #SAVEMARS2 sensheat +state real QFX ij misc 1 - r "QFX" "UPWARD MOISTURE FLUX AT THE SURFACE" "kg m-2 s-1" +state real LH ij misc 1 - r "LH" "LATENT HEAT FLUX AT THE SURFACE" "W m-2" state real FLHC ij misc 1 - r "FLHC" "SURFACE EXCHANGE COEFFICIENT FOR HEAT" "" state real FLQC ij misc 1 - r "FLQC" "SURFACE EXCHANGE COEFFICIENT FOR MOISTURE" "" state real QSG ij misc 1 - r "QSG" "SURFACE SATURATION WATER VAPOR MIXING RATIO" "kg kg-1" @@ -898,7 +1067,7 @@ state real dfi_SOILT1 ij misc 1 - r "S state real TSNAV ij misc 1 - r "TSNAV" "AVERAGE SNOW TEMPERATURE " "C" state real dfi_TSNAV ij misc 1 - r "TSNAV_dfi" "AVERAGE SNOW TEMPERATURE " "C" state real REGIME ij misc 1 - r "REGIME" "FLAGS: 1=Night/Stable, 2=Mechanical Turbulent, 3=Forced Conv, 4=Free Conv" "" -state real SNOWC ij misc 1 - irhd=(interp_mask_land_field:lu_index)u=(copy_fcnm) "SNOWC" "FLAG INDICATING SNOW COVERAGE (1 FOR SNOW COVER)" "" +state real SNOWC ij misc 1 - ird=(interp_mask_land_field:lu_index)u=(copy_fcnm) "SNOWC" "FLAG INDICATING SNOW COVERAGE (1 FOR SNOW COVER)" "" state real dfi_SNOWC ij misc 1 - r "SNOWC_dfi" "FLAG INDICATING SNOW COVERAGE (1 FOR SNOW COVER)" "" state real MAVAIL ij misc 1 - r "MAVAIL" "SURFACE MOISTURE AVAILABILITY" "" @@ -992,16 +1161,16 @@ rconfig integer run_days namelist,time_control 1 0 rconfig integer run_hours namelist,time_control 1 0 irh "run_hours" "NUMBER OF HOURS TO RUN" rconfig integer run_minutes namelist,time_control 1 0 irh "run_minutes" "NUMBER OF MINUTES TO RUN" rconfig integer run_seconds namelist,time_control 1 0 irh "run_seconds" "NUMBER OF SECONDS TO RUN" -rconfig integer start_year namelist,time_control max_domains 1993 irh "start_year" "4 DIGIT YEAR OF START OF MODEL" "YEARS" -rconfig integer start_month namelist,time_control max_domains 03 irh "start_month" "2 DIGIT MONTH OF THE YEAR OF START OF MODEL, 1-12" "MONTHS" -rconfig integer start_day namelist,time_control max_domains 13 irh "start_day" "2 DIGIT DAY OF THE MONTH OF START OF MODEL, 1-31" "DAYS" -rconfig integer start_hour namelist,time_control max_domains 12 irh "start_hour" "2 DIGIT HOUR OF THE DAY OF START OF MODEL, 0-23" "HOURS" +rconfig integer start_year namelist,time_control max_domains 2024 irh "start_year" "4 DIGIT YEAR OF START OF MODEL" "YEARS" +rconfig integer start_month namelist,time_control max_domains 01 irh "start_month" "2 DIGIT MONTH OF THE YEAR OF START OF MODEL, 1-12" "MONTHS" +rconfig integer start_day namelist,time_control max_domains 01 irh "start_day" "2 DIGIT DAY OF THE MONTH OF START OF MODEL, 1-31" "DAYS" +rconfig integer start_hour namelist,time_control max_domains 00 irh "start_hour" "2 DIGIT HOUR OF THE DAY OF START OF MODEL, 0-23" "HOURS" rconfig integer start_minute namelist,time_control max_domains 00 irh "start_minute" "2 DIGIT MINUTE OF THE HOUR OF START OF MODEL, 0-59" "MINUTES" rconfig integer start_second namelist,time_control max_domains 00 irh "start_second" "2 DIGIT SECOND OF THE MINUTE OF START OF MODEL, 0-59" "SECONDS" -rconfig integer end_year namelist,time_control max_domains 1993 irh "end_year" "4 DIGIT YEAR OF END OF MODEL" "YEARS" -rconfig integer end_month namelist,time_control max_domains 03 irh "end_month" "2 DIGIT MONTH OF THE YEAR OF END OF MODEL, 1-12" "MONTHS" -rconfig integer end_day namelist,time_control max_domains 14 irh "end_day" "2 DIGIT DAY OF THE MONTH OF END OF MODEL, 1-31" "DAYS" -rconfig integer end_hour namelist,time_control max_domains 12 irh "end_hour" "2 DIGIT HOUR OF THE DAY OF END OF MODEL, 0-23" "HOURS" +rconfig integer end_year namelist,time_control max_domains 2024 irh "end_year" "4 DIGIT YEAR OF END OF MODEL" "YEARS" +rconfig integer end_month namelist,time_control max_domains 01 irh "end_month" "2 DIGIT MONTH OF THE YEAR OF END OF MODEL, 1-12" "MONTHS" +rconfig integer end_day namelist,time_control max_domains 02 irh "end_day" "2 DIGIT DAY OF THE MONTH OF END OF MODEL, 1-31" "DAYS" +rconfig integer end_hour namelist,time_control max_domains 00 irh "end_hour" "2 DIGIT HOUR OF THE DAY OF END OF MODEL, 0-23" "HOURS" rconfig integer end_minute namelist,time_control max_domains 00 irh "end_minute" "2 DIGIT MINUTE OF THE HOUR OF END OF MODEL, 0-59" "MINUTES" rconfig integer end_second namelist,time_control max_domains 00 irh "end_second" "2 DIGIT SECOND OF THE MINUTE OF END OF MODEL, 0-59" "SECONDS" rconfig integer interval_seconds namelist,time_control 1 43200 irh "interval_seconds" "SECONDS BETWEEN ANALYSIS AND BOUNDARY PERIODS" "SECONDS" @@ -1128,13 +1297,32 @@ rconfig real eta_levels namelist,domains max_eta -1. rconfig real max_dz namelist,domains 1 1000. # Physics +###### +###### MARS SPECIFIC NAMELIST ENTRIES +###### +rconfig character planet namelist,physics 1 "mars" - "planet" "selection of the planet" "" +rconfig integer mars namelist,physics max_domains 0 rh "mars" "model mode" "" +rconfig real init_TI namelist,physics max_domains 0 irh "init_TI" "thermal inertia" "" +rconfig real init_AL namelist,physics max_domains 0 irh "init_AL" "albedo" "" +rconfig real init_Z0 namelist,physics max_domains 0 irh "init_Z0" "surface roughness" "" +rconfig real init_U namelist,physics max_domains 0 irh "init_U" "zonal wind" "" +rconfig real init_V namelist,physics max_domains 0 irh "init_V" "meridional wind" "" +rconfig integer init_WX namelist,physics max_domains 0 irh "init_WX" "x coord" "" +rconfig integer init_WY namelist,physics max_domains 0 irh "init_WY" "y coord" "" +rconfig real init_MU namelist,physics max_domains 0 irh "init_MU" "zonal wind mult." "" +rconfig real init_MV namelist,physics max_domains 0 irh "init_MV" "meridional wind mult." "" +rconfig logical init_LES namelist,physics max_domains .false. irh "init_LES" "LES mode" "" +rconfig logical modif_wrf namelist,physics max_domains .true. ir "modif_wrf" "true if tweaked WRF" "" +####### +####### MARS SPECIFIC NAMELIST ENTRIES +####### rconfig integer mp_physics namelist,physics max_domains 0 rh "mp_physics" "" "" rconfig integer gsfcgce_hail namelist,physics 1 0 rh "gsfcgce select hail/graupel" "" "" rconfig integer gsfcgce_2ice namelist,physics 1 0 rh "gsfcgce select 2ice/3ice" "" "" rconfig integer progn namelist,physics max_domains 0 rh "progn" "" "" rconfig integer ra_lw_physics namelist,physics max_domains 0 rh "ra_lw_physics" "" "" rconfig integer ra_sw_physics namelist,physics max_domains 0 rh "ra_sw_physics" "" "" -rconfig real radt namelist,physics max_domains 0 h "RADT" "" "" +rconfig real radt namelist,physics max_domains 1 h "RADT" "" "" rconfig real naer namelist,physics max_domains 1e9 rh "NAER" "" "" rconfig integer sf_sfclay_physics namelist,physics max_domains 0 rh "sf_sfclay_physics" "" "" rconfig integer sf_surface_physics namelist,physics max_domains 0 rh "sf_surface_physics" "" "" @@ -1148,7 +1336,7 @@ rconfig integer IFSNOW namelist,physics 1 0 rconfig integer ICLOUD namelist,physics 1 1 irh "ICLOUD" "" "" rconfig real swrad_scat namelist,physics 1 1 irh "SWRAD_SCAT" "SCATTERING FACTOR IN SWRAD" "" rconfig integer surface_input_source namelist,physics 1 1 irh "surface_input_source" "1=static (fractional), 2=time dependent (dominant), 3=hybrid (not yet implemented)" "" -rconfig integer num_soil_layers namelist,physics 1 5 irh "num_soil_layers" "" "" +rconfig integer num_soil_layers namelist,physics 1 10 irh "num_soil_layers" "" "" rconfig integer num_months namelist,physics 1 12 irh "num_months" "" "" rconfig integer maxiens namelist,physics 1 1 irh "maxiens" "" "" rconfig integer maxens namelist,physics 1 3 irh "maxens" "" "" @@ -1245,15 +1433,15 @@ rconfig real zdamp namelist,dynamics max_domains 5000. rconfig real dampcoef namelist,dynamics max_domains 0. h "dampcoef" "" "" rconfig real khdif namelist,dynamics max_domains 0 h "khdif" "" "" rconfig real kvdif namelist,dynamics max_domains 0 h "kvdif" "" "" -rconfig real diff_6th_factor namelist,dynamics max_domains 0.12 h "diff_6th_factor" "factor that controls rate of 6th-order numerical diffusion" -rconfig integer diff_6th_opt namelist,dynamics max_domains 0 irh "diff_6th_opt" "switch for 6th-order numerical diffusion" +rconfig real diff_6th_factor namelist,dynamics max_domains 0.2 h "diff_6th_factor" "factor that controls rate of 6th-order numerical diffusion" +rconfig integer diff_6th_opt namelist,dynamics max_domains 2 irh "diff_6th_opt" "switch for 6th-order numerical diffusion" rconfig real c_s namelist,dynamics max_domains 0.25 h "c_s" "Smagorinsky coeff" "" rconfig real c_k namelist,dynamics max_domains 0.15 h "c_k" "TKE coeff" "" rconfig real smdiv namelist,dynamics max_domains 0.1 h "smdiv" "" "" rconfig real emdiv namelist,dynamics max_domains 0.01 h "emdiv" "" "" -rconfig real epssm namelist,dynamics max_domains .1 h "epssm" "" "" +rconfig real epssm namelist,dynamics max_domains 0.1 h "epssm" "" "" rconfig logical non_hydrostatic namelist,dynamics max_domains .true. irh "non_hydrostatic" "" "" -rconfig integer time_step_sound namelist,dynamics max_domains 0 h "time_step_sound" "" "" +rconfig integer time_step_sound namelist,dynamics max_domains 6 h "time_step_sound" "" "" rconfig integer h_mom_adv_order namelist,dynamics max_domains 5 rh "h_mom_adv_order" "" "" rconfig integer v_mom_adv_order namelist,dynamics max_domains 3 rh "v_mom_adv_order" "" "" rconfig integer h_sca_adv_order namelist,dynamics max_domains 5 rh "h_sca_adv_order" "" "" @@ -1261,7 +1449,7 @@ rconfig integer v_sca_adv_order namelist,dynamics max_domains 3 rconfig logical pd_moist namelist,dynamics max_domains .false. rh "pd_moist" "positive-definite RK3 transport switch" "" rconfig logical pd_moist_dfi namelist,dynamics max_domains .false. rh "pd_moist_dfi" "positive-definite RK3 transport switch" "" rconfig logical pd_chem namelist,dynamics max_domains .false. rh "pd_chem" "positive-definite RK3 transport switch" "" -rconfig logical pd_scalar namelist,dynamics max_domains .false. rh "pd_scalar" "positive-definite RK3 transport switch" "" +rconfig logical pd_scalar namelist,dynamics max_domains .true. rh "pd_scalar" "positive-definite RK3 transport switch" "" rconfig logical pd_tke namelist,dynamics max_domains .false. rh "pd_tke" "positive-definite RK3 transport switch" "" rconfig logical top_radiation namelist,dynamics max_domains .false. rh "top_radiation" "" "" rconfig integer mix_isotropic namelist,dynamics max_domains 0 h "mix_isotropic" "0=anistropic, 1=isotropic" "" @@ -1339,6 +1527,39 @@ state integer nodyn_dummy - dyn_nodyn - - - "" "" "" #key package associated package associated 4d scalars # name namelist choice state vars + +##### MARS OPTIONS +##### MARS OPTIONS +##### MARS OPTIONS +## +## CHANGING THE OPTION CHANGE THE NUMBER OF TRACERS WITHOUT ANY NEED TO RECOMPILE ENTIRELY WRF +## HOWEVER, YOU STILL NEED TO RECOMPILE THE PHYSICS BEFORE CHANGING THE OPTION +## JUST USE THE COMPILE_ALL SCRIPT FOR A FAST RECOMPILATION +## ------- +## ONE REMAINING PROBLEM IS THE FACT THAT YOU NEED TO RECOMPILE +## ENTIRELY IF YOU DO NOT WANT TO OUTPUT THE TRACERS +## (FOR EXAMPLE, IF THEY ARE TURNED OFF ...) +## ------- +## +## +package default mars==0 - - +package water mars==1 - scalar:qh2o,qh2o_ice +package dust1 mars==2 - scalar:qdust +package dust2eq mars==3 - scalar:qdust,qdustn +package newbasis mars==10 - scalar:qco2 +package newwater mars==11 - scalar:qh2o,qh2o_ice,qdust,qdustn +package newwatersca mars==12 - scalar:qh2o,qh2o_ice,qdust,qdustn,qccn,qccnn +package radioac mars==20 - scalar:qtrac1 +package VenusPC mars==34 - scalar:qco2,qco,qh2,qh2o,qo1d,qo,qo2,qo2dg,qo3,qh,qoh,qho2,qh2o2,qcl,qclo,qcl2,qhcl,qhocl,qclco,qclco3,qcocl2,qss,qso,qso2,qso3,qs2o2,qocs,qhso3,qh2so4,qs2,qclso2,qoscl,qh2oliq,qh2so4liq +package waterdyn mars==42 - scalar:qh2o,qh2o_ice;moist:qv,qc +package zemoist mars==51 - moist:qv;scalar:qh2o_ice +##### MARS OPTIONS +##### MARS OPTIONS +##### MARS OPTIONS + + + + #package passivec1 chem_opt==0 - package passiveqv mp_physics==0 - moist:qv package kesslerscheme mp_physics==1 - moist:qv,qc,qr diff --git a/WRF.COMMON/WRFV3/arch/configure_new.defaults b/WRF.COMMON/WRFV3/arch/configure_new.defaults index 68f3a95e..a7828a0c 100644 --- a/WRF.COMMON/WRFV3/arch/configure_new.defaults +++ b/WRF.COMMON/WRFV3/arch/configure_new.defaults @@ -414,8 +414,8 @@ OMPCPP = # -D_OPENMP OMP = # -fopenmp SFC = gfortran SCC = gcc -DM_FC = mpif90 -f90=$(SFC) -DM_CC = mpicc -cc=$(SCC) +DM_FC = mpif90 +DM_CC = mpicc FC = CONFIGURE_FC CC = CONFIGURE_CC LD = $(FC) diff --git a/WRF.COMMON/WRFV3/dyn_em/Makefile b/WRF.COMMON/WRFV3/dyn_em/Makefile index 8b9bedbc..6d78dab8 100644 --- a/WRF.COMMON/WRFV3/dyn_em/Makefile +++ b/WRF.COMMON/WRFV3/dyn_em/Makefile @@ -242,16 +242,11 @@ solve_em.o: module_small_step_em.o \ ../share/module_llxy.o \ ../share/module_model_constants.o \ ../share/module_bc.o \ - ../phys/module_microphysics_driver.o \ - ../phys/module_microphysics_zero_out.o \ ../phys/module_physics_addtendc.o +### pas sur module_first_rk_step_part1.o : \ - ../phys/module_radiation_driver.o \ - ../phys/module_surface_driver.o \ - ../phys/module_cumulus_driver.o \ - ../phys/module_pbl_driver.o \ - ../phys/module_fddagd_driver.o + ../phys/module_lmd_driver.o module_first_rk_step_part2.o : \ module_diffusion_em.o \ @@ -261,8 +256,7 @@ module_first_rk_step_part2.o : \ ../frame/module_driver_constants.o \ ../frame/module_configure.o \ ../frame/module_dm.o \ - ../share/module_bc.o \ - ../phys/module_fddaobs_driver.o + ../share/module_bc.o adapt_timestep_em.o: \ module_bc_em.o \ diff --git a/WRF.COMMON/WRFV3/dyn_em/module_big_step_utilities_em.F b/WRF.COMMON/WRFV3/dyn_em/module_big_step_utilities_em.F index 523d9433..a0c95691 100644 --- a/WRF.COMMON/WRFV3/dyn_em/module_big_step_utilities_em.F +++ b/WRF.COMMON/WRFV3/dyn_em/module_big_step_utilities_em.F @@ -4346,10 +4346,10 @@ END SUBROUTINE pole_point_bc !====================================================================== SUBROUTINE phy_prep ( config_flags, & ! input - mu, muu, muv, u, v, p, pb, alt, ph, & ! input + mu, muu, muv, u, v, w, p, pb, alt, ph, & ! input phb, t, tsk, moist, n_moist, & ! input mu_3d, rho, th_phy, p_phy , pi_phy , & ! output - u_phy, v_phy, p8w, t_phy, t8w, & ! output + u_phy, v_phy, w_phy, p8w, t_phy, t8w, & ! output z, z_at_w, dz8w, & ! output fzm, fzp, & ! params RTHRATEN, & @@ -4382,6 +4382,7 @@ END SUBROUTINE pole_point_bc REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , & INTENT( OUT) :: u_phy, & v_phy, & + w_phy, & pi_phy, & p_phy, & p8w, & @@ -4399,6 +4400,7 @@ END SUBROUTINE pole_point_bc p, & u, & v, & + w, & alt, & ph, & phb, & @@ -4472,7 +4474,12 @@ END SUBROUTINE pole_point_bc th_phy(i,k,j) = t(i,k,j) + t0 p_phy(i,k,j) = p(i,k,j) + pb(i,k,j) pi_phy(i,k,j) = (p_phy(i,k,j)/p1000mb)**rcp - t_phy(i,k,j) = th_phy(i,k,j)*pi_phy(i,k,j) + !! TAKE INTO ACCOUNT cp=f(T) on Venus + IF (planet.eq. "venus" ) THEN + t_phy(i,k,j)= (th_phy(i,k,j)**nu - nu*(TT00**nu)*log((p1000mb/p_phy(i,k,j))**rcp))**(1/nu) + ELSE + t_phy(i,k,j) = th_phy(i,k,j)*pi_phy(i,k,j) + ENDIF rho(i,k,j) = 1./alt(i,k,j)*(1.+moist(i,k,j,P_QV)) mu_3d(i,k,j) = mu(i,j) u_phy(i,k,j) = 0.5*(u(i,k,j)+u(i+1,k,j)) @@ -4511,7 +4518,9 @@ END SUBROUTINE pole_point_bc do j = j_start,j_end do k = k_start, k_end do i = i_start, i_end - z(i,k,j) = 0.5*(z_at_w(i,k,j) +z_at_w(i,k+1,j) ) + z(i,k,j) = 0.5*(z_at_w(i,k,j) + z_at_w(i,k+1,j) ) +!!!! MARS MARS ajout aymeric (ainsi que les arguments de cette routine) + w_phy(i,k,j) = 0.5*(w(i,k,j) + w(i,k+1,j) ) enddo enddo enddo @@ -4635,8 +4644,11 @@ END SUBROUTINE pole_point_bc ENDIF - IF (config_flags%bl_pbl_physics .gt. 0) THEN - +!!MARS MARS +! IF (config_flags%bl_pbl_physics .gt. 0) THEN + IF ( (config_flags%bl_pbl_physics .gt. 0) & + .OR. (config_flags%modif_wrf) ) THEN +!****MARS DO J=j_start,j_end DO K=k_start,k_end DO I=i_start,i_end diff --git a/WRF.COMMON/WRFV3/dyn_em/module_diffusion_em.F b/WRF.COMMON/WRFV3/dyn_em/module_diffusion_em.F index 79b07942..3c8caa5c 100644 --- a/WRF.COMMON/WRFV3/dyn_em/module_diffusion_em.F +++ b/WRF.COMMON/WRFV3/dyn_em/module_diffusion_em.F @@ -4443,7 +4443,9 @@ SUBROUTINE phy_bc ( config_flags,div,defor11,defor22,defor33, & ! End declarations. !----------------------------------------------------------------------- - IF(config_flags%bl_pbl_physics .GT. 0) THEN + IF( (config_flags%bl_pbl_physics .GT. 0) & + .OR. (config_flags%modif_wrf) ) THEN +!****MARS: Always do that ?? > yes, for periodic simu -- grep in share CALL set_physical_bc3d( RUBLTEN , 't', config_flags, & ids, ide, jds, jde, kds, kde, & @@ -4755,6 +4757,7 @@ END SUBROUTINE phy_bc ! set in namelist.input ! LES mods K=KTS + PRINT *, 'USE constant H/rho/cp : e.g. value of Hs ', heat_flux0*cp*rho(i_start,k,j_start) DO j = j_start, j_end DO i = i_start, i_end heat_flux = heat_flux0 @@ -4765,6 +4768,7 @@ END SUBROUTINE phy_bc ENDDO CASE (1) ! use surface heat flux computed from surface routine + PRINT *, 'USE surface heat flux from PHYSICS', hfx(i_start,j_start) K=KTS DO j = j_start, j_end DO i = i_start, i_end @@ -5167,6 +5171,7 @@ END SUBROUTINE phy_bc CASE (1,2) ! ustar computed from surface routine + PRINT *, 'USE u star (surf drag) from PHYSICS', ust(i_start,j_start) DO j = j_start, j_end DO i = i_start, i_end diff --git a/WRF.COMMON/WRFV3/dyn_em/module_em.F b/WRF.COMMON/WRFV3/dyn_em/module_em.F index 73f73371..acf92c56 100644 --- a/WRF.COMMON/WRFV3/dyn_em/module_em.F +++ b/WRF.COMMON/WRFV3/dyn_em/module_em.F @@ -570,7 +570,10 @@ SUBROUTINE rk_tendency ( config_flags, rk_step, & ims, ime, jms, jme, kms, kme, & its, ite, jts, jte, kts, kte ) - pbl_test : IF (config_flags%bl_pbl_physics .eq. 0) THEN +! pbl_test : IF (config_flags%bl_pbl_physics .eq. 0) THEN +!!!****MARS: vertical diffusion is done in the physics (TODO: consider the nonhydrostatic case ?) + pbl_test : IF ( (config_flags%bl_pbl_physics .eq. 0) & + .AND. (.not. config_flags%modif_wrf) ) THEN CALL vertical_diffusion_u ( u, ru_tendf, config_flags, & u_base, & @@ -948,7 +951,10 @@ SUBROUTINE rk_scalar_tend ( scs, sce, config_flags, & ims, ime, jms, jme, kms, kme, & its, ite, jts, jte, kts, kte ) - pbl_test : IF (config_flags%bl_pbl_physics .eq. 0) THEN +!!!****MARS: done in the physics + pbl_test : IF ( (config_flags%bl_pbl_physics .eq. 0) & + .AND. (.not. config_flags%modif_wrf) ) THEN +! pbl_test : IF (config_flags%bl_pbl_physics .eq. 0) THEN IF( (moist_step) .and. ( im == P_QV)) THEN @@ -1601,7 +1607,9 @@ SUBROUTINE calculate_phy_tend (config_flags,mu,muu,muv,pi3d, & ! pbl - IF (config_flags%bl_pbl_physics .gt. 0) THEN +! IF (config_flags%bl_pbl_physics .gt. 0) THEN +!!****MARS + IF ( (config_flags%bl_pbl_physics .gt. 0) .OR. (config_flags%modif_wrf) ) THEN DO J=jts,jtf DO K=kts,ktf diff --git a/WRF.COMMON/WRFV3/dyn_em/module_first_rk_step_part1.F b/WRF.COMMON/WRFV3/dyn_em/module_first_rk_step_part1.F index 2383e8bd..f7d5b539 100644 --- a/WRF.COMMON/WRFV3/dyn_em/module_first_rk_step_part1.F +++ b/WRF.COMMON/WRFV3/dyn_em/module_first_rk_step_part1.F @@ -31,12 +31,17 @@ CONTAINS USE module_model_constants USE module_domain, ONLY : domain USE module_configure, ONLY : grid_config_rec_type, model_config_rec - USE module_radiation_driver, ONLY : pre_radiation_driver, radiation_driver - USE module_surface_driver, ONLY : surface_driver - USE module_cumulus_driver, ONLY : cumulus_driver - USE module_pbl_driver, ONLY : pbl_driver - USE module_fddagd_driver, ONLY : fddagd_driver +!!!!****MARS MARS +!!!!****MARS MARS +! USE module_radiation_driver, ONLY : pre_radiation_driver, radiation_driver +! USE module_surface_driver, ONLY : surface_driver +! USE module_cumulus_driver, ONLY : cumulus_driver +! USE module_pbl_driver, ONLY : pbl_driver +! USE module_fddagd_driver, ONLY : fddagd_driver USE module_em, ONLY : init_zero_tendency +!!MARS + USE module_lmd_driver +!!MARS USE module_big_step_utilities_em, ONLY : phy_prep USE module_dm IMPLICIT NONE @@ -74,6 +79,7 @@ CONTAINS REAL ,DIMENSION(ims:ime,kms:kme,jms:jme), INTENT(INOUT) :: t_phy REAL ,DIMENSION(ims:ime,kms:kme,jms:jme), INTENT(INOUT) :: u_phy REAL ,DIMENSION(ims:ime,kms:kme,jms:jme), INTENT(INOUT) :: v_phy + REAL ,DIMENSION(ims:ime,kms:kme,jms:jme) :: w_phy !!MARS aymeric var loc REAL ,DIMENSION(ims:ime,kms:kme,jms:jme), INTENT(INOUT) :: dz8w REAL ,DIMENSION(ims:ime,kms:kme,jms:jme), INTENT(INOUT) :: p8w REAL ,DIMENSION(ims:ime,kms:kme,jms:jme), INTENT(INOUT) :: t8w @@ -143,10 +149,10 @@ BENCH_END(init_zero_tend_tim) CALL wrf_debug ( 200 , ' call phy_prep' ) CALL phy_prep ( config_flags, & grid%mut, grid%muu, grid%muv, grid%u_2, & - grid%v_2, grid%p, grid%pb, grid%alt, & + grid%v_2, grid%w_2, grid%p, grid%pb, grid%alt, & grid%ph_2, grid%phb, grid%t_2, grid%tsk, moist, num_moist, & mu_3d, rho, & - th_phy, p_phy, pi_phy, u_phy, v_phy, & + th_phy, p_phy, pi_phy, u_phy, v_phy, w_phy, & p8w, t_phy, t8w, grid%z, z_at_w, & dz8w, grid%fnm, grid%fnp, & grid%rthraten, & @@ -167,394 +173,527 @@ BENCH_END(init_zero_tend_tim) BENCH_END(phy_prep_tim) -! radiation +!!!!****MARS MARS +!!!!****MARS MARS -! this driver is only needed to handle non-local shadowing effects - CALL pre_radiation_driver ( grid, config_flags & - & ,itimestep=grid%itimestep, ra_call_offset=grid%ra_call_offset & - & ,XLAT=grid%xlat, XLONG=grid%xlong, GMT=grid%gmt & - & ,julian=grid%julian, xtime=grid%xtime, RADT=grid%radt & - & ,STEPRA=grid%stepra & - & ,ht=grid%ht,dx=grid%dx,dy=grid%dy,sina=grid%sina,cosa=grid%cosa & - & ,shadowmask=shadowmask,slope_rad=config_flags%slope_rad & - & ,topo_shading=config_flags%topo_shading & - & ,shadlen=config_flags%shadlen,ht_shad=grid%ht_shad,ht_loc=ht_loc & - & ,ht_shad_bxs=grid%ht_shad_bxs, ht_shad_bxe=grid%ht_shad_bxe & - & ,ht_shad_bys=grid%ht_shad_bys, ht_shad_bye=grid%ht_shad_bye & - & ,nested=config_flags%nested, min_ptchsz=grid%min_ptchsz & - & ,spec_bdy_width=config_flags%spec_bdy_width & - ! indexes - & ,IDS=ids,IDE=ide, JDS=jds,JDE=jde, KDS=kds,KDE=kde & - & ,IMS=ims,IME=ime, JMS=jms,JME=jme, KMS=kms,KME=kme & - & ,IPS=ips,IPE=ipe, JPS=jps,JPE=jpe, KPS=kps,KPE=kpe & - & ,i_start=grid%i_start,i_end=min(grid%i_end, ide-1) & - & ,j_start=grid%j_start,j_end=min(grid%j_end, jde-1) & - & ,kts=k_start, kte=min(k_end,kde-1) & - & ,num_tiles=grid%num_tiles ) - - CALL wrf_debug ( 200 , ' call radiation_driver' ) -BENCH_START(rad_driver_tim) - - CALL radiation_driver( & - & ACFRCV=grid%acfrcv ,ACFRST=grid%acfrst ,ALBEDO=grid%albedo & - & ,CFRACH=grid%cfrach ,CFRACL=grid%cfracl ,CFRACM=grid%cfracm & - & ,CUPPT=grid%cuppt ,CZMEAN=grid%czmean ,DT=grid%dt & - & ,DZ8W=dz8w ,EMISS=grid%emiss ,GLW=grid%glw & - & ,GMT=grid%gmt ,GSW=grid%gsw ,HBOT=grid%hbot & - & ,HTOP=grid%htop ,HBOTR=grid%hbotr ,HTOPR=grid%htopr & - & ,ICLOUD=config_flags%icloud & - & ,ITIMESTEP=grid%itimestep,JULDAY=grid%julday , JULIAN=grid%julian & - & ,JULYR=grid%julyr ,LW_PHYSICS=config_flags%ra_lw_physics & - & ,NCFRCV=grid%ncfrcv ,NCFRST=grid%ncfrst ,NPHS=1 & - & ,P8W=p8w ,P=p_phy ,PI=pi_phy & - & ,RADT=grid%radt ,RA_CALL_OFFSET=grid%ra_call_offset & - & ,RHO=rho ,RLWTOA=grid%rlwtoa & - & ,RSWTOA=grid%rswtoa ,RTHRATEN=grid%rthraten & - & ,RTHRATENLW=grid%rthratenlw ,RTHRATENSW=grid%rthratensw & - & ,SNOW=grid%snow ,STEPRA=grid%stepra ,SWDOWN=grid%swdown & - & ,SWDOWNC=grid%swdownc ,SW_PHYSICS=config_flags%ra_sw_physics & - & ,T8W=t8w ,T=t_phy ,TAUCLDC=grid%taucldc & - & ,TAUCLDI=grid%taucldi ,TSK=grid%tsk ,VEGFRA=grid%vegfra & - & ,WARM_RAIN=grid%warm_rain ,XICE=grid%xice ,XLAND=grid%xland & - & ,XLAT=grid%xlat ,XLONG=grid%xlong & -!Optional urban - & ,DECLIN_URB=grid%declin_urb ,COSZ_URB2D=grid%cosz_urb2d & - & ,OMG_URB2D=grid%omg_urb2d & +!! radiation ! - & ,Z=grid%z & - & ,LEVSIZ=grid%levsiz, N_OZMIXM=num_ozmixm & - & ,N_AEROSOLC=num_aerosolc & - & ,PAERLEV=grid%paerlev & - & ,CAM_ABS_DIM1=grid%cam_abs_dim1, CAM_ABS_DIM2=grid%cam_abs_dim2 & - & ,CAM_ABS_FREQ_S=grid%cam_abs_freq_s & - & ,XTIME=grid%xtime & - ,CURR_SECS=curr_secs, ADAPT_STEP_FLAG=adapt_step_flag & - ! indexes +!! this driver is only needed to handle non-local shadowing effects +! CALL pre_radiation_driver ( grid, config_flags & +! & ,itimestep=grid%itimestep, ra_call_offset=grid%ra_call_offset & +! & ,XLAT=grid%xlat, XLONG=grid%xlong, GMT=grid%gmt & +! & ,julian=grid%julian, xtime=grid%xtime, RADT=grid%radt & +! & ,STEPRA=grid%stepra & +! & ,ht=grid%ht,dx=grid%dx,dy=grid%dy,sina=grid%sina,cosa=grid%cosa & +! & ,shadowmask=shadowmask,slope_rad=config_flags%slope_rad & +! & ,topo_shading=config_flags%topo_shading & +! & ,shadlen=config_flags%shadlen,ht_shad=grid%ht_shad,ht_loc=ht_loc & +! & ,ht_shad_bxs=grid%ht_shad_bxs, ht_shad_bxe=grid%ht_shad_bxe & +! & ,ht_shad_bys=grid%ht_shad_bys, ht_shad_bye=grid%ht_shad_bye & +! & ,nested=config_flags%nested, min_ptchsz=grid%min_ptchsz & +! & ,spec_bdy_width=config_flags%spec_bdy_width & +! ! indexes +! & ,IDS=ids,IDE=ide, JDS=jds,JDE=jde, KDS=kds,KDE=kde & +! & ,IMS=ims,IME=ime, JMS=jms,JME=jme, KMS=kms,KME=kme & +! & ,IPS=ips,IPE=ipe, JPS=jps,JPE=jpe, KPS=kps,KPE=kpe & +! & ,i_start=grid%i_start,i_end=min(grid%i_end, ide-1) & +! & ,j_start=grid%j_start,j_end=min(grid%j_end, jde-1) & +! & ,kts=k_start, kte=min(k_end,kde-1) & +! & ,num_tiles=grid%num_tiles ) +! +! CALL wrf_debug ( 200 , ' call radiation_driver' ) +!BENCH_START(rad_driver_tim) +! +! CALL radiation_driver( & +! & ACFRCV=grid%acfrcv ,ACFRST=grid%acfrst ,ALBEDO=grid%albedo & +! & ,CFRACH=grid%cfrach ,CFRACL=grid%cfracl ,CFRACM=grid%cfracm & +! & ,CUPPT=grid%cuppt ,CZMEAN=grid%czmean ,DT=grid%dt & +! & ,DZ8W=dz8w ,EMISS=grid%emiss ,GLW=grid%glw & +! & ,GMT=grid%gmt ,GSW=grid%gsw ,HBOT=grid%hbot & +! & ,HTOP=grid%htop ,HBOTR=grid%hbotr ,HTOPR=grid%htopr & +! & ,ICLOUD=config_flags%icloud & +! & ,ITIMESTEP=grid%itimestep,JULDAY=grid%julday , JULIAN=grid%julian & +! & ,JULYR=grid%julyr ,LW_PHYSICS=config_flags%ra_lw_physics & +! & ,NCFRCV=grid%ncfrcv ,NCFRST=grid%ncfrst ,NPHS=1 & +! & ,P8W=p8w ,P=p_phy ,PI=pi_phy & +! & ,RADT=grid%radt ,RA_CALL_OFFSET=grid%ra_call_offset & +! & ,RHO=rho ,RLWTOA=grid%rlwtoa & +! & ,RSWTOA=grid%rswtoa ,RTHRATEN=grid%rthraten & +! & ,RTHRATENLW=grid%rthratenlw ,RTHRATENSW=grid%rthratensw & +! & ,SNOW=grid%snow ,STEPRA=grid%stepra ,SWDOWN=grid%swdown & +! & ,SWDOWNC=grid%swdownc ,SW_PHYSICS=config_flags%ra_sw_physics & +! & ,T8W=t8w ,T=t_phy ,TAUCLDC=grid%taucldc & +! & ,TAUCLDI=grid%taucldi ,TSK=grid%tsk ,VEGFRA=grid%vegfra & +! & ,WARM_RAIN=grid%warm_rain ,XICE=grid%xice ,XLAND=grid%xland & +! & ,XLAT=grid%xlat ,XLONG=grid%xlong & +!!Optional urban +! & ,DECLIN_URB=grid%declin_urb ,COSZ_URB2D=grid%cosz_urb2d & +! & ,OMG_URB2D=grid%omg_urb2d & +!! +! & ,Z=grid%z & +! & ,LEVSIZ=grid%levsiz, N_OZMIXM=num_ozmixm & +! & ,N_AEROSOLC=num_aerosolc & +! & ,PAERLEV=grid%paerlev & +! & ,CAM_ABS_DIM1=grid%cam_abs_dim1, CAM_ABS_DIM2=grid%cam_abs_dim2 & +! & ,CAM_ABS_FREQ_S=grid%cam_abs_freq_s & +! & ,XTIME=grid%xtime & +! ,CURR_SECS=curr_secs, ADAPT_STEP_FLAG=adapt_step_flag & +! ! indexes +! & ,IDS=ids,IDE=ide, JDS=jds,JDE=jde, KDS=kds,KDE=kde & +! & ,IMS=ims,IME=ime, JMS=jms,JME=jme, KMS=kms,KME=kme & +! & ,i_start=grid%i_start,i_end=min(grid%i_end, ide-1) & +! & ,j_start=grid%j_start,j_end=min(grid%j_end, jde-1) & +! & ,kts=k_start, kte=min(k_end,kde-1) & +! & ,num_tiles=grid%num_tiles & +! ! Optional +! & , CLDFRA=grid%cldfra & +! & , PB=grid%pb & +! & , F_ICE_PHY=grid%f_ice_phy,F_RAIN_PHY=grid%f_rain_phy & +! & , QV=moist(ims,kms,jms,P_QV), F_QV=F_QV & +! & , QC=moist(ims,kms,jms,P_QC), F_QC=F_QC & +! & , QR=moist(ims,kms,jms,P_QR), F_QR=F_QR & +! & , QI=moist(ims,kms,jms,P_QI), F_QI=F_QI & +! & , QS=moist(ims,kms,jms,P_QS), F_QS=F_QS & +! & , QG=moist(ims,kms,jms,P_QG), F_QG=F_QG & +! & , QNDROP=scalar(ims,kms,jms,P_QNDROP), F_QNDROP=F_QNDROP & +!#ifdef ACFLUX +! & ,ACSWUPT=acswupt ,ACSWUPTC=acswuptc & +! & ,ACSWDNT=acswdnt ,ACSWDNTC=acswdntc & +! & ,ACSWUPB=acswupb ,ACSWUPBC=acswupbc & +! & ,ACSWDNB=acswdnb ,ACSWDNBC=acswdnbc & +! & ,ACLWUPT=aclwupt ,ACLWUPTC=aclwuptc & +! & ,ACLWDNT=aclwdnt ,ACLWDNTC=aclwdntc & +! & ,ACLWUPB=aclwupb ,ACLWUPBC=aclwupbc & +! & ,ACLWDNB=aclwdnb ,ACLWDNBC=aclwdnbc & +! & ,SWUPT=swupt ,SWUPTC=swuptc & +! & ,SWDNT=swdnt ,SWDNTC=swdntc & +! & ,SWUPB=swupb ,SWUPBC=swupbc & +! & ,SWDNB=swdnb ,SWDNBC=swdnbc & +! & ,LWUPT=lwupt ,LWUPTC=lwuptc & +! & ,LWDNT=lwdnt ,LWDNTC=lwdntc & +! & ,LWUPB=lwupb ,LWUPBC=lwupbc & +! & ,LWDNB=lwdnb ,LWDNBC=lwdnbc & +!#endif +! & ,LWCF=grid%lwcf & +! & ,SWCF=grid%swcf & +! & ,OLR=grid%olr & +! & ,OZMIXM=grid%ozmixm, PIN=grid%pin & +! & ,M_PS_1=grid%m_ps_1, M_PS_2=grid%m_ps_2, AEROSOLC_1=grid%aerosolc_1 & +! & ,AEROSOLC_2=grid%aerosolc_2, M_HYBI0=grid%m_hybi & +! & ,ABSTOT=grid%abstot, ABSNXT=grid%absnxt, EMSTOT=grid%emstot & +!#ifdef WRF_CHEM +! & ,CU_RAD_FEEDBACK=config_flags%cu_rad_feedback & +! & ,AER_RA_FEEDBACK=config_flags%aer_ra_feedback & +! & ,QC_ADJUST=grid%GD_CLOUD_B , QI_ADJUST=grid%GD_CLOUD2_B & +! & ,PM2_5_DRY=grid%pm2_5_dry, PM2_5_WATER=grid%pm2_5_water & +! & ,PM2_5_DRY_EC=grid%pm2_5_dry_ec & +! & ,TAUAER300=grid%tauaer1, TAUAER400=grid%tauaer2 & ! jcb +! & ,TAUAER600=grid%tauaer3, TAUAER999=grid%tauaer4 & ! jcb +! & ,GAER300=grid%gaer1, GAER400=grid%gaer2, GAER600=grid%gaer3, GAER999=grid%gaer4 & ! jcb +! & ,WAER300=grid%waer1, WAER400=grid%waer2, WAER600=grid%waer3, WAER999=grid%waer4 & ! jcb +!#endif +! & ,slope_rad=config_flags%slope_rad,topo_shading=config_flags%topo_shading & +! & ,shadowmask=shadowmask,ht=grid%ht,dx=grid%dx,dy=grid%dy,sina=grid%sina,cosa=grid%cosa ) +! +!BENCH_END(rad_driver_tim) +! +!!********* Surface driver +!! surface +! +!BENCH_START(surf_driver_tim) +! +!!----------------------------------------------------------------- +!! urban related variable are added to arguments of surface_driver +!!----------------------------------------------------------------- +! num_roof_layers = grid%num_soil_layers !urban +! num_wall_layers = grid%num_soil_layers !urban +! num_road_layers = grid%num_soil_layers !urban +! CALL nl_get_iswater(grid%id, iswater) +! +! CALL wrf_debug ( 200 , ' call surface_driver' ) +! +! CALL surface_driver( & +! & ACSNOM=grid%acsnom ,ACSNOW=grid%acsnow ,AKHS=grid%akhs & +! & ,AKMS=grid%akms ,ALBBCK=grid%albbck ,ALBEDO=grid%albedo & +! & ,EMBCK=grid%embck & +! & ,BR=br ,CANWAT=grid%canwat ,CHKLOWQ=chklowq & +! & ,CT=grid%ct ,DT=grid%dt ,DX=grid%dx & +! & ,DZ8W=dz8w ,DZS=grid%dzs ,FLHC=grid%flhc & +! & ,FLQC=grid%flqc ,GLW=grid%glw ,GRDFLX=grid%grdflx & +! & ,GSW=grid%gsw ,SWDOWN=grid%swdown ,GZ1OZ0=gz1oz0 ,HFX=grid%hfx & +! & ,HT=grid%ht ,IFSNOW=config_flags%ifsnow ,ISFFLX=config_flags%isfflx & +! & ,ISLTYP=grid%isltyp ,ITIMESTEP=grid%itimestep & +! & ,IVGTYP=grid%ivgtyp ,LH=grid%lh ,LOWLYR=grid%lowlyr & +! & ,MAVAIL=grid%mavail ,NUM_SOIL_LAYERS=config_flags%num_soil_layers & +! & ,P8W=p8w ,PBLH=grid%pblh ,PI_PHY=pi_phy & +! & ,PSFC=grid%psfc ,PSHLTR=grid%pshltr ,PSIH=psih & +! & ,BLDT=grid%bldt ,CURR_SECS=curr_secs, ADAPT_STEP_FLAG=adapt_step_flag & +! & ,PSIM=psim ,P_PHY=p_phy ,Q10=grid%q10 & +! & ,Q2=grid%q2 ,QFX=grid%qfx ,QSFC=grid%qsfc & +! & ,QSHLTR=grid%qshltr ,QZ0=grid%qz0 ,RAINCV=grid%raincv & +! & ,RA_LW_PHYSICS=config_flags%ra_lw_physics ,RHO=rho & +! & ,RMOL=grid%rmol ,SFCEVP=grid%sfcevp ,SFCEXC=grid%sfcexc & +! & ,SFCRUNOFF=grid%sfcrunoff & +! & ,SF_SFCLAY_PHYSICS=config_flags%sf_sfclay_physics & +! & ,SF_SURFACE_PHYSICS=config_flags%sf_surface_physics ,SH2O=grid%sh2o & +! & ,SHDMAX=grid%shdmax ,SHDMIN=grid%shdmin ,SMOIS=grid%smois & +! & ,SMSTAV=grid%smstav ,SMSTOT=grid%smstot ,SNOALB=grid%snoalb & +! & ,SNOW=grid%snow ,SNOWC=grid%snowc ,SNOWH=grid%snowh & +! & ,SST=grid%sst ,SST_UPDATE=grid%sst_update & +! & ,STEPBL=grid%stepbl ,TH10=grid%th10 ,TH2=grid%th2 & +! & ,THZ0=grid%thz0 ,TH_PHY=th_phy ,TKE_MYJ=grid%tke_myj & +! & ,TMN=grid%tmn ,TSHLTR=grid%tshltr ,TSK=grid%tsk & +! & ,TSLB=grid%tslb ,T_PHY=t_phy ,U10=grid%u10 & +! & ,URATX=grid%uratx ,VRATX=grid%vratx ,TRATX=grid%tratx & +! & ,UDRUNOFF=grid%udrunoff ,UST=grid%ust ,UZ0=grid%uz0 & +! & ,U_FRAME=grid%u_frame ,U_PHY=u_phy ,V10=grid%v10 & +! & ,VEGFRA=grid%vegfra ,VZ0=grid%vz0 ,V_FRAME=grid%v_frame & +! & ,V_PHY=v_phy ,WARM_RAIN=grid%warm_rain & +! & ,WSPD=wspd ,XICE=grid%xice ,XLAND=grid%xland & +! & ,Z0=grid%z0 ,Z=grid%z ,ZNT=grid%znt & +! & ,ZS=grid%zs ,XICEM=grid%xicem ,ISICE=grid%landuse_isice& +! & ,USTM=grid%ustm ,CK=grid%ck ,CKA=grid%cka & +! & ,CD=grid%cd ,CDA=grid%cda & +! & ,ISFTCFLX=config_flags%isftcflx & +! & ,OMLCALL=config_flags%omlcall ,OML_HML0=config_flags%oml_hml0 ,OML_GAMMA=config_flags%oml_gamma & +! & ,TML=grid%tml, T0ML=grid%t0ml, HML=grid%hml, H0ML=grid%h0ml, HUML=grid%huml, HVML=grid%hvml, F=grid%f & +! & ,ISWATER=iswater & +! & ,DECLIN_URB=grid%declin_urb ,COSZ_URB2D=grid%cosz_urb2d & !I urban +! & ,OMG_URB2D=grid%omg_urb2d ,xlat_urb2d=grid%XLAT & !I urban +! & ,NUM_ROOF_LAYERS=num_roof_layers & !I urban +! & ,NUM_WALL_LAYERS=num_wall_layers & !I urban +! & ,NUM_ROAD_LAYERS=num_road_layers & +! & ,DZR=grid%dzr ,DZB=grid%dzb ,DZG=grid%dzg & !I urban +! & ,TR_URB2D=grid%tr_urb2d ,TB_URB2D=grid%tb_urb2d & +! & ,TG_URB2D=grid%tg_urb2d & !H urban +! & ,TC_URB2D=grid%tc_urb2d ,QC_URB2D=grid%qc_urb2d & !H urban +! & ,UC_URB2D=grid%uc_urb2d & !H urban +! & ,XXXR_URB2D=grid%xxxr_urb2d & +! & ,XXXB_URB2D=grid%xxxb_urb2d & !H urban +! & ,XXXG_URB2D=grid%xxxg_urb2d & +! & ,XXXC_URB2D=grid%xxxc_urb2d & !H urban +! & ,TRL_URB3D=grid%trl_urb3d ,TBL_URB3D=grid%tbl_urb3d & !H urban +! & ,TGL_URB3D=grid%tgl_urb3d & !H urban +! & ,SH_URB2D=grid%sh_urb2d ,LH_URB2D=grid%lh_urb2d & +! & ,G_URB2D=grid%g_urb2d & !H urban +! & ,RN_URB2D=grid%rn_urb2d , TS_URB2D=grid%ts_urb2d & !H urban +! & ,FRC_URB2D=grid%frc_urb2d & !H urban +! & ,UTYPE_URB2D=grid%utype_urb2d & !H urban +! & ,ucmcall=grid%ucmcall & !H urban +! ! P-X LSM Variables +! & ,LANDUSEF=grid%landusef, SOILCTOP=grid%soilctop & ! P-X LSM +! & ,SOILCBOT=grid%soilcbot & ! P-X LSM +! & ,RA=grid%ra, RS=grid%rs, LAI=grid%lai & ! P-X LSM +! & ,NLCAT=grid%num_land_cat, NSCAT=grid%num_soil_cat & ! P-X LSM +! & ,VEGF_PX=grid%vegf_px, SNOWNCV=grid%snowncv & ! P-X LSM +! & ,ANAL_INTERVAL=config_flags%interval_seconds & ! P-X LSM +! & ,PXLSM_SMOIS_INIT=config_flags%pxlsm_smois_init & ! P-X LSM +! & ,PXLSM_SOIL_NUDGE=config_flags%grid_fdda & ! P-X LSM +! ! Optional PX LSM nudging +! & ,t2_ndg_old=fdda2d(ims,1,jms,P_t2_ndg_old) & +! & ,q2_ndg_old=fdda2d(ims,1,jms,P_q2_ndg_old) & +! & ,t2_ndg_new=fdda2d(ims,1,jms,P_t2_ndg_new) & +! & ,q2_ndg_new=fdda2d(ims,1,jms,P_q2_ndg_new) & +! & ,sn_ndg_old=fdda2d(ims,1,jms,P_sn_ndg_old) & +! & ,sn_ndg_new=fdda2d(ims,1,jms,P_sn_ndg_new) & +! ! Indexes +! & ,IDS=ids,IDE=ide, JDS=jds,JDE=jde, KDS=kds,KDE=kde & +! & ,IMS=ims,IME=ime, JMS=jms,JME=jme, KMS=kms,KME=kme & +! & , I_START=grid%i_start,I_END=min(grid%i_end, ide-1) & +! & , J_START=grid%j_start,J_END=min(grid%j_end, jde-1) & +! & , KTS=k_start, KTE=min(k_end,kde-1) & +! & , NUM_TILES=grid%num_tiles & +! ! Optional +! & ,QV_CURR=moist(ims,kms,jms,P_QV), F_QV=F_QV & +! & ,QC_CURR=moist(ims,kms,jms,P_QC), F_QC=F_QC & +! & ,QR_CURR=moist(ims,kms,jms,P_QR), F_QR=F_QR & +! & ,QI_CURR=moist(ims,kms,jms,P_QI), F_QI=F_QI & +! & ,QS_CURR=moist(ims,kms,jms,P_QS), F_QS=F_QS & +! & ,QG_CURR=moist(ims,kms,jms,P_QG), F_QG=F_QG & +! & ,CAPG=grid%capg, EMISS=grid%emiss, HOL=hol,MOL=grid%mol & +! & ,T2OBS=grid%t2obs, Q2OBS=grid%q2obs & +! & ,RAINBL=grid%rainbl,SR=grid%sr & +! & ,RAINNCV=grid%rainncv,REGIME=grid%regime,T2=grid%t2,THC=grid%thc & +! & ,QSG=grid%qsg,QVG=grid%qvg,QCG=grid%qcg,SOILT1=grid%soilt1,TSNAV=grid%tsnav & ! ruc lsm +! & ,SMFR3D=grid%smfr3d,KEEPFR3DFLAG=grid%keepfr3dflag & ! ruc lsm +! & ,POTEVP=grid%POTEVP, SNOPCX=grid%SNOPCX, SOILTB=grid%SOILTB & ! ruc lsm +! & ) +!BENCH_END(surf_driver_tim) +! +!!********* +!! pbl +! +! CALL wrf_debug ( 200 , ' call pbl_driver' ) +!BENCH_START(pbl_driver_tim) +! CALL pbl_driver( & +! & AKHS=grid%akhs ,AKMS=grid%akms & +! & ,BL_PBL_PHYSICS=config_flags%bl_pbl_physics & +! & ,BLDT=grid%bldt, CURR_SECS=curr_secs, ADAPT_STEP_FLAG=adapt_step_flag & +! & ,BR=br ,CHKLOWQ=chklowq ,CT=grid%ct & +! & ,DT=grid%dt ,DX=grid%dx ,DZ8W=dz8w & +! & ,EL_MYJ=grid%el_myj ,EXCH_H=grid%exch_h ,GRDFLX=grid%grdflx & +! & ,GZ1OZ0=gz1oz0 ,HFX=grid%hfx ,HT=grid%ht & +! & ,ITIMESTEP=grid%itimestep ,KPBL=grid%kpbl & +! & ,LH=grid%lh ,LOWLYR=grid%lowlyr ,P8W=p8w & +! & ,PBLH=grid%pblh ,PI_PHY=pi_phy ,PSIH=psih & +! & ,PSIM=psim ,P_PHY=p_phy ,QFX=grid%qfx & +! & ,QSFC=grid%qsfc ,QZ0=grid%qz0 & +! & ,RA_LW_PHYSICS=config_flags%ra_lw_physics & +! & ,RHO=rho ,RQCBLTEN=grid%rqcblten ,RQIBLTEN=grid%rqiblten & +! & ,RQVBLTEN=grid%rqvblten ,RTHBLTEN=grid%rthblten ,RUBLTEN=grid%rublten & +! & ,RVBLTEN=grid%rvblten ,SNOW=grid%snow ,STEPBL=grid%stepbl & +! & ,THZ0=grid%thz0 ,TH_PHY=th_phy ,TKE_MYJ=grid%tke_myj & +! & ,TSK=grid%tsk ,T_PHY=t_phy ,UST=grid%ust & +! & ,U10=grid%u10 ,UZ0=grid%uz0 ,U_FRAME=grid%u_frame ,U_PHY=u_phy & +! & ,V10=grid%v10 ,VZ0=grid%vz0 ,V_FRAME=grid%v_frame ,V_PHY=v_phy & +! & ,WARM_RAIN=grid%warm_rain ,WSPD=wspd & +! & ,XICE=grid%xice ,XLAND=grid%xland ,Z=grid%z & +! & ,ZNT=grid%znt & +! & ,IDS=ids,IDE=ide, JDS=jds,JDE=jde, KDS=kds,KDE=kde & +! & ,IMS=ims,IME=ime, JMS=jms,JME=jme, KMS=kms,KME=kme & +! & ,I_START=grid%i_start,I_END=min(grid%i_end, ide-1) & +! & ,J_START=grid%j_start,J_END=min(grid%j_end, jde-1) & +! & ,KTS=k_start, KTE=min(k_end,kde-1) & +! & ,NUM_TILES=grid%num_tiles & +! ! Variables Required by ACM PBL - jp +! & ,ZNU=grid%znu,ZNW=grid%znw,MUT=grid%mut,P_TOP=grid%p_top & +! ! optional +! & ,QV_CURR=moist(ims,kms,jms,P_QV), F_QV=F_QV & +! & ,QC_CURR=moist(ims,kms,jms,P_QC), F_QC=F_QC & +! & ,QR_CURR=moist(ims,kms,jms,P_QR), F_QR=F_QR & +! & ,QI_CURR=moist(ims,kms,jms,P_QI), F_QI=F_QI & +! & ,QS_CURR=moist(ims,kms,jms,P_QS), F_QS=F_QS & +! & ,QG_CURR=moist(ims,kms,jms,P_QG), F_QG=F_QG & +! & ,HOL=HOL, MOL=grid%mol, REGIME=grid%REGIME & +! & ) +! +!BENCH_END(pbl_driver_tim) +! +!! cumulus para. +! +! CALL wrf_debug ( 200 , ' call cumulus_driver' ) +! +! +!BENCH_START(cu_driver_tim) +! CALL cumulus_driver(grid & +! ! Prognostic variables +! & ,U=u_phy ,V=v_phy ,TH=th_phy ,T=t_phy & +! & ,W=grid%w_2 ,P=p_phy ,PI=pi_phy ,RHO=rho & +! ! Other arguments +! & ,ITIMESTEP=grid%itimestep ,DT=grid%dt ,DX=grid%dx & +! & ,CUDT=grid%cudt,CURR_SECS=curr_secs,ADAPT_STEP_FLAG=adapt_step_flag & +! & ,RAINC=grid%rainc ,RAINCV=grid%raincv ,PRATEC=grid%pratec & +! & , NCA=grid%nca & +! & ,HTOP=grid%cutop ,HBOT=grid%cubot ,KPBL=grid%kpbl & +! & ,DZ8W=dz8w ,P8W=p8w & +! & ,W0AVG=grid%w0avg ,STEPCU=grid%stepcu & +! & ,CLDEFI=grid%cldefi ,LOWLYR=grid%lowlyr ,XLAND=grid%xland & +! & ,APR_GR=grid%apr_gr ,APR_W=grid%apr_w ,APR_MC=grid%apr_mc & +! & ,APR_ST=grid%apr_st ,APR_AS=grid%apr_as ,APR_CAPMA=grid%apr_capma & +! & ,APR_CAPME=grid%apr_capme ,APR_CAPMI=grid%apr_capmi & +! & ,MASS_FLUX=grid%mass_flux ,XF_ENS=grid%xf_ens & +! & ,PR_ENS=grid%pr_ens ,HT=grid%ht,EDT_OUT=grid%edt_out & +! & ,imomentum=grid%imomentum,clos_choice=grid%clos_choice & +! & ,cugd_tten=grid%cugd_tten,cugd_qvten=grid%cugd_qvten,cugd_qcten=grid%cugd_qcten & +! & ,cugd_ttens=grid%cugd_ttens,cugd_qvtens=grid%cugd_qvtens & +! & ,ENSDIM=config_flags%ensdim ,MAXIENS=config_flags%maxiens ,MAXENS=config_flags%maxens & +! & ,MAXENS2=config_flags%maxens2 ,MAXENS3=config_flags%maxens3 & +! & ,CU_ACT_FLAG=cu_act_flag ,WARM_RAIN=grid%warm_rain & +! & ,GSW=grid%gsw,cugd_avedx=config_flags%cugd_avedx & +! & ,PERIODIC_X=(config_flags%polar .OR. config_flags%periodic_x) & +! & ,PERIODIC_Y=config_flags%periodic_y & +! ! Selection flag +! & ,CU_PHYSICS=config_flags%cu_physics & +! ! Dimension arguments +! & ,IDS=ids,IDE=ide, JDS=jds,JDE=jde, KDS=kds,KDE=kde & +! & ,IMS=ims,IME=ime, JMS=jms,JME=jme, KMS=kms,KME=kme & +! & ,IPS=ips,IPE=ipe, JPS=jps,JPE=jpe, KPS=kps,KPE=kpe & +! & ,I_START=grid%i_start,I_END=min(grid%i_end, ide-1) & +! & ,J_START=grid%j_start,J_END=min(grid%j_end, jde-1) & +! & ,KTS=k_start, KTE=min(k_end,kde-1) & +! & ,NUM_TILES=grid%num_tiles & +! ! Moisture tendency arguments +! & ,RQVCUTEN=grid%rqvcuten , RQCCUTEN=grid%rqccuten & +! & ,RQSCUTEN=grid%rqscuten , RQICUTEN=grid%rqicuten & +! & ,RQRCUTEN=grid%rqrcuten , RQVBLTEN=grid%rqvblten & +! & ,RQVFTEN=grid%rqvften & +! ! Other tendency arguments +! & ,RTHRATEN=grid%rthraten , RTHBLTEN=grid%rthblten & +! & ,RTHCUTEN=grid%rthcuten , RTHFTEN=grid%rthften & +! ! Moisture tracer arguments +! & ,QV_CURR=moist(ims,kms,jms,P_QV), F_QV=F_QV & +! & ,QC_CURR=moist(ims,kms,jms,P_QC), F_QC=F_QC & +! & ,QR_CURR=moist(ims,kms,jms,P_QR), F_QR=F_QR & +! & ,QI_CURR=moist(ims,kms,jms,P_QI), F_QI=F_QI & +! & ,QS_CURR=moist(ims,kms,jms,P_QS), F_QS=F_QS & +! & ,QG_CURR=moist(ims,kms,jms,P_QG), F_QG=F_QG & +!#ifdef WRF_CHEM +! & ,GD_CLOUD=grid%GD_CLOUD,GD_CLOUD2=grid%GD_CLOUD2 & +!#endif +! & ) +!BENCH_END(cu_driver_tim) +! +! CALL wrf_debug ( 200 , ' call fddagd_driver' ) +! +!BENCH_START(fdda_driver_tim) +! CALL fddagd_driver(itimestep=grid%itimestep,dt=grid%dt,xtime=grid%XTIME, & +! id=grid%id, & +! RUNDGDTEN=grid%rundgdten,RVNDGDTEN=grid%rvndgdten, & +! RTHNDGDTEN=grid%rthndgdten,RQVNDGDTEN=grid%rqvndgdten, & +! RMUNDGDTEN=grid%rmundgdten, & +! u_ndg_old=fdda3d(ims,kms,jms,P_u_ndg_old), & +! v_ndg_old=fdda3d(ims,kms,jms,P_v_ndg_old), & +! t_ndg_old=fdda3d(ims,kms,jms,P_t_ndg_old), & +! q_ndg_old=fdda3d(ims,kms,jms,P_q_ndg_old), & +! mu_ndg_old=fdda2d(ims,1,jms,P_mu_ndg_old), & +! u_ndg_new=fdda3d(ims,kms,jms,P_u_ndg_new), & +! v_ndg_new=fdda3d(ims,kms,jms,P_v_ndg_new), & +! t_ndg_new=fdda3d(ims,kms,jms,P_t_ndg_new), & +! q_ndg_new=fdda3d(ims,kms,jms,P_q_ndg_new), & +! mu_ndg_new=fdda2d(ims,1,jms,P_mu_ndg_new), & +! u3d=grid%u_2,v3d=grid%v_2,th_phy=th_phy,rho=rho,moist=moist, & +! p_phy=p_phy,pi_phy=pi_phy,p8w=p8w,t_phy=t_phy, & +! dz8w=dz8w,z=grid%z,z_at_w=z_at_w, & +! config_flags=config_flags,dx=grid%DX,n_moist=num_moist, & +! STEPFG=grid%STEPFG, & +! pblh=grid%pblh,ht=grid%ht, & +! IDS=ids,IDE=ide, JDS=jds,JDE=jde, KDS=kds,KDE=kde & +! ,IMS=ims,IME=ime, JMS=jms,JME=jme, KMS=kms,KME=kme & +! ,I_START=grid%i_start,I_END=min(grid%i_end, ide-1) & +! ,J_START=grid%j_start,J_END=min(grid%j_end, jde-1) & +! ,KTS=k_start, KTE=min(k_end,kde-1) & +! , num_tiles=grid%num_tiles ) +!BENCH_END(fdda_driver_tim) + +!!****MARS +IF (config_flags%modif_wrf) THEN +!!!!!!!!!!!!!!!!!!!!!!! +! call to LMD physics ! +!!!!!!!!!!!!!!!!!!!!!!! + CALL wrf_debug ( 200 , ' call lmd_driver' ) + CALL lmd_driver( & + ! structure + & id=grid%id,max_dom=grid%max_dom & + & ,DT=grid%dt & + & ,ITIMESTEP=grid%itimestep & + ! position + & ,XLAT=grid%xlat,XLONG=grid%xlong & + & ,DX=grid%dx ,DY=grid%dy & + & ,MSFT=grid%msftx,MSFU=grid%msfux,MSFV=grid%msfvx & +! & ,MSFT=grid%msft,MSFU=grid%msfu,MSFV=grid%msfv & + ! indexes & ,IDS=ids,IDE=ide, JDS=jds,JDE=jde, KDS=kds,KDE=kde & & ,IMS=ims,IME=ime, JMS=jms,JME=jme, KMS=kms,KME=kme & & ,i_start=grid%i_start,i_end=min(grid%i_end, ide-1) & & ,j_start=grid%j_start,j_end=min(grid%j_end, jde-1) & & ,kts=k_start, kte=min(k_end,kde-1) & & ,num_tiles=grid%num_tiles & - ! Optional - & , CLDFRA=grid%cldfra & - & , PB=grid%pb & - & , F_ICE_PHY=grid%f_ice_phy,F_RAIN_PHY=grid%f_rain_phy & - & , QV=moist(ims,kms,jms,P_QV), F_QV=F_QV & - & , QC=moist(ims,kms,jms,P_QC), F_QC=F_QC & - & , QR=moist(ims,kms,jms,P_QR), F_QR=F_QR & - & , QI=moist(ims,kms,jms,P_QI), F_QI=F_QI & - & , QS=moist(ims,kms,jms,P_QS), F_QS=F_QS & - & , QG=moist(ims,kms,jms,P_QG), F_QG=F_QG & - & , QNDROP=scalar(ims,kms,jms,P_QNDROP), F_QNDROP=F_QNDROP & -#ifdef ACFLUX - & ,ACSWUPT=acswupt ,ACSWUPTC=acswuptc & - & ,ACSWDNT=acswdnt ,ACSWDNTC=acswdntc & - & ,ACSWUPB=acswupb ,ACSWUPBC=acswupbc & - & ,ACSWDNB=acswdnb ,ACSWDNBC=acswdnbc & - & ,ACLWUPT=aclwupt ,ACLWUPTC=aclwuptc & - & ,ACLWDNT=aclwdnt ,ACLWDNTC=aclwdntc & - & ,ACLWUPB=aclwupb ,ACLWUPBC=aclwupbc & - & ,ACLWDNB=aclwdnb ,ACLWDNBC=aclwdnbc & - & ,SWUPT=swupt ,SWUPTC=swuptc & - & ,SWDNT=swdnt ,SWDNTC=swdntc & - & ,SWUPB=swupb ,SWUPBC=swupbc & - & ,SWDNB=swdnb ,SWDNBC=swdnbc & - & ,LWUPT=lwupt ,LWUPTC=lwuptc & - & ,LWDNT=lwdnt ,LWDNTC=lwdntc & - & ,LWUPB=lwupb ,LWUPBC=lwupbc & - & ,LWDNB=lwdnb ,LWDNBC=lwdnbc & + ! time variables + & ,GMT=grid%gmt ,JULYR=grid%julyr ,JULDAY=grid%julday & + ! output from phy_prep + & ,P8W=p8w ,DZ8W=dz8w ,T8W=t8w & + ! Prognostic variables at p points +! & ,Z=grid%em_z & + & ,Z=grid%z & + ! z is the geopotential height at p points + ! ... (cf phy_prep in module_big_step_utilities_em) + & ,HT=grid%ht & + & ,U=u_phy ,V=v_phy ,W=w_phy & + & ,TH=th_phy ,T=t_phy & + & ,P=p_phy ,EXNER=pi_phy ,RHO=rho & +!!!!!ADDITION CAS IDEALISES + & ,PTOP=grid%p_top & + ! physics calls + & ,RADT=grid%radt & + & ,CUDT=grid%cudt & + ! surface temperature and surface pressure + & ,TSK=grid%tsk,PSFC=grid%psfc & + ! tendencies for the dynamics + & ,RTHBLTEN=grid%rthblten ,RUBLTEN=grid%rublten,RVBLTEN=grid%rvblten & + ! scalars +! & ,NUM_3D_S=num_3d_s,SCALAR=grid%scalar & + & ,NUM_3D_S=num_scalar,SCALAR=grid%scalar & + & ,NUM_3D_M=num_moist,MOIST=grid%moist & + ! mode + & ,MARS_MODE=config_flags%mars & +#ifdef NEWPHYS + ! planet + & ,planet_type=config_flags%planet & #endif - & ,LWCF=grid%lwcf & - & ,SWCF=grid%swcf & - & ,OLR=grid%olr & - & ,OZMIXM=grid%ozmixm, PIN=grid%pin & - & ,M_PS_1=grid%m_ps_1, M_PS_2=grid%m_ps_2, AEROSOLC_1=grid%aerosolc_1 & - & ,AEROSOLC_2=grid%aerosolc_2, M_HYBI0=grid%m_hybi & - & ,ABSTOT=grid%abstot, ABSNXT=grid%absnxt, EMSTOT=grid%emstot & -#ifdef WRF_CHEM - & ,CU_RAD_FEEDBACK=config_flags%cu_rad_feedback & - & ,AER_RA_FEEDBACK=config_flags%aer_ra_feedback & - & ,QC_ADJUST=grid%GD_CLOUD_B , QI_ADJUST=grid%GD_CLOUD2_B & - & ,PM2_5_DRY=grid%pm2_5_dry, PM2_5_WATER=grid%pm2_5_water & - & ,PM2_5_DRY_EC=grid%pm2_5_dry_ec & - & ,TAUAER300=grid%tauaer1, TAUAER400=grid%tauaer2 & ! jcb - & ,TAUAER600=grid%tauaer3, TAUAER999=grid%tauaer4 & ! jcb - & ,GAER300=grid%gaer1, GAER400=grid%gaer2, GAER600=grid%gaer3, GAER999=grid%gaer4 & ! jcb - & ,WAER300=grid%waer1, WAER400=grid%waer2, WAER600=grid%waer3, WAER999=grid%waer4 & ! jcb + ! added variables + & ,M_ALBEDO=grid%m_albedo,M_TI=grid%m_ti & + & ,M_CO2ICE=grid%m_co2ice,M_EMISS=grid%m_emiss & + & ,M_H2OICE=grid%m_h2oice & + & ,M_TSOIL=grid%m_tsoil & + & ,M_Q2=grid%m_q2 & + & ,M_TSURF=grid%m_tsurf & +#ifdef NEWPHYS + & ,M_FLUXRAD=grid%m_fluxrad & + & ,M_WSTAR=grid%m_wstar & + & ,M_ISOIL=grid%m_isoil & + & ,M_DSOIL=grid%m_dsoil & + & ,M_Z0=grid%m_z0 & + & ,CST_Z0=config_flags%init_Z0 & #endif - & ,slope_rad=config_flags%slope_rad,topo_shading=config_flags%topo_shading & - & ,shadowmask=shadowmask,ht=grid%ht,dx=grid%dx,dy=grid%dy,sina=grid%sina,cosa=grid%cosa ) - -BENCH_END(rad_driver_tim) - -!********* Surface driver -! surface - -BENCH_START(surf_driver_tim) - -!----------------------------------------------------------------- -! urban related variable are added to arguments of surface_driver -!----------------------------------------------------------------- - num_roof_layers = grid%num_soil_layers !urban - num_wall_layers = grid%num_soil_layers !urban - num_road_layers = grid%num_soil_layers !urban - CALL nl_get_iswater(grid%id, iswater) - - CALL wrf_debug ( 200 , ' call surface_driver' ) - - CALL surface_driver( & - & ACSNOM=grid%acsnom ,ACSNOW=grid%acsnow ,AKHS=grid%akhs & - & ,AKMS=grid%akms ,ALBBCK=grid%albbck ,ALBEDO=grid%albedo & - & ,EMBCK=grid%embck & - & ,BR=br ,CANWAT=grid%canwat ,CHKLOWQ=chklowq & - & ,CT=grid%ct ,DT=grid%dt ,DX=grid%dx & - & ,DZ8W=dz8w ,DZS=grid%dzs ,FLHC=grid%flhc & - & ,FLQC=grid%flqc ,GLW=grid%glw ,GRDFLX=grid%grdflx & - & ,GSW=grid%gsw ,SWDOWN=grid%swdown ,GZ1OZ0=gz1oz0 ,HFX=grid%hfx & - & ,HT=grid%ht ,IFSNOW=config_flags%ifsnow ,ISFFLX=config_flags%isfflx & - & ,ISLTYP=grid%isltyp ,ITIMESTEP=grid%itimestep & - & ,IVGTYP=grid%ivgtyp ,LH=grid%lh ,LOWLYR=grid%lowlyr & - & ,MAVAIL=grid%mavail ,NUM_SOIL_LAYERS=config_flags%num_soil_layers & - & ,P8W=p8w ,PBLH=grid%pblh ,PI_PHY=pi_phy & - & ,PSFC=grid%psfc ,PSHLTR=grid%pshltr ,PSIH=psih & - & ,BLDT=grid%bldt ,CURR_SECS=curr_secs, ADAPT_STEP_FLAG=adapt_step_flag & - & ,PSIM=psim ,P_PHY=p_phy ,Q10=grid%q10 & - & ,Q2=grid%q2 ,QFX=grid%qfx ,QSFC=grid%qsfc & - & ,QSHLTR=grid%qshltr ,QZ0=grid%qz0 ,RAINCV=grid%raincv & - & ,RA_LW_PHYSICS=config_flags%ra_lw_physics ,RHO=rho & - & ,RMOL=grid%rmol ,SFCEVP=grid%sfcevp ,SFCEXC=grid%sfcexc & - & ,SFCRUNOFF=grid%sfcrunoff & - & ,SF_SFCLAY_PHYSICS=config_flags%sf_sfclay_physics & - & ,SF_SURFACE_PHYSICS=config_flags%sf_surface_physics ,SH2O=grid%sh2o & - & ,SHDMAX=grid%shdmax ,SHDMIN=grid%shdmin ,SMOIS=grid%smois & - & ,SMSTAV=grid%smstav ,SMSTOT=grid%smstot ,SNOALB=grid%snoalb & - & ,SNOW=grid%snow ,SNOWC=grid%snowc ,SNOWH=grid%snowh & - & ,SST=grid%sst ,SST_UPDATE=grid%sst_update & - & ,STEPBL=grid%stepbl ,TH10=grid%th10 ,TH2=grid%th2 & - & ,THZ0=grid%thz0 ,TH_PHY=th_phy ,TKE_MYJ=grid%tke_myj & - & ,TMN=grid%tmn ,TSHLTR=grid%tshltr ,TSK=grid%tsk & - & ,TSLB=grid%tslb ,T_PHY=t_phy ,U10=grid%u10 & - & ,URATX=grid%uratx ,VRATX=grid%vratx ,TRATX=grid%tratx & - & ,UDRUNOFF=grid%udrunoff ,UST=grid%ust ,UZ0=grid%uz0 & - & ,U_FRAME=grid%u_frame ,U_PHY=u_phy ,V10=grid%v10 & - & ,VEGFRA=grid%vegfra ,VZ0=grid%vz0 ,V_FRAME=grid%v_frame & - & ,V_PHY=v_phy ,WARM_RAIN=grid%warm_rain & - & ,WSPD=wspd ,XICE=grid%xice ,XLAND=grid%xland & - & ,Z0=grid%z0 ,Z=grid%z ,ZNT=grid%znt & - & ,ZS=grid%zs ,XICEM=grid%xicem ,ISICE=grid%landuse_isice& - & ,USTM=grid%ustm ,CK=grid%ck ,CKA=grid%cka & - & ,CD=grid%cd ,CDA=grid%cda & - & ,ISFTCFLX=config_flags%isftcflx & - & ,OMLCALL=config_flags%omlcall ,OML_HML0=config_flags%oml_hml0 ,OML_GAMMA=config_flags%oml_gamma & - & ,TML=grid%tml, T0ML=grid%t0ml, HML=grid%hml, H0ML=grid%h0ml, HUML=grid%huml, HVML=grid%hvml, F=grid%f & - & ,ISWATER=iswater & - & ,DECLIN_URB=grid%declin_urb ,COSZ_URB2D=grid%cosz_urb2d & !I urban - & ,OMG_URB2D=grid%omg_urb2d ,xlat_urb2d=grid%XLAT & !I urban - & ,NUM_ROOF_LAYERS=num_roof_layers & !I urban - & ,NUM_WALL_LAYERS=num_wall_layers & !I urban - & ,NUM_ROAD_LAYERS=num_road_layers & - & ,DZR=grid%dzr ,DZB=grid%dzb ,DZG=grid%dzg & !I urban - & ,TR_URB2D=grid%tr_urb2d ,TB_URB2D=grid%tb_urb2d & - & ,TG_URB2D=grid%tg_urb2d & !H urban - & ,TC_URB2D=grid%tc_urb2d ,QC_URB2D=grid%qc_urb2d & !H urban - & ,UC_URB2D=grid%uc_urb2d & !H urban - & ,XXXR_URB2D=grid%xxxr_urb2d & - & ,XXXB_URB2D=grid%xxxb_urb2d & !H urban - & ,XXXG_URB2D=grid%xxxg_urb2d & - & ,XXXC_URB2D=grid%xxxc_urb2d & !H urban - & ,TRL_URB3D=grid%trl_urb3d ,TBL_URB3D=grid%tbl_urb3d & !H urban - & ,TGL_URB3D=grid%tgl_urb3d & !H urban - & ,SH_URB2D=grid%sh_urb2d ,LH_URB2D=grid%lh_urb2d & - & ,G_URB2D=grid%g_urb2d & !H urban - & ,RN_URB2D=grid%rn_urb2d , TS_URB2D=grid%ts_urb2d & !H urban - & ,FRC_URB2D=grid%frc_urb2d & !H urban - & ,UTYPE_URB2D=grid%utype_urb2d & !H urban - & ,ucmcall=grid%ucmcall & !H urban - ! P-X LSM Variables - & ,LANDUSEF=grid%landusef, SOILCTOP=grid%soilctop & ! P-X LSM - & ,SOILCBOT=grid%soilcbot & ! P-X LSM - & ,RA=grid%ra, RS=grid%rs, LAI=grid%lai & ! P-X LSM - & ,NLCAT=grid%num_land_cat, NSCAT=grid%num_soil_cat & ! P-X LSM - & ,VEGF_PX=grid%vegf_px, SNOWNCV=grid%snowncv & ! P-X LSM - & ,ANAL_INTERVAL=config_flags%interval_seconds & ! P-X LSM - & ,PXLSM_SMOIS_INIT=config_flags%pxlsm_smois_init & ! P-X LSM - & ,PXLSM_SOIL_NUDGE=config_flags%grid_fdda & ! P-X LSM - ! Optional PX LSM nudging - & ,t2_ndg_old=fdda2d(ims,1,jms,P_t2_ndg_old) & - & ,q2_ndg_old=fdda2d(ims,1,jms,P_q2_ndg_old) & - & ,t2_ndg_new=fdda2d(ims,1,jms,P_t2_ndg_new) & - & ,q2_ndg_new=fdda2d(ims,1,jms,P_q2_ndg_new) & - & ,sn_ndg_old=fdda2d(ims,1,jms,P_sn_ndg_old) & - & ,sn_ndg_new=fdda2d(ims,1,jms,P_sn_ndg_new) & - ! Indexes - & ,IDS=ids,IDE=ide, JDS=jds,JDE=jde, KDS=kds,KDE=kde & - & ,IMS=ims,IME=ime, JMS=jms,JME=jme, KMS=kms,KME=kme & - & , I_START=grid%i_start,I_END=min(grid%i_end, ide-1) & - & , J_START=grid%j_start,J_END=min(grid%j_end, jde-1) & - & , KTS=k_start, KTE=min(k_end,kde-1) & - & , NUM_TILES=grid%num_tiles & - ! Optional - & ,QV_CURR=moist(ims,kms,jms,P_QV), F_QV=F_QV & - & ,QC_CURR=moist(ims,kms,jms,P_QC), F_QC=F_QC & - & ,QR_CURR=moist(ims,kms,jms,P_QR), F_QR=F_QR & - & ,QI_CURR=moist(ims,kms,jms,P_QI), F_QI=F_QI & - & ,QS_CURR=moist(ims,kms,jms,P_QS), F_QS=F_QS & - & ,QG_CURR=moist(ims,kms,jms,P_QG), F_QG=F_QG & - & ,CAPG=grid%capg, EMISS=grid%emiss, HOL=hol,MOL=grid%mol & - & ,T2OBS=grid%t2obs, Q2OBS=grid%q2obs & - & ,RAINBL=grid%rainbl,SR=grid%sr & - & ,RAINNCV=grid%rainncv,REGIME=grid%regime,T2=grid%t2,THC=grid%thc & - & ,QSG=grid%qsg,QVG=grid%qvg,QCG=grid%qcg,SOILT1=grid%soilt1,TSNAV=grid%tsnav & ! ruc lsm - & ,SMFR3D=grid%smfr3d,KEEPFR3DFLAG=grid%keepfr3dflag & ! ruc lsm - & ,POTEVP=grid%POTEVP, SNOPCX=grid%SNOPCX, SOILTB=grid%SOILTB & ! ruc lsm - & ) -BENCH_END(surf_driver_tim) - -!********* -! pbl - - CALL wrf_debug ( 200 , ' call pbl_driver' ) -BENCH_START(pbl_driver_tim) - CALL pbl_driver( & - & AKHS=grid%akhs ,AKMS=grid%akms & - & ,BL_PBL_PHYSICS=config_flags%bl_pbl_physics & - & ,BLDT=grid%bldt, CURR_SECS=curr_secs, ADAPT_STEP_FLAG=adapt_step_flag & - & ,BR=br ,CHKLOWQ=chklowq ,CT=grid%ct & - & ,DT=grid%dt ,DX=grid%dx ,DZ8W=dz8w & - & ,EL_MYJ=grid%el_myj ,EXCH_H=grid%exch_h ,GRDFLX=grid%grdflx & - & ,GZ1OZ0=gz1oz0 ,HFX=grid%hfx ,HT=grid%ht & - & ,ITIMESTEP=grid%itimestep ,KPBL=grid%kpbl & - & ,LH=grid%lh ,LOWLYR=grid%lowlyr ,P8W=p8w & - & ,PBLH=grid%pblh ,PI_PHY=pi_phy ,PSIH=psih & - & ,PSIM=psim ,P_PHY=p_phy ,QFX=grid%qfx & - & ,QSFC=grid%qsfc ,QZ0=grid%qz0 & - & ,RA_LW_PHYSICS=config_flags%ra_lw_physics & - & ,RHO=rho ,RQCBLTEN=grid%rqcblten ,RQIBLTEN=grid%rqiblten & - & ,RQVBLTEN=grid%rqvblten ,RTHBLTEN=grid%rthblten ,RUBLTEN=grid%rublten & - & ,RVBLTEN=grid%rvblten ,SNOW=grid%snow ,STEPBL=grid%stepbl & - & ,THZ0=grid%thz0 ,TH_PHY=th_phy ,TKE_MYJ=grid%tke_myj & - & ,TSK=grid%tsk ,T_PHY=t_phy ,UST=grid%ust & - & ,U10=grid%u10 ,UZ0=grid%uz0 ,U_FRAME=grid%u_frame ,U_PHY=u_phy & - & ,V10=grid%v10 ,VZ0=grid%vz0 ,V_FRAME=grid%v_frame ,V_PHY=v_phy & - & ,WARM_RAIN=grid%warm_rain ,WSPD=wspd & - & ,XICE=grid%xice ,XLAND=grid%xland ,Z=grid%z & - & ,ZNT=grid%znt & - & ,IDS=ids,IDE=ide, JDS=jds,JDE=jde, KDS=kds,KDE=kde & - & ,IMS=ims,IME=ime, JMS=jms,JME=jme, KMS=kms,KME=kme & - & ,I_START=grid%i_start,I_END=min(grid%i_end, ide-1) & - & ,J_START=grid%j_start,J_END=min(grid%j_end, jde-1) & - & ,KTS=k_start, KTE=min(k_end,kde-1) & - & ,NUM_TILES=grid%num_tiles & - ! Variables Required by ACM PBL - jp - & ,ZNU=grid%znu,ZNW=grid%znw,MUT=grid%mut,P_TOP=grid%p_top & - ! optional - & ,QV_CURR=moist(ims,kms,jms,P_QV), F_QV=F_QV & - & ,QC_CURR=moist(ims,kms,jms,P_QC), F_QC=F_QC & - & ,QR_CURR=moist(ims,kms,jms,P_QR), F_QR=F_QR & - & ,QI_CURR=moist(ims,kms,jms,P_QI), F_QI=F_QI & - & ,QS_CURR=moist(ims,kms,jms,P_QS), F_QS=F_QS & - & ,QG_CURR=moist(ims,kms,jms,P_QG), F_QG=F_QG & - & ,HOL=HOL, MOL=grid%mol, REGIME=grid%REGIME & - & ) - -BENCH_END(pbl_driver_tim) - -! cumulus para. - - CALL wrf_debug ( 200 , ' call cumulus_driver' ) - - -BENCH_START(cu_driver_tim) - CALL cumulus_driver(grid & - ! Prognostic variables - & ,U=u_phy ,V=v_phy ,TH=th_phy ,T=t_phy & - & ,W=grid%w_2 ,P=p_phy ,PI=pi_phy ,RHO=rho & - ! Other arguments - & ,ITIMESTEP=grid%itimestep ,DT=grid%dt ,DX=grid%dx & - & ,CUDT=grid%cudt,CURR_SECS=curr_secs,ADAPT_STEP_FLAG=adapt_step_flag & - & ,RAINC=grid%rainc ,RAINCV=grid%raincv ,PRATEC=grid%pratec & - & , NCA=grid%nca & - & ,HTOP=grid%cutop ,HBOT=grid%cubot ,KPBL=grid%kpbl & - & ,DZ8W=dz8w ,P8W=p8w & - & ,W0AVG=grid%w0avg ,STEPCU=grid%stepcu & - & ,CLDEFI=grid%cldefi ,LOWLYR=grid%lowlyr ,XLAND=grid%xland & - & ,APR_GR=grid%apr_gr ,APR_W=grid%apr_w ,APR_MC=grid%apr_mc & - & ,APR_ST=grid%apr_st ,APR_AS=grid%apr_as ,APR_CAPMA=grid%apr_capma & - & ,APR_CAPME=grid%apr_capme ,APR_CAPMI=grid%apr_capmi & - & ,MASS_FLUX=grid%mass_flux ,XF_ENS=grid%xf_ens & - & ,PR_ENS=grid%pr_ens ,HT=grid%ht,EDT_OUT=grid%edt_out & - & ,imomentum=grid%imomentum,clos_choice=grid%clos_choice & - & ,cugd_tten=grid%cugd_tten,cugd_qvten=grid%cugd_qvten,cugd_qcten=grid%cugd_qcten & - & ,cugd_ttens=grid%cugd_ttens,cugd_qvtens=grid%cugd_qvtens & - & ,ENSDIM=config_flags%ensdim ,MAXIENS=config_flags%maxiens ,MAXENS=config_flags%maxens & - & ,MAXENS2=config_flags%maxens2 ,MAXENS3=config_flags%maxens3 & - & ,CU_ACT_FLAG=cu_act_flag ,WARM_RAIN=grid%warm_rain & - & ,GSW=grid%gsw,cugd_avedx=config_flags%cugd_avedx & - & ,PERIODIC_X=(config_flags%polar .OR. config_flags%periodic_x) & - & ,PERIODIC_Y=config_flags%periodic_y & - ! Selection flag - & ,CU_PHYSICS=config_flags%cu_physics & - ! Dimension arguments - & ,IDS=ids,IDE=ide, JDS=jds,JDE=jde, KDS=kds,KDE=kde & - & ,IMS=ims,IME=ime, JMS=jms,JME=jme, KMS=kms,KME=kme & - & ,IPS=ips,IPE=ipe, JPS=jps,JPE=jpe, KPS=kps,KPE=kpe & - & ,I_START=grid%i_start,I_END=min(grid%i_end, ide-1) & - & ,J_START=grid%j_start,J_END=min(grid%j_end, jde-1) & - & ,KTS=k_start, KTE=min(k_end,kde-1) & - & ,NUM_TILES=grid%num_tiles & - ! Moisture tendency arguments - & ,RQVCUTEN=grid%rqvcuten , RQCCUTEN=grid%rqccuten & - & ,RQSCUTEN=grid%rqscuten , RQICUTEN=grid%rqicuten & - & ,RQRCUTEN=grid%rqrcuten , RQVBLTEN=grid%rqvblten & - & ,RQVFTEN=grid%rqvften & - ! Other tendency arguments - & ,RTHRATEN=grid%rthraten , RTHBLTEN=grid%rthblten & - & ,RTHCUTEN=grid%rthcuten , RTHFTEN=grid%rthften & - ! Moisture tracer arguments - & ,QV_CURR=moist(ims,kms,jms,P_QV), F_QV=F_QV & - & ,QC_CURR=moist(ims,kms,jms,P_QC), F_QC=F_QC & - & ,QR_CURR=moist(ims,kms,jms,P_QR), F_QR=F_QR & - & ,QI_CURR=moist(ims,kms,jms,P_QI), F_QI=F_QI & - & ,QS_CURR=moist(ims,kms,jms,P_QS), F_QS=F_QS & - & ,QG_CURR=moist(ims,kms,jms,P_QG), F_QG=F_QG & -#ifdef WRF_CHEM - & ,GD_CLOUD=grid%GD_CLOUD,GD_CLOUD2=grid%GD_CLOUD2 & + & ,M_GW=grid%m_gw & + & ,NUM_SOIL_LAYERS=config_flags%num_soil_layers & + ! cst fields + & ,CST_AL=config_flags%init_AL & + & ,CST_TI=config_flags%init_TI & + & ,ISFFLX=config_flags%isfflx & + & ,DIFF_OPT=config_flags%diff_opt & + & ,KM_OPT=config_flags%km_opt & + & ,HISTORY_INTERVAL=model_config_rec%history_interval(1) & + !------------------! + ! OUTPUT VARIABLES ! + !------------------! +#ifdef NEWPHYS + & ,HR_SW=grid%HR_SW & + & ,HR_LW=grid%HR_LW & + & ,HR_DYN=grid%HR_DYN & + & ,DDT=grid%DDT & + & ,DT_RAD=grid%DT_RAD & + & ,DT_VDF=grid%DT_VDF & + & ,DT_AJS=grid%DT_AJS & + & ,CLOUDFRAC=grid%CLOUDFRAC & + & ,TOTCLOUDFRAC=grid%TOTCLOUDFRAC & + & ,GRAIN=grid%GRAIN & + & ,GSNOW=grid%GSNOW & + & ,REEVAP=grid%REEVAP & + & ,SURFRAIN=grid%SURFRAIN & + & ,ALBEQ=grid%ALBEQ & + & ,FLUXTOP_DN=grid%FLUXTOP_DN & + & ,FLUXABS_SW=grid%FLUXABS_SW & + & ,FLUXTOP_LW=grid%FLUXTOP_LW & + & ,FLUXSURF_SW=grid%FLUXSURF_SW & + & ,FLUXSURF_LW=grid%FLUXSURF_LW & + & ,FLXGRD=grid%FLXGRD & + & ,LSCEZ=grid%LSCEZ & + & ,H2OICE_REFF=grid%H2OICE_REFF & + & ,LATENT_HF=grid%LATENT_HF & + & ,SWDOWNZ=grid%SWDOWNZ & + & ,TAU_DUST=grid%TAU_DUST & + & ,RDUST=grid%RDUST & + & ,QSURFDUST=grid%QSURFDUST & + & ,MTOT=grid%MTOT & + & ,ICETOT=grid%ICETOT & + & ,VMR_ICE=grid%VMR_ICE & + & ,TAU_ICE=grid%TAU_ICE & + & ,RICE=grid%RICE & + & ,ZMAX=grid%ZMAX & + & ,HFMAX=grid%HFMAX & + & ,USTM=grid%USTM & + & ,HFX=grid%HFX & +#else +#include "module_lmd_driver_output4.inc" #endif - & ) -BENCH_END(cu_driver_tim) - - CALL wrf_debug ( 200 , ' call fddagd_driver' ) + & ,SLPX=grid%slpx,SLPY=grid%slpy,RESTART=config_flags%restart) +ENDIF -BENCH_START(fdda_driver_tim) - CALL fddagd_driver(itimestep=grid%itimestep,dt=grid%dt,xtime=grid%XTIME, & - id=grid%id, & - RUNDGDTEN=grid%rundgdten,RVNDGDTEN=grid%rvndgdten, & - RTHNDGDTEN=grid%rthndgdten,RQVNDGDTEN=grid%rqvndgdten, & - RMUNDGDTEN=grid%rmundgdten, & - u_ndg_old=fdda3d(ims,kms,jms,P_u_ndg_old), & - v_ndg_old=fdda3d(ims,kms,jms,P_v_ndg_old), & - t_ndg_old=fdda3d(ims,kms,jms,P_t_ndg_old), & - q_ndg_old=fdda3d(ims,kms,jms,P_q_ndg_old), & - mu_ndg_old=fdda2d(ims,1,jms,P_mu_ndg_old), & - u_ndg_new=fdda3d(ims,kms,jms,P_u_ndg_new), & - v_ndg_new=fdda3d(ims,kms,jms,P_v_ndg_new), & - t_ndg_new=fdda3d(ims,kms,jms,P_t_ndg_new), & - q_ndg_new=fdda3d(ims,kms,jms,P_q_ndg_new), & - mu_ndg_new=fdda2d(ims,1,jms,P_mu_ndg_new), & - u3d=grid%u_2,v3d=grid%v_2,th_phy=th_phy,rho=rho,moist=moist, & - p_phy=p_phy,pi_phy=pi_phy,p8w=p8w,t_phy=t_phy, & - dz8w=dz8w,z=grid%z,z_at_w=z_at_w, & - config_flags=config_flags,dx=grid%DX,n_moist=num_moist, & - STEPFG=grid%STEPFG, & - pblh=grid%pblh,ht=grid%ht, & - IDS=ids,IDE=ide, JDS=jds,JDE=jde, KDS=kds,KDE=kde & - ,IMS=ims,IME=ime, JMS=jms,JME=jme, KMS=kms,KME=kme & - ,I_START=grid%i_start,I_END=min(grid%i_end, ide-1) & - ,J_START=grid%j_start,J_END=min(grid%j_end, jde-1) & - ,KTS=k_start, KTE=min(k_end,kde-1) & - , num_tiles=grid%num_tiles ) -BENCH_END(fdda_driver_tim) +!!!!!!!!!!!!!!!!!!!!!!! +! call to LMD physics ! +!!!!!!!!!!!!!!!!!!!!!!! +!****MARS END SUBROUTINE first_rk_step_part1 diff --git a/WRF.COMMON/WRFV3/dyn_em/module_first_rk_step_part2.F b/WRF.COMMON/WRFV3/dyn_em/module_first_rk_step_part2.F index 66b8c832..0084c01b 100644 --- a/WRF.COMMON/WRFV3/dyn_em/module_first_rk_step_part2.F +++ b/WRF.COMMON/WRFV3/dyn_em/module_first_rk_step_part2.F @@ -36,7 +36,8 @@ CONTAINS vertical_diffusion_2, horizontal_diffusion_2, calculate_km_kh, & tke_rhs USE module_em, ONLY : calculate_phy_tend - USE module_fddaobs_driver, ONLY : fddaobs_driver +!!!!****MARS MARS +! USE module_fddaobs_driver, ONLY : fddaobs_driver USE module_bc, ONLY : set_physical_bc3d, set_physical_bc2d USE module_physics_addtendc, ONLY : update_phy_ten @@ -350,7 +351,11 @@ BENCH_END(phy_bc_tim) ! tke x ! !----------------------------------------------------------------------- - IF ( config_flags%bl_pbl_physics .ge. 1 ) THEN + +!!****MARS: always include this HALO for Mars version ... + IF ( ( config_flags%bl_pbl_physics .ge. 1 ) & + .OR. ( config_flags%modif_wrf ) ) THEN +! IF ( config_flags%bl_pbl_physics .ge. 1 ) THEN # include "HALO_EM_PHYS_PBL.inc" ENDIF IF ( config_flags%grid_fdda .eq. 1) THEN @@ -460,8 +465,19 @@ BENCH_END(tke_rhs_tim) IF(config_flags%diff_opt .eq. 2) THEN - IF (config_flags%bl_pbl_physics .eq. 0) THEN - +!!!!****MARS: vertical diffusion is done by the physics +!!!!****MARS: a part si isfflx=1 (SGS completement fait par WRF) +!!!!****MARS: ou si TKE_heat precisee dans la namelist +! IF ( (config_flags%bl_pbl_physics .eq. 0) & +! .AND. (.not. config_flags%modif_wrf ) ) THEN +!! IF (config_flags%bl_pbl_physics .eq. 0) THEN +!! +!! + IF ( ( config_flags%bl_pbl_physics .eq. 0 ) & + .AND. ( ( config_flags%isfflx .ge. 1 ) & + .OR. ( config_flags%tke_heat_flux .ne. 0.) ) ) THEN +!! +!! BENCH_START(vert_diff_tim) !$OMP PARALLEL DO & !$OMP PRIVATE ( ij ) @@ -524,74 +540,77 @@ BENCH_START(hor_diff_tim) BENCH_END(hor_diff_tim) ENDIF - IF ( grid%obs_nudge_opt .EQ. 1 ) THEN -# ifdef DM_PARALLEL -# include "HALO_OBS_NUDGE.inc" -#endif -!*********************************************************************** -! This section for obs nudging - !$OMP PARALLEL DO & - !$OMP PRIVATE ( ij ) - - DO ij = 1 , grid%num_tiles - - CALL fddaobs_driver (grid%grid_id, model_config_rec%grid_id, & - model_config_rec%parent_id, config_flags%restart, & - grid%obs_nudge_opt, & - grid%obs_ipf_errob, & - grid%obs_ipf_nudob, & - grid%fdda_start, & - grid%fdda_end, & - grid%obs_nudge_wind, & - grid%obs_nudge_temp, & - grid%obs_nudge_mois, & - grid%obs_nudge_pstr, & - grid%obs_coef_wind, & - grid%obs_coef_temp, & - grid%obs_coef_mois, & - grid%obs_coef_pstr, & - grid%obs_rinxy, & - grid%obs_rinsig, & - grid%obs_npfi, & - grid%obs_ionf, & - grid%obs_nobs_prt, & - grid%obs_idynin, & - grid%obs_dtramp, & - model_config_rec%cen_lat(1), & - model_config_rec%cen_lon(1), & - config_flags%truelat1, & - config_flags%truelat2, & - config_flags%map_proj, & - model_config_rec%i_parent_start, & - model_config_rec%j_parent_start, & - grid%parent_grid_ratio, & - grid%max_dom, grid%itimestep, & - grid%dt, grid%gmt, grid%julday, grid%fdob, & - grid%max_obs, & - model_config_rec%nobs_ndg_vars, & - model_config_rec%nobs_err_flds, & - grid%fdob%nstat, grid%fdob%varobs, grid%fdob%errf, & - grid%dx, grid%KPBL,grid%HT, & - grid%mut, grid%muu, grid%muv, & - grid%msftx, grid%msfty, grid%msfux, grid%msfuy, grid%msfvx, grid%msfvy, & - p_phy, t_tendf, t0, & - grid%u_2, grid%v_2, grid%t_2, & - moist(ims,kms,jms,P_QV), & - grid%pb, grid%p_top, grid%p, & - grid%uratx, grid%vratx, grid%tratx, & - ru_tendf, rv_tendf, & - moist_tend(ims,kms,jms,P_QV), grid%obs_savwt, & - ids,ide, jds,jde, kds,kde, & - ims,ime, jms,jme, kms,kme, & - grid%i_start(ij), min(grid%i_end(ij),ide-1), & - grid%j_start(ij), min(grid%j_end(ij),jde-1), & - k_start , min(k_end,kde-1) ) - - ENDDO - !$OMP END PARALLEL DO - ENDIF ! obs_nudge_opt .eq. 1 +!!!!****MARS MARS +!!!!****MARS MARS + +! IF ( grid%obs_nudge_opt .EQ. 1 ) THEN +!# ifdef DM_PARALLEL +!# include "HALO_OBS_NUDGE.inc" +!#endif +!!*********************************************************************** +!! This section for obs nudging +! !$OMP PARALLEL DO & +! !$OMP PRIVATE ( ij ) +! +! DO ij = 1 , grid%num_tiles +! +! CALL fddaobs_driver (grid%grid_id, model_config_rec%grid_id, & +! model_config_rec%parent_id, config_flags%restart, & +! grid%obs_nudge_opt, & +! grid%obs_ipf_errob, & +! grid%obs_ipf_nudob, & +! grid%fdda_start, & +! grid%fdda_end, & +! grid%obs_nudge_wind, & +! grid%obs_nudge_temp, & +! grid%obs_nudge_mois, & +! grid%obs_nudge_pstr, & +! grid%obs_coef_wind, & +! grid%obs_coef_temp, & +! grid%obs_coef_mois, & +! grid%obs_coef_pstr, & +! grid%obs_rinxy, & +! grid%obs_rinsig, & +! grid%obs_npfi, & +! grid%obs_ionf, & +! grid%obs_nobs_prt, & +! grid%obs_idynin, & +! grid%obs_dtramp, & +! model_config_rec%cen_lat(1), & +! model_config_rec%cen_lon(1), & +! config_flags%truelat1, & +! config_flags%truelat2, & +! config_flags%map_proj, & +! model_config_rec%i_parent_start, & +! model_config_rec%j_parent_start, & +! grid%parent_grid_ratio, & +! grid%max_dom, grid%itimestep, & +! grid%dt, grid%gmt, grid%julday, grid%fdob, & +! grid%max_obs, & +! model_config_rec%nobs_ndg_vars, & +! model_config_rec%nobs_err_flds, & +! grid%fdob%nstat, grid%fdob%varobs, grid%fdob%errf, & +! grid%dx, grid%KPBL,grid%HT, & +! grid%mut, grid%muu, grid%muv, & +! grid%msftx, grid%msfty, grid%msfux, grid%msfuy, grid%msfvx, grid%msfvy, & +! p_phy, t_tendf, t0, & +! grid%u_2, grid%v_2, grid%t_2, & +! moist(ims,kms,jms,P_QV), & +! grid%pb, grid%p_top, grid%p, & +! grid%uratx, grid%vratx, grid%tratx, & +! ru_tendf, rv_tendf, & +! moist_tend(ims,kms,jms,P_QV), grid%obs_savwt, & +! ids,ide, jds,jde, kds,kde, & +! ims,ime, jms,jme, kms,kme, & +! grid%i_start(ij), min(grid%i_end(ij),ide-1), & +! grid%j_start(ij), min(grid%j_end(ij),jde-1), & +! k_start , min(k_end,kde-1) ) ! -!*********************************************************************** +! ENDDO +! !$OMP END PARALLEL DO +! ENDIF ! obs_nudge_opt .eq. 1 +!! +!!*********************************************************************** END SUBROUTINE first_rk_step_part2 diff --git a/WRF.COMMON/WRFV3/dyn_em/module_init_utilities.F b/WRF.COMMON/WRFV3/dyn_em/module_init_utilities.F index 9c140a92..223252ee 100644 --- a/WRF.COMMON/WRFV3/dyn_em/module_init_utilities.F +++ b/WRF.COMMON/WRFV3/dyn_em/module_init_utilities.F @@ -90,6 +90,183 @@ CONTAINS return END FUNCTION interp_0 + real function interp_0_log( v_in, & + p_in, p_out, nz_in ) + implicit none + integer nz_in, nz_out + real v_in(nz_in), p_in(nz_in) + real p_out + + integer kp, k, im, ip + logical interp, increasing_z + real height, w1, w2 + logical debug + parameter ( debug = .false. ) + +! does vertical coordinate increase or decrease with increasing k? +! set offset appropriately + + height = p_out + + if(debug) write(6,*) ' height in interp_0 ',height + + if (p_in(nz_in) .gt. p_in(1)) then + + if(debug) write(6,*) ' monotonic increase in z in interp_0 ' + IF (height > p_in(nz_in)) then + if(debug) write(6,*) ' point 1 in interp_0 ' + w2 = log(p_in(nz_in)/height)/log(p_in(nz_in)/p_in(nz_in-1)) + w1 = 1.-w2 + interp_0_log = w1*v_in(nz_in) + w2*v_in(nz_in-1) + ELSE IF (height < p_in(1)) then + if(debug) write(6,*) ' point 2 in interp_0 ' + w2 = log(p_in(2)/height)/log(p_in(2)/p_in(1)) + w1 = 1.-w2 + interp_0_log = w1*v_in(2) + w2*v_in(1) + ELSE + if(debug) write(6,*) ' point 3 in interp_0 ' + interp = .false. + kp = nz_in + DO WHILE ( (interp .eqv. .false.) .and. (kp .ge. 2) ) + IF( ((p_in(kp) .ge. height) .and. & + (p_in(kp-1) .le. height)) ) THEN + w2 = log(height/p_in(kp))/log(p_in(kp-1)/p_in(kp)) + w1 = 1.-w2 + interp_0_log = w1*v_in(kp) + w2*v_in(kp-1) + if(debug) write(6,*) ' interp data, kp, w1, w2 ',kp, w1, w2 + if(debug) write(6,*) ' interp data, v_in(kp), v_in(kp-1), interp_0_p ', & + v_in(kp), v_in(kp-1), interp_0_log + interp = .true. + END IF + kp = kp-1 + ENDDO + ENDIF + + else + + if(debug) write(6,*) ' monotonic decrease in z in interp_0 ' + + IF (height < p_in(nz_in)) then + if(debug) write(6,*) ' point 1 in interp_0 ' + w2 = log(p_in(nz_in)/height)/log(p_in(nz_in)/p_in(nz_in-1)) + w1 = 1.-w2 + interp_0_log = w1*v_in(nz_in) + w2*v_in(nz_in-1) + ELSE IF (height > p_in(1)) then + if(debug) write(6,*) ' point 2 in interp_0 ' + w2 = log(p_in(2)/height)/log(p_in(2)/p_in(1)) + w1 = 1.-w2 + interp_0_log = w1*v_in(2) + w2*v_in(1) + ELSE + if(debug) write(6,*) ' point 3 in interp_0 ' + interp = .false. + kp = nz_in + height = p_out + DO WHILE ( (interp .eqv. .false.) .and. (kp .ge. 2) ) + IF( ((p_in(kp) .le. height) .and. & + (p_in(kp-1) .ge. height)) ) THEN + w2 = log(height/p_in(kp))/log(p_in(kp-1)/p_in(kp)) + w1 = 1.-w2 + interp_0_log = w1*v_in(kp) + w2*v_in(kp-1) + interp = .true. + END IF + kp = kp-1 + ENDDO + ENDIF + + end if + + return + END FUNCTION interp_0_log + + real function interp_0_log2( v_in, & + p_in, p_out, nz_in ) + implicit none + integer nz_in, nz_out + real*8 v_in(nz_in) + real*8 p_in(nz_in) + real*8 p_out + + integer kp, k, im, ip + logical interp, increasing_z + real height, w1, w2 + logical debug + parameter ( debug = .false. ) + +! does vertical coordinate increase or decrease with increasing k? +! set offset appropriately + + height = p_out + + if(debug) write(6,*) ' height in interp_0 ',height + + if (p_in(nz_in) .gt. p_in(1)) then + + if(debug) write(6,*) ' monotonic increase in z in interp_0 ' + IF (height > p_in(nz_in)) then + if(debug) write(6,*) ' point 1 in interp_0 ' + w2 = log(p_in(nz_in)/height)/log(p_in(nz_in)/p_in(nz_in-1)) + w1 = 1.-w2 + interp_0_log2 = w1*v_in(nz_in) + w2*v_in(nz_in-1) + ELSE IF (height < p_in(1)) then + if(debug) write(6,*) ' point 2 in interp_0 ' + w2 = log(p_in(2)/height)/log(p_in(2)/p_in(1)) + w1 = 1.-w2 + interp_0_log2 = w1*v_in(2) + w2*v_in(1) + ELSE + if(debug) write(6,*) ' point 3 in interp_0 ' + interp = .false. + kp = nz_in + DO WHILE ( (interp .eqv. .false.) .and. (kp .ge. 2) ) + IF( ((p_in(kp) .ge. height) .and. & + (p_in(kp-1) .le. height)) ) THEN + w2 = log(height/p_in(kp))/log(p_in(kp-1)/p_in(kp)) + w1 = 1.-w2 + interp_0_log2 = w1*v_in(kp) + w2*v_in(kp-1) + if(debug) write(6,*) ' interp data, kp, w1, w2 ',kp, w1, w2 + if(debug) write(6,*) ' interp data, v_in(kp), v_in(kp-1), interp_0_p', & + v_in(kp), v_in(kp-1), interp_0_log2 + interp = .true. + END IF + kp = kp-1 + ENDDO + ENDIF + + else + + if(debug) write(6,*) ' monotonic decrease in z in interp_0 ' + + IF (height < p_in(nz_in)) then + if(debug) write(6,*) ' point 1 in interp_0 ' + w2 = log(p_in(nz_in)/height)/log(p_in(nz_in)/p_in(nz_in-1)) + w1 = 1.-w2 + interp_0_log2 = w1*v_in(nz_in) + w2*v_in(nz_in-1) + ELSE IF (height > p_in(1)) then + if(debug) write(6,*) ' point 2 in interp_0 ' + w2 = log(p_in(2)/height)/log(p_in(2)/p_in(1)) + w1 = 1.-w2 + interp_0_log2 = w1*v_in(2) + w2*v_in(1) + ELSE + if(debug) write(6,*) ' point 3 in interp_0 ' + interp = .false. + kp = nz_in + height = p_out + DO WHILE ( (interp .eqv. .false.) .and. (kp .ge. 2) ) + IF( ((p_in(kp) .le. height) .and. & + (p_in(kp-1) .ge. height)) ) THEN + w2 = log(height/p_in(kp))/log(p_in(kp-1)/p_in(kp)) + w1 = 1.-w2 + interp_0_log2 = w1*v_in(kp) + w2*v_in(kp-1) + interp = .true. + END IF + kp = kp-1 + ENDDO + ENDIF + + end if + + return + END FUNCTION interp_0_log2 + END MODULE module_init_utilities diff --git a/WRF.COMMON/WRFV3/dyn_em/module_initialize_les.F b/WRF.COMMON/WRFV3/dyn_em/module_initialize_les.F index 59298026..abb2bdbf 100644 --- a/WRF.COMMON/WRFV3/dyn_em/module_initialize_les.F +++ b/WRF.COMMON/WRFV3/dyn_em/module_initialize_les.F @@ -86,12 +86,13 @@ CONTAINS INTEGER, PARAMETER :: nl_max = 1000 REAL, DIMENSION(nl_max) :: zk, p_in, theta, rho, u, v, qv, pd_in + REAL*8, DIMENSION(nl_max) :: pd_in8 INTEGER :: nl_in - INTEGER :: icm,jcm, ii, im1, jj, jm1, loop, error, fid, nxc, nyc REAL :: u_mean,v_mean, f0, p_surf, p_level, qvf, z_at_v, z_at_u - REAL :: z_scale, xrad, yrad, zrad, rad, delt, cof1, cof2 + REAL*8 :: p_level8 + REAL :: xrad, yrad, zrad, rad, delt, cof1, cof2 ! REAL, EXTERNAL :: interp_0 REAL :: hm REAL :: pi @@ -111,6 +112,24 @@ CONTAINS ! For LES, add randx real :: randx +!!MARS + REAL :: lon_input, lat_input, alt_input, tsurf_input + ! for mode 3 + REAL, DIMENSION(nl_max) :: profdustq,profdustn + REAL, DIMENSION(nl_max) :: prescribed_sw,prescribed_lw,prescribed_dyn + REAL, DIMENSION(nl_max) :: hrsw,hrlw,hrdyn + REAL, DIMENSION(nl_max) :: lsf_dt,lsf_dq,lsfdt,lsfdq + REAL, DIMENSION(nl_max) :: venus_hrdyn + REAL, DIMENSION(nl_max) :: altitude + REAL*8, DIMENSION(nl_max) :: trac +!!MARS + + REAL :: pfu, pfd, phm + INTEGER :: hypsometric_opt = 1 ! classic + !INTEGER :: hypsometric_opt = 2 ! Wee et al. 2012 correction + + LOGICAL :: logp = .true. ! use logp to interpolate (and not p) + #ifdef DM_PARALLEL # include #endif @@ -156,13 +175,17 @@ CONTAINS END SELECT - -! stretch_grid = .true. -! FOR LES, set stretch to false - stretch_grid = .false. + IF (planet == "mars") THEN + stretch_grid = .false. + !! FOR LES, set stretch to false + ELSE + stretch_grid = .true. !! VENUS + ENDIF delt = 3. ! z_scale = .50 - z_scale = .40 +! z_scale = .10 +! z_scale = .25 +! z_scale = .15 pi = 2.*asin(1.0) write(6,*) ' pi is ',pi nxc = (ide-ids)/2 @@ -210,8 +233,8 @@ CONTAINS grid%cosa(i,j) = 1. grid%e(i,j) = 0. ! for LES, include Coriolis force - grid%f(i,j) = 1.e-4 - + grid%f(i,j) = 0. !!MARS MARS 1.e-4 +!! grid%f(i,j) = 2*EOMEG*SIN(grid%xlat(i,j)*degrad) END DO END DO @@ -233,11 +256,37 @@ CONTAINS (1.-exp(-1./z_scale)) ENDDO ELSE - DO k=1, kde - grid%znw(k) = 1. - float(k-1)/float(kde-1) + !!MARS + !!MARS + IF (planet .ne. "mars") THEN + open(unit=12,file='levels',form='formatted',status='old') + rewind(12) + DO k=1, kde + read(12,*) grid%znw(k) + write(6,*) 'read level ', k,grid%znw(k) + ENDDO + close(12) + ENDIF + !!MARS + !!MARS + ! !DO k=1, kde + ! ! grid%znw(k) = 1. - float(k-1)/float(kde-1) + ! !ENDDO + ENDIF + + !! SPECIFIC FOR LES PBL MARS + IF (planet == "mars") THEN + !!!MARS + grid%znw(1)=1.000 + grid%znw(2)=0.9995 !5m + grid%znw(3)=0.9980 !20m + grid%znw(4)=0.9950 !55m + DO k=5, kde + grid%znw(k) = grid%znw(4) * ( 1. - float(k-4)/float(kde-4) ) ENDDO ENDIF + DO k=1, kde-1 grid%dnw(k) = grid%znw(k+1) - grid%znw(k) grid%rdnw(k) = 1./grid%dnw(k) @@ -282,14 +331,63 @@ CONTAINS write(6,*) ' returned from reading sounding, nl_in is ',nl_in +!!MARS +!!MARS + open(unit=14,file='input_coord',form='formatted',status='old') + rewind(14) + read(14,*) lon_input + read(14,*) lat_input + close(14) + write(6,*) ' lon is ',lon_input + write(6,*) ' lat is ',lat_input +!!MARS +!!MARS + +!!MARS +!!MARS + open(unit=18,file='input_more',form='formatted',status='old') + rewind(18) + read(18,*) alt_input, tsurf_input + close(18) + write(6,*) ' alt is ',alt_input + write(6,*) ' tsurf is ',tsurf_input +!!MARS +!!MARS + ! find ptop for the desired ztop (ztop is input from the namelist), ! and find surface pressure - grid%p_top = interp_0( p_in, zk, config_flags%ztop, nl_in ) + write(6,*) ' ztop above ground is ',config_flags%ztop + write(6,*) ' real ztop is ',config_flags%ztop + alt_input + grid%p_top = interp_0( p_in, zk, config_flags%ztop + alt_input, nl_in ) DO j=jts,jte DO i=its,ite - grid%ht(i,j) = 0. +!!MARS + grid%ht(i,j) = alt_input + grid%m_tsurf(i,j) = tsurf_input +!!MARS + grid%xlat(i,j) = lat_input !+ float(j)*config_flags%dy/59000. + grid%xlong(i,j) = lon_input !+ float(i)*config_flags%dx/59000. + grid%m_emiss(i,j)=0.95 + grid%m_co2ice(i,j)=0. + grid%m_h2oice(i,j)=0. +!! >> Used for restarts only: + grid%m_q2(i,:,j)=0. + grid%m_fluxrad(i,j)=0. + grid%m_wstar(i,j)=0. +!! << + grid%slpx(i,j) = 0. + grid%slpy(i,j) = 0. + DO k=1,config_flags%num_soil_layers + grid%m_tsoil(i,k,j) = 0. + ENDDO + grid%m_gw(i,1,j) = 0. + grid%m_gw(i,2,j) = 0. + grid%m_gw(i,3,j) = 0. + grid%m_gw(i,4,j) = 0. + grid%m_gw(i,5,j) = 0. +!!MARS ENDDO ENDDO @@ -302,7 +400,7 @@ CONTAINS #ifdef MTN DO j=max(ys,jds),min(ye,jde-1) DO i=max(xs,ids),min(xe,ide-1) - grid%ht(i,j) = mtn_ht * 0.25 * & + grid%ht(i,j) = alt_input + mtn_ht * 0.25 * & ( 1. + COS ( 2*pi/(xe-xs) * ( i-xs ) + pi ) ) * & ( 1. + COS ( 2*pi/(ye-ys) * ( j-ys ) + pi ) ) ENDDO @@ -331,6 +429,12 @@ CONTAINS ENDDO ENDDO + IF (.not.logp) THEN + write(6,*) 'interpolate in p' + ELSE + write(6,*) 'interpolate in logp' + ENDIF + DO J = jts, jte DO I = its, ite @@ -343,7 +447,11 @@ CONTAINS DO K = 1, kte-1 p_level = grid%znu(k)*(p_surf - grid%p_top) + grid%p_top grid%pb(i,k,j) = p_level + IF (.not.logp) THEN grid%t_init(i,k,j) = interp_0( theta, p_in, p_level, nl_in ) - t0 + ELSE + grid%t_init(i,k,j) = interp_0_log( theta, p_in, p_level, nl_in ) - t0 + ENDIF grid%alb(i,k,j) = (r_d/p1000mb)*(grid%t_init(i,k,j)+t0)*(grid%pb(i,k,j)/p1000mb)**cvpm ENDDO @@ -351,13 +459,22 @@ CONTAINS ! sounding, but this assures that the base state is in exact hydrostatic balance with ! respect to the model eqns. + IF (hypsometric_opt == 1) THEN DO k = 2,kte grid%phb(i,k,j) = grid%phb(i,k-1,j) - grid%dnw(k-1)*grid%mub(i,j)*grid%alb(i,k-1,j) ENDDO + ELSE IF (hypsometric_opt == 2) THEN + DO k = 2,kte + pfu = grid%mub(i,j)*grid%znw(k) + grid%p_top + pfd = grid%mub(i,j)*grid%znw(k-1) + grid%p_top + phm = grid%mub(i,j)*grid%znu(k-1) + grid%p_top + grid%phb(i,k,j) = grid%phb(i,k-1,j) + grid%alb(i,k-1,j)*phm*LOG(pfd/pfu) + END DO + END IF + ENDDO ENDDO - IF ( wrf_dm_on_monitor() ) THEN write(6,*) ' ptop is ',grid%p_top write(6,*) ' base state grid%mub(1,1), p_surf is ',grid%mub(1,1),grid%mub(1,1)+grid%p_top @@ -389,9 +506,13 @@ CONTAINS do k=1,kde-1 p_level = grid%znu(k)*(pd_surf - grid%p_top) + grid%p_top - + IF (.not.logp) THEN moist(i,k,j,P_QV) = interp_0( qv, pd_in, p_level, nl_in ) grid%t_1(i,k,j) = interp_0( theta, pd_in, p_level, nl_in ) - t0 + ELSE + moist(i,k,j,P_QV) = interp_0_log( qv, pd_in, p_level, nl_in ) + grid%t_1(i,k,j) = interp_0_log( theta, pd_in, p_level, nl_in ) - t0 + ENDIF grid%t_2(i,k,j) = grid%t_1(i,k,j) @@ -433,6 +554,7 @@ CONTAINS grid%ph_1(i,1,j) = 0. + IF (hypsometric_opt == 1) THEN DO k = 2,kte grid%ph_1(i,k,j) = grid%ph_1(i,k-1,j) - (1./grid%rdnw(k-1))*( & (grid%mub(i,j)+grid%mu_1(i,j))*grid%al(i,k-1,j)+ & @@ -441,6 +563,28 @@ CONTAINS grid%ph_2(i,k,j) = grid%ph_1(i,k,j) grid%ph0(i,k,j) = grid%ph_1(i,k,j) + grid%phb(i,k,j) ENDDO + ELSE IF (hypsometric_opt == 2) THEN + + ! Alternative hydrostatic eq.: dZ = -al*p*dLOG(p), where p is dry pressure. + ! Note that al*p approximates Rd*T and dLOG(p) does z. + ! Here T varies mostly linear with z, the first-order integration produces better result. + + grid%ph_2(i,1,j) = grid%phb(i,1,j) + DO k = 2,kte + pfu = grid%mu0(i,j)*grid%znw(k) + grid%p_top + pfd = grid%mu0(i,j)*grid%znw(k-1) + grid%p_top + phm = grid%mu0(i,j)*grid%znu(k-1) + grid%p_top + grid%ph_2(i,k,j) = grid%ph_2(i,k-1,j) + grid%alt(i,k-1,j)*phm*LOG(pfd/pfu) + END DO + + DO k = 1,kte + grid%ph_2(i,k,j) = grid%ph_2(i,k,j) - grid%phb(i,k,j) + grid%ph_1(i,k,j) = grid%ph_2(i,k,j) + END DO + + END IF + + IF ( wrf_dm_on_monitor() ) THEN if((i==2) .and. (j==2)) then @@ -498,6 +642,8 @@ CONTAINS ! rebalance hydrostatically + IF (hypsometric_opt == 1) THEN + DO k = 2,kte grid%ph_1(i,k,j) = grid%ph_1(i,k-1,j) - (1./grid%rdnw(k-1))*( & (grid%mub(i,j)+grid%mu_1(i,j))*grid%al(i,k-1,j)+ & @@ -507,6 +653,28 @@ CONTAINS grid%ph0(i,k,j) = grid%ph_1(i,k,j) + grid%phb(i,k,j) ENDDO + ELSE IF (hypsometric_opt == 2) THEN + + ! Alternative hydrostatic eq.: dZ = -al*p*dLOG(p), where p is dry pressure. + ! Note that al*p approximates Rd*T and dLOG(p) does z. + ! Here T varies mostly linear with z, the first-order integration produces better result. + + grid%ph_2(i,1,j) = grid%phb(i,1,j) + DO k = 2,kte + pfu = grid%mu0(i,j)*grid%znw(k) + grid%p_top + pfd = grid%mu0(i,j)*grid%znw(k-1) + grid%p_top + phm = grid%mu0(i,j)*grid%znu(k-1) + grid%p_top + grid%ph_2(i,k,j) = grid%ph_2(i,k-1,j) + grid%alt(i,k-1,j)*phm*LOG(pfd/pfu) + END DO + + DO k = 1,kte + grid%ph_2(i,k,j) = grid%ph_2(i,k,j) - grid%phb(i,k,j) + grid%ph_1(i,k,j) = grid%ph_2(i,k,j) + END DO + + END IF + + ENDDO ENDDO @@ -514,9 +682,9 @@ CONTAINS IF ( wrf_dm_on_monitor() ) THEN write(6,*) ' grid%mu_1 from comp ', grid%mu_1(1,1) - write(6,*) ' full state sounding from comp, ph, grid%p, grid%al, grid%t_1, qv ' + write(6,*) ' full state sounding from comp, ph/g, grid%p, grid%al, grid%t_1, qv ' do k=1,kde-1 - write(6,'(i3,1x,5(1x,1pe10.3))') k, grid%ph_1(1,k,1)+grid%phb(1,k,1), & + write(6,'(i3,1x,5(1x,1pe10.3))') k, (grid%ph_1(1,k,1)+grid%phb(1,k,1))/g, & grid%p(1,k,1)+grid%pb(1,k,1), grid%alt(1,k,1), & grid%t_1(1,k,1)+t0, moist(1,k,1,P_QV) enddo @@ -541,11 +709,16 @@ CONTAINS ELSE z_at_v = 0.5*(grid%phb(i,1,j)+grid%phb(i,1,j-1))/g END IF + p_surf = interp_0( p_in, zk, z_at_v, nl_in ) DO K = 1, kte-1 p_level = grid%znu(k)*(p_surf - grid%p_top) + grid%p_top + IF (.not.logp) THEN grid%v_1(i,k,j) = interp_0( v, p_in, p_level, nl_in ) + ELSE + grid%v_1(i,k,j) = interp_0_log( v, p_in, p_level, nl_in ) + ENDIF grid%v_2(i,k,j) = grid%v_1(i,k,j) ENDDO @@ -569,7 +742,11 @@ CONTAINS DO K = 1, kte-1 p_level = grid%znu(k)*(p_surf - grid%p_top) + grid%p_top + IF (.not.logp) THEN grid%u_1(i,k,j) = interp_0( u, p_in, p_level, nl_in ) + ELSE + grid%u_1(i,k,j) = interp_0_log( u, p_in, p_level, nl_in ) + ENDIF grid%u_2(i,k,j) = grid%u_1(i,k,j) ENDDO @@ -587,12 +764,58 @@ CONTAINS ENDDO ENDDO +!!!MARS MARS +IF (config_flags%init_MU .ne. 0.) THEN + grid%u_1 = grid%u_1*config_flags%init_MU + grid%u_2 = grid%u_2*config_flags%init_MU + print *, 'multiply zonal wind ', config_flags%init_MU +ENDIF +IF (config_flags%init_MV .ne. 0.) THEN + grid%v_1 = grid%v_1*config_flags%init_MV + grid%v_2 = grid%v_2*config_flags%init_MV + print *, 'multiply meridional wind ', config_flags%init_MV +ENDIF +IF (config_flags%init_U .ne. 0.) THEN + DO J = jts, min(jde-1,jte) + DO K = kts, kte-1 + DO I = its, min(ide-1,ite) + grid%u_1(i,k,j) = config_flags%init_U + grid%u_2(i,k,j) = config_flags%init_U + ENDDO + ENDDO + ENDDO + print *, 'constant zonal wind ', config_flags%init_U + !!! ****** ou autre possibilité + !!! > grid%u_1 = grid%u_1*0. + config_flags%init_U + !!! > grid%u_2 = grid%u_2*0. + config_flags%init_U +ENDIF +IF (config_flags%init_V .ne. 0.) THEN + DO J = jts, min(jde-1,jte) + DO K = kts, kte-1 + DO I = its, min(ide-1,ite) + grid%v_1(i,k,j) = config_flags%init_V + grid%v_2(i,k,j) = config_flags%init_V + ENDDO + ENDDO + ENDDO + print *, 'constant meridional wind ', config_flags%init_V +ENDIF + +!!!MARS MARS + + ! set a few more things DO J = jts, min(jde-1,jte) DO K = kts, kte-1 DO I = its, min(ide-1,ite) grid%h_diabatic(i,k,j) = 0. + !!!!! MARS NO WIND CASE + !grid%u_1(i,k,j) = 0. + !grid%u_2(i,k,j) = 0. + !grid%v_1(i,k,j) = 0. + !grid%v_2(i,k,j) = 0. + !!!!! MARS NO WIND CASE ENDDO ENDDO ENDDO @@ -604,6 +827,16 @@ CONTAINS grid%u_base(k) = grid%u_1(1,k,1) grid%v_base(k) = grid%v_1(1,k,1) grid%z_base(k) = 0.5*(grid%phb(1,k,1)+grid%phb(1,k+1,1)+grid%ph_1(1,k,1)+grid%ph_1(1,k+1,1))/g + +!!!!! MARS SIMPLE LES (PURE BUOYANCY) +!! grid%t_base(k) = grid%t_init(its,k,jts) +! grid%t_base(k) = 0. +! grid%qv_base(k) = 0. +! grid%u_base(k) = 0. +! grid%v_base(k) = 0. +! grid%z_base(k) = 0. +!!!!! MARS SIMPLE LES + ENDDO ENDIF CALL wrf_dm_bcast_real( grid%t_base , kte ) @@ -624,14 +857,147 @@ CONTAINS ptmp = grid%p(i,3,j)+grid%pb(i,3,j) temp(3) = thtmp * (ptmp/p1000mb)**rcp -! For LES-CBL, add 5 degrees to the surface temperature! -! -! grid%tsk(I,J)=grid%cf1*temp(1)+grid%cf2*temp(2)+grid%cf3*temp(3) - grid%tsk(I,J)=grid%cf1*temp(1)+grid%cf2*temp(2)+grid%cf3*temp(3)+5. +!! For LES-CBL, add 5 degrees to the surface temperature! +!! +! grid%tsk(I,J)=grid%cf1*temp(1)+grid%cf2*temp(2)+grid%cf3*temp(3) +!! grid%tsk(I,J)=grid%cf1*temp(1)+grid%cf2*temp(2)+grid%cf3*temp(3)+5. grid%tmn(I,J)=grid%tsk(I,J)-0.5 + ENDDO ENDDO +!!!!! MARS + + ! interpolate water vapor + if ( ( config_flags%mars == 1 ) & + .OR. ( config_flags%mars == 11 ) & + .OR. ( config_flags%mars == 12 ) ) then + print *, '**** INTERPOLATE HV **** RANK 2 in SCALAR' + DO k=1,kte-1 + p_level = grid%znu(k)*(pd_surf - grid%p_top) + grid%p_top + IF (.not.logp) THEN + scalar(its:ite,k,jts:jte,2) = interp_0( qv, pd_in, p_level, nl_in ) + ELSE + scalar(its:ite,k,jts:jte,2) = interp_0_log( qv, pd_in, p_level, nl_in ) + ENDIF + scalar(its:ite,k,jts:jte,3) = 0. + !! water ice is set to 0 (was put into water vapor when building prof from MCD) + ENDDO + print *, "WATER VAPOR",scalar(its,:,jts,2) + endif + + ! interpolate qdust + if ( ( config_flags%mars == 11 ) & + .OR. ( config_flags%mars == 12 ) ) then + call read_dust(profdustq,profdustn,nl_in) + print *, '**** INTERPOLATE DUSTQ **** RANK 4 in SCALAR' + print *, '**** INTERPOLATE DUSTN **** RANK 5 in SCALAR' + DO k=1,kte-1 + p_level = grid%znu(k)*(pd_surf - grid%p_top) + grid%p_top + IF (.not.logp) THEN + scalar(its:ite,k,jts:jte,4) = interp_0( profdustq, pd_in, p_level,nl_in ) + scalar(its:ite,k,jts:jte,5) = interp_0( profdustn, pd_in, p_level,nl_in ) + ELSE + scalar(its:ite,k,jts:jte,4) = interp_0_log( profdustq, pd_in, p_level, nl_in ) + scalar(its:ite,k,jts:jte,5) = interp_0_log( profdustn, pd_in, p_level, nl_in ) + ENDIF + ENDDO + print *, "DUST Q", scalar(its,:,jts,4) + print *, "DUST N", scalar(its,:,jts,5) + endif + + if ( config_flags%mars == 12 ) then + scalar(its:ite,1:kte-1,jts:jte,6) = 0. + scalar(its:ite,1:kte-1,jts:jte,7) = 0. + endif + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + IF (planet .ne. "mars") THEN + call read_dust(profdustq,profdustn,nl_in) + DO k=1,kte!-1 + p_level = grid%znu(k)*(pd_surf - grid%p_top) + grid%p_top + DO j = jts, jte + DO i = its, ite + !!! we use Q2 as a vehicle for heating rates! sick! + grid%m_q2(i,k,j) = interp_0_log( profdustq, pd_in, p_level, nl_in ) & + + interp_0_log( profdustn, pd_in, p_level, nl_in ) + ENDDO + ENDDO + !print*,'grid%m_q2' + !print*,k,grid%m_q2(1,k,1) + ENDDO + ENDIF + + IF (planet.eq."prescribed") Then + call read_hr(hrsw,hrlw,hrdyn,nl_in) + open(unit=17,file="prescribed_sw.txt",action="write") + open(unit=18,file="prescribed_lw.txt",action="write") + open(unit=19,file="prescribed_dyn.txt",action="write") + DO k=1,kte!-1 + p_level = grid%znu(k)*(pd_surf - grid%p_top) + grid%p_top + prescribed_sw(k) = interp_0_log( hrsw, pd_in, p_level, nl_in ) + prescribed_lw(k) = interp_0_log( hrlw, pd_in, p_level, nl_in ) + prescribed_dyn(k) = interp_0_log( hrdyn, pd_in, p_level, nl_in ) + write (17,*) prescribed_sw(k) + write (18,*) prescribed_lw(k) + write (19,*) prescribed_dyn(k) + ENDDO + close(unit=19) + close(unit=18) + close(unit=17) + ENDIF + + IF (planet.eq."venus") Then + call read_hr(hrsw,hrlw,hrdyn,nl_in) + open(unit=20,file="venus_hrdyn.txt",action="write") + DO k=1,kte!-1 + p_level = grid%znu(k)*(pd_surf - grid%p_top) + grid%p_top + venus_hrdyn(k) = interp_0_log( hrdyn, pd_in, p_level, nl_in ) + write (20,*) venus_hrdyn(k) + ENDDO + close(unit=20) + ENDIF + + IF (planet.eq."generic") THEN + call read_lsf(lsfdt,lsfdq,nl_in) + open(unit=17,file="lsf.txt",action="write") + DO k=1,kte!-1 + p_level = grid%znu(k)*(pd_surf - grid%p_top) + grid%p_top + lsf_dt = interp_0_log( lsfdt, pd_in, p_level, nl_in ) + lsf_dq = interp_0_log( lsfdq, pd_in, p_level, nl_in ) + write (17,*) lsf_dt(k),lsf_dq(k) + ENDDO + ENDIF + + IF ((planet.eq."venus") .AND. ( config_flags%mars == 34 )) Then + pd_in8(:)=pd_in(:) + do i = 1,34 + call read_tracer(trac,num_scalar,i,nl_in) + DO k=1,kte-1 + p_level = grid%znu(k)*(pd_surf - grid%p_top) + grid%p_top + p_level8=p_level + scalar(its:ite,k,jts:jte,i+1) = interp_0_log2( trac, pd_in8, p_level8, nl_in ) + ENDDO + ENDDO + !close(unit=22) + ENDIF + + open(unit=21,file="altitude.txt",action="write") + DO k=1,kte!-1 + p_level = grid%znu(k)*(pd_surf - grid%p_top) + grid%p_top + altitude(k) = interp_0_log( zk, pd_in, p_level, nl_in ) + write (21,*) altitude(k) + ENDDO + close(unit=21) + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + +!!!!! MARS + + END SUBROUTINE init_domain_rk SUBROUTINE init_module_initialize @@ -681,6 +1047,10 @@ CONTAINS real pi_surf, pi(n) real h_input(n), th_input(n), qv_input(n), u_input(n), v_input(n) +! input therm data (element 0 is the ground so it's n+1 but n is 1000 anyway so...) + + real r_therm(n),cp_therm(n),p_therm(n),rho_therm(n),t_therm(n) + ! diagnostics real rho_surf, p_input(n), rho_input(n) @@ -688,41 +1058,72 @@ CONTAINS ! local data - real p1000mb,cv,cp,r,cvpm,g - parameter (p1000mb = 1.e+05, r = 287, cp = 1003., cv = cp-r, cvpm = -cv/cp, g=9.81 ) +! real p1000mb,cv,cp,r,cvpm,g +! parameter (p1000mb = 1.e+05, r = 287, cp = 1003., cv = cp-r, cvpm = -cv/cp, g=9.81 ) +! parameter (p1000mb = 610., r = 192., cp = 844.6, cv = cp-r, cvpm = -cv/cp, g=3.72) +! parameter (p1000mb = 610., r = 191., cp = 744.5, cv = cp-r, cvpm = -cv/cp, g=3.72) + !parameter (p1000mb = 92.e+05, r = 192., cp = 900.0, cv = cp-r, cvpm = -cv/cp, g=8.87) integer k, it, nl real qvf, qvf1, dz + LOGICAL :: direct_from_file + + IF (planet == "mars") THEN + direct_from_file = .false. + ELSE + direct_from_file = .true. + ENDIF + ! first, read the sounding call read_sounding( p_surf, th_surf, qv_surf, & - h_input, th_input, qv_input, u_input, v_input,n, nl, debug ) + h_input, th_input, qv_input, & + u_input, v_input,n, nl, debug ) + +! and the therm : - if(dry) then - do k=1,nl - qv_input(k) = 0. - enddo - endif + call read_therm(r_therm,cp_therm,p_therm,rho_therm,t_therm,n) if(debug) write(6,*) ' number of input levels = ',nl + nl_in = nl + if(nl_in .gt. nl_max ) then + write(6,*) ' too many levels for input arrays ',nl_in,nl_max + call wrf_error_fatal ( ' too many levels for input arrays ' ) + end if - nl_in = nl - if(nl_in .gt. nl_max ) then - write(6,*) ' too many levels for input arrays ',nl_in,nl_max - call wrf_error_fatal ( ' too many levels for input arrays ' ) - end if + IF (.NOT. direct_from_file) THEN + +! To use r/cp as defined above, one has to recompute teta from T (default MCD computes +! teta for a variable r/cp) + + do k=1,nl + th_input(k) = t_therm(k)*(p1000mb/p_therm(k))**(rcp) + enddo + th_surf = t_therm(1)*(p1000mb/p_therm(1))**(rcp) +! ----- + + !if(dry) then + ! do k=1,nl + ! qv_input(k) = 0. + ! enddo + !endif ! compute diagnostics, ! first, convert qv(g/kg) to qv(g/g) do k=1,nl + !!!!!!!!!!!!!! MARS + !! from mol/mol to kg/kg + qv_input(k) = qv_input(k)*18./mwdry qv_input(k) = 0.001*qv_input(k) enddo p_surf = 100.*p_surf ! convert to pascals qvf = 1. + rvovrd*qv_input(1) - rho_surf = 1./((r/p1000mb)*th_surf*qvf*((p_surf/p1000mb)**cvpm)) - pi_surf = (p_surf/p1000mb)**(r/cp) +!!MARS + qvf = 1. + rho_surf = 1./((r_d/p1000mb)*th_surf*qvf*((p_surf/p1000mb)**cvpm)) + pi_surf = (p_surf/p1000mb)**(rcp) if(debug) then write(6,*) ' surface density is ',rho_surf @@ -736,12 +1137,17 @@ CONTAINS qvf = 1. + rvovrd*qv_input(1) qvf1 = 1. + qv_input(1) +!!MARS + qvf = 1. + qvf1 = 1. rho_input(1) = rho_surf dz = h_input(1) do it=1,10 - pm_input(1) = p_surf & - - 0.5*dz*(rho_surf+rho_input(1))*g*qvf1 - rho_input(1) = 1./((r/p1000mb)*th_input(1)*qvf*((pm_input(1)/p1000mb)**cvpm)) +! pm_input(1) = p_surf & +! - 0.5*dz*(rho_surf+rho_input(1))*g*qvf1 +!!!MARS MARS MARS + pm_input(1) = p_surf + rho_input(1) = 1./((r_d/p1000mb)*th_input(1)*qvf*((pm_input(1)/p1000mb)**cvpm)) enddo ! integrate up the column @@ -751,11 +1157,15 @@ CONTAINS dz = h_input(k)-h_input(k-1) qvf1 = 0.5*(2.+(qv_input(k-1)+qv_input(k))) qvf = 1. + rvovrd*qv_input(k) ! qv is in g/kg here - +!!MARS + qvf = 1. + qvf1 = 1. +!!MARS + do it=1,10 pm_input(k) = pm_input(k-1) & - 0.5*dz*(rho_input(k)+rho_input(k-1))*g*qvf1 - rho_input(k) = 1./((r/p1000mb)*th_input(k)*qvf*((pm_input(k)/p1000mb)**cvpm)) + rho_input(k) = 1./((r_d/p1000mb)*th_input(k)*qvf*((pm_input(k)/p1000mb)**cvpm)) enddo enddo @@ -771,6 +1181,18 @@ CONTAINS p_input(k) = p_input(k+1) + 0.5*dz*(rho_input(k)+rho_input(k+1))*g enddo + ELSE !IF (.NOT. direct_from_file) THEN + + do k=1,nl + !!!! direct input from file + write(6,*) '*** DIRECT INPUT FROM FILE ***' + pm_input(k) = p_therm(k) + p_input(k) = p_therm(k) + rho_input(k) = rho_therm(k) + enddo + + ENDIF + do k=1,nl @@ -836,4 +1258,140 @@ CONTAINS end subroutine read_sounding + subroutine read_therm(r,cp,p,rho,t,n) + implicit none + integer n + real r(n),cp(n),p(n),rho(n),t(n) + logical end_of_file + + integer k + +! first element is the surface + + open(unit=11,file='input_therm',form='formatted',status='old') + rewind(11) + end_of_file = .false. + k = 0 + do while (.not. end_of_file) + + read(11,*,end=101) r(k+1), cp(k+1), p(k+1), rho(k+1), t(k+1) + write(*,*) k, r(k+1), cp(k+1), p(k+1), rho(k+1), t(k+1) + k = k+1 + go to 112 + 101 end_of_file = .true. + 112 continue + enddo + + close(unit=11,status = 'keep') + + end subroutine read_therm + +!!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc + subroutine read_dust(pdustq,pdustn,n) + implicit none + integer n + real pdustq(n+1),pdustn(n+1) + logical end_of_file + + integer k + +! first element is the surface + + open(unit=11,file='input_dust',form='formatted',status='old') + rewind(11) + end_of_file = .false. + k = 0 + do while (.not. end_of_file) + + read(11,*,end=102) pdustq(k+1),pdustn(k+1) + write(*,*) k,pdustq(k+1),pdustn(k+1) + k = k+1 + go to 113 + 102 end_of_file = .true. + 113 continue + enddo + + close(unit=11,status = 'keep') + + end subroutine read_dust +!!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc + subroutine read_hr(hr_sw,hr_lw,hr_dyn,n) + implicit none + integer n + real hr_sw(n+1),hr_lw(n+1),hr_dyn(n+1) + logical end_of_file + + integer k + +! first element is the surface + + open(unit=11,file='input_hr',form='formatted',status='old') + rewind(11) + end_of_file = .false. + k = 0 + do while (.not. end_of_file) + + read(11,*,end=103) hr_sw(k+1),hr_lw(k+1),hr_dyn(k+1) + write(*,*) k,hr_sw(k+1),hr_lw(k+1),hr_dyn(k+1) + k = k+1 + go to 114 + 103 end_of_file = .true. + 114 continue + enddo + + close(unit=11,status = 'keep') + + end subroutine read_hr + + subroutine read_lsf(dt,dq,n) + implicit none + integer n + real dt(n+1),dq(n+1) + logical end_of_file + + integer k + +! first element is the surface + + open(unit=12,file='input_lsf',form='formatted',status='old') + rewind(12) + end_of_file = .false. + k = 0 + do while (.not. end_of_file) + + read(12,*,end=103) dt(k+1),dq(k+1) + write(*,*) k,dt(k+1),dq(k+1) + k = k+1 + go to 114 + 103 end_of_file = .true. + 114 continue + enddo + + close(unit=12,status = 'keep') + + end subroutine read_lsf + + subroutine read_tracer(trace,nq,qn,n) + implicit none + integer n,qn,nq ! qn : number of the tracer + real*8 tra(nq-1,n+1) + real*8 trace(n+1) !output + logical end_of_file + + integer k,j + +! first element is the surface + open(unit=14,file='input_tracer',form='formatted',status='old') + rewind(14) + end_of_file = .false. + DO k=1,n + read(14,*) tra(:,k) + write(*,*) k,tra(qn,k) + ENDDO + + close(14) + trace(:)=tra(qn,:) + end subroutine read_tracer + + END MODULE module_initialize_ideal diff --git a/WRF.COMMON/WRFV3/dyn_em/solve_em.F b/WRF.COMMON/WRFV3/dyn_em/solve_em.F index 1c04c6e7..36647050 100644 --- a/WRF.COMMON/WRFV3/dyn_em/solve_em.F +++ b/WRF.COMMON/WRFV3/dyn_em/solve_em.F @@ -31,10 +31,12 @@ SUBROUTINE solve_em ( grid , config_flags & USE module_physics_addtendc USE module_diffusion_em USE module_polarfft - USE module_microphysics_driver - USE module_microphysics_zero_out - USE module_fddaobs_driver - USE module_diagnostics +!!!!****MARS MARS +!!!!****MARS MARS +! USE module_microphysics_driver +! USE module_microphysics_zero_out +! USE module_fddaobs_driver +! USE module_diagnostics #ifdef WRF_CHEM USE module_input_chem_data USE module_chem_utilities @@ -2637,154 +2639,157 @@ BENCH_END(advance_ppt_tim) sz = 0 ENDIF - IF (config_flags%mp_physics /= 0) then +!!!!****MARS MARS +!!!!****MARS MARS - !$OMP PARALLEL DO & - !$OMP PRIVATE ( ij, its, ite, jts, jte ) - - scalar_tile_loop_1a: DO ij = 1 , grid%num_tiles - - IF ( config_flags%periodic_x ) THEN - its = max(grid%i_start(ij),ids) - ite = min(grid%i_end(ij),ide-1) - ELSE - its = max(grid%i_start(ij),ids+sz) - ite = min(grid%i_end(ij),ide-1-sz) - ENDIF - jts = max(grid%j_start(ij),jds+sz) - jte = min(grid%j_end(ij),jde-1-sz) - - CALL wrf_debug ( 200 , ' call moist_physics_prep' ) -BENCH_START(moist_physics_prep_tim) - CALL moist_physics_prep_em( grid%t_2, grid%t_1, t0, rho, & - grid%al, grid%alb, grid%p, p8w, p0, grid%pb, & - grid%ph_2, grid%phb, th_phy, pi_phy, p_phy, & - grid%z, z_at_w, dz8w, & - dtm, grid%h_diabatic, & - config_flags,grid%fnm, grid%fnp, & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, & - k_start , k_end ) -BENCH_END(moist_physics_prep_tim) - END DO scalar_tile_loop_1a - !$OMP END PARALLEL DO - - CALL wrf_debug ( 200 , ' call microphysics_driver' ) - - grid%sr = 0. - specified_bdy = config_flags%specified .OR. config_flags%nested - channel_bdy = config_flags%specified .AND. config_flags%periodic_x - -BENCH_START(micro_driver_tim) - - CALL microphysics_driver( & - & DT=dtm ,DX=grid%dx ,DY=grid%dy & - & ,DZ8W=dz8w ,F_ICE_PHY=grid%f_ice_phy & - & ,ITIMESTEP=grid%itimestep ,LOWLYR=grid%lowlyr & - & ,P8W=p8w ,P=p_phy ,PI_PHY=pi_phy & - & ,RHO=rho ,SPEC_ZONE=grid%spec_zone & - & ,SR=grid%sr ,TH=th_phy & - & ,WARM_RAIN=grid%warm_rain & - & ,T8W=t8w & - & ,CLDFRA=grid%cldfra, EXCH_H=grid%exch_h & - & ,NSOURCE=grid%qndropsource & -#ifdef WRF_CHEM - & ,QLSINK=grid%qlsink,CLDFRA_OLD=grid%cldfra_old & - & ,PRECR=grid%precr, PRECI=grid%preci, PRECS=grid%precs, PRECG=grid%precg & - & ,CHEM_OPT=config_flags%chem_opt, PROGN=config_flags%progn & -#endif - & ,XLAND=grid%xland & - & ,SPECIFIED=specified_bdy, CHANNEL_SWITCH=channel_bdy & - & ,F_RAIN_PHY=grid%f_rain_phy & - & ,F_RIMEF_PHY=grid%f_rimef_phy & - & ,MP_PHYSICS=config_flags%mp_physics & - & ,ID=grid%id & - & ,IDS=ids,IDE=ide, JDS=jds,JDE=jde, KDS=kds,KDE=kde & - & ,IMS=ims,IME=ime, JMS=jms,JME=jme, KMS=kms,KME=kme & -#ifdef RUN_ON_GPU - & ,IPS=ips,IPE=ipe, JPS=jps,JPE=jpe, KPS=kps,KPE=kpe & -#endif - & ,I_START=grid%i_start,I_END=min(grid%i_end, ide-1) & - & ,J_START=grid%j_start,J_END=min(grid%j_end, jde-1) & - & ,KTS=k_start, KTE=min(k_end,kde-1) & - & ,NUM_TILES=grid%num_tiles & - & ,NAER=grid%naer & - ! Optional - & , RAINNC=grid%rainnc, RAINNCV=grid%rainncv & - & , SNOWNC=grid%snownc, SNOWNCV=grid%snowncv & - & , GRAUPELNC=grid%graupelnc, GRAUPELNCV=grid%graupelncv & - & , W=grid%w_2, Z=grid%z, HT=grid%ht & - & , MP_RESTART_STATE=grid%mp_restart_state & - & , TBPVS_STATE=grid%tbpvs_state & ! etampnew - & , TBPVS0_STATE=grid%tbpvs0_state & ! etampnew - & , QV_CURR=moist(ims,kms,jms,P_QV), F_QV=F_QV & - & , QC_CURR=moist(ims,kms,jms,P_QC), F_QC=F_QC & - & , QR_CURR=moist(ims,kms,jms,P_QR), F_QR=F_QR & - & , QI_CURR=moist(ims,kms,jms,P_QI), F_QI=F_QI & - & , QS_CURR=moist(ims,kms,jms,P_QS), F_QS=F_QS & - & , QG_CURR=moist(ims,kms,jms,P_QG), F_QG=F_QG & - & , QNDROP_CURR=scalar(ims,kms,jms,P_QNDROP), F_QNDROP=F_QNDROP & - & , QNI_CURR=scalar(ims,kms,jms,P_QNI), F_QNI=F_QNI & - & , QT_CURR=scalar(ims,kms,jms,P_QT), F_QT=F_QT & - & , QNS_CURR=scalar(ims,kms,jms,P_QNS), F_QNS=F_QNS & - & , QNR_CURR=scalar(ims,kms,jms,P_QNR), F_QNR=F_QNR & - & , QNG_CURR=scalar(ims,kms,jms,P_QNG), F_QNG=F_QNG & - & , qrcuten=grid%rqrcuten, qscuten=grid%rqscuten & - & , qicuten=grid%rqicuten,mu=grid%mut & - & , HAIL=config_flags%gsfcgce_hail & ! for gsfcgce - & , ICE2=config_flags%gsfcgce_2ice & ! for gsfcgce - ) -BENCH_END(micro_driver_tim) - -#if 0 -BENCH_START(microswap_2) -! for load balancing; communication to redistribute the points - IF ( config_flags%mp_physics .EQ. ETAMPNEW ) THEN -#include "SWAP_ETAMP_NEW.inc" - ELSE IF ( config_flags%mp_physics .EQ. WSM3SCHEME ) THEN -#include "SWAP_WSM3.inc" - ENDIF -BENCH_END(microswap_2) -#endif - - CALL wrf_debug ( 200 , ' call moist_physics_finish' ) -BENCH_START(moist_phys_end_tim) - - !$OMP PARALLEL DO & - !$OMP PRIVATE ( ij, its, ite, jts, jte, im, ii, jj, kk ) - - DO ij = 1 , grid%num_tiles - - IF ( config_flags%periodic_x ) THEN - its = max(grid%i_start(ij),ids) - ite = min(grid%i_end(ij),ide-1) - ELSE - its = max(grid%i_start(ij),ids+sz) - ite = min(grid%i_end(ij),ide-1-sz) - ENDIF - jts = max(grid%j_start(ij),jds+sz) - jte = min(grid%j_end(ij),jde-1-sz) - - CALL microphysics_zero_out ( & - moist , num_moist , config_flags , & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, & - k_start , k_end ) - - - CALL moist_physics_finish_em( grid%t_2, grid%t_1, t0, grid%muts, th_phy, & - grid%h_diabatic, dtm, config_flags, & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, & - k_start , k_end ) - - END DO - !$OMP END PARALLEL DO - - ENDIF ! microphysics test +! IF (config_flags%mp_physics /= 0) then +! +! !$OMP PARALLEL DO & +! !$OMP PRIVATE ( ij, its, ite, jts, jte ) +! +! scalar_tile_loop_1a: DO ij = 1 , grid%num_tiles +! +! IF ( config_flags%periodic_x ) THEN +! its = max(grid%i_start(ij),ids) +! ite = min(grid%i_end(ij),ide-1) +! ELSE +! its = max(grid%i_start(ij),ids+sz) +! ite = min(grid%i_end(ij),ide-1-sz) +! ENDIF +! jts = max(grid%j_start(ij),jds+sz) +! jte = min(grid%j_end(ij),jde-1-sz) +! +! CALL wrf_debug ( 200 , ' call moist_physics_prep' ) +!BENCH_START(moist_physics_prep_tim) +! CALL moist_physics_prep_em( grid%t_2, grid%t_1, t0, rho, & +! grid%al, grid%alb, grid%p, p8w, p0, grid%pb, & +! grid%ph_2, grid%phb, th_phy, pi_phy, p_phy, & +! grid%z, z_at_w, dz8w, & +! dtm, grid%h_diabatic, & +! config_flags,grid%fnm, grid%fnp, & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, & +! k_start , k_end ) +!BENCH_END(moist_physics_prep_tim) +! END DO scalar_tile_loop_1a +! !$OMP END PARALLEL DO +! +! CALL wrf_debug ( 200 , ' call microphysics_driver' ) +! +! grid%sr = 0. +! specified_bdy = config_flags%specified .OR. config_flags%nested +! channel_bdy = config_flags%specified .AND. config_flags%periodic_x +! +!BENCH_START(micro_driver_tim) +! +! CALL microphysics_driver( & +! & DT=dtm ,DX=grid%dx ,DY=grid%dy & +! & ,DZ8W=dz8w ,F_ICE_PHY=grid%f_ice_phy & +! & ,ITIMESTEP=grid%itimestep ,LOWLYR=grid%lowlyr & +! & ,P8W=p8w ,P=p_phy ,PI_PHY=pi_phy & +! & ,RHO=rho ,SPEC_ZONE=grid%spec_zone & +! & ,SR=grid%sr ,TH=th_phy & +! & ,WARM_RAIN=grid%warm_rain & +! & ,T8W=t8w & +! & ,CLDFRA=grid%cldfra, EXCH_H=grid%exch_h & +! & ,NSOURCE=grid%qndropsource & +!#ifdef WRF_CHEM +! & ,QLSINK=grid%qlsink,CLDFRA_OLD=grid%cldfra_old & +! & ,PRECR=grid%precr, PRECI=grid%preci, PRECS=grid%precs, PRECG=grid%precg & +! & ,CHEM_OPT=config_flags%chem_opt, PROGN=config_flags%progn & +!#endif +! & ,XLAND=grid%xland & +! & ,SPECIFIED=specified_bdy, CHANNEL_SWITCH=channel_bdy & +! & ,F_RAIN_PHY=grid%f_rain_phy & +! & ,F_RIMEF_PHY=grid%f_rimef_phy & +! & ,MP_PHYSICS=config_flags%mp_physics & +! & ,ID=grid%id & +! & ,IDS=ids,IDE=ide, JDS=jds,JDE=jde, KDS=kds,KDE=kde & +! & ,IMS=ims,IME=ime, JMS=jms,JME=jme, KMS=kms,KME=kme & +!#ifdef RUN_ON_GPU +! & ,IPS=ips,IPE=ipe, JPS=jps,JPE=jpe, KPS=kps,KPE=kpe & +!#endif +! & ,I_START=grid%i_start,I_END=min(grid%i_end, ide-1) & +! & ,J_START=grid%j_start,J_END=min(grid%j_end, jde-1) & +! & ,KTS=k_start, KTE=min(k_end,kde-1) & +! & ,NUM_TILES=grid%num_tiles & +! & ,NAER=grid%naer & +! ! Optional +! & , RAINNC=grid%rainnc, RAINNCV=grid%rainncv & +! & , SNOWNC=grid%snownc, SNOWNCV=grid%snowncv & +! & , GRAUPELNC=grid%graupelnc, GRAUPELNCV=grid%graupelncv & +! & , W=grid%w_2, Z=grid%z, HT=grid%ht & +! & , MP_RESTART_STATE=grid%mp_restart_state & +! & , TBPVS_STATE=grid%tbpvs_state & ! etampnew +! & , TBPVS0_STATE=grid%tbpvs0_state & ! etampnew +! & , QV_CURR=moist(ims,kms,jms,P_QV), F_QV=F_QV & +! & , QC_CURR=moist(ims,kms,jms,P_QC), F_QC=F_QC & +! & , QR_CURR=moist(ims,kms,jms,P_QR), F_QR=F_QR & +! & , QI_CURR=moist(ims,kms,jms,P_QI), F_QI=F_QI & +! & , QS_CURR=moist(ims,kms,jms,P_QS), F_QS=F_QS & +! & , QG_CURR=moist(ims,kms,jms,P_QG), F_QG=F_QG & +! & , QNDROP_CURR=scalar(ims,kms,jms,P_QNDROP), F_QNDROP=F_QNDROP & +! & , QNI_CURR=scalar(ims,kms,jms,P_QNI), F_QNI=F_QNI & +! & , QT_CURR=scalar(ims,kms,jms,P_QT), F_QT=F_QT & +! & , QNS_CURR=scalar(ims,kms,jms,P_QNS), F_QNS=F_QNS & +! & , QNR_CURR=scalar(ims,kms,jms,P_QNR), F_QNR=F_QNR & +! & , QNG_CURR=scalar(ims,kms,jms,P_QNG), F_QNG=F_QNG & +! & , qrcuten=grid%rqrcuten, qscuten=grid%rqscuten & +! & , qicuten=grid%rqicuten,mu=grid%mut & +! & , HAIL=config_flags%gsfcgce_hail & ! for gsfcgce +! & , ICE2=config_flags%gsfcgce_2ice & ! for gsfcgce +! ) +!BENCH_END(micro_driver_tim) +! +!#if 0 +!BENCH_START(microswap_2) +!! for load balancing; communication to redistribute the points +! IF ( config_flags%mp_physics .EQ. ETAMPNEW ) THEN +!#include "SWAP_ETAMP_NEW.inc" +! ELSE IF ( config_flags%mp_physics .EQ. WSM3SCHEME ) THEN +!#include "SWAP_WSM3.inc" +! ENDIF +!BENCH_END(microswap_2) +!#endif +! +! CALL wrf_debug ( 200 , ' call moist_physics_finish' ) +!BENCH_START(moist_phys_end_tim) +! +! !$OMP PARALLEL DO & +! !$OMP PRIVATE ( ij, its, ite, jts, jte, im, ii, jj, kk ) +! +! DO ij = 1 , grid%num_tiles +! +! IF ( config_flags%periodic_x ) THEN +! its = max(grid%i_start(ij),ids) +! ite = min(grid%i_end(ij),ide-1) +! ELSE +! its = max(grid%i_start(ij),ids+sz) +! ite = min(grid%i_end(ij),ide-1-sz) +! ENDIF +! jts = max(grid%j_start(ij),jds+sz) +! jte = min(grid%j_end(ij),jde-1-sz) +! +! CALL microphysics_zero_out ( & +! moist , num_moist , config_flags , & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, & +! k_start , k_end ) +! +! +! CALL moist_physics_finish_em( grid%t_2, grid%t_1, t0, grid%muts, th_phy, & +! grid%h_diabatic, dtm, config_flags, & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, & +! k_start , k_end ) +! +! END DO +! !$OMP END PARALLEL DO +! +! ENDIF ! microphysics test !----------------------------------------------------------- ! filter for moist variables post-microphysics and end of timestep @@ -3130,31 +3135,34 @@ BENCH_END(bc_2d_tim) grid%dtbc = grid%dtbc + grid%dt ENDIF -! calculate some model diagnostics. +!!!!****MARS MARS +!!!!****MARS MARS - CALL wrf_debug ( 200 , ' call diagnostic_driver' ) - - CALL diagnostic_output_calc( & - & DPSDT=grid%dpsdt ,DMUDT=grid%dmudt & - & ,P8W=p8w ,PK1M=grid%pk1m & - & ,MU_2=grid%mu_2 ,MU_2M=grid%mu_2m & - & ,U=grid%u_2 ,V=grid%v_2 & - & ,RAINCV=grid%raincv ,RAINNCV=grid%rainncv & - & ,RAINC=grid%rainc ,RAINNC=grid%rainnc & - & ,HFX=grid%hfx ,SFCEVP=grid%sfcevp ,LH=grid%lh & - & ,DT=grid%dt ,SBW=config_flags%spec_bdy_width & - & ,XTIME=grid%xtime & - ! Selection flag - & ,DIAG_PRINT=config_flags%diag_print & - ! Dimension arguments - & ,IDS=ids,IDE=ide, JDS=jds,JDE=jde, KDS=kds,KDE=kde & - & ,IMS=ims,IME=ime, JMS=jms,JME=jme, KMS=kms,KME=kme & - & ,IPS=ips,IPE=ipe, JPS=jps,JPE=jpe, KPS=kps,KPE=kpe & - & ,I_START=grid%i_start,I_END=min(grid%i_end, ide-1) & - & ,J_START=grid%j_start,J_END=min(grid%j_end, jde-1) & - & ,KTS=k_start, KTE=min(k_end,kde-1) & - & ,NUM_TILES=grid%num_tiles & - & ) +!! calculate some model diagnostics. +! +! CALL wrf_debug ( 200 , ' call diagnostic_driver' ) +! +! CALL diagnostic_output_calc( & +! & DPSDT=grid%dpsdt ,DMUDT=grid%dmudt & +! & ,P8W=p8w ,PK1M=grid%pk1m & +! & ,MU_2=grid%mu_2 ,MU_2M=grid%mu_2m & +! & ,U=grid%u_2 ,V=grid%v_2 & +! & ,RAINCV=grid%raincv ,RAINNCV=grid%rainncv & +! & ,RAINC=grid%rainc ,RAINNC=grid%rainnc & +! & ,HFX=grid%hfx ,SFCEVP=grid%sfcevp ,LH=grid%lh & +! & ,DT=grid%dt ,SBW=config_flags%spec_bdy_width & +! & ,XTIME=grid%xtime & +! ! Selection flag +! & ,DIAG_PRINT=config_flags%diag_print & +! ! Dimension arguments +! & ,IDS=ids,IDE=ide, JDS=jds,JDE=jde, KDS=kds,KDE=kde & +! & ,IMS=ims,IME=ime, JMS=jms,JME=jme, KMS=kms,KME=kme & +! & ,IPS=ips,IPE=ipe, JPS=jps,JPE=jpe, KPS=kps,KPE=kpe & +! & ,I_START=grid%i_start,I_END=min(grid%i_end, ide-1) & +! & ,J_START=grid%j_start,J_END=min(grid%j_end, jde-1) & +! & ,KTS=k_start, KTE=min(k_end,kde-1) & +! & ,NUM_TILES=grid%num_tiles & +! & ) #ifdef DM_PARALLEL !----------------------------------------------------------------------- @@ -3221,6 +3229,25 @@ BENCH_END(bc_2d_tim) DEALLOCATE(max_vert_cfl_tmp) DEALLOCATE(max_horiz_cfl_tmp) + +!!!!!!!!!!!!!MARS +!!!!!!!!!!!!!MARS +!! +!! to get lighter output files, output the sum of the constant value phb (pb) +!with ph (p) +!! --- these variables were added to the Registry +!! +!!pressure + grid%ptot = grid%p + grid%pb +!!geopotential: already in php + grid%phtot = grid%php +!!mass + !grid%em_mutot = grid%em_mub + grid%em_mu_2 +!! +!!!!!!!!!!!!!MARS +!!!!!!!!!!!!!MARS + + CALL wrf_debug ( 200 , ' call end of solve_em' ) ! Finish timers if compiled with -DBENCH. diff --git a/WRF.COMMON/WRFV3/frame/module_driver_constants.F b/WRF.COMMON/WRFV3/frame/module_driver_constants.F index 0e094785..9933689e 100644 --- a/WRF.COMMON/WRFV3/frame/module_driver_constants.F +++ b/WRF.COMMON/WRFV3/frame/module_driver_constants.F @@ -90,16 +90,18 @@ MODULE module_driver_constants ! ! P2SI is the number of SI seconds in an planetary solar day ! divided by the number of SI seconds in an earth solar day -#if defined MARS - ! For Mars, P2SI = 88775.2/86400. - REAL , PARAMETER :: P2SI = 1.0274907 -#elif defined TITAN - ! For Titan, P2SI = 1378080.0/86400. - REAL , PARAMETER :: P2SI = 15.95 -#else +!#if defined MARS +! ! For Mars, P2SI = 88775.2/86400. +! REAL , PARAMETER :: P2SI = 1.0274907 +!#elif defined TITAN +! ! For Titan, P2SI = 1378080.0/86400. +! REAL , PARAMETER :: P2SI = 15.95 +!#else ! Default for Earth REAL , PARAMETER :: P2SI = 1.0 -#endif +!!!!MARS +! REAL , PARAMETER :: P2SI = 1.0274907 +!#endif CONTAINS SUBROUTINE init_module_driver_constants END SUBROUTINE init_module_driver_constants diff --git a/WRF.COMMON/WRFV3/phys/Makefile b/WRF.COMMON/WRFV3/phys/Makefile index 327966c5..636bd4c2 100644 --- a/WRF.COMMON/WRFV3/phys/Makefile +++ b/WRF.COMMON/WRFV3/phys/Makefile @@ -6,64 +6,14 @@ RM = rm -f MODULES = \ - module_bl_ysu.o \ - module_bl_mrf.o \ - module_bl_gfs.o \ - module_bl_myjpbl.o \ - module_bl_acm.o \ - module_cu_g3.o \ - module_cu_kf.o \ - module_cu_bmj.o \ - module_cu_kfeta.o \ - module_cu_gd.o \ - module_cu_sas.o \ - module_mp_kessler.o \ - module_mp_lin.o \ - module_mp_wsm3.o \ - module_mp_wsm5.o \ - module_mp_wsm6.o \ - module_mp_etanew.o \ - module_mp_thompson.o \ - module_mp_gsfcgce.o \ - module_mp_morr_two_moment.o \ - module_ra_sw.o \ - module_ra_gsfcsw.o \ - module_ra_rrtm.o \ - module_ra_cam_support.o \ - module_ra_cam.o \ - module_ra_gfdleta.o \ - module_ra_hs.o \ - module_sf_sfclay.o \ - module_sf_gfs.o \ - module_sf_slab.o \ - module_sf_noahdrv.o \ - module_sf_noahlsm.o \ - module_sf_urban.o \ - module_sf_lsm_nmm.o \ - module_sf_pxlsm.o \ - module_sf_ruclsm.o \ - module_sf_sfcdiags.o \ - module_sf_myjsfc.o \ - module_sf_pxsfclay.o \ module_physics_addtendc.o \ module_physics_init.o \ - module_gfs_machine.o \ - module_gfs_funcphys.o \ - module_gfs_physcons.o \ - module_progtm.o \ - module_pbl_driver.o \ - module_data_gocart_dust.o \ - module_cumulus_driver.o \ - module_microphysics_driver.o \ - module_microphysics_zero_out.o \ - module_mixactivate.o \ - module_radiation_driver.o \ - module_surface_driver.o \ - module_diagnostics.o \ - module_fdda_psufddagd.o \ - module_fddagd_driver.o \ - module_fddaobs_rtfdda.o \ - module_fddaobs_driver.o + variables_mod.o \ + update_inputs_physiq_mod.o \ + update_outputs_physiq_mod.o \ + iniphysiq_mod.o \ + callphysiq_mod.o \ + module_lmd_driver.o OBJS = @@ -92,195 +42,23 @@ clean: # DEPENDENCIES : only dependencies after this line (don't remove the word DEPENDENCIES) -module_bl_myjpbl.o: ../share/module_model_constants.o - -module_bl_gfs.o: module_gfs_machine.o \ - module_gfs_physcons.o - -module_cu_bmj.o: ../share/module_model_constants.o - -module_cu_kf.o: ../frame/module_wrf_error.o - -module_cu_kfeta.o: ../frame/module_wrf_error.o - -module_cu_gd.o: - -module_gfs_physcons.o: module_gfs_machine.o - -module_gfs_funcphys.o: module_gfs_machine.o \ - module_gfs_physcons.o - -module_cu_sas.o: module_gfs_machine.o \ - module_gfs_funcphys.o \ - module_gfs_physcons.o - -module_ra_gfdleta.o: ../frame/module_dm.o - -module_ra_rrtm.o: ../frame/module_wrf_error.o \ - ../frame/module_dm.o - -module_ra_cam_support.o: ../frame/module_wrf_error.o - -module_ra_cam.o: module_ra_cam_support.o \ - ../frame/module_wrf_error.o - -module_mp_lin.o : ../frame/module_wrf_error.o - -module_sf_lsm_nmm.o: ../share/module_model_constants.o \ - ../share/module_MPP.o - -module_sf_myjsfc.o: ../share/module_model_constants.o - -module_sf_gfs.o: module_gfs_machine.o \ - module_gfs_funcphys.o \ - module_gfs_physcons.o \ - module_progtm.o - -module_sf_noahdrv.o: module_sf_noahlsm.o module_data_gocart_dust.o \ - module_sf_urban.o - -module_sf_noahlsm.o: ../share/module_model_constants.o - -module_sf_ruclsm.o: ../frame/module_wrf_error.o module_data_gocart_dust.o - -module_sf_pxlsm.o: ../share/module_model_constants.o - module_physics_addtendc.o: \ - module_cu_kf.o \ - module_cu_kfeta.o \ ../frame/module_state_description.o \ ../frame/module_configure.o module_physics_init.o : \ - module_ra_rrtm.o \ - module_ra_cam.o \ - module_ra_cam_support.o \ - module_ra_sw.o \ - module_ra_gsfcsw.o \ - module_ra_gfdleta.o \ - module_ra_hs.o \ - module_sf_sfclay.o \ - module_sf_slab.o \ - module_sf_myjsfc.o \ - module_sf_pxsfclay.o \ - module_sf_noahlsm.o \ - module_sf_noahdrv.o \ - module_sf_ruclsm.o \ - module_sf_pxlsm.o \ - module_bl_ysu.o \ - module_bl_mrf.o \ - module_bl_gfs.o \ - module_bl_acm.o \ - module_bl_myjpbl.o \ - module_cu_kf.o \ - module_cu_g3.o \ - module_cu_kfeta.o \ - module_cu_bmj.o \ - module_cu_gd.o \ - module_cu_sas.o \ - module_mp_wsm3.o \ - module_mp_wsm5.o \ - module_mp_wsm6.o \ - module_mp_etanew.o \ - module_fdda_psufddagd.o \ - module_fddaobs_rtfdda.o \ - module_mp_thompson.o \ - module_mp_gsfcgce.o \ - module_mp_morr_two_moment.o \ ../frame/module_state_description.o \ ../frame/module_configure.o \ ../frame/module_wrf_error.o \ ../frame/module_dm.o \ - ../share/module_model_constants.o \ - module_sf_lsm_nmm.o - -module_microphysics_driver.o: \ - module_mixactivate.o \ - module_mp_kessler.o module_mp_lin.o \ - module_mp_wsm3.o module_mp_wsm5.o \ - module_mp_wsm6.o module_mp_etanew.o \ - module_mp_thompson.o \ - module_mp_gsfcgce.o \ - module_mp_morr_two_moment.o \ - ../frame/module_driver_constants.o \ - ../frame/module_state_description.o \ - ../frame/module_wrf_error.o \ - ../frame/module_configure.o \ - ../share/module_model_constants.o - -module_cumulus_driver.o: \ - module_cu_kf.o \ - module_cu_g3.o \ - module_cu_kfeta.o \ - module_cu_bmj.o \ - module_cu_gd.o \ - module_cu_sas.o \ - ../frame/module_state_description.o \ - ../frame/module_configure.o \ - ../share/module_model_constants.o - -module_pbl_driver.o: \ - module_bl_myjpbl.o \ - module_bl_acm.o \ - module_bl_ysu.o \ - module_bl_mrf.o \ - module_bl_gfs.o \ - ../frame/module_state_description.o \ - ../frame/module_configure.o \ ../share/module_model_constants.o -module_data_gocart_dust.o: - -module_mixactivate.o: \ - module_radiation_driver.o - -module_radiation_driver.o: \ - module_ra_sw.o \ - module_ra_gsfcsw.o \ - module_ra_rrtm.o \ - module_ra_cam.o \ - module_ra_gfdleta.o \ - module_ra_hs.o \ - ../frame/module_driver_constants.o \ +module_lmd_driver.o: \ ../frame/module_state_description.o \ - ../frame/module_dm.o \ - ../frame/module_domain.o \ ../frame/module_wrf_error.o \ ../frame/module_configure.o \ - ../share/module_bc.o \ - ../share/module_model_constants.o - -module_surface_driver.o: \ - module_sf_sfclay.o \ - module_sf_slab.o \ - module_sf_myjsfc.o \ - module_sf_pxsfclay.o \ - module_sf_gfs.o \ - module_sf_noahdrv.o \ - module_sf_ruclsm.o \ - module_sf_pxlsm.o \ - module_sf_sfcdiags.o \ - ../frame/module_state_description.o \ - ../frame/module_configure.o \ - ../share/module_model_constants.o \ - module_sf_lsm_nmm.o - -module_diagnostics.o: ../frame/module_dm.o - - -module_mixactivate.o: \ - module_radiation_driver.o - -module_fddagd_driver.o: \ - ../frame/module_state_description.o \ - ../frame/module_configure.o \ - ../share/module_model_constants.o \ - module_fdda_psufddagd.o - -module_fddaobs_driver.o: \ - ../frame/module_domain.o \ - ../share/module_bc.o \ - ../share/module_model_constants.o \ - module_fddaobs_rtfdda.o + ../share/module_model_constants.o \ +#../frame/module_wrf_error.o \ +#../share/module_model_constants.o # DO NOT DELETE diff --git a/WRF.COMMON/WRFV3/phys/module_physics_addtendc.F b/WRF.COMMON/WRFV3/phys/module_physics_addtendc.F index 199b9b73..aedba100 100644 --- a/WRF.COMMON/WRFV3/phys/module_physics_addtendc.F +++ b/WRF.COMMON/WRFV3/phys/module_physics_addtendc.F @@ -93,7 +93,13 @@ SUBROUTINE update_phy_ten(rt_tendf,ru_tendf,rv_tendf,moist_tendf, & ims, ime, jms, jme, kms, kme, & its, ite, jts, jte, kts, kte ) - if (config_flags%bl_pbl_physics .gt. 0) & +! if (config_flags%bl_pbl_physics .gt. 0) & +!****MARS +! - All the LMD physics packages provide one tendency in the WRF sense +! - PBL was chosen for practical reasons (U+V+T) +! - The tendencies are supposed to be A-gridded + if ( (config_flags%bl_pbl_physics .gt. 0) & + .OR. (config_flags%modif_wrf) ) & CALL phy_bl_ten(config_flags,rk_step,n_moist,n_scalar, & rt_tendf,ru_tendf,rv_tendf,moist_tendf, & scalar_tendf,adv_moist_cond, & @@ -199,6 +205,28 @@ SUBROUTINE phy_bl_ten(config_flags,rk_step,n_moist,n_scalar, & !----------------------------------------------------------------- + +!****MARS +!****MARS +!update with LMD physics tendencies +if (config_flags%modif_wrf) then +CALL add_a2a(rt_tendf,RTHBLTEN,config_flags, & + ids,ide, jds, jde, kds, kde, & + ims, ime, jms, jme, kms, kme, & + its, ite, jts, jte, kts, kte ) +CALL add_a2c_u(ru_tendf,RUBLTEN,config_flags, & + ids,ide, jds, jde, kds, kde, & + ims, ime, jms, jme, kms, kme, & + its, ite, jts, jte, kts, kte ) +CALL add_a2c_v(rv_tendf,RVBLTEN,config_flags, & + ids,ide, jds, jde, kds, kde, & + ims, ime, jms, jme, kms, kme, & + its, ite, jts, jte, kts, kte ) +endif +!****MARS +!****MARS + + SELECT CASE(config_flags%bl_pbl_physics) CASE (YSUSCHEME) @@ -468,7 +496,7 @@ SUBROUTINE phy_bl_ten(config_flags,rk_step,n_moist,n_scalar, & CASE DEFAULT - print*,'phy_bl_ten: The pbl scheme does not exist' + ! print*,'phy_bl_ten: The pbl scheme does not exist' END SELECT @@ -759,8 +787,10 @@ SUBROUTINE advance_ppt(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQRCUTEN, & its,ite, jts,jte, kts,kte ) !---------------------------------------------------------------------- USE module_state_description - USE module_cu_kf - USE module_cu_kfeta +!!!******MARS MARS +!!!******MARS MARS +! USE module_cu_kf +! USE module_cu_kfeta !---------------------------------------------------------------------- IMPLICIT NONE !---------------------------------------------------------------------- diff --git a/WRF.COMMON/WRFV3/phys/module_physics_init.F b/WRF.COMMON/WRFV3/phys/module_physics_init.F index f40e5b10..cbc3dd93 100644 --- a/WRF.COMMON/WRFV3/phys/module_physics_init.F +++ b/WRF.COMMON/WRFV3/phys/module_physics_init.F @@ -398,131 +398,136 @@ integer myproc allowed_to_read, & kds,kde,kms,kme,kts,kte) -!-- initialize physics -!-- ra: radiation -!-- bl: pbl -!-- cu: cumulus -!-- mp: microphysics - - CALL wrf_debug ( 200 , 'module_start: phy_init: Before call to ra_init' ) - - CALL ra_init(id,STEPRA,RADT,DT,RTHRATEN,RTHRATENLW, & - RTHRATENSW,CLDFRA,EMISS,cen_lat,JULYR,JULDAY,GMT, & - levsiz,XLAT,n_ozmixm, & - cldfra_old, & ! Optional - ozmixm,pin, & ! Optional - m_ps_1,m_ps_2,m_hybi,aerosolc_1,aerosolc_2, & ! Optional - paerlev,n_aerosolc, & - sfull,shalf,pptop,swrad_scat, & - config_flags,restart, & - allowed_to_read, start_of_simulation, & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) - - CALL wrf_debug ( 200 , 'module_start: phy_init: Before call to bl_init' ) - - CALL bl_init(STEPBL,BLDT,DT,RUBLTEN,RVBLTEN,RTHBLTEN, & - RQVBLTEN,RQCBLTEN,RQIBLTEN,TSK,TMN, & - config_flags,restart,UST,LOWLYR,TSLB,ZS,DZS, & - num_soil_layers,TKE_MYJ,EXCH_H,VEGFRA, & - SNOW,SNOWC, CANWAT,SMSTAV, & - SMSTOT, SFCRUNOFF,UDRUNOFF,ACSNOW,ACSNOM, & - IVGTYP,ISLTYP,SMOIS,SMFR3D,MAVAIL, & - SNOWH,SH2O,FNDSOILW, FNDSNOWH, & -#if (NMM_CORE == 1) - Z0,XLAND,XICE, & -#else - ZNT,XLAND,XICE, & -#endif - SFCEVP,GRDFLX, & - allowed_to_read , & - start_of_simulation , & - DZR, DZB, DZG, & !Optional urban - TR_URB2D,TB_URB2D,TG_URB2D,TC_URB2D,QC_URB2D, & !Optional urban - XXXR_URB2D,XXXB_URB2D,XXXG_URB2D,XXXC_URB2D, & !Optional urban - TRL_URB3D, TBL_URB3D, TGL_URB3D, & !Optional urban - SH_URB2D, LH_URB2D, G_URB2D, RN_URB2D, & !Optional urban - TS_URB2D, FRC_URB2D, UTYPE_URB2D, UCMCALL, & !Optional urban - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte, & - oml_hml0, omlcall, & !Optional oml - TML,T0ML,HML,H0ML,HUML,HVML ) !Optional oml - - CALL wrf_debug ( 200 , 'module_start: phy_init: Before call to cu_init' ) - - CALL cu_init(STEPCU,CUDT,DT,RTHCUTEN,RQVCUTEN,RQRCUTEN, & - RQCCUTEN,RQSCUTEN,RQICUTEN,NCA,RAINC, & - RAINCV,W0AVG,config_flags,restart, & - CLDEFI,LOWLYR,MASS_FLUX, & - RTHFTEN, RQVFTEN, & - APR_GR,APR_W,APR_MC,APR_ST,APR_AS, & - APR_CAPMA,APR_CAPME,APR_CAPMI, & - cugd_tten,cugd_ttens,cugd_qvten, & - cugd_qvtens,cugd_qcten, & - allowed_to_read, start_of_simulation, & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) - - CALL wrf_debug ( 200 , 'module_start: phy_init: Before call to mp_init' ) - - CALL mp_init(RAINNC,config_flags,restart,warm_rain, & - adv_moist_cond, & - MPDT, DT, DX, DY, LOWLYR, & - F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY, & - mp_restart_state,tbpvs_state,tbpvs0_state, & - allowed_to_read, start_of_simulation, & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) - - write(message,*)'STEPRA,STEPCU,STEPBL',STEPRA,STEPCU,STEPBL - CALL wrf_message( message ) - -#if ( EM_CORE == 1 ) - CALL wrf_debug ( 200 , 'module_start: phy_init: Before call to fg_init' ) - - CALL fg_init(STEPFG,FGDT,DT,id,RUNDGDTEN,RVNDGDTEN, & - RTHNDGDTEN,RQVNDGDTEN,RMUNDGDTEN, & - config_flags,restart, & - allowed_to_read , & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) - - CALL wrf_debug ( 200 , 'module_start: phy_init: Before call to fdob_init' ) - - CALL fdob_init(model_config_rec%obs_nudge_opt, & - model_config_rec%max_dom, & - id, & - model_config_rec%parent_id, & - model_config_rec%obs_idynin, & - model_config_rec%obs_dtramp, & - model_config_rec%fdda_end, & - config_flags%restart, & - obs_twindo_cg, obs_twindo, & - itimestep, & - config_flags%cen_lat, & - config_flags%cen_lon, & - config_flags%stand_lon, & - config_flags%truelat1, & - config_flags%truelat2, & - config_flags%map_proj, & - xlat, & - xlong, & - model_config_rec%s_sn(1), & - model_config_rec%e_sn(1), & - model_config_rec%s_we(1), & - model_config_rec%e_we(1), & - fdob, & - model_config_rec%obs_ipf_init, & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) +!!!!******MARS MARS MARS +!!!!******MARS MARS MARS +!!!!******MARS MARS MARS -#endif +! +!!-- initialize physics +!!-- ra: radiation +!!-- bl: pbl +!!-- cu: cumulus +!!-- mp: microphysics +! +! CALL wrf_debug ( 200 , 'module_start: phy_init: Before call to ra_init' ) +! +! CALL ra_init(id,STEPRA,RADT,DT,RTHRATEN,RTHRATENLW, & +! RTHRATENSW,CLDFRA,EMISS,cen_lat,JULYR,JULDAY,GMT, & +! levsiz,XLAT,n_ozmixm, & +! cldfra_old, & ! Optional +! ozmixm,pin, & ! Optional +! m_ps_1,m_ps_2,m_hybi,aerosolc_1,aerosolc_2, & ! Optional +! paerlev,n_aerosolc, & +! sfull,shalf,pptop,swrad_scat, & +! config_flags,restart, & +! allowed_to_read, start_of_simulation, & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +! +! CALL wrf_debug ( 200 , 'module_start: phy_init: Before call to bl_init' ) +! +! CALL bl_init(STEPBL,BLDT,DT,RUBLTEN,RVBLTEN,RTHBLTEN, & +! RQVBLTEN,RQCBLTEN,RQIBLTEN,TSK,TMN, & +! config_flags,restart,UST,LOWLYR,TSLB,ZS,DZS, & +! num_soil_layers,TKE_MYJ,EXCH_H,VEGFRA, & +! SNOW,SNOWC, CANWAT,SMSTAV, & +! SMSTOT, SFCRUNOFF,UDRUNOFF,ACSNOW,ACSNOM, & +! IVGTYP,ISLTYP,SMOIS,SMFR3D,MAVAIL, & +! SNOWH,SH2O,FNDSOILW, FNDSNOWH, & +!#if (NMM_CORE == 1) +! Z0,XLAND,XICE, & +!#else +! ZNT,XLAND,XICE, & +!#endif +! SFCEVP,GRDFLX, & +! allowed_to_read , & +! start_of_simulation , & +! DZR, DZB, DZG, & !Optional urban +! TR_URB2D,TB_URB2D,TG_URB2D,TC_URB2D,QC_URB2D, & !Optional urban +! XXXR_URB2D,XXXB_URB2D,XXXG_URB2D,XXXC_URB2D, & !Optional urban +! TRL_URB3D, TBL_URB3D, TGL_URB3D, & !Optional urban +! SH_URB2D, LH_URB2D, G_URB2D, RN_URB2D, & !Optional urban +! TS_URB2D, FRC_URB2D, UTYPE_URB2D, UCMCALL, & !Optional urban +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte, & +! oml_hml0, omlcall, & !Optional oml +! TML,T0ML,HML,H0ML,HUML,HVML ) !Optional oml +! +! CALL wrf_debug ( 200 , 'module_start: phy_init: Before call to cu_init' ) +! +! CALL cu_init(STEPCU,CUDT,DT,RTHCUTEN,RQVCUTEN,RQRCUTEN, & +! RQCCUTEN,RQSCUTEN,RQICUTEN,NCA,RAINC, & +! RAINCV,W0AVG,config_flags,restart, & +! CLDEFI,LOWLYR,MASS_FLUX, & +! RTHFTEN, RQVFTEN, & +! APR_GR,APR_W,APR_MC,APR_ST,APR_AS, & +! APR_CAPMA,APR_CAPME,APR_CAPMI, & +! cugd_tten,cugd_ttens,cugd_qvten, & +! cugd_qvtens,cugd_qcten, & +! allowed_to_read, start_of_simulation, & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +! +! CALL wrf_debug ( 200 , 'module_start: phy_init: Before call to mp_init' ) +! +! CALL mp_init(RAINNC,config_flags,restart,warm_rain, & +! adv_moist_cond, & +! MPDT, DT, DX, DY, LOWLYR, & +! F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY, & +! mp_restart_state,tbpvs_state,tbpvs0_state, & +! allowed_to_read, start_of_simulation, & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +! +! write(message,*)'STEPRA,STEPCU,STEPBL',STEPRA,STEPCU,STEPBL +! CALL wrf_message( message ) +! +!#if ( EM_CORE == 1 ) +! CALL wrf_debug ( 200 , 'module_start: phy_init: Before call to fg_init' ) +! +! CALL fg_init(STEPFG,FGDT,DT,id,RUNDGDTEN,RVNDGDTEN, & +! RTHNDGDTEN,RQVNDGDTEN,RMUNDGDTEN, & +! config_flags,restart, & +! allowed_to_read , & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +! +! CALL wrf_debug ( 200 , 'module_start: phy_init: Before call to fdob_init' ) +! +! CALL fdob_init(model_config_rec%obs_nudge_opt, & +! model_config_rec%max_dom, & +! id, & +! model_config_rec%parent_id, & +! model_config_rec%obs_idynin, & +! model_config_rec%obs_dtramp, & +! model_config_rec%fdda_end, & +! config_flags%restart, & +! obs_twindo_cg, obs_twindo, & +! itimestep, & +! config_flags%cen_lat, & +! config_flags%cen_lon, & +! config_flags%stand_lon, & +! config_flags%truelat1, & +! config_flags%truelat2, & +! config_flags%map_proj, & +! xlat, & +! xlong, & +! model_config_rec%s_sn(1), & +! model_config_rec%e_sn(1), & +! model_config_rec%s_we(1), & +! model_config_rec%e_we(1), & +! fdob, & +! model_config_rec%obs_ipf_init, & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +! +!#endif END SUBROUTINE phy_init @@ -766,958 +771,962 @@ integer myproc END SUBROUTINE landuse_init -!===================================================================== - SUBROUTINE ra_init(id,STEPRA,RADT,DT,RTHRATEN,RTHRATENLW, & - RTHRATENSW,CLDFRA,EMISS,cen_lat,JULYR,JULDAY,GMT, & - levsiz,XLAT,n_ozmixm, & - cldfra_old, & ! Optional - ozmixm,pin, & ! Optional - m_ps_1,m_ps_2,m_hybi,aerosolc_1,aerosolc_2, & ! Optional - paerlev,n_aerosolc, & - sfull,shalf,pptop,swrad_scat, & - config_flags,restart, & - allowed_to_read, start_of_simulation, & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) -!--------------------------------------------------------------------- - USE module_ra_rrtm - USE module_ra_cam - USE module_ra_sw - USE module_ra_gsfcsw - USE module_ra_gfdleta - USE module_ra_hs - USE module_domain -!--------------------------------------------------------------------- - IMPLICIT NONE -!--------------------------------------------------------------------- - INTEGER, INTENT(IN) :: id - TYPE (grid_config_rec_type) :: config_flags - LOGICAL , INTENT(IN) :: restart - LOGICAL, INTENT(IN) :: allowed_to_read - - INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte - - INTEGER , INTENT(IN) :: JULDAY,JULYR - REAL , INTENT(IN) :: DT, RADT, cen_lat, GMT, pptop, & - swrad_scat - LOGICAL, INTENT(IN) :: start_of_simulation - - INTEGER, INTENT(IN ) :: levsiz, n_ozmixm - INTEGER, INTENT(IN ) :: paerlev, n_aerosolc - - REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(IN) :: XLAT - - REAL, DIMENSION( ims:ime, levsiz, jms:jme, n_ozmixm ), OPTIONAL, & - INTENT(INOUT) :: OZMIXM - - REAL, DIMENSION(ims:ime,jms:jme), OPTIONAL, INTENT(INOUT) :: m_ps_1,m_ps_2 - REAL, DIMENSION(paerlev), OPTIONAL, INTENT(INOUT) :: m_hybi - REAL, DIMENSION( ims:ime, paerlev, jms:jme, n_aerosolc ), OPTIONAL, & - INTENT(INOUT) :: aerosolc_1, aerosolc_2 - - REAL, DIMENSION(levsiz), OPTIONAL, INTENT(INOUT) :: PIN - - INTEGER , INTENT(INOUT) :: STEPRA - INTEGER :: isn - - REAL , DIMENSION( kms:kme ) , INTENT(IN) :: sfull, shalf - REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT) :: & - RTHRATEN, & - RTHRATENLW, & - RTHRATENSW, & - CLDFRA - - REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , OPTIONAL, INTENT(OUT) :: & - CLDFRA_OLD - - REAL , DIMENSION( ims:ime , jms:jme ) , INTENT(INOUT) :: EMISS - LOGICAL :: etalw = .false. - LOGICAL :: camlw = .false. - LOGICAL :: etamp = .false. - integer :: month,iday - INTEGER :: i, j, k, itf, jtf, ktf -!--------------------------------------------------------------------- - - jtf=min0(jte,jde-1) - ktf=min0(kte,kde-1) - itf=min0(ite,ide-1) - -!--------------------------------------------------------------------- - -!-- calculate radiation time step - - STEPRA = nint(RADT*60./DT) - STEPRA = max(STEPRA,1) - -!-- initialization - - IF(start_of_simulation)THEN - DO j=jts,jtf - DO k=kts,ktf - DO i=its,itf - RTHRATEN(i,k,j)=0. - RTHRATENLW(i,k,j)=0. - RTHRATENSW(i,k,j)=0. - CLDFRA(i,k,j)=0. - ENDDO - ENDDO - ENDDO - - if( present(cldfra_old) ) then - DO j=jts,jtf - DO k=kts,ktf - DO i=its,itf - cldfra_old(i,k,j) = 0. - ENDDO - ENDDO - ENDDO - end if - ENDIF - -!-- find out which microphysics option is used first - - mp_select: SELECT CASE(config_flags%mp_physics) - - CASE (ETAMPNEW) - etamp = .true. - - END SELECT mp_select - -!-- chose long wave radiation scheme - - lwrad_select: SELECT CASE(config_flags%ra_lw_physics) - - CASE (RRTMSCHEME) - CALL rrtminit( & - allowed_to_read , & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) - - CASE (CAMLWSCHEME) -#ifdef MAC_KLUDGE - CALL wrf_error_fatal ( 'CAM radiation scheme not supported under the chosen build configuration' ) -#endif - IF ( PRESENT( OZMIXM ) .AND. PRESENT( PIN ) .AND. & - PRESENT(M_PS_1) .AND. PRESENT(M_PS_2) .AND. & - PRESENT(M_HYBI) .AND. PRESENT(AEROSOLC_1) & - .AND. PRESENT(AEROSOLC_2)) THEN - CALL camradinit( & - R_D,R_V,CP,G,STBOLT,EP_2,shalf,pptop, & - ozmixm,pin,levsiz,XLAT,n_ozmixm, & - m_ps_1,m_ps_2,m_hybi,aerosolc_1,aerosolc_2,& - paerlev, n_aerosolc, & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) - ELSE - CALL wrf_error_fatal ( 'arguments not present for calling cam radiation' ) - ENDIF - - camlw = .true. - - CASE (GFDLLWSCHEME) - CALL nl_get_start_month(id,month) - CALL nl_get_start_day(id,iday) - CALL gfdletainit(emiss,sfull,shalf,pptop, & - julyr,month,iday,gmt, & - config_flags,allowed_to_read, & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) - etalw = .true. - CASE (HELDSUAREZ) - CALL hsinit(RTHRATEN,restart, & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) - CASE DEFAULT - - END SELECT lwrad_select -!-- initialize short wave radiation scheme - - swrad_select: SELECT CASE(config_flags%ra_sw_physics) - - CASE (SWRADSCHEME) - CALL swinit( & - swrad_scat, & - allowed_to_read , & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) - - CASE (CAMSWSCHEME) -#ifdef MAC_KLUDGE - CALL wrf_error_fatal ( 'CAM radiation scheme not supported under the chosen build configuration' ) -#endif - IF(.not.camlw)THEN - CALL camradinit( & - R_D,R_V,CP,G,STBOLT,EP_2,shalf,pptop, & - ozmixm,pin,levsiz,XLAT,n_ozmixm, & - m_ps_1,m_ps_2,m_hybi,aerosolc_1,aerosolc_2,& - paerlev, n_aerosolc, & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) - ENDIF - - CASE (GSFCSWSCHEME) - CALL gsfc_swinit(cen_lat, allowed_to_read ) - - CASE (GFDLSWSCHEME) - IF(.not.etalw)THEN - CALL nl_get_start_month(id,month) - CALL nl_get_start_day(id,iday) - CALL gfdletainit(emiss,sfull,shalf,pptop, & - julyr,month,iday,gmt, & - config_flags,allowed_to_read, & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) - ENDIF - - CASE DEFAULT - - END SELECT swrad_select - - END SUBROUTINE ra_init - - SUBROUTINE bl_init(STEPBL,BLDT,DT,RUBLTEN,RVBLTEN,RTHBLTEN, & - RQVBLTEN,RQCBLTEN,RQIBLTEN,TSK,TMN, & - config_flags,restart,UST,LOWLYR,TSLB,ZS,DZS, & - num_soil_layers,TKE_MYJ,EXCH_H,VEGFRA, & - SNOW,SNOWC, CANWAT,SMSTAV, & - SMSTOT, SFCRUNOFF,UDRUNOFF,ACSNOW,ACSNOM, & - IVGTYP,ISLTYP,SMOIS,SMFR3D,mavail, & - SNOWH,SH2O,FNDSOILW, FNDSNOWH, & -#if ( NMM_CORE == 1 ) - Z0,XLAND,XICE, & -#else - ZNT,XLAND,XICE, & -#endif - SFCEVP,GRDFLX, & - allowed_to_read, & - start_of_simulation, & -! num_roof_layers,num_wall_layers,num_road_layers,& !Optional urban - DZR, DZB, DZG, & !Optional urban - TR_URB2D,TB_URB2D,TG_URB2D,TC_URB2D,QC_URB2D, & !Optional urban - XXXR_URB2D,XXXB_URB2D,XXXG_URB2D,XXXC_URB2D, & !Optional urban - TRL_URB3D, TBL_URB3D, TGL_URB3D, & !Optional urban - SH_URB2D,LH_URB2D,G_URB2D,RN_URB2D, & !Optional urban - TS_URB2D, FRC_URB2D, UTYPE_URB2D,UCMCALL, & !Optional urban - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte, & - oml_hml0, omlcall, & !Optional oml - TML,T0ML,HML,H0ML,HUML,HVML ) !Optional oml -!-------------------------------------------------------------------- - USE module_sf_sfclay - USE module_sf_slab - USE module_sf_pxsfclay - USE module_bl_ysu - USE module_bl_mrf - USE module_bl_gfs - USE module_bl_acm - USE module_sf_myjsfc - USE module_sf_noahdrv - USE module_sf_urban - USE module_sf_ruclsm - USE module_sf_pxlsm - USE module_bl_myjpbl -#if (NMM_CORE == 1) - USE module_sf_lsm_nmm -#endif -!-------------------------------------------------------------------- - IMPLICIT NONE -!-------------------------------------------------------------------- - TYPE (grid_config_rec_type) :: config_flags - LOGICAL , INTENT(IN) :: restart - LOGICAL, INTENT(IN) :: FNDSOILW, FNDSNOWH - - INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte - INTEGER , INTENT(IN) :: num_soil_layers - INTEGER , INTENT(IN) :: UCMCALL - - REAL , INTENT(IN) :: DT, BLDT - INTEGER , INTENT(INOUT) :: STEPBL - - REAL, DIMENSION( ims:ime , 1:num_soil_layers , jms:jme ), & - INTENT(OUT) :: SMFR3D - - REAL, DIMENSION( ims:ime , 1:num_soil_layers , jms:jme ),& - INTENT(INOUT) :: SMOIS,SH2O,TSLB - - REAL, DIMENSION( ims:ime, jms:jme ) , & - INTENT(INOUT) :: SNOW, & - SNOWH, & - SNOWC, & - CANWAT, & - MAVAIL, & - SMSTAV, & - SMSTOT, & - SFCRUNOFF, & - UDRUNOFF, & - ACSNOW, & - VEGFRA, & - ACSNOM, & - SFCEVP, & - GRDFLX, & - UST, & -#if ( NMM_CORE == 1 ) - Z0, & -#else - ZNT, & -#endif - XLAND, & - XICE - - INTEGER, DIMENSION( ims:ime, jms:jme ) , & - INTENT(INOUT) :: IVGTYP, & - ISLTYP, & - LOWLYR - - - REAL, DIMENSION(1:num_soil_layers), INTENT(INOUT) :: ZS,DZS - - REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT) :: & - RUBLTEN, & - RVBLTEN, & - EXCH_H, & - RTHBLTEN, & - RQVBLTEN, & - RQCBLTEN, & - RQIBLTEN, & - TKE_MYJ - - REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(IN) :: TSK - REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(INOUT) :: TMN - LOGICAL, INTENT(IN) :: allowed_to_read - INTEGER :: isn, isfc - -!URBAN -! REAL, DIMENSION(1:num_roof_layers), INTENT(INOUT) :: DZR !Optional urban -! REAL, DIMENSION(1:num_wall_layers), INTENT(INOUT) :: DZB !Optional urban -! REAL, DIMENSION(1:num_road_layers), INTENT(INOUT) :: DZG !Optional urban - REAL, OPTIONAL, DIMENSION(1:num_soil_layers), INTENT(INOUT) :: DZR !Optional urban - REAL, OPTIONAL, DIMENSION(1:num_soil_layers), INTENT(INOUT) :: DZB !Optional urban - REAL, OPTIONAL, DIMENSION(1:num_soil_layers), INTENT(INOUT) :: DZG !Optional urban - REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TR_URB2D !Optional urban - REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TB_URB2D !Optional urban - REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TG_URB2D !Optional urban - REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TC_URB2D !Optional urban - REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: QC_URB2D !Optional urban - REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: XXXR_URB2D !Optional urban - REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: XXXB_URB2D !Optional urban - REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: XXXG_URB2D !Optional urban - REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: XXXC_URB2D !Optional urban - REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: SH_URB2D !Optional urban - REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: LH_URB2D !Optional urban - REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: G_URB2D !Optional urban - REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: RN_URB2D !Optional urban - REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TS_URB2D !Optional urban - REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: FRC_URB2D !Optional urban - INTEGER, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: UTYPE_URB2D !Optional urban -! REAL, DIMENSION( ims:ime, 1:num_roof_layers, jms:jme ), INTENT(INOUT) :: TRL_URB3D !Optional urban -! REAL, DIMENSION( ims:ime, 1:num_wall_layers, jms:jme ), INTENT(INOUT) :: TBL_URB3D !Optional urban -! REAL, DIMENSION( ims:ime, 1:num_road_layers, jms:jme ), INTENT(INOUT) :: TGL_URB3D !Optional urban - REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_soil_layers, jms:jme ), INTENT(INOUT) :: TRL_URB3D !Optional urban - REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_soil_layers, jms:jme ), INTENT(INOUT) :: TBL_URB3D !Optional urban - REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_soil_layers, jms:jme ), INTENT(INOUT) :: TGL_URB3D !Optional urban - -! Optional OML variables - REAL, DIMENSION( ims:ime , jms:jme ) , OPTIONAL, INTENT(INOUT) :: & - TML,T0ML,HML,H0ML,HUML,HVML - INTEGER, OPTIONAL, INTENT(IN) :: omlcall - REAL, OPTIONAL, INTENT(IN) :: oml_hml0 - LOGICAL, INTENT(IN) :: start_of_simulation - -!-- calculate pbl time step - - STEPBL = nint(BLDT*60./DT) - STEPBL = max(STEPBL,1) - - -!-- initialize surface layer scheme - - sfclay_select: SELECT CASE(config_flags%sf_sfclay_physics) - - CASE (SFCLAYSCHEME) - CALL sfclayinit( allowed_to_read ) - isfc = 1 - CASE (PXSFCSCHEME) - CALL pxsfclayinit( allowed_to_read ) - isfc = 1 - CASE (MYJSFCSCHEME) - CALL myjsfcinit(LOWLYR,UST, & -#if ( NMM_CORE == 1 ) - Z0, & -#else - ZNT, & -#endif - XLAND,XICE, & - IVGTYP,restart, & - allowed_to_read , & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) - isfc = 2 - - CASE (GFSSFCSCHEME) - CALL myjsfcinit(LOWLYR,UST, & -#if ( NMM_CORE == 1 ) - Z0, & -#else - ZNT, & -#endif - XLAND,XICE, & - IVGTYP,restart, & - allowed_to_read , & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) - isfc = 1 - - CASE DEFAULT - - END SELECT sfclay_select - - -!-- initialize surface scheme - - sfc_select: SELECT CASE(config_flags%sf_surface_physics) - - CASE (SLABSCHEME) - - CALL slabinit(TSK,TMN, & - TSLB,ZS,DZS,num_soil_layers, & - allowed_to_read ,start_of_simulation ,& - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte, & - oml_hml0, omlcall, & - tml, t0ml, hml, h0ml, huml, hvml ) - -#if (NMM_CORE == 1) - CASE (NMMLSMSCHEME) - CALL nmmlsminit(isn,XICE,VEGFRA,SNOW,SNOWC, CANWAT,SMSTAV, & - SMSTOT, SFCRUNOFF,UDRUNOFF,GRDFLX,ACSNOW, & - ACSNOM,IVGTYP,ISLTYP,TSLB,SMOIS,DZS,SFCEVP, & - TMN, & - num_soil_layers, & - allowed_to_read , & - ids,ide, jds,jde, kds,kde, & - ims,ime, jms,jme, kms,kme, & - its,ite, jts,jte, kts,kte ) -#endif - CASE (LSMSCHEME) - CALL LSMINIT(VEGFRA,SNOW,SNOWC,SNOWH,CANWAT,SMSTAV, & - SMSTOT, SFCRUNOFF,UDRUNOFF,ACSNOW, & - ACSNOM,IVGTYP,ISLTYP,TSLB,SMOIS,SH2O,ZS,DZS, & - FNDSOILW, FNDSNOWH, & - num_soil_layers, restart, & - allowed_to_read , & - ids,ide, jds,jde, kds,kde, & - ims,ime, jms,jme, kms,kme, & - its,ite, jts,jte, kts,kte ) - -!URBAN - IF(UCMCALL.eq.1) THEN - - IF ( PRESENT( FRC_URB2D ) .AND. PRESENT( UTYPE_URB2D )) THEN - - CALL urban_param_init(DZR,DZB,DZG,num_soil_layers & !urban - ) -! num_roof_layers,num_wall_layers,road_soil_layers) !urban - CALL urban_var_init(TSK,TSLB,TMN,IVGTYP, & !urban - ims,ime,jms,jme,num_soil_layers, & !urban -! num_roof_layers,num_wall_layers,num_road_layers, & !urban - restart, & !urban - XXXR_URB2D,XXXB_URB2D,XXXG_URB2D,XXXC_URB2D, & !urban - TR_URB2D,TB_URB2D,TG_URB2D,TC_URB2D,QC_URB2D, & !urban - TRL_URB3D,TBL_URB3D,TGL_URB3D, & !urban - SH_URB2D,LH_URB2D,G_URB2D,RN_URB2D, TS_URB2D, & ! urban - FRC_URB2D, UTYPE_URB2D) !urban - ELSE - CALL wrf_error_fatal ( 'arguments not present for calling urban model' ) - ENDIF - ENDIF - - - CASE (RUCLSMSCHEME) -! if(isfc .ne. 2)CALL wrf_error_fatal & -! ( 'module_physics_init: use myjsfc and myjpbl scheme for this lsm option' ) - CALL lsmrucinit( SMFR3D,TSLB,SMOIS,ISLTYP,mavail, & - num_soil_layers, restart, & - allowed_to_read , & - ids,ide, jds,jde, kds,kde, & - ims,ime, jms,jme, kms,kme, & - its,ite, jts,jte, kts,kte ) - - CASE (PXLSMSCHEME) - CALL LSMINIT(VEGFRA,SNOW,SNOWC,SNOWH,CANWAT,SMSTAV, & - SMSTOT, SFCRUNOFF,UDRUNOFF,ACSNOW, & - ACSNOM,IVGTYP,ISLTYP,TSLB,SMOIS,SH2O,ZS,DZS, & - FNDSOILW, FNDSNOWH, & - num_soil_layers, restart, & - allowed_to_read , & - ids,ide, jds,jde, kds,kde, & - ims,ime, jms,jme, kms,kme, & - its,ite, jts,jte, kts,kte ) - - CASE DEFAULT - - END SELECT sfc_select - - -!-- initialize pbl scheme - - pbl_select: SELECT CASE(config_flags%bl_pbl_physics) - - CASE (YSUSCHEME) - if(isfc .ne. 1)CALL wrf_error_fatal & - ( 'module_physics_init: use sfclay scheme for this pbl option' ) - CALL ysuinit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, & - RQCBLTEN,RQIBLTEN,P_QI, & - PARAM_FIRST_SCALAR, & - restart, & - allowed_to_read , & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) - CASE (MRFSCHEME) - if(isfc .ne. 1)CALL wrf_error_fatal & - ( 'module_physics_init: use sfclay scheme for this pbl option' ) - CALL mrfinit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, & - RQCBLTEN,RQIBLTEN,P_QI, & - PARAM_FIRST_SCALAR, & - restart, & - allowed_to_read , & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) - CASE (ACMPBLSCHEME) - if(isfc .ne. 1)CALL wrf_error_fatal & - ( 'module_physics_init: use sfclay scheme for this pbl option' ) - CALL acminit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, & - RQCBLTEN,RQIBLTEN,P_QI, & - PARAM_FIRST_SCALAR, & - restart, & - allowed_to_read , & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) - CASE (GFSSCHEME) - if(isfc .ne. 1)CALL wrf_error_fatal & - ( 'module_physics_init: use sfclay scheme for this pbl option' ) - CALL gfsinit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, & - RQCBLTEN,RQIBLTEN,P_QI, & - PARAM_FIRST_SCALAR, & - restart, & - allowed_to_read , & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) - CASE (MYJPBLSCHEME) - if(isfc .ne. 2)CALL wrf_error_fatal & - ( 'module_physics_init: use myjsfc scheme for this pbl option' ) - CALL myjpblinit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, & - TKE_MYJ,EXCH_H,restart, & - allowed_to_read , & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) - CASE DEFAULT - - END SELECT pbl_select - - END SUBROUTINE bl_init - -!================================================================== - SUBROUTINE cu_init(STEPCU,CUDT,DT,RTHCUTEN,RQVCUTEN,RQRCUTEN, & - RQCCUTEN,RQSCUTEN,RQICUTEN,NCA,RAINC, & - RAINCV,W0AVG,config_flags,restart, & - CLDEFI,LOWLYR,MASS_FLUX, & - RTHFTEN, RQVFTEN, & - APR_GR,APR_W,APR_MC,APR_ST,APR_AS, & - APR_CAPMA,APR_CAPME,APR_CAPMI, & - cugd_tten,cugd_ttens,cugd_qvten, & - cugd_qvtens,cugd_qcten, & - allowed_to_read, start_of_simulation, & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) -!------------------------------------------------------------------ - USE module_cu_kf - USE module_cu_kfeta - USE MODULE_CU_BMJ - USE module_cu_gd, ONLY : GDINIT - USE module_cu_g3, ONLY : G3INIT - USE module_cu_sas -!------------------------------------------------------------------ - IMPLICIT NONE -!------------------------------------------------------------------ - TYPE (grid_config_rec_type) :: config_flags - LOGICAL , INTENT(IN) :: restart - - - INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte - - REAL , INTENT(IN) :: DT, CUDT - LOGICAL , INTENT(IN) :: start_of_simulation - LOGICAL , INTENT(IN) :: allowed_to_read - INTEGER , INTENT(INOUT) :: STEPCU - - REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(INOUT) :: & - RTHCUTEN, RQVCUTEN, RQCCUTEN, RQRCUTEN, RQICUTEN, RQSCUTEN - REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , OPTIONAL, INTENT(INOUT) :: & - cugd_tten,cugd_ttens,cugd_qvten, & - cugd_qvtens,cugd_qcten - - REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT) :: W0AVG - - REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT) :: & - RTHFTEN, RQVFTEN - - REAL , DIMENSION( ims:ime , jms:jme ), INTENT(OUT):: RAINC, RAINCV - - REAL , DIMENSION( ims:ime , jms:jme ), INTENT(OUT):: CLDEFI - - REAL , DIMENSION( ims:ime , jms:jme ), INTENT(INOUT):: NCA - - REAL , DIMENSION( ims:ime , jms:jme ), INTENT(INOUT):: MASS_FLUX, & - APR_GR,APR_W,APR_MC,APR_ST,APR_AS, & - APR_CAPMA,APR_CAPME,APR_CAPMI - - INTEGER, DIMENSION( ims:ime , jms:jme ), INTENT(INOUT):: LOWLYR - -! LOCAL VAR - - INTEGER :: i,j,itf,jtf - -!-------------------------------------------------------------------- - -!-- calculate cumulus parameterization time step - - itf=min0(ite,ide-1) - jtf=min0(jte,jde-1) +!!!!******MARS MARS MARS +!!!!******MARS MARS MARS +!!!!******MARS MARS MARS + +!!===================================================================== +! SUBROUTINE ra_init(id,STEPRA,RADT,DT,RTHRATEN,RTHRATENLW, & +! RTHRATENSW,CLDFRA,EMISS,cen_lat,JULYR,JULDAY,GMT, & +! levsiz,XLAT,n_ozmixm, & +! cldfra_old, & ! Optional +! ozmixm,pin, & ! Optional +! m_ps_1,m_ps_2,m_hybi,aerosolc_1,aerosolc_2, & ! Optional +! paerlev,n_aerosolc, & +! sfull,shalf,pptop,swrad_scat, & +! config_flags,restart, & +! allowed_to_read, start_of_simulation, & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +!!--------------------------------------------------------------------- +! USE module_ra_rrtm +! USE module_ra_cam +! USE module_ra_sw +! USE module_ra_gsfcsw +! USE module_ra_gfdleta +! USE module_ra_hs +! USE module_domain +!!--------------------------------------------------------------------- +! IMPLICIT NONE +!!--------------------------------------------------------------------- +! INTEGER, INTENT(IN) :: id +! TYPE (grid_config_rec_type) :: config_flags +! LOGICAL , INTENT(IN) :: restart +! LOGICAL, INTENT(IN) :: allowed_to_read ! - STEPCU = nint(CUDT*60./DT) - STEPCU = max(STEPCU,1) - -!-- initialization - - IF(start_of_simulation)THEN - DO j=jts,jtf - DO i=its,itf - RAINC(i,j)=0. - RAINCV(i,j)=0. - ENDDO - ENDDO - ENDIF - - cps_select: SELECT CASE(config_flags%cu_physics) - - CASE (KFSCHEME) - CALL kfinit(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQRCUTEN, & - RQICUTEN,RQSCUTEN,NCA,W0AVG,P_QI,P_QS, & - PARAM_FIRST_SCALAR,restart, & - allowed_to_read , & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) - - CASE (BMJSCHEME) - CALL bmjinit(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQRCUTEN, & - CLDEFI,LOWLYR,cp,r_d,restart, & - allowed_to_read , & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) - - CASE (KFETASCHEME) - CALL kf_eta_init(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQRCUTEN, & - RQICUTEN,RQSCUTEN,NCA,W0AVG,P_QI,P_QS, & - SVP1,SVP2,SVP3,SVPT0, & - PARAM_FIRST_SCALAR,restart, & - allowed_to_read , & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) - CASE (GDSCHEME) - CALL gdinit(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQICUTEN, & - MASS_FLUX,cp,restart, & - P_QC,P_QI,PARAM_FIRST_SCALAR, & - RTHFTEN, RQVFTEN, & - APR_GR,APR_W,APR_MC,APR_ST,APR_AS, & - APR_CAPMA,APR_CAPME,APR_CAPMI, & - allowed_to_read , & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) -#if ( EM_CORE == 1 ) - CASE (G3SCHEME) - CALL g3init(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQICUTEN, & - MASS_FLUX,cp,restart, & - P_QC,P_QI,PARAM_FIRST_SCALAR, & - RTHFTEN, RQVFTEN, & - APR_GR,APR_W,APR_MC,APR_ST,APR_AS, & - APR_CAPMA,APR_CAPME,APR_CAPMI, & - cugd_tten,cugd_ttens,cugd_qvten, & - cugd_qvtens,cugd_qcten, & - allowed_to_read , & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) -#endif - CASE (SASSCHEME) - CALL sasinit(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQICUTEN, & - restart,P_QC,P_QI,PARAM_FIRST_SCALAR, & - allowed_to_read , & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) - - CASE DEFAULT - - END SELECT cps_select - - END SUBROUTINE cu_init - -!================================================================== - SUBROUTINE mp_init(RAINNC,config_flags,restart,warm_rain, & - adv_moist_cond, & - MPDT, DT, DX, DY, LOWLYR, & ! for eta mp - F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY, & ! for eta mp - mp_restart_state,tbpvs_state,tbpvs0_state, & ! eta mp - allowed_to_read, start_of_simulation, & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) -!------------------------------------------------------------------ - USE module_mp_wsm3 - USE module_mp_wsm5 - USE module_mp_wsm6 - USE module_mp_etanew - USE module_mp_thompson - USE module_mp_morr_two_moment -!------------------------------------------------------------------ - IMPLICIT NONE -!------------------------------------------------------------------ -! Arguments - TYPE (grid_config_rec_type) :: config_flags - LOGICAL , INTENT(IN) :: restart - LOGICAL , INTENT(OUT) :: warm_rain,adv_moist_cond - REAL , INTENT(IN) :: MPDT, DT, DX, DY - LOGICAL , INTENT(IN) :: start_of_simulation - - INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte - - INTEGER , DIMENSION( ims:ime , jms:jme ) ,INTENT(INOUT) :: LOWLYR - REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(INOUT) :: RAINNC - REAL, DIMENSION( ims:ime , kms:kme, jms:jme ) , INTENT(INOUT) :: & - F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY - REAL , DIMENSION(:) ,INTENT(INOUT) :: mp_restart_state,tbpvs_state,tbpvs0_state - LOGICAL , INTENT(IN) :: allowed_to_read - -! Local - INTEGER :: i, j, itf, jtf - - warm_rain = .false. - adv_moist_cond = .true. - itf=min0(ite,ide-1) - jtf=min0(jte,jde-1) - - IF(start_of_simulation)THEN - DO j=jts,jtf - DO i=its,itf - RAINNC(i,j) = 0. - ENDDO - ENDDO - ENDIF - - mp_select: SELECT CASE(config_flags%mp_physics) - - CASE (KESSLERSCHEME) - warm_rain = .true. - CASE (WSM3SCHEME) - CALL wsm3init(rhoair0,rhowater,rhosnow,cliq,cpv, allowed_to_read ) - CASE (WSM5SCHEME) - CALL wsm5init(rhoair0,rhowater,rhosnow,cliq,cpv, allowed_to_read ) - CASE (WSM6SCHEME) - CALL wsm6init(rhoair0,rhowater,rhosnow,cliq,cpv, allowed_to_read ) - CASE (ETAMPNEW) - adv_moist_cond = .false. - CALL etanewinit (MPDT,DT,DX,DY,LOWLYR,restart, & - F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY, & - mp_restart_state,tbpvs_state,tbpvs0_state,& - allowed_to_read, & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) - CASE (THOMPSON) - CALL thompson_init - CASE (MORR_TWO_MOMENT) - CALL morr_two_moment_init - - CASE DEFAULT - - END SELECT mp_select - - END SUBROUTINE mp_init - -#if ( EM_CORE == 1 ) -!========================================================== - SUBROUTINE fg_init(STEPFG,FGDT,DT,id,RUNDGDTEN,RVNDGDTEN, & - RTHNDGDTEN,RQVNDGDTEN,RMUNDGDTEN, & - config_flags,restart, & - allowed_to_read , & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) - - -!-------------------------------------------------------------------- - USE module_fdda_psufddagd -!-------------------------------------------------------------------- - IMPLICIT NONE -!-------------------------------------------------------------------- - TYPE (grid_config_rec_type) :: config_flags - LOGICAL , INTENT(IN) :: restart - - INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte - - REAL , INTENT(IN) :: DT, FGDT - INTEGER , INTENT(IN) :: id - INTEGER , INTENT(INOUT) :: STEPFG - REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT) :: & - RUNDGDTEN, & - RVNDGDTEN, & - RTHNDGDTEN, & - RQVNDGDTEN - REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(OUT) :: RMUNDGDTEN - - LOGICAL, INTENT(IN) :: allowed_to_read -!-------------------------------------------------------------------- - -!-- calculate pbl time step - - STEPFG = nint(FGDT*60./DT) - STEPFG = max(STEPFG,1) - - -!-- initialize fdda scheme - - fdda_select: SELECT CASE(config_flags%grid_fdda) - - CASE (PSUFDDAGD) - CALL fddagdinit(id,rundgdten,rvndgdten,rthndgdten,rqvndgdten,rmundgdten,& - config_flags%run_hours, & - config_flags%if_no_pbl_nudging_uv, & - config_flags%if_no_pbl_nudging_t, & - config_flags%if_no_pbl_nudging_q, & - config_flags%if_zfac_uv, & - config_flags%k_zfac_uv, & - config_flags%if_zfac_t, & - config_flags%k_zfac_t, & - config_flags%if_zfac_q, & - config_flags%k_zfac_q, & - config_flags%guv, & - config_flags%gt, config_flags%gq, & - config_flags%if_ramping, config_flags%dtramp_min, & - config_flags%gfdda_end_h, & - restart, allowed_to_read, & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) - CASE DEFAULT - - END SELECT fdda_select - - END SUBROUTINE fg_init - -!------------------------------------------------------------------- - SUBROUTINE fdob_init(obs_nudge_opt, maxdom, inest, parid, & - idynin, dtramp, fdaend, restart, & - obs_twindo_cg, obs_twindo, itimestep, & - cen_lat, cen_lon, stand_lon, & - true_lat1, true_lat2, map_proj, & - xlat, xlong, & - s_sn_cg, e_sn_cg, s_we_cg, e_we_cg, & - fdob, ipf_init, & - ids, ide, jds, jde, kds, kde, & - ims, ime, jms, jme, kms, kme, & - its, ite, jts, jte, kts, kte ) - -!-------------------------------------------------------------------- - USE module_domain - USE module_fddaobs_rtfdda - USE module_llxy -!-------------------------------------------------------------------- - IMPLICIT NONE -!-------------------------------------------------------------------- - INTEGER , INTENT(IN) :: maxdom - INTEGER , INTENT(IN) :: obs_nudge_opt(maxdom) - INTEGER , INTENT(IN) :: ids,ide, jds,jde, kds,kde, & - ims,ime, jms,jme, kms,kme, & - its,ite, jts,jte, kts,kte - INTEGER , INTENT(IN) :: inest - INTEGER , INTENT(IN) :: parid(maxdom) - INTEGER , INTENT(IN) :: idynin ! flag for dynamic initialization - REAL , INTENT(IN) :: dtramp ! time period for ramping (idynin) - REAL , INTENT(IN) :: fdaend(maxdom) ! nudging end time for domain (min) - LOGICAL , INTENT(IN) :: restart - REAL , INTENT(IN) :: obs_twindo_cg ! twindo on course grid - REAL , INTENT(IN) :: obs_twindo - INTEGER , INTENT(IN) :: itimestep - REAL , INTENT(IN) :: cen_lat ! domain center latitude - REAL , INTENT(IN) :: cen_lon ! domain center longitude - REAL , INTENT(IN) :: stand_lon ! domain longitude - REAL , INTENT(IN) :: true_lat1 ! domain standard parallel - REAL , INTENT(IN) :: true_lat2 ! domain second standard parallel - INTEGER , INTENT(IN) :: map_proj ! map projection - REAL, DIMENSION( ims:ime, jms:jme ), & - INTENT(IN ) :: xlat, xlong ! lat/long locations on mass point grid - INTEGER, intent(in) :: s_sn_cg ! starting north-south coarse-grid index - INTEGER, intent(in) :: e_sn_cg ! ending north-south coarse-grid index - INTEGER, intent(in) :: s_we_cg ! starting west-east coarse-grid index - INTEGER, intent(in) :: e_we_cg ! ending west-east coarse-grid index - - TYPE(fdob_type), INTENT(INOUT) :: fdob - - INTEGER :: e_sn ! ending north-south grid index - LOGICAL :: ipf_init ! print warnings detected at initialzn -!-------------------------------------------------------------------- -!-- initialize fdda obs-nudging scheme - - IF ( obs_nudge_opt(inest) .eq. 0 ) RETURN - - e_sn = jde - CALL fddaobs_init(obs_nudge_opt, maxdom, inest, parid, & - idynin, dtramp, fdaend, restart, & - obs_twindo_cg, & - obs_twindo, itimestep, & - cen_lat, cen_lon, stand_lon, & - true_lat1, true_lat2, map_proj, & - xlat, xlong, & - e_sn, s_sn_cg, e_sn_cg, s_we_cg, e_we_cg, & - fdob, ipf_init, & - ids,ide, jds,jde, kds,kde, & - ims,ime, jms,jme, kms,kme, & - its,ite, jts,jte, kts,kte) - - END SUBROUTINE fdob_init -#endif +! INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte +! +! INTEGER , INTENT(IN) :: JULDAY,JULYR +! REAL , INTENT(IN) :: DT, RADT, cen_lat, GMT, pptop, & +! swrad_scat +! LOGICAL, INTENT(IN) :: start_of_simulation +! +! INTEGER, INTENT(IN ) :: levsiz, n_ozmixm +! INTEGER, INTENT(IN ) :: paerlev, n_aerosolc +! +! REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(IN) :: XLAT +! +! REAL, DIMENSION( ims:ime, levsiz, jms:jme, n_ozmixm ), OPTIONAL, & +! INTENT(INOUT) :: OZMIXM +! +! REAL, DIMENSION(ims:ime,jms:jme), OPTIONAL, INTENT(INOUT) :: m_ps_1,m_ps_2 +! REAL, DIMENSION(paerlev), OPTIONAL, INTENT(INOUT) :: m_hybi +! REAL, DIMENSION( ims:ime, paerlev, jms:jme, n_aerosolc ), OPTIONAL, & +! INTENT(INOUT) :: aerosolc_1, aerosolc_2 +! +! REAL, DIMENSION(levsiz), OPTIONAL, INTENT(INOUT) :: PIN +! +! INTEGER , INTENT(INOUT) :: STEPRA +! INTEGER :: isn +! +! REAL , DIMENSION( kms:kme ) , INTENT(IN) :: sfull, shalf +! REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT) :: & +! RTHRATEN, & +! RTHRATENLW, & +! RTHRATENSW, & +! CLDFRA +! +! REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , OPTIONAL, INTENT(OUT) :: & +! CLDFRA_OLD +! +! REAL , DIMENSION( ims:ime , jms:jme ) , INTENT(INOUT) :: EMISS +! LOGICAL :: etalw = .false. +! LOGICAL :: camlw = .false. +! LOGICAL :: etamp = .false. +! integer :: month,iday +! INTEGER :: i, j, k, itf, jtf, ktf +!!--------------------------------------------------------------------- +! +! jtf=min0(jte,jde-1) +! ktf=min0(kte,kde-1) +! itf=min0(ite,ide-1) +! +!!--------------------------------------------------------------------- +! +!!-- calculate radiation time step +! +! STEPRA = nint(RADT*60./DT) +! STEPRA = max(STEPRA,1) +! +!!-- initialization +! +! IF(start_of_simulation)THEN +! DO j=jts,jtf +! DO k=kts,ktf +! DO i=its,itf +! RTHRATEN(i,k,j)=0. +! RTHRATENLW(i,k,j)=0. +! RTHRATENSW(i,k,j)=0. +! CLDFRA(i,k,j)=0. +! ENDDO +! ENDDO +! ENDDO +! +! if( present(cldfra_old) ) then +! DO j=jts,jtf +! DO k=kts,ktf +! DO i=its,itf +! cldfra_old(i,k,j) = 0. +! ENDDO +! ENDDO +! ENDDO +! end if +! ENDIF +! +!!-- find out which microphysics option is used first +! +! mp_select: SELECT CASE(config_flags%mp_physics) +! +! CASE (ETAMPNEW) +! etamp = .true. +! +! END SELECT mp_select +! +!!-- chose long wave radiation scheme +! +! lwrad_select: SELECT CASE(config_flags%ra_lw_physics) +! +! CASE (RRTMSCHEME) +! CALL rrtminit( & +! allowed_to_read , & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +! +! CASE (CAMLWSCHEME) +!#ifdef MAC_KLUDGE +! CALL wrf_error_fatal ( 'CAM radiation scheme not supported under the chosen build configuration' ) +!#endif +! IF ( PRESENT( OZMIXM ) .AND. PRESENT( PIN ) .AND. & +! PRESENT(M_PS_1) .AND. PRESENT(M_PS_2) .AND. & +! PRESENT(M_HYBI) .AND. PRESENT(AEROSOLC_1) & +! .AND. PRESENT(AEROSOLC_2)) THEN +! CALL camradinit( & +! R_D,R_V,CP,G,STBOLT,EP_2,shalf,pptop, & +! ozmixm,pin,levsiz,XLAT,n_ozmixm, & +! m_ps_1,m_ps_2,m_hybi,aerosolc_1,aerosolc_2,& +! paerlev, n_aerosolc, & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +! ELSE +! CALL wrf_error_fatal ( 'arguments not present for calling cam radiation' ) +! ENDIF +! +! camlw = .true. +! +! CASE (GFDLLWSCHEME) +! CALL nl_get_start_month(id,month) +! CALL nl_get_start_day(id,iday) +! CALL gfdletainit(emiss,sfull,shalf,pptop, & +! julyr,month,iday,gmt, & +! config_flags,allowed_to_read, & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +! etalw = .true. +! CASE (HELDSUAREZ) +! CALL hsinit(RTHRATEN,restart, & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +! CASE DEFAULT +! +! END SELECT lwrad_select +!!-- initialize short wave radiation scheme +! +! swrad_select: SELECT CASE(config_flags%ra_sw_physics) +! +! CASE (SWRADSCHEME) +! CALL swinit( & +! swrad_scat, & +! allowed_to_read , & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +! +! CASE (CAMSWSCHEME) +!#ifdef MAC_KLUDGE +! CALL wrf_error_fatal ( 'CAM radiation scheme not supported under the chosen build configuration' ) +!#endif +! IF(.not.camlw)THEN +! CALL camradinit( & +! R_D,R_V,CP,G,STBOLT,EP_2,shalf,pptop, & +! ozmixm,pin,levsiz,XLAT,n_ozmixm, & +! m_ps_1,m_ps_2,m_hybi,aerosolc_1,aerosolc_2,& +! paerlev, n_aerosolc, & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +! ENDIF +! +! CASE (GSFCSWSCHEME) +! CALL gsfc_swinit(cen_lat, allowed_to_read ) +! +! CASE (GFDLSWSCHEME) +! IF(.not.etalw)THEN +! CALL nl_get_start_month(id,month) +! CALL nl_get_start_day(id,iday) +! CALL gfdletainit(emiss,sfull,shalf,pptop, & +! julyr,month,iday,gmt, & +! config_flags,allowed_to_read, & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +! ENDIF +! +! CASE DEFAULT +! +! END SELECT swrad_select +! +! END SUBROUTINE ra_init +! +! SUBROUTINE bl_init(STEPBL,BLDT,DT,RUBLTEN,RVBLTEN,RTHBLTEN, & +! RQVBLTEN,RQCBLTEN,RQIBLTEN,TSK,TMN, & +! config_flags,restart,UST,LOWLYR,TSLB,ZS,DZS, & +! num_soil_layers,TKE_MYJ,EXCH_H,VEGFRA, & +! SNOW,SNOWC, CANWAT,SMSTAV, & +! SMSTOT, SFCRUNOFF,UDRUNOFF,ACSNOW,ACSNOM, & +! IVGTYP,ISLTYP,SMOIS,SMFR3D,mavail, & +! SNOWH,SH2O,FNDSOILW, FNDSNOWH, & +!#if ( NMM_CORE == 1 ) +! Z0,XLAND,XICE, & +!#else +! ZNT,XLAND,XICE, & +!#endif +! SFCEVP,GRDFLX, & +! allowed_to_read, & +! start_of_simulation, & +!! num_roof_layers,num_wall_layers,num_road_layers,& !Optional urban +! DZR, DZB, DZG, & !Optional urban +! TR_URB2D,TB_URB2D,TG_URB2D,TC_URB2D,QC_URB2D, & !Optional urban +! XXXR_URB2D,XXXB_URB2D,XXXG_URB2D,XXXC_URB2D, & !Optional urban +! TRL_URB3D, TBL_URB3D, TGL_URB3D, & !Optional urban +! SH_URB2D,LH_URB2D,G_URB2D,RN_URB2D, & !Optional urban +! TS_URB2D, FRC_URB2D, UTYPE_URB2D,UCMCALL, & !Optional urban +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte, & +! oml_hml0, omlcall, & !Optional oml +! TML,T0ML,HML,H0ML,HUML,HVML ) !Optional oml +!!-------------------------------------------------------------------- +! USE module_sf_sfclay +! USE module_sf_slab +! USE module_sf_pxsfclay +! USE module_bl_ysu +! USE module_bl_mrf +! USE module_bl_gfs +! USE module_bl_acm +! USE module_sf_myjsfc +! USE module_sf_noahdrv +! USE module_sf_urban +! USE module_sf_ruclsm +! USE module_sf_pxlsm +! USE module_bl_myjpbl +!#if (NMM_CORE == 1) +! USE module_sf_lsm_nmm +!#endif +!!-------------------------------------------------------------------- +! IMPLICIT NONE +!!-------------------------------------------------------------------- +! TYPE (grid_config_rec_type) :: config_flags +! LOGICAL , INTENT(IN) :: restart +! LOGICAL, INTENT(IN) :: FNDSOILW, FNDSNOWH +! +! INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte +! INTEGER , INTENT(IN) :: num_soil_layers +! INTEGER , INTENT(IN) :: UCMCALL +! +! REAL , INTENT(IN) :: DT, BLDT +! INTEGER , INTENT(INOUT) :: STEPBL +! +! REAL, DIMENSION( ims:ime , 1:num_soil_layers , jms:jme ), & +! INTENT(OUT) :: SMFR3D +! +! REAL, DIMENSION( ims:ime , 1:num_soil_layers , jms:jme ),& +! INTENT(INOUT) :: SMOIS,SH2O,TSLB +! +! REAL, DIMENSION( ims:ime, jms:jme ) , & +! INTENT(INOUT) :: SNOW, & +! SNOWH, & +! SNOWC, & +! CANWAT, & +! MAVAIL, & +! SMSTAV, & +! SMSTOT, & +! SFCRUNOFF, & +! UDRUNOFF, & +! ACSNOW, & +! VEGFRA, & +! ACSNOM, & +! SFCEVP, & +! GRDFLX, & +! UST, & +!#if ( NMM_CORE == 1 ) +! Z0, & +!#else +! ZNT, & +!#endif +! XLAND, & +! XICE +! +! INTEGER, DIMENSION( ims:ime, jms:jme ) , & +! INTENT(INOUT) :: IVGTYP, & +! ISLTYP, & +! LOWLYR +! +! +! REAL, DIMENSION(1:num_soil_layers), INTENT(INOUT) :: ZS,DZS +! +! REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT) :: & +! RUBLTEN, & +! RVBLTEN, & +! EXCH_H, & +! RTHBLTEN, & +! RQVBLTEN, & +! RQCBLTEN, & +! RQIBLTEN, & +! TKE_MYJ +! +! REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(IN) :: TSK +! REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(INOUT) :: TMN +! LOGICAL, INTENT(IN) :: allowed_to_read +! INTEGER :: isn, isfc +! +!!URBAN +!! REAL, DIMENSION(1:num_roof_layers), INTENT(INOUT) :: DZR !Optional urban +!! REAL, DIMENSION(1:num_wall_layers), INTENT(INOUT) :: DZB !Optional urban +!! REAL, DIMENSION(1:num_road_layers), INTENT(INOUT) :: DZG !Optional urban +! REAL, OPTIONAL, DIMENSION(1:num_soil_layers), INTENT(INOUT) :: DZR !Optional urban +! REAL, OPTIONAL, DIMENSION(1:num_soil_layers), INTENT(INOUT) :: DZB !Optional urban +! REAL, OPTIONAL, DIMENSION(1:num_soil_layers), INTENT(INOUT) :: DZG !Optional urban +! REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TR_URB2D !Optional urban +! REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TB_URB2D !Optional urban +! REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TG_URB2D !Optional urban +! REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TC_URB2D !Optional urban +! REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: QC_URB2D !Optional urban +! REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: XXXR_URB2D !Optional urban +! REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: XXXB_URB2D !Optional urban +! REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: XXXG_URB2D !Optional urban +! REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: XXXC_URB2D !Optional urban +! REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: SH_URB2D !Optional urban +! REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: LH_URB2D !Optional urban +! REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: G_URB2D !Optional urban +! REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: RN_URB2D !Optional urban +! REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TS_URB2D !Optional urban +! REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: FRC_URB2D !Optional urban +! INTEGER, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: UTYPE_URB2D !Optional urban +!! REAL, DIMENSION( ims:ime, 1:num_roof_layers, jms:jme ), INTENT(INOUT) :: TRL_URB3D !Optional urban +!! REAL, DIMENSION( ims:ime, 1:num_wall_layers, jms:jme ), INTENT(INOUT) :: TBL_URB3D !Optional urban +!! REAL, DIMENSION( ims:ime, 1:num_road_layers, jms:jme ), INTENT(INOUT) :: TGL_URB3D !Optional urban +! REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_soil_layers, jms:jme ), INTENT(INOUT) :: TRL_URB3D !Optional urban +! REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_soil_layers, jms:jme ), INTENT(INOUT) :: TBL_URB3D !Optional urban +! REAL, OPTIONAL, DIMENSION( ims:ime, 1:num_soil_layers, jms:jme ), INTENT(INOUT) :: TGL_URB3D !Optional urban +! +!! Optional OML variables +! REAL, DIMENSION( ims:ime , jms:jme ) , OPTIONAL, INTENT(INOUT) :: & +! TML,T0ML,HML,H0ML,HUML,HVML +! INTEGER, OPTIONAL, INTENT(IN) :: omlcall +! REAL, OPTIONAL, INTENT(IN) :: oml_hml0 +! LOGICAL, INTENT(IN) :: start_of_simulation +! +!!-- calculate pbl time step +! +! STEPBL = nint(BLDT*60./DT) +! STEPBL = max(STEPBL,1) +! +! +!!-- initialize surface layer scheme +! +! sfclay_select: SELECT CASE(config_flags%sf_sfclay_physics) +! +! CASE (SFCLAYSCHEME) +! CALL sfclayinit( allowed_to_read ) +! isfc = 1 +! CASE (PXSFCSCHEME) +! CALL pxsfclayinit( allowed_to_read ) +! isfc = 1 +! CASE (MYJSFCSCHEME) +! CALL myjsfcinit(LOWLYR,UST, & +!#if ( NMM_CORE == 1 ) +! Z0, & +!#else +! ZNT, & +!#endif +! XLAND,XICE, & +! IVGTYP,restart, & +! allowed_to_read , & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +! isfc = 2 +! +! CASE (GFSSFCSCHEME) +! CALL myjsfcinit(LOWLYR,UST, & +!#if ( NMM_CORE == 1 ) +! Z0, & +!#else +! ZNT, & +!#endif +! XLAND,XICE, & +! IVGTYP,restart, & +! allowed_to_read , & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +! isfc = 1 +! +! CASE DEFAULT +! +! END SELECT sfclay_select +! +! +!!-- initialize surface scheme +! +! sfc_select: SELECT CASE(config_flags%sf_surface_physics) +! +! CASE (SLABSCHEME) +! +! CALL slabinit(TSK,TMN, & +! TSLB,ZS,DZS,num_soil_layers, & +! allowed_to_read ,start_of_simulation ,& +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte, & +! oml_hml0, omlcall, & +! tml, t0ml, hml, h0ml, huml, hvml ) +! +!#if (NMM_CORE == 1) +! CASE (NMMLSMSCHEME) +! CALL nmmlsminit(isn,XICE,VEGFRA,SNOW,SNOWC, CANWAT,SMSTAV, & +! SMSTOT, SFCRUNOFF,UDRUNOFF,GRDFLX,ACSNOW, & +! ACSNOM,IVGTYP,ISLTYP,TSLB,SMOIS,DZS,SFCEVP, & +! TMN, & +! num_soil_layers, & +! allowed_to_read , & +! ids,ide, jds,jde, kds,kde, & +! ims,ime, jms,jme, kms,kme, & +! its,ite, jts,jte, kts,kte ) +!#endif +! CASE (LSMSCHEME) +! CALL LSMINIT(VEGFRA,SNOW,SNOWC,SNOWH,CANWAT,SMSTAV, & +! SMSTOT, SFCRUNOFF,UDRUNOFF,ACSNOW, & +! ACSNOM,IVGTYP,ISLTYP,TSLB,SMOIS,SH2O,ZS,DZS, & +! FNDSOILW, FNDSNOWH, & +! num_soil_layers, restart, & +! allowed_to_read , & +! ids,ide, jds,jde, kds,kde, & +! ims,ime, jms,jme, kms,kme, & +! its,ite, jts,jte, kts,kte ) +! +!!URBAN +! IF(UCMCALL.eq.1) THEN +! +! IF ( PRESENT( FRC_URB2D ) .AND. PRESENT( UTYPE_URB2D )) THEN +! +! CALL urban_param_init(DZR,DZB,DZG,num_soil_layers & !urban +! ) +!! num_roof_layers,num_wall_layers,road_soil_layers) !urban +! CALL urban_var_init(TSK,TSLB,TMN,IVGTYP, & !urban +! ims,ime,jms,jme,num_soil_layers, & !urban +!! num_roof_layers,num_wall_layers,num_road_layers, & !urban +! restart, & !urban +! XXXR_URB2D,XXXB_URB2D,XXXG_URB2D,XXXC_URB2D, & !urban +! TR_URB2D,TB_URB2D,TG_URB2D,TC_URB2D,QC_URB2D, & !urban +! TRL_URB3D,TBL_URB3D,TGL_URB3D, & !urban +! SH_URB2D,LH_URB2D,G_URB2D,RN_URB2D, TS_URB2D, & ! urban +! FRC_URB2D, UTYPE_URB2D) !urban +! ELSE +! CALL wrf_error_fatal ( 'arguments not present for calling urban model' ) +! ENDIF +! ENDIF +! +! +! CASE (RUCLSMSCHEME) +!! if(isfc .ne. 2)CALL wrf_error_fatal & +!! ( 'module_physics_init: use myjsfc and myjpbl scheme for this lsm option' ) +! CALL lsmrucinit( SMFR3D,TSLB,SMOIS,ISLTYP,mavail, & +! num_soil_layers, restart, & +! allowed_to_read , & +! ids,ide, jds,jde, kds,kde, & +! ims,ime, jms,jme, kms,kme, & +! its,ite, jts,jte, kts,kte ) +! +! CASE (PXLSMSCHEME) +! CALL LSMINIT(VEGFRA,SNOW,SNOWC,SNOWH,CANWAT,SMSTAV, & +! SMSTOT, SFCRUNOFF,UDRUNOFF,ACSNOW, & +! ACSNOM,IVGTYP,ISLTYP,TSLB,SMOIS,SH2O,ZS,DZS, & +! FNDSOILW, FNDSNOWH, & +! num_soil_layers, restart, & +! allowed_to_read , & +! ids,ide, jds,jde, kds,kde, & +! ims,ime, jms,jme, kms,kme, & +! its,ite, jts,jte, kts,kte ) +! +! CASE DEFAULT +! +! END SELECT sfc_select +! +! +!!-- initialize pbl scheme +! +! pbl_select: SELECT CASE(config_flags%bl_pbl_physics) +! +! CASE (YSUSCHEME) +! if(isfc .ne. 1)CALL wrf_error_fatal & +! ( 'module_physics_init: use sfclay scheme for this pbl option' ) +! CALL ysuinit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, & +! RQCBLTEN,RQIBLTEN,P_QI, & +! PARAM_FIRST_SCALAR, & +! restart, & +! allowed_to_read , & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +! CASE (MRFSCHEME) +! if(isfc .ne. 1)CALL wrf_error_fatal & +! ( 'module_physics_init: use sfclay scheme for this pbl option' ) +! CALL mrfinit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, & +! RQCBLTEN,RQIBLTEN,P_QI, & +! PARAM_FIRST_SCALAR, & +! restart, & +! allowed_to_read , & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +! CASE (ACMPBLSCHEME) +! if(isfc .ne. 1)CALL wrf_error_fatal & +! ( 'module_physics_init: use sfclay scheme for this pbl option' ) +! CALL acminit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, & +! RQCBLTEN,RQIBLTEN,P_QI, & +! PARAM_FIRST_SCALAR, & +! restart, & +! allowed_to_read , & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +! CASE (GFSSCHEME) +! if(isfc .ne. 1)CALL wrf_error_fatal & +! ( 'module_physics_init: use sfclay scheme for this pbl option' ) +! CALL gfsinit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, & +! RQCBLTEN,RQIBLTEN,P_QI, & +! PARAM_FIRST_SCALAR, & +! restart, & +! allowed_to_read , & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +! CASE (MYJPBLSCHEME) +! if(isfc .ne. 2)CALL wrf_error_fatal & +! ( 'module_physics_init: use myjsfc scheme for this pbl option' ) +! CALL myjpblinit(RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, & +! TKE_MYJ,EXCH_H,restart, & +! allowed_to_read , & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +! CASE DEFAULT +! +! END SELECT pbl_select +! +! END SUBROUTINE bl_init +! +!!================================================================== +! SUBROUTINE cu_init(STEPCU,CUDT,DT,RTHCUTEN,RQVCUTEN,RQRCUTEN, & +! RQCCUTEN,RQSCUTEN,RQICUTEN,NCA,RAINC, & +! RAINCV,W0AVG,config_flags,restart, & +! CLDEFI,LOWLYR,MASS_FLUX, & +! RTHFTEN, RQVFTEN, & +! APR_GR,APR_W,APR_MC,APR_ST,APR_AS, & +! APR_CAPMA,APR_CAPME,APR_CAPMI, & +! cugd_tten,cugd_ttens,cugd_qvten, & +! cugd_qvtens,cugd_qcten, & +! allowed_to_read, start_of_simulation, & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +!!------------------------------------------------------------------ +! USE module_cu_kf +! USE module_cu_kfeta +! USE MODULE_CU_BMJ +! USE module_cu_gd, ONLY : GDINIT +! USE module_cu_g3, ONLY : G3INIT +! USE module_cu_sas +!!------------------------------------------------------------------ +! IMPLICIT NONE +!!------------------------------------------------------------------ +! TYPE (grid_config_rec_type) :: config_flags +! LOGICAL , INTENT(IN) :: restart +! +! +! INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte +! +! REAL , INTENT(IN) :: DT, CUDT +! LOGICAL , INTENT(IN) :: start_of_simulation +! LOGICAL , INTENT(IN) :: allowed_to_read +! INTEGER , INTENT(INOUT) :: STEPCU +! +! REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(INOUT) :: & +! RTHCUTEN, RQVCUTEN, RQCCUTEN, RQRCUTEN, RQICUTEN, RQSCUTEN +! REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , OPTIONAL, INTENT(INOUT) :: & +! cugd_tten,cugd_ttens,cugd_qvten, & +! cugd_qvtens,cugd_qcten +! +! REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT) :: W0AVG +! +! REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT) :: & +! RTHFTEN, RQVFTEN +! +! REAL , DIMENSION( ims:ime , jms:jme ), INTENT(OUT):: RAINC, RAINCV +! +! REAL , DIMENSION( ims:ime , jms:jme ), INTENT(OUT):: CLDEFI +! +! REAL , DIMENSION( ims:ime , jms:jme ), INTENT(INOUT):: NCA +! +! REAL , DIMENSION( ims:ime , jms:jme ), INTENT(INOUT):: MASS_FLUX, & +! APR_GR,APR_W,APR_MC,APR_ST,APR_AS, & +! APR_CAPMA,APR_CAPME,APR_CAPMI +! +! INTEGER, DIMENSION( ims:ime , jms:jme ), INTENT(INOUT):: LOWLYR +! +!! LOCAL VAR +! +! INTEGER :: i,j,itf,jtf +! +!!-------------------------------------------------------------------- +! +!!-- calculate cumulus parameterization time step +! +! itf=min0(ite,ide-1) +! jtf=min0(jte,jde-1) +!! +! STEPCU = nint(CUDT*60./DT) +! STEPCU = max(STEPCU,1) +! +!!-- initialization +! +! IF(start_of_simulation)THEN +! DO j=jts,jtf +! DO i=its,itf +! RAINC(i,j)=0. +! RAINCV(i,j)=0. +! ENDDO +! ENDDO +! ENDIF +! +! cps_select: SELECT CASE(config_flags%cu_physics) +! +! CASE (KFSCHEME) +! CALL kfinit(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQRCUTEN, & +! RQICUTEN,RQSCUTEN,NCA,W0AVG,P_QI,P_QS, & +! PARAM_FIRST_SCALAR,restart, & +! allowed_to_read , & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +! +! CASE (BMJSCHEME) +! CALL bmjinit(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQRCUTEN, & +! CLDEFI,LOWLYR,cp,r_d,restart, & +! allowed_to_read , & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +! +! CASE (KFETASCHEME) +! CALL kf_eta_init(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQRCUTEN, & +! RQICUTEN,RQSCUTEN,NCA,W0AVG,P_QI,P_QS, & +! SVP1,SVP2,SVP3,SVPT0, & +! PARAM_FIRST_SCALAR,restart, & +! allowed_to_read , & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +! CASE (GDSCHEME) +! CALL gdinit(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQICUTEN, & +! MASS_FLUX,cp,restart, & +! P_QC,P_QI,PARAM_FIRST_SCALAR, & +! RTHFTEN, RQVFTEN, & +! APR_GR,APR_W,APR_MC,APR_ST,APR_AS, & +! APR_CAPMA,APR_CAPME,APR_CAPMI, & +! allowed_to_read , & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +!#if ( EM_CORE == 1 ) +! CASE (G3SCHEME) +! CALL g3init(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQICUTEN, & +! MASS_FLUX,cp,restart, & +! P_QC,P_QI,PARAM_FIRST_SCALAR, & +! RTHFTEN, RQVFTEN, & +! APR_GR,APR_W,APR_MC,APR_ST,APR_AS, & +! APR_CAPMA,APR_CAPME,APR_CAPMI, & +! cugd_tten,cugd_ttens,cugd_qvten, & +! cugd_qvtens,cugd_qcten, & +! allowed_to_read , & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +!#endif +! CASE (SASSCHEME) +! CALL sasinit(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQICUTEN, & +! restart,P_QC,P_QI,PARAM_FIRST_SCALAR, & +! allowed_to_read , & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +! +! CASE DEFAULT +! +! END SELECT cps_select +! +! END SUBROUTINE cu_init +! +!!================================================================== +! SUBROUTINE mp_init(RAINNC,config_flags,restart,warm_rain, & +! adv_moist_cond, & +! MPDT, DT, DX, DY, LOWLYR, & ! for eta mp +! F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY, & ! for eta mp +! mp_restart_state,tbpvs_state,tbpvs0_state, & ! eta mp +! allowed_to_read, start_of_simulation, & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +!!------------------------------------------------------------------ +! USE module_mp_wsm3 +! USE module_mp_wsm5 +! USE module_mp_wsm6 +! USE module_mp_etanew +! USE module_mp_thompson +! USE module_mp_morr_two_moment +!!------------------------------------------------------------------ +! IMPLICIT NONE +!!------------------------------------------------------------------ +!! Arguments +! TYPE (grid_config_rec_type) :: config_flags +! LOGICAL , INTENT(IN) :: restart +! LOGICAL , INTENT(OUT) :: warm_rain,adv_moist_cond +! REAL , INTENT(IN) :: MPDT, DT, DX, DY +! LOGICAL , INTENT(IN) :: start_of_simulation +! +! INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte +! +! INTEGER , DIMENSION( ims:ime , jms:jme ) ,INTENT(INOUT) :: LOWLYR +! REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(INOUT) :: RAINNC +! REAL, DIMENSION( ims:ime , kms:kme, jms:jme ) , INTENT(INOUT) :: & +! F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY +! REAL , DIMENSION(:) ,INTENT(INOUT) :: mp_restart_state,tbpvs_state,tbpvs0_state +! LOGICAL , INTENT(IN) :: allowed_to_read +! +!! Local +! INTEGER :: i, j, itf, jtf +! +! warm_rain = .false. +! adv_moist_cond = .true. +! itf=min0(ite,ide-1) +! jtf=min0(jte,jde-1) +! +! IF(start_of_simulation)THEN +! DO j=jts,jtf +! DO i=its,itf +! RAINNC(i,j) = 0. +! ENDDO +! ENDDO +! ENDIF +! +! mp_select: SELECT CASE(config_flags%mp_physics) +! +! CASE (KESSLERSCHEME) +! warm_rain = .true. +! CASE (WSM3SCHEME) +! CALL wsm3init(rhoair0,rhowater,rhosnow,cliq,cpv, allowed_to_read ) +! CASE (WSM5SCHEME) +! CALL wsm5init(rhoair0,rhowater,rhosnow,cliq,cpv, allowed_to_read ) +! CASE (WSM6SCHEME) +! CALL wsm6init(rhoair0,rhowater,rhosnow,cliq,cpv, allowed_to_read ) +! CASE (ETAMPNEW) +! adv_moist_cond = .false. +! CALL etanewinit (MPDT,DT,DX,DY,LOWLYR,restart, & +! F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY, & +! mp_restart_state,tbpvs_state,tbpvs0_state,& +! allowed_to_read, & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +! CASE (THOMPSON) +! CALL thompson_init +! CASE (MORR_TWO_MOMENT) +! CALL morr_two_moment_init +! +! CASE DEFAULT +! +! END SELECT mp_select +! +! END SUBROUTINE mp_init +! +!#if ( EM_CORE == 1 ) +!!========================================================== +! SUBROUTINE fg_init(STEPFG,FGDT,DT,id,RUNDGDTEN,RVNDGDTEN, & +! RTHNDGDTEN,RQVNDGDTEN,RMUNDGDTEN, & +! config_flags,restart, & +! allowed_to_read , & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +! +! +!!-------------------------------------------------------------------- +! USE module_fdda_psufddagd +!!-------------------------------------------------------------------- +! IMPLICIT NONE +!!-------------------------------------------------------------------- +! TYPE (grid_config_rec_type) :: config_flags +! LOGICAL , INTENT(IN) :: restart +! +! INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte +! +! REAL , INTENT(IN) :: DT, FGDT +! INTEGER , INTENT(IN) :: id +! INTEGER , INTENT(INOUT) :: STEPFG +! REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT) :: & +! RUNDGDTEN, & +! RVNDGDTEN, & +! RTHNDGDTEN, & +! RQVNDGDTEN +! REAL, DIMENSION( ims:ime , jms:jme ) , INTENT(OUT) :: RMUNDGDTEN +! +! LOGICAL, INTENT(IN) :: allowed_to_read +!!-------------------------------------------------------------------- +! +!!-- calculate pbl time step +! +! STEPFG = nint(FGDT*60./DT) +! STEPFG = max(STEPFG,1) +! +! +!!-- initialize fdda scheme +! +! fdda_select: SELECT CASE(config_flags%grid_fdda) +! +! CASE (PSUFDDAGD) +! CALL fddagdinit(id,rundgdten,rvndgdten,rthndgdten,rqvndgdten,rmundgdten,& +! config_flags%run_hours, & +! config_flags%if_no_pbl_nudging_uv, & +! config_flags%if_no_pbl_nudging_t, & +! config_flags%if_no_pbl_nudging_q, & +! config_flags%if_zfac_uv, & +! config_flags%k_zfac_uv, & +! config_flags%if_zfac_t, & +! config_flags%k_zfac_t, & +! config_flags%if_zfac_q, & +! config_flags%k_zfac_q, & +! config_flags%guv, & +! config_flags%gt, config_flags%gq, & +! config_flags%if_ramping, config_flags%dtramp_min, & +! config_flags%gfdda_end_h, & +! restart, allowed_to_read, & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +! CASE DEFAULT +! +! END SELECT fdda_select +! +! END SUBROUTINE fg_init +! +!!------------------------------------------------------------------- +! SUBROUTINE fdob_init(obs_nudge_opt, maxdom, inest, parid, & +! idynin, dtramp, fdaend, restart, & +! obs_twindo_cg, obs_twindo, itimestep, & +! cen_lat, cen_lon, stand_lon, & +! true_lat1, true_lat2, map_proj, & +! xlat, xlong, & +! s_sn_cg, e_sn_cg, s_we_cg, e_we_cg, & +! fdob, ipf_init, & +! ids, ide, jds, jde, kds, kde, & +! ims, ime, jms, jme, kms, kme, & +! its, ite, jts, jte, kts, kte ) +! +!!-------------------------------------------------------------------- +! USE module_domain +! USE module_fddaobs_rtfdda +! USE module_llxy +!!-------------------------------------------------------------------- +! IMPLICIT NONE +!!-------------------------------------------------------------------- +! INTEGER , INTENT(IN) :: maxdom +! INTEGER , INTENT(IN) :: obs_nudge_opt(maxdom) +! INTEGER , INTENT(IN) :: ids,ide, jds,jde, kds,kde, & +! ims,ime, jms,jme, kms,kme, & +! its,ite, jts,jte, kts,kte +! INTEGER , INTENT(IN) :: inest +! INTEGER , INTENT(IN) :: parid(maxdom) +! INTEGER , INTENT(IN) :: idynin ! flag for dynamic initialization +! REAL , INTENT(IN) :: dtramp ! time period for ramping (idynin) +! REAL , INTENT(IN) :: fdaend(maxdom) ! nudging end time for domain (min) +! LOGICAL , INTENT(IN) :: restart +! REAL , INTENT(IN) :: obs_twindo_cg ! twindo on course grid +! REAL , INTENT(IN) :: obs_twindo +! INTEGER , INTENT(IN) :: itimestep +! REAL , INTENT(IN) :: cen_lat ! domain center latitude +! REAL , INTENT(IN) :: cen_lon ! domain center longitude +! REAL , INTENT(IN) :: stand_lon ! domain longitude +! REAL , INTENT(IN) :: true_lat1 ! domain standard parallel +! REAL , INTENT(IN) :: true_lat2 ! domain second standard parallel +! INTEGER , INTENT(IN) :: map_proj ! map projection +! REAL, DIMENSION( ims:ime, jms:jme ), & +! INTENT(IN ) :: xlat, xlong ! lat/long locations on mass point grid +! INTEGER, intent(in) :: s_sn_cg ! starting north-south coarse-grid index +! INTEGER, intent(in) :: e_sn_cg ! ending north-south coarse-grid index +! INTEGER, intent(in) :: s_we_cg ! starting west-east coarse-grid index +! INTEGER, intent(in) :: e_we_cg ! ending west-east coarse-grid index +! +! TYPE(fdob_type), INTENT(INOUT) :: fdob +! +! INTEGER :: e_sn ! ending north-south grid index +! LOGICAL :: ipf_init ! print warnings detected at initialzn +!!-------------------------------------------------------------------- +!!-- initialize fdda obs-nudging scheme +! +! IF ( obs_nudge_opt(inest) .eq. 0 ) RETURN +! +! e_sn = jde +! CALL fddaobs_init(obs_nudge_opt, maxdom, inest, parid, & +! idynin, dtramp, fdaend, restart, & +! obs_twindo_cg, & +! obs_twindo, itimestep, & +! cen_lat, cen_lon, stand_lon, & +! true_lat1, true_lat2, map_proj, & +! xlat, xlong, & +! e_sn, s_sn_cg, e_sn_cg, s_we_cg, e_we_cg, & +! fdob, ipf_init, & +! ids,ide, jds,jde, kds,kde, & +! ims,ime, jms,jme, kms,kme, & +! its,ite, jts,jte, kts,kte) +! +! END SUBROUTINE fdob_init +!#endif !-------------------------------------------------------------------- SUBROUTINE z2sigma(zf,zh,sf,sh,p_top,pptop,config_flags, & diff --git a/WRF.COMMON/WRFV3/share/module_model_constants.F b/WRF.COMMON/WRFV3/share/module_model_constants.F index 6cfad577..44c0b46c 100644 --- a/WRF.COMMON/WRFV3/share/module_model_constants.F +++ b/WRF.COMMON/WRFV3/share/module_model_constants.F @@ -1,51 +1,23 @@ !WRF:MODEL_LAYER:CONSTANTS ! +!PLANET MARS MODULE module_model_constants - + USE module_configure ! 2. Following are constants for use in defining real number bounds. ! A really small number. - + character(len=15) :: planet REAL , PARAMETER :: epsilon = 1.E-15 ! 4. Following is information related to the physical constants. - ! These are the physical constants used within the model. - -! JM NOTE -- can we name this grav instead? - REAL , PARAMETER :: g = 9.81 ! acceleration due to gravity (m {s}^-2) - -#if ( NMM_CORE == 1 ) - REAL , PARAMETER :: r_d = 287.04 - REAL , PARAMETER :: cp = 1004.6 -#else - REAL , PARAMETER :: r_d = 287. - REAL , PARAMETER :: cp = 7.*r_d/2. -#endif + ! These are the physical parameter used within the model. - REAL , PARAMETER :: r_v = 461.6 - REAL , PARAMETER :: cv = cp-r_d - REAL , PARAMETER :: cpv = 4.*r_v - REAL , PARAMETER :: cvv = cpv-r_v - REAL , PARAMETER :: cvpm = -cv/cp - REAL , PARAMETER :: cliq = 4190. - REAL , PARAMETER :: cice = 2106. - REAL , PARAMETER :: psat = 610.78 - REAL , PARAMETER :: rcv = r_d/cv - REAL , PARAMETER :: rcp = r_d/cp - REAL , PARAMETER :: rovg = r_d/g - REAL , PARAMETER :: c2 = cp * rcv - real , parameter :: mwdry = 28.966 ! molecular weight of dry air (g/mole) - - REAL , PARAMETER :: p1000mb = 100000. - REAL , PARAMETER :: t0 = 300. - REAL , PARAMETER :: p0 = p1000mb - REAL , PARAMETER :: cpovcv = cp/(cp-r_d) - REAL , PARAMETER :: cvovcp = 1./cpovcv - REAL , PARAMETER :: rvovrd = r_v/r_d - - REAL , PARAMETER :: reradius = 1./6370.0e03 + !! added in WRFV3 + real , parameter :: mwdry = 43.49 ! molecular weight of dry air (g/mole) +! +!------------------------------- REAL , PARAMETER :: asselin = .025 ! REAL , PARAMETER :: asselin = .0 @@ -62,26 +34,31 @@ REAL , PARAMETER :: rhowater = 1000. REAL , PARAMETER :: rhosnow = 100. - REAL , PARAMETER :: rhoair0 = 1.28 - + REAL , PARAMETER :: rhoair0 = 0.02 !Earth Surface density: 1.217 kg/m3 + !Mars Surface density: 0.020 kg/m3 REAL , PARAMETER :: DEGRAD = 3.1415926/180. - REAL , PARAMETER :: DPD = 360./365. + REAL , PARAMETER :: DPD = 360./669. ! longitude solaire d'un jour? REAL , PARAMETER :: SVP1=0.6112 REAL , PARAMETER :: SVP2=17.67 REAL , PARAMETER :: SVP3=29.65 REAL , PARAMETER :: SVPT0=273.15 - REAL , PARAMETER :: EP_1=R_v/R_d-1. - REAL , PARAMETER :: EP_2=R_d/R_v - REAL , PARAMETER :: KARMAN=0.4 - REAL , PARAMETER :: EOMEG=7.2921E-5 - REAL , PARAMETER :: STBOLT=5.67051E-8 + REAL , PARAMETER :: KARMAN=0.4 ! von karman constant + REAL , PARAMETER :: STBOLT=5.67051E-8 ! stefan-boltzmann constant + !! NB: c_s and c_k in WRFV2 moved to module_diffusion_em.F + !! NB: no need in WRFV3 because set in namelist REAL , PARAMETER :: prandtl = 1./3.0 ! constants for w-damping option - REAL , PARAMETER :: w_alpha = 0.3 ! strength m/s/s - REAL , PARAMETER :: w_beta = 1.0 ! activation cfl number +! REAL , PARAMETER :: w_alpha = 0.3 ! strength m/s/s + REAL , PARAMETER :: w_alpha = 2.0 ! strength m/s/s +! REAL , PARAMETER :: w_beta = 1.0 ! activation cfl number + REAL , PARAMETER :: w_beta = 0.8 ! activation cfl number +!! in WRFV3 +! REAL , PARAMETER :: w_alpha = 0.3 ! strength m/s/s +! REAL , PARAMETER :: w_beta = 1.0 ! activation cfl number +!! REAL , PARAMETER :: pq0=379.90516 REAL , PARAMETER :: epsq2=0.2 ! REAL , PARAMETER :: epsq2=0.02 @@ -89,7 +66,6 @@ REAL , PARAMETER :: a3=273.16 REAL , PARAMETER :: a4=35.86 REAL , PARAMETER :: epsq=1.e-12 - REAL , PARAMETER :: p608=rvovrd-1. !#if ( NMM_CORE == 1 ) REAL , PARAMETER :: climit=1.e-20 REAL , PARAMETER :: cm1=2937.4 @@ -102,8 +78,9 @@ REAL , PARAMETER :: epsfc=1./1.05 REAL , PARAMETER :: epswet=0.0 REAL , PARAMETER :: fcdif=1./3. +! REAL , PARAMETER :: fcm=0.003 REAL , PARAMETER :: fcm=0.00003 - REAL , PARAMETER :: gma=-r_d*(1.-rcp)*0.5 +! REAL , PARAMETER :: fcm=0.0 REAL , PARAMETER :: p400=40000.0 REAL , PARAMETER :: phitp=15000.0 REAL , PARAMETER :: pi2=2.*3.1415926 @@ -111,7 +88,6 @@ REAL , PARAMETER :: plomd=64200.0 REAL , PARAMETER :: pmdhi=35000.0 REAL , PARAMETER :: q2ini=0.50 - REAL , PARAMETER :: rfcp=0.25/cp REAL , PARAMETER :: rhcrit_land=0.75 REAL , PARAMETER :: rhcrit_sea=0.80 REAL , PARAMETER :: rlag=14.8125 @@ -123,11 +99,13 @@ REAL , PARAMETER :: wght=0.35 REAL , PARAMETER :: wpc=0.075 REAL , PARAMETER :: z0land=0.10 +! REAL , PARAMETER :: z0max=0.01 REAL , PARAMETER :: z0max=0.008 REAL , PARAMETER :: z0sea=0.001 + REAL, PARAMETER :: r_v=461.6 ! gas constant for water vapor !#endif - +!!!! needed in WRFV3 ! Earth ! The value for P2SI *must* be set to 1.0 for Earth @@ -145,8 +123,202 @@ ! Fraction into the year (from perhelion) of the ! occurrence of the Northern Spring Equinox REAL , PARAMETER :: EQUINOX_FRACTION= 0.0 +!!!! needed in WRFV3 + + ! These are the physical constants planet dependent used within the model. + + real :: g + REAL :: r_d + REAL :: cp + !REAL :: cpp + REAL :: cv + REAL :: cpv + REAL :: cvv + REAL :: cvpm + REAL :: cliq + REAL :: cice + REAL :: psat + REAL :: rcv + REAL :: rcp + REAL :: rovg + REAL :: c2 + REAL :: EOMEG ! angular rotation rate (rad.s-1) + REAL :: p1000mb + REAL :: t0 + REAL :: p0 + REAL :: cpovcv + REAL :: cvovcp + REAL :: rvovrd + REAL :: gma + REAL :: EP_1 + REAL :: EP_2 + REAL :: rfcp + REAL :: p608 + REAL :: rad + REAL :: reradius + Real :: molmas !Molecular mass + + REAL :: wdaysec ! duree du sol (s) ~88775 s + REAL :: wmugaz ! Masse molaire de l'atm (g.mol-1) ~43.49 + REAL :: womeg ! omega (rad.s-1) + REAL :: wyear_day ! Duree de l'annee (sols) ~668.6 + REAL :: wperiheli ! Dist.min. soleil-mars (Mkm) ~206.66 + REAL :: waphelie ! Dist.max. soleil-mars (Mkm) ~249.22 + REAL :: wperi_day ! Date du perihelie (sols depuis printemps) + REAL :: wobliquit ! Obliquite de la planete (deg) ~25.2 + REAL :: wz0 ! surface roughness (m) ~0.01 + REAL :: wlmixmin ! longueur de melange ~100 + REAL :: wemin_turb ! energie minimale ~1.e-8 + REAL :: wemissiv ! Emissivite du sol martien ~.95 + REAL :: wemissiceN ! Emissivite calotte nord + REAL :: wemissiceS ! Emissivite calotte sud + REAL :: walbediceN ! Albedo calotte nord !0.5 + REAL :: walbediceS ! Albedo calotte sud !0.5 + REAL :: wiceradiusN ! mean scat radius of CO2 snow (north) + REAL :: wiceradiusS ! mean scat radius of CO2 snow (south) + REAL :: wdtemisiceN ! time scale for snow metamorphism (north) !2 + REAL :: wdtemisiceS ! time scale for snow metamorphism (south) !2 + REAL :: wvolcapa ! volumetric capacity of soil (new soil model) + REAL :: z_scale ! scale height + + REAL :: TT00 + REAL :: nu CONTAINS - SUBROUTINE init_module_model_constants - END SUBROUTINE init_module_model_constants + SUBROUTINE init_module_model_constants + IMPLICIT NONE + Call initial_config + planet=model_config_rec%planet + !write(*,*) "unknown planet type", planet + !stop + + ! These are the physical constants used within the model + + IF ( planet == "mars" ) then +! JM NOTE -- can we name this grav instead? + g = 3.72 ! acceleration due to gravity (m {s}^-2) + +!#if ( NMM_CORE == 1 ) +! REAL :: r_d = 192. ! gas constant m2 s-2 K-1 +! REAL :: cp = 844.6 ! r= 8.314511E+0 *1000.E+0/mugaz +!#else +! REAL :: r_d = 192. +! REAL :: cp = 844.6 +!#endif + + r_d = 191. + cp = 744.5 + cliq = 4190. + cice = 2106. + psat = 610.78 + t0 = 220. ! earth : 300 ... à remplacer par 220 ? + p0 = 610. + p1000mb = 610. + reradius = 1./3397200. ! Rayon de mars (m) ~3397200 m + EOMEG =7.0721E-5 ! angular rotation rate (rad.s-1) + wdaysec = 88800. ! duree du sol (s) ~88775 s + wmugaz = 43.49 ! Masse molaire de l'atm (g.mol-1) ~43.49 + womeg = 7.0721E-5 ! omega (rad.s-1) + wyear_day = 669. ! Duree de l'annee (sols) ~668.6 + wperiheli = 206.66 ! Dist.min. soleil-mars (Mkm) ~206.66 + waphelie = 249.22 ! Dist.max. soleil-mars (Mkm) ~249.22 + wperi_day = 485. ! Date du perihelie (sols depuis printemps) + wobliquit = 25.2 ! Obliquite de la planete (deg) ~25.2 + wz0 = 1.e-2 ! surface roughness (m) ~0.01 + wlmixmin = 30. ! longueur de melange ~100 + wemin_turb = 1.e-6 ! energie minimale ~1.e-8 + wemissiv = 0.95 ! Emissivite du sol martien ~.95 + wemissiceN = 0.95 ! Emissivite calotte nord + wemissiceS = 0.95 ! Emissivite calotte sud + walbediceN = 0.65 ! Albedo calotte nord !0.5 + walbediceS = 0.65 ! Albedo calotte sud !0.5 + wiceradiusN = 100.e-6 ! mean scat radius of CO2 snow (north) + wiceradiusS = 100.e-6 ! mean scat radius of CO2 snow (south) + wdtemisiceN = 0.4 ! time scale for snow metamorphism (north) !2 + wdtemisiceS = 0.4 ! time scale for snow metamorphism (south) !2 +#ifdef NEWPHYS + wvolcapa = 1.e6 ! volumetric capacity of soil (new soil model) +#endif + TT00=0. + nu=0. +!#endif + ELSE if ( planet == "venus") then + g = 8.87 + r_d = 191.84383904727036 + !cpp = 1000. + cp = 1000. + cliq = 4190. + psat = 610.78 + t0 = 735. ! earth : 300 + p0 = 92.e5 + p1000mb = 92.e5 + reradius = 1./6051800. ! Rayon de mars (m) ~6051800 m + rad = 6051800. + wmugaz = 43.49 + womeg = 0.2992549E-06 + wdaysec = 0.1008707E08 + TT00=460. + nu=0.35 + ELSE if ( planet == "titan") then + g = 1.35 + r_d = 290.6 + !cpp = 1000. + cp = 1051. + cliq = 4190. + psat = 610.78 + t0 = 94. ! earth : 300 + p0 = 1.45e5 + p1000mb = 1.45e5 + reradius = 1./2575500.0 ! Rayon de mars (m) ~6051800 m + rad = 2575500.0 + wmugaz = 28.6 + womeg = 0.2992549E-06 !!!!!!!!!!!!!!!!!!! + wdaysec = 1377665.28 + TT00=0. + nu=0. + ELSE if (( planet == "prescribed").or.(planet == "generic")) then + open(17,file='planet_constant',form='formatted',status='old') + rewind(17) + read(17,*) g + read(17,*) cp + read(17,*) molmas + read(17,*) t0 + read(17,*) p0 + read(17,*) rad + close(17) + r_d=8.314/(molmas*1e-3) + p1000mb=p0 + reradius=1./rad + TT00=0. + nu=0. + Else + write(*,*) "unknown planet type:", planet + stop + endif + cv = cp-r_d + cpv = 3.9*r_v + cvv = cpv-r_v + cvpm = -cv/cp + rcv = r_d/cv + rcp = r_d/cp + rovg = r_d/g + c2 = cp * rcv + cpovcv = cp/(cp-r_d) + cvovcp = 1./cpovcv + rvovrd = r_v/r_d + gma = -r_d*(1.-rcp)*0.5 + EP_1 = r_v/r_d-1. + EP_2 = r_d/r_v + rfcp =0.25/cp + p608 =rvovrd-1. + z_scale =(r_d*t0/g)*1e-3 + write(*,*) "planet : ", planet + write(*,*) "g = ", g + write(*,*) "cp = ", cp + write(*,*) "r_d = ", r_d + write(*,*) "t0 = ", t0 + write(*,*) "p0 = ", p0 + write(*,*) "T0 = ", TT00 + write(*,*) "nu = ", nu + END SUBROUTINE init_module_model_constants END MODULE module_model_constants