Interoperable Physics Driver for NGGPS
GFS Physics Implementation Layer

Layer that invokes individual GFS physics routines. More...

Functions/Subroutines

subroutine gbphys
 

Detailed Description

Layer that invokes individual GFS physics routines.

Function/Subroutine Documentation

subroutine gbphys ( )

This subroutine is the suite driver for the GFS atmospheric physics and surface. It is responsible for calculating and applying tendencies of the atmospheric state variables due to the atmospheric physics and due to the surface layer scheme. In addition, this routine applies radiative heating rates that were calculated during the antecedent call to the radiation scheme. Code within this subroutine is executed on the physics sub-timestep. The sub-timestep loop is executed in the subroutine gloopb.

Parameter descriptions include intent, name, description, and size

Parameters
[in]ix(1),im(1)- integer, horiz dimension and num of used pts
[in]levs(1)- integer, vertical layer dimension
[in]lsoil(1)- integer, number of soil layers
[in]lsm(1)- integer, flag for land surface model to use =0 for osu lsm; =1 for noah lsm
[in]ntrac(1)- integer, number of tracers
[in]ncld(1)- integer, number of cloud species
[in]ntoz(1)- integer, ozone location in the tracer array
[in]ntcw(1)- integer, cloud condensate location in the tracer array
[in]ntke(1)- integer, tke location in the tracer array
[in]nmtvr(1)- integer, number of topographic variables such as variance etc used in the GWD parameterization
[in]nrcm(1)- integer, second dimension for the random number array rann
[in]ko3(1)- integer, number of layers for ozone data
[in]lonr(1),latr(1)- integer, number of lon/lat points
[in]jcap(1)- integer, number of spectral wave trancation used only by sascnv shalcnv
[in]num_p3d(1)- integer, number of 3D arrays needed for microphysics
[in]num_p2d(1)- integer, number of 2D arrays needed for microphysics
[in]npdf3d(1)- integer, number of 3d arrays associated with pdf based clouds/microphysics
[in]ncnvcld3d(1)- integer, number of 3d arrays associated with convective cloudiness enhancement
[in]kdt(1)- integer, number of the current time step
[in]lat(1)- integer, latitude index - used for debug prints
[in]me(1)- integer, pe number - used for debug prints
[in]pl_coeff(1)- integer, number coefficients in ozone forcing
[in]nlons(im)- integer, number of total grid points in a latitude circle through a point
[in]ncw(2)- integer, range of droplet number concentrations for Ferrier microphysics
[in]flgmin(2)- real, range of minimum large ice fraction for Ferrier microphys
[in]crtrh(3)- real, critical relative humidity at the surface, PBL top and at the top of the atmosphere
[in]cdmbgwd(2)- real, multiplication factors for cdmb and gwd
[in]ccwf(2)- real, multiplication factor for critical cloud workfunction for RAS
[in]dlqf(2)- real, factor for cloud condensate detrainment from cloud edges (RAS)
[in]ctei_rm(2)- real, critical cloud top entrainment instability criteria (used if mstrat=.true.)
[in]clstp(1)- real, index used by cnvc90 (for convective clouds) legacy stuff - does not affect forecast
[in]cgwf(2)- real, multiplication factor for convective GWD
[in]prslrd0(1)- real, pressure level (Pa) from which Rayleigh Damping is applied
[in]ral_ts(1)- real time scale for Rayleigh damping in days
[in]dtp(1)- real, physics time step in seconds
[in]dtf(1)- real, dynamics time step in seconds
[in]fhour(1)- real, forecast hour
[in]solhr(1)- real, fcst hour at the end of prev time step
[in]slag(1)- real, equation of time ( radian )
[in]sdec(1),cdec(1)- real, sin and cos of the solar declination angle
[in]sinlat(im)- real, sin of latitude
[in]coslat(im)- real, cos of latitude
[in]pgr(im)- real, surface pressure (Pa)
[in]ugrs(ix,levs),vgrs(ix,levs)- real, u/v component of layer wind
[in]tgrs(ix,levs)- real, layer mean temperature ( k )
[in]qgrs(ix,levs,ntrac)- real, layer mean tracer concentration
[in]vvel(ix,levs)- real, layer mean vertical velocity (Pa/s)
[in]prsi(ix,levs+1)- real, pressure at layer interfaces
[in]prsl(ix,levs)- real, mean layer presure
[in]prsik(ix,levs+1)- real, Exner function at layer interface
[in]prslk(ix,levs)- real, Exner function at layer
[in]phii(ix,levs+1)- real, interface geopotential (m^2/s^2)
[in]phil(ix,levs)- real, layer geopotential (m^2/s^2)
[in]rann(ix,nrcm)- real, random number array (0-1)
[in]prdout(ix,ko3,pl_coeff)- real, ozone forcing data
[in]poz(ko3)- real, ozone forcing data level pressure (ln(Pa))
[in]dpshc(im)- real, maximum pressure depth for shallow convection
[in]hprime(ix,nmtvr)- real, orographic std dev
[in]xlon(im),xlat(im)- real, longitude and latitude ( radian )
[in]slope(im)- real, sfc slope type for lsm
[in]shdmin(im1)- real, min fractional coverage of green veg
[in]shdmax(im1)- real, max fractnl cover of green veg (not used)
[in]snoalb(im1)- real, max snow albedo over land (for deep snow)
[in]tg3(im)- real, deep soil temperature
[in]slmsk(im- real, sea/land/ice mask (=0/1/2)
[in]vfrac(im)- real, vegetation fraction
[in]vtype(im)- real, vegetation type
[in]stype(im)- real, soil type
[in]uustar(im)- real, boundary layer parameter
[in]oro(im)- real, orography
[in]oro_uf(im)- real, unfiltered orography
[in]coszen(im)- real, avg cosz over daytime sw radiation interval
[in]sfcdsw(im)- real, total sky sfc downward sw flux ( w/m**2 )
[in]sfcnsw(im)- real, total sky sfc netsw flx into ground(w/m**2)
[in]sfcdlw(im)- real, total sky sfc downward lw flux ( w/m**2 )
[in]tsflw(im)- real, sfc air (layer 1) temp over lw interval (k)
[in]sfcemis(im)- real, sfc lw emissivity ( fraction )
[in]sfalb(im)- real, mean sfc diffused sw albedo
[in]sfcnirbmu(im)- real, sfc nir-beam sw upward flux (w/m2)
[in]sfcnirdfu(im)- real, sfc nir-diff sw upward flux (w/m2)
[in]sfcvisbmu(im)- real, sfc uv+vis-beam sw upward flux (w/m2)
[in]sfcvisdfu(im)- real, sfc uv+vis-diff sw upward flux (w/m2)
[in]sfcnirbmd(im)- real, sfc nir-beam sw downward flux (w/m2)
[in]sfcnirdfd(im)- real, sfc nir-diff sw downward flux (w/m2)
[in]sfcvisbmd(im)- real, sfc uv+vis-beam sw downward flux (w/m2)
[in]sfcvisdfd(im)- real, sfc uv+vis-diff sw downward flux (w/m2)
[in]slimskin_cpl(im)- real,
[in]ulwsfcin_cpl(im)- real,
[in]dusfcin_cpl(im)- real,
[in]dvsfcin_cpl(im)- real,
[in]dtsfcin_cpl(im)- real,
[in]dqsfcin_cpl(im)- real,
[in]swh(ix,levs)- real, total sky sw heating rates ( k/s )
[in]swhc(ix,levs)- real, clear sky sw heating rates ( k/s )
[in]hlw(ix,levs)- real, total sky lw heating rates ( k/s )
[in]hlwc(ix,levs)- real, clear sky lw heating rates ( k/s )
[in]hlwd(ix,levs)- real, idea sky lw heating rates ( k/s )
[in]ras(1)- logical, flag for ras convection scheme
[in]cscnv(1)- logical, flag for Chikira-Sugiyama convection
[in]nctp(1)- integer, number of cloud types in CS scheme
[in]do_shoc(1)- logical, flag for SHOC
[in]shocaftcnv(1)- logical, flag for SHOC
[in]ntot3d(1)- integer, number of total 3d fields for phy_f3d
[in]ntot2d(1)- integer, number of total 2d fields for phy_f2d
[in]pre_rad(1)- logical, flag for testing purpose
[in]ldiag3d(1)- logical, flag for 3d diagnostic fields
[in]lgocart(1)- logical, flag for 3d diagnostic fields for gocart
[in]lssav(1)- logical, flag controls data store and output
[in]lssav_cpl(1)- logical, flag for save data for A/O/I coupling
[in]flipv(1)- logical, flag for vertical direction flip (ras)
[in]xkzm_m(1)- real, background vertical diffusion for momentum
[in]xkzm_h(1)- real, background vertical diffusion for heat, q
[in]xkzm_s(1)- real, sigma threshold for background mom. diffusn
[in]psautco(2)- real, auto conversion coeff from ice to snow
[in]prautco(2)- real, auto conversion coeff from cloud to rain
[in]evpco(1)- real, coeff for evaporation of largescale rain
[in]wminco(1)- real, water and ice minimum threshold for Zhao
[in]pdfcld(1)- logical, flag for pdfcld
[in]shcnvcw(1)- logical, flag for shallow convective cloud
[in]sup(1)- real, supsaturation for ho. nucleation of ice
[in]redrag(1)- logical, flag for reduced drag coeff. over sea
[in]hybedmf(1)- logical, flag for hybrid edmf pbl scheme
[in]dspheat(1)- logical, flag for tke dissipative heating
[in]old_monin(1)- logical, flag for diff monin schemes
[in]cnvgwd(1)- logical, flag for conv gravity wave drag
[in]shal_cnv(1)- logical, flag for calling shallow convection
[in]imfshalcnv(1)- integer, flag for mass-flux shallow conv scheme
     1: July 2010 version of mass-flux shallow conv scheme
         current operational version as of 2016
     2: scale- & aerosol-aware mass-flux shallow conv scheme (2017)
     0: modified Tiedtke's eddy-diffusion shallow conv scheme
    -1: no shallow convection used
[in]imfdeepcnv(1)- integer, flag for mass-flux deep conv scheme
     1: July 2010 version of SAS conv scheme
           current operational version as of 2016
     2: scale- & aerosol-aware mass-flux deep conv scheme (2017)
     0: old SAS Convection scheme before July 2010
[in]cal_pre(1)- logical, flag controls precip type algorithm
[in]mom4ice(1)- logical, flag controls mom4 sea-ice
[in]mstrat(1)- logical, flag for moorthi approach for stratus
[in]trans_trac(1)- logical, flag for convective transport of tracers
[in]nstf_name(1)- integer array, NSST related flag parameters
     nstf_name(1) : 0 = NSSTM off
                    1 = NSSTM on but uncoupled
                    2 = NSSTM on and coupled
     nstf_name(2) : 1 = NSSTM spin up on
                    0 = NSSTM spin up off
     nstf_name(3) : 1 = NSST analysis on
                    0 = NSSTM analysis off
     nstf_name(4) : zsea1 in mm
     nstf_name(5) : zsea2 in mm
[in]moist_adj(1)- logical, flag for moist convective adjustment
[in]thermodyn_id(1)- integer, valid for GFS only for get_prs/phi
[in]sfcpress_id(1)- integer, valid for GFS only for get_prs/phi
[in]gen_coord_hybrid(1)- logical for pk=ak+bk*ps+ck*theta (Henry)
[in]levr(1)- integer, the number of layers GFS Radiative heating calculted at 1
[in]adjtrc(ntrac)- real, dynamics adjustments to tracers
[in]nnp(1)- integer, physics substep number
[in,out]hice(im)- real, sea-ice thickness
[in,out]fice(im)- real, sea-ice concentration
[in,out]tisfc(im)- real, sea-ice temperature
[in,out]tsea(im)- real, ground surface temperature ( k )
[in,out]tprcp(im)- real, total precipitation the following three variables do not affect the forecast
[in,out]cv(im)- real, convective clouds amountt
[in,out]cvb(im)- real, convective clouds base pressure (kPa)
[in,out]cvt(im)- real, convective clouds top pressure (kPa)
[in,out]srflag(im)- real, snow/rain flag for precipitation
[in,out]snwdph(im)- real, actual snow depth (mm) over land/sea ice
[in,out]weasd(im)- real, water equiv of accumulated snow depth (kg/m**2) over land and sea ice
[in,out]sncovr(im)- real, snow cover over land
[in,out]zorl(im)- real, surface roughness
[in,out]canopy(im)- real, canopy water
[in,out]ffmm(im)- real, fm parameter from PBL scheme
[in,out]ffhh(im)- real, fh parameter from PBL scheme
[in,out]f10m(im)- real, fm at 10m
[in,out]srunoff(im)- real, surface water runoff (from lsm)
[in,out]evbsa(im)- real, noah lsm diagnostics
[in,out]evcwa(im)- real, noah lsm diagnostics
[in,out]snohfa(im)- real, noah lsm diagnostics
[in,out]transa(im)- real, noah lsm diagnostics
[in,out]sbsnoa(im)- real, noah lsm diagnostics
[in,out]snowca(im)- real, noah lsm diagnostics
[in,out]soilm(im)- real, soil moisture
[in,out]tmpmin(im)- real, min temperature at 2m height (k)
[in,out]tmpmax(im)- real, max temperature at 2m height (k)
[in,out]dusfc(im)- real, u component of surface stress
[in,out]dvsfc(im)- real, v component of surface stress
[in,out]dtsfc(im)- real, sensible heat flux (w/m2)
[in,out]dqsfc(im)- real, latent heat flux (w/m2)
[in,out]totprcp(im)- real, accumulated total precipitation (kg/m2)
[in,out]gflux(im)- real, groud conductive heat flux
[in,out]dlwsfc(im)- real, time accumulated sfc dn lw flux ( w/m**2 )
[in,out]ulwsfc(im)- real, time accumulated sfc up lw flux ( w/m**2 )
[in,out]suntim(im)- real, sunshine duration time (s)
[in,out]runoff(im)- real, total water runoff
[in,out]ep(im)- real, potential evaporation
[in,out]cldwrk(im)- real, cloud workfunction (valid only with sas)
[in,out]dugwd(im)- real, vertically integrated u change by OGWD
[in,out]dvgwd(im)- real, vertically integrated v change by OGWD
[in,out]psmean(im)- real, surface pressure (kPa)
[in,out]cnvprcp(im)- real, accumulated convective precipitation (kg/m2)
[in,out]spfhmin(im)- real, minimum specific humidity
[in,out]spfhmax(im)- real, maximum specific humidity
[in,out]rain(im)- real, total rain at this time step
[in,out]rainc(im)- real, convective rain at this time step
[in,out]dt3dt(ix,les,6)- real, temperature change due to physics
[in,out]dq3dt(ix,levs,5+pl_coeff)- real, moisture change due to physics
[in,out]du3dt(ix,levs,4)- real, u momentum change due to physics
[in,out]dv3dt(ix,levs,4)- real, v momentum change due to physics
[in,out]dqdt_v(ix,levs)- real, total moisture tendency (kg/kg/s)
[in,out]cnvqc_v(ix,levs)- real, total convective conensate (kg/kg)
[in,out]acv(im)- real, array containing accumulated convective clouds
[in,out]acvb(im),acvt(im)- real, arrays used by cnvc90
[in,out]slc(ix,soil)- real, liquid soil moisture
[in,out]smc(ix,soil)- real, total soil moisture
[in,out]stc(ix,soil)- real, soil temperature
[in,out]upd_mf(ix,levs)- real, convective updraft mass flux
[in,out]dwn_mf(ix,levs)- real, convective downdraft mass flux
[in,out]det_mf(ix,levs)- real, convective detrainment mass flux
[in,out]dkh(ix,levs)- real, vertical diffusion coefficient (gocart), not used
[in,out]rnp(ix,levs)- real, n cloud precipitation rate (gocart), not used
[in,out]phy_f3d(ix,levs,num_p3d)- real, 3d arrays saved for restart
[in,out]phy_f2d(ix,num_p2d)- real, 2d arrays save for restart
[in,out]dusfc_cpl(im)- real, sfc u-momentum flux for A/O/I coupling
[in,out]dvsfc_cpl(im)- real, sfc v-momentum flux for A/O/I coupling
[in,out]dtsfc_cpl(im)- real, sfc sensible heat flux for A/O/I coupling
[in,out]dqsfc_cpl(im)- real, sfc latent heat flux for A/O/I coupling
[in,out]dlwsfc_cpl(im)- real, sfc dnwd lw flux (w/m**2) for A/O/I coupling
[in,out]dswsfc_cpl(im)- real, sfc dnwd sw flux (w/m**2) for A/O/I coupling
[in,out]dnirbm_cpl(im)- real, sfc nir beam dnwd sw rad flux (w/m**2)
[in,out]dnirdf_cpl(im)- real, sfc nir diff dnwd sw rad flux (w/m**2)
[in,out]dvisbm_cpl(im)- real, sfc uv+vis beam dnwd sw rad flux (w/m**2)
[in,out]dvisdf_cpl(im)- real, sfc uv+vis diff dnwd sw rad flux (w/m**2)
[in,out]nlwsfc_cpl(im)- real, net dnwd lw flux (w/m**2) for A/O/I coupling
[in,out]nswsfc_cpl(im)- real, net dnwd sw flux (w/m**2) for A/O/I coupling
[in,out]nnirbm_cpl(im)- real, net nir beam dnwd sw rad flux (w/m**2)
[in,out]nnirdf_cpl(im)- real, net nir diff dnwd sw rad flux (w/m**2)
[in,out]nvisbm_cpl(im)- real, net uv+vis beam dnwd sw rad flux (w/m**2)
[in,out]nvisdf_cpl(im)- real, net uv+vis diff dnwd sw rad flux (w/m**2)
[in,out]rain_cpl(im)- real, total precipitation rain for A/O/I coupling
[in,out]snow_cpl(im)- real, total precipitation snow for A/O/I coupling
[in,out]xt(im)- real, heat content in DTL
[in,out]xs(im)- real, salinity content in DTL
[in,out]xu(im)- real, u-current content in DTL
[in,out]xv(im)- real, v-current content in DTL
[in,out]xz(im)- real, DTL thickness
[in,out]zm(im)- real, MXL thickness
[in,out]xtts(im)- real, d(xt)/d(ts)
[in,out]xzts(im)- real, d(xz)/d(ts)
[in,out]d_conv(im)- real, thickness of Free Convection Layer (FCL)
[in,out]ifd(im)- real, index to start DTM run or not
[in,out]dt_cool(im)- real, Sub-layer cooling amount
[in,out]Qrain(im)- real, sensible heat flux due to rainfall (watts)
[in,out]phy_fctd(ix,nctp)- real, cloud base mass flux for CScnv
[out]gt0(ix,levs)- real, updated temperature
[out]gq0(ix,levs,ntrac)- real, updated tracers
[out]gu0(ix,levs)- real, updated zonal wind
[out]gv0(ix,levs)- real, update meridional wind
[out]t2m(im),q2m(im)- real, 2 meter temperature and humidity
[out]u10m(im),v10m(im)- real, 10 meater u/v wind speed
[out]zlvl(im)- real, layer 1 height (m)
[out]psurf(im)- real, surface pressure (Pa)
[out]hpbl(im)- real, pbl height (m)
[out]pwat(im)- real, precipitable water
[out]t1(im)- real, layer 1 temperature (K)
[out]q1(im)- real, layer 1 specific humidity (kg/kg)
[out]u1(im)- real, layer 1 zonal wind (m/s)
[out]v1(im)- real, layer 1 merdional wind (m/s)
[out]chh(im)- real, thermal exchange coefficient
[out]cmm(im)- real, momentum exchange coefficient
[out]dlwsfci(im)- real, instantaneous sfc dnwd lw flux ( w/m**2 )
[out]ulwsfci(im)- real, instantaneous sfc upwd lw flux ( w/m**2 )
[out]dswsfci(im)- real, instantaneous sfc dnwd sw flux ( w/m**2 )
[out]uswsfci(im)- real, instantaneous sfc upwd sw flux ( w/m**2 )
[out]dusfci(im)- real, instantaneous u component of surface stress
[out]dvsfci(im)- real, instantaneous v component of surface stress
[out]dtsfci(im)- real, instantaneous sfc sensible heat flux
[out]dqsfci(im)- real, instantaneous sfc latent heat flux
[out]gfluxi(im)- real, instantaneous sfc ground heat flux
[out]epi(im)- real, instantaneous sfc potential evaporation
[out]smcwlt2(im)- real, wilting point (volumetric)
[out]smcref2(im)- real, soil moisture threshold (volumetric)
[out]dusfci_cpl(im)- real, sfc u-momentum flux at time step AOI cpl
[out]dvsfci_cpl(im)- real, sfc v-momentum flux at time step AOI cpl
[out]dtsfci_cpl(im)- real, sfc sensib heat flux at time step AOI cpl
[out]dqsfci_cpl(im)- real, sfc latent heat flux at time step AOI cpl
[out]dlwsfci_cpl(im)- real, sfc dnwd lw flux at time step AOI cpl
[out]dswsfci_cpl(im)- real, sfc dnwd sw flux at time step AOI cpl
[out]dnirbmi_cpl(im)- real, sfc nir beam dnwd sw flx rad at time step
[out]dnirdfi_cpl(im)- real, sfc nir diff dnwd sw flx rad at time step
[out]dvisbmi_cpl(im)- real, sfc uv+vis beam dnwd sw flx at time step
[out]dvisdfi_cpl(im)- real, sfc uv+vis diff dnwd sw flx at time step
[out]nlwsfci_cpl(im)- real, net sfc dnwd lw flux at time step AOI cpl
[out]nswsfci_cpl(im)- real, net sfc dnwd sw flux at time step AOI cpl
[out]nnirbmi_cpl(im)- real, net nir beam dnwd sw flx rad at time step
[out]nnirdfi_cpl(im)- real, net nir diff dnwd sw flx rad at time step
[out]nvisbmi_cpl(im)- real, net uv+vis beam dnwd sw flx at time step
[out]nvisdfi_cpl(im)- real, net uv+vis diff dnwd sw flx at time step
[out]ocalnirbm_cpl(im)- real, ocean alb nir beam (no ice) at time step
[out]ocalnirdf_cpl(im)- real, ocean alb nir diff (no ice) at time step
[out]ocalvisbm_cpl(im)- real, ocean alb vis beam (no ice) at time step
[out]ocalvisdf_cpl(im)- real, ocean alb vis diff (no ice) at time step
[out]t2mi_cpl(im)- real, T2m at time step AOI cpl
[out]q2mi_cpl(im)- real, Q2m at time step AOI cpl
[out]u10mi_cpl(im)- real, U10m at time step AOI cpl
[out]v10mi_cpl(im)- real, V10m at time step AOI cpl
[out]tseai_cpl(im)- real, sfc temp at time step AOI cpl
[out]psurfi_cpl(im)- real, sfc pressure at time step AOI cpl
[out]tref(im)- real, Reference Temperature
[out]z_c(im)- real, Sub-layer cooling thickness
[out]c_0(im)- real, coefficient1 to calculate d(Tz)/d(Ts)
[out]c_d(im)- real, coefficient2 to calculate d(Tz)/d(Ts)
[out]w_0(im)- real, coefficient3 to calculate d(Tz)/d(Ts)
[out]w_d(im)- real, coefficient4 to calculate d(Tz)/d(Ts)
[out]rqtk(im)- real, mass change due to moisture variation
[out]dtdtr(ix,levs)- real, temperature change due to radiative heating per time step (K)

General Algorithm

  1. Prepare input variables for calling individual parameterizations.
  2. Using a two-iteration loop, calculate the state variable tendencies for the surface layer.
  3. Calculate the state variable tendencies due to the PBL (vertical diffusion) scheme.
  4. Calculate the state variable tendencies due to orographic gravity wave drag and Rayleigh damping.
  5. Apply tendencies to the state variables calculated so far:
    • for temperature: radiation, surface, PBL, oro. GWD, Rayleigh damping
    • for momentum: surface, PBL, oro. GWD, Rayleigh damping
    • for water vapor: surface, PBL
  6. Calculate and apply the tendency of ozone.
  7. Prepare input variables for physics routines that update the state variables within their subroutines.
  8. If SHOC is active and is supposed to be called before convection, call it and update the state variables within.
  9. Calculate and apply the state variable tendencies (within the subroutine) due to deep convection.
  10. Calculate the state variable tendencies due to convective gravity wave drag and apply them afterwards.
  11. Calculate and apply the state variable tendencies (within the subroutine) due to shallow convection.
  12. If SHOC is active and is supposed to be called after convection, call it and update the state variables within.
  13. Prepare for microphysics call by calculating preliminary variables.
  14. If necessary, call the moist convective adjustment subroutine and update the state temperature and moisture variable within.
  15. Calculate and apply the state variable tendencies (within the subroutine) due to microphysics.
  16. Determine the precipitation type and update land surface properties if necessary.
  17. Fill the output variables from the local variables as necessary and deallocate allocatable arrays.

Detailed Algorithm

Prepare input variables for calling individual parameterizations.

Before calling any parameterizations, there is a section at the beginning of the subroutine for preparing input arguments to the various schemes based on general input to the driver and initializing variables used throughout the driver.

  • General initialization:
    • set a flag for running in debug mode and the horizontal index of the column to print
    • calculate the pressure at layer centers, the exner function at layer centers and interfaces, geopotential at layer centers and interfaces, and the layer-centered pressure difference
    • calculate the ratio of dynamics time step to physics time step for applying tendencies
    • initialize local tendency arrays to zero
  • Radiation:
    • adjust radiative fluxes and heating rates to the shorter physics time step (from the longer radiation time step), unless idealized physics is true (lsidea) where radiative heating rates are set to 0
    • compute diagnostics from the radiation scheme needed for other schemes (e.g., downward longwave flux absorbed by the surface)
    • accumulate the upward and downward longwave fluxes at the surface
  • Surface:
    • set NOAH and OSU scheme variables from gbphys input arguments and initialize local soil moisture variables
    • set local sea ice variables from gbphys arguments
    • set up A/O/I coupling variables from gbphys arguments
  • PBL:
    • set the number of tracers that are diffused vertically
  • SHOC:
    • determine the index of TKE (ntk) in the convectively transported tracer array (clw)
    • allocate precipitation mixing ratio cloud droplet number concentration arrays
  • Deep Convection:
    • determine which tracers in the tracer input array undergo convective transport (valid only for the RAS and Chikira-Sugiyama schemes) and allocate a local convective transported tracer array (clw)
    • apply an adjustment to the tracers from the dynamics
    • calculate horizontal grid-related parameters needed for some parameterizations
    • calculate the maxiumum cloud base updraft speed for the Chikira-Sugiyama scheme
    • allocate array for cloud water and cloud cover (for non-RAS and non-Chikira-Sugiyama deep convective schemes)
  • Shallow Convection:
    • when using the Tiedtke shallow convection scheme with the stratus modifications, find the lowest model level where a temperature inversion exists in the absence of CTEI
  • Microphysics:
    • for the Morrison (MGB) scheme, calculate 'FRLAND' if the grid point is over land
    • allocate arrays associated with the Morrison scheme
    • assign the local critical relative humidity variables from the gbphys arguments
  • Gravity Wave Drag:
    • calculate the deep convective cloud fraction at cloud top for the convective GWD scheme

Using a two-iteration loop, calculate the state variable tendencies for the surface layer.

  • Each iteration of the loop calls the following:
    • 'sfc_diff' to calculate surface exchange coefficients and near-surface wind
    • surface energy balances routines are called regardless of surface type; the surface type is checked within each to determine whether the routine is "active"
    • for the surface energy balance over the ocean, call 'sfc_nst' if NSST is on, otherwise, call 'sfc_ocean'
    • for the surface energy balance over the land, call 'sfc_drv' for the NOAH model and 'sfc_land' for the OSU model
    • for the surface energy balance over sea ice, call sfc_sice; if A/O/I coupling, call sfc_cice
  • The initial iteration has flag_guess = F unless wind < 2 m/s; flag_iter = T
  • After the initial iteration, flag_guess = F and flag_iter = F (unless wind < 2 m/s and over a land surface or an ocean surface with NSST on)
  • The following actions are performed after the iteration to calculate surface energy balance:
    • set surface output variables from their local values
    • call 'sfc_diag' to calculate state variable values at 2 and 10 m as appropriate from near-surface model levels and the surface exchange coefficients
    • if A/O/I coupling, set coupling variables from local variables and calculate the open water albedo
    • finally, accumulate surface-related diagnostics and calculate the max/min values of T and q at 2 m height.

Calculate the state variable tendencies due to the PBL (vertical diffusion) scheme.

  • Call the vertical diffusion scheme (PBL) based on the following logical flags: do_shoc, hybedmf, old_monin, mstrat
    • the PBL scheme is expected to return tendencies of the state variables
  • If A/O/I coupling and the surface is sea ice, overwrite some surface-related variables to their states before PBL was called
  • For diagnostics, do the following:
    • accumulate surface state variable tendencies and set the instantaneous values for output
    • accumulate the temperature tendency due to the PBL scheme in dt3dt(:,:,3), subtracting out the radiative heating rate if necessary
    • accumulate the u, v tendencies due to the PBL in du3dt(:,:,1:2) and dv3dt(:,:,1:2)
    • accumulate the water vapor tendency due to the PBL in dq3dt(:,:,1)
    • accumulate the ozone tendency in dq3dt(:,:,5)

Calculate the state variable tendencies due to orographic gravity wave drag and Rayleigh damping.

  • Based on the variable nmtvr, unpack orographic gravity wave varibles from the hprime array
  • Call 'gwdps' to calculate tendencies of u, v, T, and surface stress
  • Accumulate gravity wave drag surface stresses.
  • Accumulate change in u, v, and T due to oro. gravity wave drag in du3dt(:,:,2), dv3dt(:,:,2), and dt3dt(:,:,2)
  • Call 'rayleigh_damp' to calculate tendencies to u, v, and T due to Rayleigh friction

Apply tendencies to the state variables calculated so far.

Calculate and apply the tendency of ozone.

  • Prior to ozone physics, call the convective adjustment scheme for IDEA
  • Call 'ozphys_2015' or 'ozphys' depending on the value of pl_coeff, updating the ozone tracer within and outputing the tendency of ozone in dq3dt(:,:,6)
  • Call 'h20phys' if necessary ("adaptation of NRL H20 phys for stratosphere and mesophere")

Prepare input variables for physics routines that update the state variables within their subroutines.

  • If diagnostics is active, save the updated values of the state variables in 'dudt', 'dvdt', 'dTdt', and 'dqdt(:,:,1)'
  • Call 'get_phi' to calculate geopotential from p, q, T
  • Initialize the cloud water and ice portions of the convectively transported tracer array (clw) and (if the deep convective scheme is not RAS or Chikira-Sugiyama) the convective cloud water and cloud cover.
  • If the dep convective scheme is RAS or Chikira-Sugiyama, fill the 'clw' array with tracers to be transported by convection
  • Initialize 'ktop' and 'kbot' (to be modified by all convective schemes except Chikira-Sugiyama)
  • Prepare for microphysics call (if cloud condensate is in the input tracer array):
    • all schemes: calculate critical relative humidity
    • Morrison et al. scheme (occasionally denoted MGB) (when ncld==2): set clw(:,:,1) to cloud ice and clw(:,:,2) to cloud liquid water
    • Ferrier scheme (num_p3d==3): set the cloud water variable and separate hydrometeors into cloud ice, cloud water, and rain; set clw(:,:,1) to cloud ice and clw(:,:,2) to cloud liquid water
    • Zhao-Carr scheme (num_p3d==4): calculate autoconversion coefficients from input constants and grid info; set set clw(:,:,1) to cloud liquid water
    • otherwise: set autoconversion parameters like in Zhao-Carr and set critical relative humidity to 1

If SHOC is active and is supposed to be called before convection, call it and update the state variables within.

  • Prior to calling SHOC, prepare some microphysics variables:
    • if Morrison et al. scheme: set 'skip_macro', fill clw(:,:,1,2) with cloud ice, liquid from the tracer array, and fill cloud droplet number concentration arrays from the input tracer array
    • if Zhao-Carr scheme: initialize precip. mixing ratios to 0, fill clw(:,:,1,2) with cloud ice, liquid from the tracer array (as a function of temperature)
  • Call 'shoc' (modifies state variables within the subroutine)
  • Afterward, set updated cloud number concentrations in the tracer array from the updated 'ncpl' and 'ncpi'

Calculate and apply the state variable tendencies (within the subroutine) due to deep convection.

  • Call deep convective scheme according to the parameter 'imfdeepcnv', 'ras', and 'cscnv'.
    • if imfdeepcnv == 0, 1, or 2, no special processing is needed
    • if the Chikira-Sugiyama scheme (cscnv), convert rain rate to accumulated rain (rain1)
    • if RAS, initialize 'ccwfac', 'dlqfac', 'lmh', and revap before the call to 'rascnv'
  • Zero out 'cld1d' (cloud work function calculated in non-RAS, non-Chikira-Sugiyama schemes)
  • If 'lgocart', accumulate convective mass fluxes and convective cloud water
  • Update tracers in the tracer array (gq0) due to convective transport (RAS, CS only) from the 'clw' array
  • Calculate accumulated surface convective precip. for this physics time step (rainc)
  • If necessary, accumulate cloud work function, convective precipitation, and convective mass fluxes; accumulate dt3dt(:,:,4), dq3dt(:,:,2), du3dt(:,:,3), dv3dt(:,:,3) as change in state variables due to deep convection
  • If 'lgocart', repeat the accumulation of convective mass fluxes and convective cloud water; save convective tendency for water vapor in 'dqdt_v'
  • If PDF-based clouds are active and Zhao-Carr microphysics, save convective cloud cover and water in 'phy_f3d' array
    • otherwise, if non-PDF-based clouds and the "convective cloudiness enhancement" is active, save convective cloud water in 'phy_f3d' array

Calculate the state variable tendencies due to convective gravity wave drag and apply them afterwards.

  • Calculate the average deep convective heating rate in the column to pass into 'gwdc'
  • Call 'gwdc' to calculate tendencies of u, v due to convective GWD
  • For diagnostics, accumulate the vertically-integrated change in u, v due to conv. GWD; accumulate change in u, v, due to conv. GWD in du3dt(:,:,4) and dv3dt(:,:,4)
  • Calculate updated values of u, v, T using conv. GWD tendencies

Calculate and apply the state variable tendencies (within the subroutine) due to shallow convection.

  • If diagnostics are active, set 'dtdt' and 'dqdt' to updated values of T and q before shallow convection
  • If SHOC is not active, do the following:
    • for the mass-flux shallow convection scheme (imfdeepcnv == 1), call 'shalcnv'
    • for the scale- and aerosol-aware scheme (imfshalcnv == 2), call 'mfshalcnv'
    • for either of the first two schemes, perform the following after the call:
      • if Zhao-Carr microphysics with PDF-based clouds, save convective cloud water an cover in 'phy_f3d'
      • if non-PDF-based clouds and convective cloudiness enhancement is active, save convective cloud water in 'phy_f3d'
      • calculate shallow convective precip. and add it to convective precip; accumulate convective precip.
    • for the Tiedtke scheme (imfshalcnv == 0), find the top level where shallow convection must stratosphere
      • if using Moorthi's approach to stratus, call 'shalcv'
      • otherwise, call 'shalcvt3'
    • for diagnostics, accumulate the change in water vapor due to shallow convection and save in dqdt_v if 'lgocart';
      • save the change in T and q due to shallow convection in dt3dt(:,:,5) and dq3dt(:,:,3); reset dtdt and dqdt to the updated values of T, q after shallow Convection
      • if 'clw' is not partitioned into ice/water, set 'clw(ice)' to zero
  • If SHOC is active (and shocaftcnv)
    • if Morrison et al. scheme: set 'skip_macro' and fill cloud droplet number concentration arrays from the input tracer array
    • initialize precip. mixing ratios to 0
    • call 'shoc' (modifies state variables within the subroutine)
    • afterward, set updated cloud number concentrations in the tracer array from the updated 'ncpl' and 'ncpi'

Prepare for microphysics call by calculating preliminary variables.

  • For Morrison et al. microphysics, set cloud water and ice arrays to the convecitvely transported values
  • For Ferrier microphysics, combine convectively transported cloud water and ice with column rain and save in cloud water array
    • calculate and save ice fraction and rain fraction in phy_f3d(1),(2)
  • For Zhao-Carr, combine convectively transported cloud water and ice into the cloud water array
  • Otherwise, combine convectively transported cloud water and ice into the convectively transported cloud water
  • Call 'cnvc90'; a "legacy routine which determines convective clouds"; outputs 'acv','acvb','acvt','cv','cvb','cvt'

If necessary, call the moist convective adjustment subroutine and update the state temperature and moisture variable within.

  • Updates T, q, 'rain1', cloud water array
  • Accumulate convective precip
  • For diagnostics, accumulate the change in T, q due to moist convective adjustment; reset 'dtdt' and 'dqdt' to updated T, q before call to microphysics

Calculate and apply the state variable tendencies (within the subroutine) due to microphysics.

  • If 'lgocart', calculate instantaneous moisture tendency in dqdt_v
  • If no cloud microphysics (ncld == 0), call 'lrgscl' to update T, q and output large scale precipitation and cloud water
  • Otherwise, a more advanced microphysics scheme is called (which scheme depends on values of 'num_p3d','do_shoc',and 'ncld')
  • Ferrier scheme (num_p3d == 3):
    • calculate droplet number concentration and minimum large ice fraction
    • call 'gsmdrive' (modifies T, q, cloud water, 'f_ice', 'f_rain', 'f_rimef', 'rain1')
  • Zhao-Carr-Sundqvist scheme (num_p3d == 4):
    • if non-PDF-based clouds:
      • if 'do_shoc', call 'precpd_shoc' (precpd modified for SHOC)
      • else, call 'gscond' (grid-scale condensation/evaporation); updates water vapor, cloud water, temperature
        • call 'precpd'; updates water vapor, cloud water, temperature and outputs precip., snow ratio, and rain water path
    • for PDF-based clouds:
      • call 'gscondp' followed by 'precpdp' (similar arguments to gscond, precpd above)
  • Morrison et al. scheme (ncld = 2):
    • if 'do_shoc', set clw(1),(2) from updated values; set phy_f3d(:,:,1) from phy_f3d(:,:,ntot3d-2)
    • else, set clw(1),(2) from updated values; set phy_f3d(:,:,1) to cloud cover from previous time step + convective cloud water from convective scheme
    • call 'm_micro_driver'; updates water vapor, temperature, droplet number concentrations, cloud cover
  • Combine large scale and convective precip.
  • For diagnostics, accumulate total surface precipitation and accumulate change in T and q due to microphysics in dt3dt(:,:,6) and dq3dt(:,:,4)

Determine the precipitation type and update land surface properties if necessary.

  • If 'cal_pre', diagnose the surface precipitation type
    • call 'calpreciptype'; set snow flag to 1 if snow or sleet, 0 otherwise
  • For rain/snow decision, calculate temperature at 850 hPa ( \(T_{850}\))
    • If not 'cal_pre', set snow flag to 1 if \(T_{850}\) is below freezing
  • For coupling, accumulate rain if \(T_{850}\) is above freezing, otherwise accumulate snow
  • If using the OSU land model, accumulate surface snow depth if \(T_{850}\) is below freezing and not over an ocean surface
    • call 'progt2' (canopy and soil moisture?) and set the soil liquid water equal to soil total water
    • if 'lgocart', call 'sfc_diag' to update near-surface state variables (this "allows gocart to use filtered wind fields")
  • If necessary (lssav), update the 2m max/min values of T and q
  • If necessary (lssav), accumulate total runoff and surface runoff.

Fill the output variables from the local variables as necessary and deallocate allocatable arrays.

  • Set global sea ice thickness and concentration as well as the temperature of the sea ice
  • Set global soil moisture variables
  • Calculate precipitable water and water vapor mass change due to all physics for the column
  • Deallocate arrays for SHOC scheme, deep convective scheme, and Morrison et al. microphysics

Definition at line 739 of file gbphys.f.

Referenced by gloopb(), and nuopc_physics::nuopc_phys_run().

Here is the caller graph for this function: