From 806dce81e840fbe4a14d70858391aa810cbca517 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Thu, 21 Sep 2017 12:11:48 -0600 Subject: [PATCH 01/48] added table for moninedmf_run; added init and finalize routines --- physics/moninedmf.f | 119 ++++++++++++++++++++++++-------------------- 1 file changed, 64 insertions(+), 55 deletions(-) diff --git a/physics/moninedmf.f b/physics/moninedmf.f index bab282641..2cafe0815 100755 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -13,62 +13,71 @@ !! \section intraphysics Intraphysics Communication !! This space is reserved for a description of how this scheme uses information from other scheme types and/or how information calculated in this scheme is used in other scheme types. + subroutine moninedmf_init() + end subroutine moninedmf_init() + + subroutine moninedmf_finalize() + end subroutine moninedmf_finalize() + !> \brief This subroutine contains all of logic for the Hybrid EDMF PBL scheme except for the calculation of the updraft properties and mass flux. !! !! The scheme works on a basic level by calculating background diffusion coefficients and updating them according to which processes are occurring in the column. The most important difference in diffusion coefficients occurs between those levels in the PBL and those above the PBL, so the PBL height calculation is of utmost importance. An initial estimate is calculated in a "predictor" step in order to calculate Monin-Obukhov similarity values and a corrector step recalculates the PBL height based on updated surface thermal characteristics. Using the PBL height and the similarity parameters, the diffusion coefficients are updated below the PBL top based on Hong and Pan (1996) \cite hong_and_pan_1996 (including counter-gradient terms). Diffusion coefficients in the free troposphere (above the PBL top) are calculated according to Louis (1979) \cite louis_1979 with updated Richardson number-dependent functions. If it is diagnosed that PBL top-down mixing is occurring according to Lock et al. (2000) \cite lock_et_al_2000 , then then diffusion coefficients are updated accordingly. Finally, for convective boundary layers (defined as when the Obukhov length exceeds a threshold), the counter-gradient terms are replaced using the mass flux scheme of Siebesma et al. (2007) \cite siebesma_et_al_2007 . In order to return time tendencies, a fully implicit solution is found using tridiagonal matrices, and time tendencies are "backed out." Before returning, the time tendency of temperature is updated to reflect heating due to TKE dissipation following Han et al. (2015) \cite han_et_al_2015 . !! -!! \param[in] ix horizontal dimension -!! \param[in] im number of used points -!! \param[in] km vertical layer dimension -!! \param[in] ntrac number of tracers -!! \param[in] ntcw cloud condensate index in the tracer array -!! \param[in,out] dv v-momentum tendency (\f$ m s^{-2} \f$) -!! \param[in,out] du u-momentum tendency (\f$ m s^{-2} \f$) -!! \param[in,out] tau temperature tendency (\f$ K s^{-1} \f$) -!! \param[in,out] rtg moisture tendency (\f$ kg kg^{-1} s^{-1} \f$) -!! \param[in] u1 u component of layer wind (\f$ m s^{-1} \f$) -!! \param[in] v1 v component of layer wind (\f$ m s^{-1} \f$) -!! \param[in] t1 layer mean temperature (\f$ K \f$) -!! \param[in] q1 layer mean tracer concentration (units?) -!! \param[in] swh total sky shortwave heating rate (\f$ K s^-1 \f$) -!! \param[in] hlw total sky longwave heating rate (\f$ K s^-1 \f$) -!! \param[in] xmu time step zenith angle adjust factor for shortwave -!! \param[in] psk Exner function at surface interface? -!! \param[in] rbsoil surface bulk Richardson number -!! \param[in] zorl surface roughness (units?) -!! \param[in] u10m 10-m u wind (\f$ m s^{-1} \f$) -!! \param[in] v10m 10-m v wind (\f$ m s^{-1} \f$) -!! \param[in] fm fm parameter from PBL scheme -!! \param[in] fh fh parameter from PBL scheme -!! \param[in] tsea ground surface temperature (K) -!! \param[in] qss surface saturation humidity (units?) -!! \param[in] heat surface sensible heat flux (units?) -!! \param[in] evap evaporation from latent heat flux (units?) -!! \param[in] stress surface wind stress? (\f$ cm*v^2\f$ in sfc_diff subroutine) (units?) -!! \param[in] spd1 surface wind speed? (units?) -!! \param[out] kpbl PBL top index -!! \param[in] prsi pressure at layer interfaces (units?) -!! \param[in] del pressure difference between level k and k+1 (units?) -!! \param[in] prsl mean layer pressure (units?) -!! \param[in] prslk Exner function at layer -!! \param[in] phii interface geopotential height (units?) -!! \param[in] phil layer geopotential height (units?) -!! \param[in] delt physics time step (s) -!! \param[in] dspheat flag for TKE dissipative heating -!! \param[out] dusfc surface u-momentum tendency (units?) -!! \param[out] dvsfc surface v-momentum tendency (units?) -!! \param[out] dtsfc surface temperature tendency (units?) -!! \param[out] dqsfc surface moisture tendency (units?) -!! \param[out] hpbl PBL top height (m) -!! \param[out] hgamt counter gradient mixing term for temperature (units?) -!! \param[out] hgamq counter gradient mixing term for moisture (units?) -!! \param[out] dkt diffusion coefficient for temperature (units?) -!! \param[in] kinver index location of temperature inversion -!! \param[in] xkzm_m background vertical diffusion coefficient for momentum (units?) -!! \param[in] xkzm_h background vertical diffusion coefficeint for heat, moisture (units?) -!! \param[in] xkzm_s sigma threshold for background momentum diffusion (units?) -!! \param[in] lprnt flag to print some output -!! \param[in] ipr index of point to print +!! \section arg_table_moninedmf_run +!! | local var name | longname | description | units | rank | type | kind | intent | optional | +!! |----------------|--------------------------------------------------------|----------------------------------------------------|---------------|------|---------|-----------|--------|----------| +!! | ix | horizontal_dimension | horizontal dimension | index | 0 | integer | | in | F | +!! | im | horizontal_loop_extent | horizontal loop extent, start at 1 | index | 0 | integer | | in | F | +!! | km | vertical_dimension | vertical layer dimension | index | 0 | integer | | in | F | +!! | ntrac | number_of_vertical_diffusion_tracers | number of tracers to diffuse vertically | count | 0 | integer | | in | F | +!! | ntcw | index_for_liquid_cloud_condensate | cloud condensate index in tracer array | index | 0 | integer | | in | F | +!! | dv | tendency_of_y_wind | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | inout | F | +!! | du | tendency_of_x_wind | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | inout | F | +!! | tau | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | inout | F | +!! | rtg | tendency_of_tracers_due_to_model_physics | updated tendency of the tracers | kg kg-1 s-1 | 3 | real | kind_phys | inout | F | +!! | u1 | x_wind | x component of layer wind | m s-1 | 2 | real | kind_phys | in | F | +!! | v1 | y_wind | y component of layer wind | m s-1 | 2 | real | kind_phys | in | F | +!! | t1 | air_temperature | layer mean air temperature | K | 2 | real | kind_phys | in | F | +!! | q1 | tracer_concentration | layer mean tracer concentration | kg kg-1 | 3 | real | kind_phys | in | F | +!! | swh | tendency_of_air_temperature_due_to_shortwave_heating | total sky shortwave heating rate | K s-1 | 2 | real | kind_phys | in | F | +!! | hlw | tendency_of_air_temperature_due_to_longwave_heating | total sky longwave heating rate | K s-1 | 2 | real | kind_phys | in | F | +!! | xmu | time_step_zenith_angle_adjust_factor_for_sw | time step zenith angle adjust factor for shortwave | none | 2 | real | kind_phys | in | F | +!! | psk | exner_function_at_lowest_model_interface | exner function at the surface interface | none | 1 | real | kind_phys | in | F | +!! | rbsoil | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | in | F | +!! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | in | F | +!! | u10m | x_wind_at_10m | x component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | +!! | v10m | y_wind_at_10m | y component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | +!! | fm | Monin-Obukhov_similarity_parameter_for_momentum | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | in | F | +!! | fh | Monin-Obukhov_similarity_parameter_for_heat | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | in | F | +!! | tsea | surface_temperature | surface temperature | K | 1 | real | kind_phys | in | F | +!! | qss | saturation_specific_humidity_at_the_surface | surface saturation specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | +!! | heat | surface_upward_sensible_heat_flux | surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | +!! | evap | evaporation_from_surface_upward_latent_heat_flux | evaporation from surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | +!! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | in | F | +!! | spd1 | wind_speed_at_lowest_model_level | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | in | F | +!! | kpbl | model_level_number_at_top_of_atmosphere_boundary_layer | PBL top model level index | index | 1 | integer | | out | F | +!! | prsi | air_pressure_at_model_layer_interfaces | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | +!! | del | air_pressure_layer_difference | pres(k) - pres(k+1) | Pa | 2 | real | kind_phys | in | F | +!! | prsl | air_pressure_layer | mean layer pressure | Pa | 2 | real | kind_phys | in | F | +!! | prslk | dimensionless_exner_function | Exner function at layers | none | 2 | real | kind_phys | in | F | +!! | phii | geopotential_at_interfaces | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | +!! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | +!! | delt | time_step_for_physics | time step for physics | s | 0 | real | kind_phys | in | F | +!! | dspheat | flag_TKE_dissipation_heating | flag for using TKE dissipation heating | flag | 0 | logical | | in | F | +!! | dusfc | x_momentum_flux | x momentum flux | Pa | 1 | real | kind_phys | out | F | +!! | dvsfc | y_momentum_flux | y momentum flux | Pa | 1 | real | kind_phys | out | F | +!! | dtsfc | surface_upward_sensible_heat_flux | surface upward sensible heat flux | W m-2 | 1 | real | kind_phys | out | F | +!! | dqsfc | surface_upward_latent_heat_flux | surface upward latent heat flux | W m-2 | 1 | real | kind_phys | out | F | +!! | hpbl | atmosphere_boundary_layer_thickness | PBL thickness | m | 1 | real | kind_phys | out | F | +!! | hgamt | countergradient_mixing_term_for_temperature | countergradient mixing term for temperature | K | 1 | real | kind_phys | out | F | +!! | hgamq | countergradient_mixing_term_for_water_vapor | countergradient mixing term for water vapor | kg kg-1 | 1 | real | kind_phys | out | F | +!! | dkt | atmosphere_heat_diffusivity | diffusivity for heat | m2 s-1 | 1 | real | kind_phys | out | F | +!! | kinver | index_of_highest_temperature_inversion | index of highest temperature inversion | index | 1 | integer | | in | F | +!! | xkzm_m | atmosphere_momentum_diffusivity_background | background value of momentum diffusivity | m2 s-1 | 0 | real | kind_phys | in | F | +!! | xkzm_h | atmosphere_heat_diffusivity_background | background value of heat diffusivity | m2 s-1 | 0 | real | kind_phys | in | F | +!! | xkzm_s | diffusivity_background_sigma_level | sigma level threshold for background diffusivity | none | 0 | real | kind_phys | in | F | +!! | lprnt | flag_print | flag for printing diagnostics to output | flag | 0 | logical | | in | F | +!! | ipr | horizontal_index_of_printed_column | horizontal index of printed column | index | 0 | integer | | in | F | !! !! \section general General Algorithm !! -# Compute preliminary variables from input arguments. @@ -86,7 +95,7 @@ !! -# Solve for the horizontal momentum tendencies and add them to output tendency terms. !! \section detailed Detailed Algorithm !! @{ - subroutine moninedmf(ix,im,km,ntrac,ntcw,dv,du,tau,rtg, & + subroutine moninedmf_run (ix,im,km,ntrac,ntcw,dv,du,tau,rtg, & & u1,v1,t1,q1,swh,hlw,xmu, & & psk,rbsoil,zorl,u10m,v10m,fm,fh, & & tsea,qss,heat,evap,stress,spd1,kpbl, & @@ -150,7 +159,7 @@ subroutine moninedmf(ix,im,km,ntrac,ntcw,dv,du,tau,rtg, & & govrth(im), hrad(im), & ! & hradm(im), radmin(im), vrad(im), & & radmin(im), vrad(im), & - & zd(im), zdd(im), thlvx1(im) + & zd(im), zdd(im), thlvx1(im) ! real(kind=kind_phys) rdzt(im,km-1),dktx(im,km-1), & & zi(im,km+1), zl(im,km), xkzo(im,km-1), & @@ -1192,7 +1201,7 @@ subroutine moninedmf(ix,im,km,ntrac,ntcw,dv,du,tau,rtg, & !! \brief Routine to solve the tridiagonal system to calculate temperature and moisture at \f$ t + \Delta t \f$; part of two-part process to calculate time tendencies due to vertical diffusion. !! !! Origin of subroutine unknown. - subroutine tridi2(l,n,cl,cm,cu,r1,r2,au,a1,a2) + subroutine tridi2(l,n,cl,cm,cu,r1,r2,au,a1,a2) cc use machine , only : kind_phys implicit none From 510c88d5eea5ef4d0b4269245c2eb3e3ca2aa1f3 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Thu, 21 Sep 2017 12:19:41 -0600 Subject: [PATCH 02/48] added module and changed names from moninedmf to edmf for simplicity --- physics/moninedmf.f | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/physics/moninedmf.f b/physics/moninedmf.f index 2cafe0815..11835a0b5 100755 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -2,6 +2,10 @@ !! Contains most of the hybrid eddy-diffusivity mass-flux scheme except for the !! subroutine that calculates the mass flux and updraft properties. + module edmf + + contains + !> \defgroup PBL Hybrid Eddy-diffusivity Mass-flux Scheme !! @{ !! \brief The Hybrid EDMF scheme is a first-order turbulent transport scheme used for subgrid-scale vertical turbulent mixing in the PBL and above. It blends the traditional first-order approach that has been used and improved over the last several years with a more recent scheme that uses a mass-flux approach to calculate the countergradient diffusion terms. @@ -13,11 +17,11 @@ !! \section intraphysics Intraphysics Communication !! This space is reserved for a description of how this scheme uses information from other scheme types and/or how information calculated in this scheme is used in other scheme types. - subroutine moninedmf_init() - end subroutine moninedmf_init() + subroutine edmf_init () + end subroutine edmf_init - subroutine moninedmf_finalize() - end subroutine moninedmf_finalize() + subroutine edmf_finalize () + end subroutine edmf_finalize !> \brief This subroutine contains all of logic for the Hybrid EDMF PBL scheme except for the calculation of the updraft properties and mass flux. !! @@ -95,7 +99,7 @@ end subroutine moninedmf_finalize() !! -# Solve for the horizontal momentum tendencies and add them to output tendency terms. !! \section detailed Detailed Algorithm !! @{ - subroutine moninedmf_run (ix,im,km,ntrac,ntcw,dv,du,tau,rtg, & + subroutine edmf_run (ix,im,km,ntrac,ntcw,dv,du,tau,rtg, & & u1,v1,t1,q1,swh,hlw,xmu, & & psk,rbsoil,zorl,u10m,v10m,fm,fh, & & tsea,qss,heat,evap,stress,spd1,kpbl, & @@ -1309,3 +1313,4 @@ subroutine tridin(l,n,nt,cl,cm,cu,r1,r2,au,a1,a2) return end !> @} + end module edmf From aeabd107a2572ac3769d2901344893644a6cdc07 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Thu, 21 Sep 2017 12:46:50 -0600 Subject: [PATCH 03/48] fixed subroutine name for arg_table declaration --- physics/moninedmf.f | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/moninedmf.f b/physics/moninedmf.f index 11835a0b5..ea5c14bf7 100755 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -27,7 +27,7 @@ end subroutine edmf_finalize !! !! The scheme works on a basic level by calculating background diffusion coefficients and updating them according to which processes are occurring in the column. The most important difference in diffusion coefficients occurs between those levels in the PBL and those above the PBL, so the PBL height calculation is of utmost importance. An initial estimate is calculated in a "predictor" step in order to calculate Monin-Obukhov similarity values and a corrector step recalculates the PBL height based on updated surface thermal characteristics. Using the PBL height and the similarity parameters, the diffusion coefficients are updated below the PBL top based on Hong and Pan (1996) \cite hong_and_pan_1996 (including counter-gradient terms). Diffusion coefficients in the free troposphere (above the PBL top) are calculated according to Louis (1979) \cite louis_1979 with updated Richardson number-dependent functions. If it is diagnosed that PBL top-down mixing is occurring according to Lock et al. (2000) \cite lock_et_al_2000 , then then diffusion coefficients are updated accordingly. Finally, for convective boundary layers (defined as when the Obukhov length exceeds a threshold), the counter-gradient terms are replaced using the mass flux scheme of Siebesma et al. (2007) \cite siebesma_et_al_2007 . In order to return time tendencies, a fully implicit solution is found using tridiagonal matrices, and time tendencies are "backed out." Before returning, the time tendency of temperature is updated to reflect heating due to TKE dissipation following Han et al. (2015) \cite han_et_al_2015 . !! -!! \section arg_table_moninedmf_run +!! \section arg_table_edmf_run !! | local var name | longname | description | units | rank | type | kind | intent | optional | !! |----------------|--------------------------------------------------------|----------------------------------------------------|---------------|------|---------|-----------|--------|----------| !! | ix | horizontal_dimension | horizontal dimension | index | 0 | integer | | in | F | From 10b460a278d3570f3c4cee9f6f50b62a8ac7efb2 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Mon, 25 Sep 2017 15:08:47 -0600 Subject: [PATCH 04/48] changed GFS_physics_driver.F90 to use the edmf module and changed the call to edmf_run --- GFS_layer/GFS_physics_driver.F90 | 45 ++++++++++++++++---------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/GFS_layer/GFS_physics_driver.F90 b/GFS_layer/GFS_physics_driver.F90 index 9b92e4764..5c2f59a64 100644 --- a/GFS_layer/GFS_physics_driver.F90 +++ b/GFS_layer/GFS_physics_driver.F90 @@ -4,7 +4,7 @@ module module_physics_driver use physcons, only: con_cp, con_fvirt, con_g, con_rd, & con_rv, con_hvap, con_hfus, & con_rerth, con_pi, rhc_max, dxmin,& - dxinv, pa2mb, rlapse + dxinv, pa2mb, rlapse use cs_conv, only: cs_convr use ozne_def, only: levozp, oz_coeff, oz_pres use h2o_def, only: levh2o, h2o_coeff, h2o_pres @@ -15,6 +15,7 @@ module module_physics_driver GFS_control_type, GFS_grid_type, & GFS_tbd_type, GFS_cldprop_type, & GFS_radtend_type, GFS_diag_type + use edmf, only: edmf_run implicit none @@ -27,7 +28,7 @@ module module_physics_driver real(kind=kind_phys), parameter :: hsub = con_hvap+con_hfus real(kind=kind_phys), parameter :: czmin = 0.0001 ! cos(89.994) real(kind=kind_phys), parameter :: onebg = 1.0/con_g - real(kind=kind_phys), parameter :: albdf = 0.06 + real(kind=kind_phys), parameter :: albdf = 0.06 real(kind=kind_phys) tf, tcr, tcrf parameter (tf=258.16, tcr=273.16, tcrf=1.0/(tcr-tf)) @@ -422,14 +423,14 @@ subroutine GFS_physics_driver & flag_cice logical, dimension(Model%ntrac-Model%ncld+2,2) :: & - otspt + otspt !--- REAL VARIABLES real(kind=kind_phys) :: & dtf, dtp, rhbbot, rhbtop, rhpbl, frain, tem, tem1, tem2, & xcosz_loc, zsea1, zsea2, eng0, eng1, dpshc, & - !--- experimental for shoc sub-stepping - dtshoc + !--- experimental for shoc sub-stepping + dtshoc real(kind=kind_phys), dimension(size(Grid%xlon,1)) :: & ccwfac, garea, dlength, cumabs, cice, zice, tice, gflx, & @@ -460,7 +461,7 @@ subroutine GFS_physics_driver & del, rhc, dtdt, dudt, dvdt, gwdcu, gwdcv, dtdtc, rainp, & ud_mf, dd_mf, dt_mf, prnum, dkt, sigmatot, sigmafrac - !--- GFDL modification for FV3 + !--- GFDL modification for FV3 real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levs+1) ::& del_gz @@ -468,7 +469,7 @@ subroutine GFS_physics_driver & dqdt real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levs,Model%nctp) :: & - sigmai, vverti + sigmai, vverti real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levs,oz_coeff+5) :: & dq3dt_loc @@ -477,7 +478,7 @@ subroutine GFS_physics_driver & !--- in clw, the first two varaibles are cloud water and ice. !--- from third to ntrac are convective transportable tracers, !--- third being the ozone, when ntrac=3 (valid only with ras) - !--- Anning Cheng 9/21/2016 leave a hook here for diagnosed snow, + !--- Anning Cheng 9/21/2016 leave a hook here for diagnosed snow, !--- rain, and their number real(kind=kind_phys), allocatable :: & clw(:,:,:), qpl(:,:), qpi(:,:), ncpl(:,:), ncpi(:,:), & @@ -1012,7 +1013,7 @@ subroutine GFS_physics_driver & Model%lsm, lprnt, ipr, & ! --- input/outputs: zice, cice, tice, Sfcprop%weasd, Sfcprop%tsfc, & - Sfcprop%tprcp, stsoil, ep1d, & + Sfcprop%tprcp, stsoil, ep1d, & ! --- outputs: Sfcprop%snowd, qss, snowmt, gflx, Diag%cmm, Diag%chh, evap, & hflx) @@ -1189,7 +1190,7 @@ subroutine GFS_physics_driver & Model%xkzm_m, Model%xkzm_h, Model%xkzm_s, lprnt, ipr, me) else if (Model%hybedmf) then - call moninedmf(ix, im, levs, nvdiff, Model%ntcw, dvdt, dudt, dtdt, dqdt,& + call edmf_run (ix, im, levs, nvdiff, Model%ntcw, dvdt, dudt, dtdt, dqdt,& Statein%ugrs, Statein%vgrs, Statein%tgrs, Statein%qgrs, & Radtend%htrsw, Radtend%htrlw, xmu, Statein%prsik(1,1), & rb, Sfcprop%zorl, Diag%u10m, Diag%v10m, Sfcprop%ffmm, & @@ -1904,7 +1905,7 @@ subroutine GFS_physics_driver & if (Model%cnvgwd) then ! call convective gravity wave drag -! --- ... calculate maximum convective heating rate +! --- ... calculate maximum convective heating rate ! cuhr = temperature change due to deep convection cumabs(:) = 0.0 @@ -2238,7 +2239,7 @@ subroutine GFS_physics_driver & Stateout%gq0(1,1,1), clw(1,1,1), clw(1,1,2), qpi, qpl,rhc, & Model%sup, Tbd%phy_f3d(1,1,Model%ntot3d-2), & Stateout%gq0(1,1,Model%ntke), hflx, evap, prnum, & - Tbd%phy_f3d(1,1,Model%ntot3d-1), Tbd%phy_f3d(1,1,Model%ntot3d),& + Tbd%phy_f3d(1,1,Model%ntot3d-1), Tbd%phy_f3d(1,1,Model%ntot3d),& lprnt, ipr, ncpl, ncpi, kdt) if ((Model%ntlnc > 0) .and. (Model%ntinc > 0) .and. (Model%ncld >= 2)) then @@ -2428,13 +2429,13 @@ subroutine GFS_physics_driver & ncpr(:,:) = 0. ncps(:,:) = 0. Tbd%phy_f3d(:,:,1) = Tbd%phy_f3d(:,:,Model%ntot3d-2) ! clouds from shoc - else + else clw(:,:,1) = Stateout%gq0(:,:,Model%ntiw) ! ice clw(:,:,2) = Stateout%gq0(:,:,Model%ntcw) ! water - qrn(:,:) = Stateout%gq0(:,:,Model%ntrw) - qsnw(:,:) = Stateout%gq0(:,:,Model%ntsw) - ncpr(:,:) = Stateout%gq0(:,:,Model%ntrnc) - ncps(:,:) = Stateout%gq0(:,:,Model%ntsnc) + qrn(:,:) = Stateout%gq0(:,:,Model%ntrw) + qsnw(:,:) = Stateout%gq0(:,:,Model%ntsw) + ncpr(:,:) = Stateout%gq0(:,:,Model%ntrnc) + ncps(:,:) = Stateout%gq0(:,:,Model%ntsnc) Tbd%phy_f3d(:,:,1) = Tbd%phy_f3d(:,:,Model%ntot3d-2) ! clouds from shoc end if elseif ((Model%imfdeepcnv >= 0) .or. (Model%imfshalcnv > 0)) then @@ -2470,10 +2471,10 @@ subroutine GFS_physics_driver & else clw(:,:,1) = Stateout%gq0(:,:,Model%ntiw) ! ice clw(:,:,2) = Stateout%gq0(:,:,Model%ntcw) ! water - qrn(:,:) = Stateout%gq0(:,:,Model%ntrw) - qsnw(:,:) = Stateout%gq0(:,:,Model%ntsw) - ncpr(:,:) = Stateout%gq0(:,:,Model%ntrnc) - ncps(:,:) = Stateout%gq0(:,:,Model%ntsnc) + qrn(:,:) = Stateout%gq0(:,:,Model%ntrw) + qsnw(:,:) = Stateout%gq0(:,:,Model%ntsw) + ncpr(:,:) = Stateout%gq0(:,:,Model%ntrnc) + ncps(:,:) = Stateout%gq0(:,:,Model%ntsnc) Tbd%phy_f3d(:,:,1) = min(1.0, Tbd%phy_f3d(:,:,1)+cnvc(:,:)) endif endif @@ -2812,7 +2813,7 @@ subroutine moist_bud(im,ix,ix2,levs,me,kdt,grav,dtp,delp,rain, & ! endif enddo return - + end subroutine moist_bud !> @} From 1c3829e23d46d08aa09112d7ca0618c70f4636a3 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Mon, 25 Sep 2017 20:13:52 -0600 Subject: [PATCH 05/48] added edmf_ prefix to other subs in moninedmf.f; changed actual argument to edmf_run call in GFS_physics_driver to array --- GFS_layer/GFS_physics_driver.F90 | 2 +- physics/moninedmf.f | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/GFS_layer/GFS_physics_driver.F90 b/GFS_layer/GFS_physics_driver.F90 index 5c2f59a64..d675c93d0 100644 --- a/GFS_layer/GFS_physics_driver.F90 +++ b/GFS_layer/GFS_physics_driver.F90 @@ -1192,7 +1192,7 @@ subroutine GFS_physics_driver & if (Model%hybedmf) then call edmf_run (ix, im, levs, nvdiff, Model%ntcw, dvdt, dudt, dtdt, dqdt,& Statein%ugrs, Statein%vgrs, Statein%tgrs, Statein%qgrs, & - Radtend%htrsw, Radtend%htrlw, xmu, Statein%prsik(1,1), & + Radtend%htrsw, Radtend%htrlw, xmu, Statein%prsik(:,1), & rb, Sfcprop%zorl, Diag%u10m, Diag%v10m, Sfcprop%ffmm, & Sfcprop%ffhh, Sfcprop%tsfc, qss, hflx, evap, stress, & wind, kpbl, Statein%prsi, del, Statein%prsl, & diff --git a/physics/moninedmf.f b/physics/moninedmf.f index ea5c14bf7..24381a3f1 100755 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -1047,8 +1047,8 @@ subroutine edmf_run (ix,im,km,ntrac,ntcw,dv,du,tau,rtg, & ! ! solve tridiagonal problem for heat and moisture ! -!> The tridiagonal system is solved by calling the internal ::tridin subroutine. - call tridin(im,km,ntrac,al,ad,au,a1,a2,au,a1,a2) +!> The tridiagonal system is solved by calling the internal ::edmf_tridin subroutine. + call edmf_tridin(im,km,ntrac,al,ad,au,a1,a2,au,a1,a2) ! ! recover tendencies of heat and moisture @@ -1162,7 +1162,7 @@ subroutine edmf_run (ix,im,km,ntrac,ntcw,dv,du,tau,rtg, & ! ! solve tridiagonal problem for momentum ! - call tridi2(im,km,al,ad,au,a1,a2,au,a1,a2) + call edmf_tridi2(im,km,al,ad,au,a1,a2,au,a1,a2) ! ! recover tendencies of momentum ! @@ -1205,7 +1205,7 @@ subroutine edmf_run (ix,im,km,ntrac,ntcw,dv,du,tau,rtg, & !! \brief Routine to solve the tridiagonal system to calculate temperature and moisture at \f$ t + \Delta t \f$; part of two-part process to calculate time tendencies due to vertical diffusion. !! !! Origin of subroutine unknown. - subroutine tridi2(l,n,cl,cm,cu,r1,r2,au,a1,a2) + subroutine edmf_tridi2(l,n,cl,cm,cu,r1,r2,au,a1,a2) cc use machine , only : kind_phys implicit none @@ -1248,7 +1248,7 @@ subroutine tridi2(l,n,cl,cm,cu,r1,r2,au,a1,a2) !! \brief Routine to solve the tridiagonal system to calculate u- and v-momentum at \f$ t + \Delta t \f$; part of two-part process to calculate time tendencies due to vertical diffusion. !! !! Origin of subroutine unknown. - subroutine tridin(l,n,nt,cl,cm,cu,r1,r2,au,a1,a2) + subroutine edmf_tridin(l,n,nt,cl,cm,cu,r1,r2,au,a1,a2) cc use machine , only : kind_phys implicit none From 43c5943a61a7db8511808b8dd467e94bbe981b9a Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Mon, 25 Sep 2017 20:31:49 -0600 Subject: [PATCH 06/48] fixed line continuation character in moninedmf.f --- physics/moninedmf.f | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/moninedmf.f b/physics/moninedmf.f index 24381a3f1..bec543bfd 100755 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -99,7 +99,7 @@ end subroutine edmf_finalize !! -# Solve for the horizontal momentum tendencies and add them to output tendency terms. !! \section detailed Detailed Algorithm !! @{ - subroutine edmf_run (ix,im,km,ntrac,ntcw,dv,du,tau,rtg, & + subroutine edmf_run (ix,im,km,ntrac,ntcw,dv,du,tau,rtg, & & u1,v1,t1,q1,swh,hlw,xmu, & & psk,rbsoil,zorl,u10m,v10m,fm,fh, & & tsea,qss,heat,evap,stress,spd1,kpbl, & From ec3938d4db489c7abc718085d089e46f00cf1493 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Wed, 4 Oct 2017 17:19:07 -0600 Subject: [PATCH 07/48] argument table fixes --- physics/moninedmf.f | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/physics/moninedmf.f b/physics/moninedmf.f index bec543bfd..c1884ef83 100755 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -53,18 +53,18 @@ end subroutine edmf_finalize !! | v10m | y_wind_at_10m | y component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | !! | fm | Monin-Obukhov_similarity_parameter_for_momentum | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | in | F | !! | fh | Monin-Obukhov_similarity_parameter_for_heat | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | in | F | -!! | tsea | surface_temperature | surface temperature | K | 1 | real | kind_phys | in | F | +!! | tsea | surface_skin_temperature | surface temperature | K | 1 | real | kind_phys | in | F | !! | qss | saturation_specific_humidity_at_the_surface | surface saturation specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | !! | heat | surface_upward_sensible_heat_flux | surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | !! | evap | evaporation_from_surface_upward_latent_heat_flux | evaporation from surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | !! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | in | F | -!! | spd1 | wind_speed_at_lowest_model_level | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | in | F | -!! | kpbl | model_level_number_at_top_of_atmosphere_boundary_layer | PBL top model level index | index | 1 | integer | | out | F | -!! | prsi | air_pressure_at_model_layer_interfaces | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | -!! | del | air_pressure_layer_difference | pres(k) - pres(k+1) | Pa | 2 | real | kind_phys | in | F | -!! | prsl | air_pressure_layer | mean layer pressure | Pa | 2 | real | kind_phys | in | F | +!! | spd1 | surface_wind_speed | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | in | F | +!! | kpbl | vertical_index_for_top_of_atmosphere_boundary_layer | PBL top model level index | index | 1 | integer | | out | F | +!! | prsi | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | +!! | del | air_pressure_difference_between_midlayers | pres(k) - pres(k+1) | Pa | 2 | real | kind_phys | in | F | +!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | !! | prslk | dimensionless_exner_function | Exner function at layers | none | 2 | real | kind_phys | in | F | -!! | phii | geopotential_at_interfaces | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | +!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | !! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | !! | delt | time_step_for_physics | time step for physics | s | 0 | real | kind_phys | in | F | !! | dspheat | flag_TKE_dissipation_heating | flag for using TKE dissipation heating | flag | 0 | logical | | in | F | @@ -1243,6 +1243,7 @@ subroutine edmf_tridi2(l,n,cl,cm,cu,r1,r2,au,a1,a2) c----------------------------------------------------------------------- return end + c----------------------------------------------------------------------- !> \ingroup PBL !! \brief Routine to solve the tridiagonal system to calculate u- and v-momentum at \f$ t + \Delta t \f$; part of two-part process to calculate time tendencies due to vertical diffusion. From d8eb319620f0285697f73951e017a3be206b23d7 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Wed, 4 Oct 2017 17:25:21 -0600 Subject: [PATCH 08/48] more changes to argument table --- physics/moninedmf.f | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/physics/moninedmf.f b/physics/moninedmf.f index c1884ef83..8d6e5fe40 100755 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -35,8 +35,8 @@ end subroutine edmf_finalize !! | km | vertical_dimension | vertical layer dimension | index | 0 | integer | | in | F | !! | ntrac | number_of_vertical_diffusion_tracers | number of tracers to diffuse vertically | count | 0 | integer | | in | F | !! | ntcw | index_for_liquid_cloud_condensate | cloud condensate index in tracer array | index | 0 | integer | | in | F | -!! | dv | tendency_of_y_wind | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | inout | F | -!! | du | tendency_of_x_wind | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | inout | F | +!! | dv | tendency_of_y_wind_due_to_model_physics | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | inout | F | +!! | du | tendency_of_x_wind_due_to_model_physics | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | inout | F | !! | tau | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | inout | F | !! | rtg | tendency_of_tracers_due_to_model_physics | updated tendency of the tracers | kg kg-1 s-1 | 3 | real | kind_phys | inout | F | !! | u1 | x_wind | x component of layer wind | m s-1 | 2 | real | kind_phys | in | F | @@ -58,8 +58,8 @@ end subroutine edmf_finalize !! | heat | surface_upward_sensible_heat_flux | surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | !! | evap | evaporation_from_surface_upward_latent_heat_flux | evaporation from surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | !! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | in | F | -!! | spd1 | surface_wind_speed | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | in | F | -!! | kpbl | vertical_index_for_top_of_atmosphere_boundary_layer | PBL top model level index | index | 1 | integer | | out | F | +!! | spd1 | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | in | F | +!! | kpbl | vertical_index_of_top_of_atmosphere_boundary_layer | PBL top model level index | index | 1 | integer | | out | F | !! | prsi | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | !! | del | air_pressure_difference_between_midlayers | pres(k) - pres(k+1) | Pa | 2 | real | kind_phys | in | F | !! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | From b5be301a458376f1a94933643f99fd067cecb919 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Thu, 5 Oct 2017 12:45:25 -0600 Subject: [PATCH 09/48] changes to edmf_run argument table --- physics/moninedmf.f | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/physics/moninedmf.f b/physics/moninedmf.f index 8d6e5fe40..1dda9ecf5 100755 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -51,12 +51,11 @@ end subroutine edmf_finalize !! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | in | F | !! | u10m | x_wind_at_10m | x component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | !! | v10m | y_wind_at_10m | y component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | -!! | fm | Monin-Obukhov_similarity_parameter_for_momentum | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | in | F | -!! | fh | Monin-Obukhov_similarity_parameter_for_heat | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | in | F | +!! | fm | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | in | F | +!! | fh | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | in | F | !! | tsea | surface_skin_temperature | surface temperature | K | 1 | real | kind_phys | in | F | -!! | qss | saturation_specific_humidity_at_the_surface | surface saturation specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | -!! | heat | surface_upward_sensible_heat_flux | surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | -!! | evap | evaporation_from_surface_upward_latent_heat_flux | evaporation from surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | +!! | heat | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | +!! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | !! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | in | F | !! | spd1 | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | in | F | !! | kpbl | vertical_index_of_top_of_atmosphere_boundary_layer | PBL top model level index | index | 1 | integer | | out | F | @@ -72,7 +71,7 @@ end subroutine edmf_finalize !! | dvsfc | y_momentum_flux | y momentum flux | Pa | 1 | real | kind_phys | out | F | !! | dtsfc | surface_upward_sensible_heat_flux | surface upward sensible heat flux | W m-2 | 1 | real | kind_phys | out | F | !! | dqsfc | surface_upward_latent_heat_flux | surface upward latent heat flux | W m-2 | 1 | real | kind_phys | out | F | -!! | hpbl | atmosphere_boundary_layer_thickness | PBL thickness | m | 1 | real | kind_phys | out | F | +!! | hpbl | atmosphere_boundary_layer_thickness | PBL thickness | m | 1 | real | kind_phys | out | F | !! | hgamt | countergradient_mixing_term_for_temperature | countergradient mixing term for temperature | K | 1 | real | kind_phys | out | F | !! | hgamq | countergradient_mixing_term_for_water_vapor | countergradient mixing term for water vapor | kg kg-1 | 1 | real | kind_phys | out | F | !! | dkt | atmosphere_heat_diffusivity | diffusivity for heat | m2 s-1 | 1 | real | kind_phys | out | F | @@ -102,7 +101,7 @@ end subroutine edmf_finalize subroutine edmf_run (ix,im,km,ntrac,ntcw,dv,du,tau,rtg, & & u1,v1,t1,q1,swh,hlw,xmu, & & psk,rbsoil,zorl,u10m,v10m,fm,fh, & - & tsea,qss,heat,evap,stress,spd1,kpbl, & + & tsea,heat,evap,stress,spd1,kpbl, & & prsi,del,prsl,prslk,phii,phil,delt,dspheat, & & dusfc,dvsfc,dtsfc,dqsfc,hpbl,hgamt,hgamq,dkt, & & kinver,xkzm_m,xkzm_h,xkzm_s,lprnt,ipr) @@ -129,7 +128,7 @@ subroutine edmf_run (ix,im,km,ntrac,ntcw,dv,du,tau,rtg, & & rbsoil(im), zorl(im), & & u10m(im), v10m(im), & & fm(im), fh(im), & - & tsea(im), qss(im), & + & tsea(im), & & spd1(im), & & prsi(ix,km+1), del(ix,km), & & prsl(ix,km), prslk(ix,km), & From 079668a658d8bdb757055ecd3559ee1fce974ba9 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Tue, 31 Oct 2017 13:05:42 -0600 Subject: [PATCH 10/48] added GFS generic PBL interstitial code --- GFS_layer/GFS_physics_driver.F90 | 97 +++++++++++++++------------- makefile | 2 +- physics/GFS_PBL_generic.f90 | 106 +++++++++++++++++++++++++++++++ 3 files changed, 159 insertions(+), 46 deletions(-) create mode 100644 physics/GFS_PBL_generic.f90 diff --git a/GFS_layer/GFS_physics_driver.F90 b/GFS_layer/GFS_physics_driver.F90 index d675c93d0..a9fdc24ba 100644 --- a/GFS_layer/GFS_physics_driver.F90 +++ b/GFS_layer/GFS_physics_driver.F90 @@ -16,6 +16,8 @@ module module_physics_driver GFS_tbd_type, GFS_cldprop_type, & GFS_radtend_type, GFS_diag_type use edmf, only: edmf_run + use GFS_PBL_generic, only: GFS_PBL_generic_pre, & + GFS_PBL_generic_post implicit none @@ -790,8 +792,10 @@ subroutine GFS_physics_driver & endif endif ! end if_lssav_block + call GFS_PBL_generic_pre(im, levs, kinver) + kcnv(:) = 0 - kinver(:) = levs + !kinver(:) = levs invrsn(:) = .false. tx1(:) = 0.0 tx2(:) = 10.0 @@ -1269,56 +1273,59 @@ subroutine GFS_physics_driver & Coupling%dtsfci_cpl(:) = dtsfc1(:) Coupling%dqsfci_cpl(:) = dqsfc1(:) endif -!-------------------------------------------------------lssav if loop ---------- - if (Model%lssav) then - Diag%dusfc (:) = Diag%dusfc(:) + dusfc1(:)*dtf - Diag%dvsfc (:) = Diag%dvsfc(:) + dvsfc1(:)*dtf - Diag%dtsfc (:) = Diag%dtsfc(:) + dtsfc1(:)*dtf - Diag%dqsfc (:) = Diag%dqsfc(:) + dqsfc1(:)*dtf - Diag%dusfci(:) = dusfc1(:) - Diag%dvsfci(:) = dvsfc1(:) - Diag%dtsfci(:) = dtsfc1(:) - Diag%dqsfci(:) = dqsfc1(:) -! if (lprnt) then -! write(0,*)' dusfc=',dusfc(ipr),' dusfc1=',dusfc1(ipr),' dtf=', -! & dtf,' kdt=',kdt,' lat=',lat -! endif - if (Model%ldiag3d) then - if (Model%lsidea) then - Diag%dt3dt(:,:,3) = Diag%dt3dt(:,:,3) + dtdt(:,:)*dtf - else - do k = 1, levs - do i = 1, im - tem = dtdt(i,k) - (Radtend%htrlw(i,k)+Radtend%htrsw(i,k)*xmu(i)) - Diag%dt3dt(i,k,3) = Diag%dt3dt(i,k,3) + tem*dtf - enddo - enddo - endif - Diag%du3dt(:,:,1) = Diag%du3dt(:,:,1) + dudt(:,:) * dtf - Diag%du3dt(:,:,2) = Diag%du3dt(:,:,2) - dudt(:,:) * dtf - Diag%dv3dt(:,:,1) = Diag%dv3dt(:,:,1) + dvdt(:,:) * dtf - Diag%dv3dt(:,:,2) = Diag%dv3dt(:,:,2) - dvdt(:,:) * dtf -! update dqdt_v to include moisture tendency due to vertical diffusion -! if (lgocart) then + call GFS_PBL_generic_post(Grid, Model, Radtend, dusfc1, dvsfc1, & + dtsfc1, dqsfc1, dudt, dvdt, dtdt, dqdt, xmu, Diag) +! !-------------------------------------------------------lssav if loop ---------- +! if (Model%lssav) then +! Diag%dusfc (:) = Diag%dusfc(:) + dusfc1(:)*dtf +! Diag%dvsfc (:) = Diag%dvsfc(:) + dvsfc1(:)*dtf +! Diag%dtsfc (:) = Diag%dtsfc(:) + dtsfc1(:)*dtf +! Diag%dqsfc (:) = Diag%dqsfc(:) + dqsfc1(:)*dtf +! Diag%dusfci(:) = dusfc1(:) +! Diag%dvsfci(:) = dvsfc1(:) +! Diag%dtsfci(:) = dtsfc1(:) +! Diag%dqsfci(:) = dqsfc1(:) +! ! if (lprnt) then +! ! write(0,*)' dusfc=',dusfc(ipr),' dusfc1=',dusfc1(ipr),' dtf=', +! ! & dtf,' kdt=',kdt,' lat=',lat +! ! endif +! +! if (Model%ldiag3d) then +! if (Model%lsidea) then +! Diag%dt3dt(:,:,3) = Diag%dt3dt(:,:,3) + dtdt(:,:)*dtf +! else +! do k = 1, levs +! do i = 1, im +! tem = dtdt(i,k) - (Radtend%htrlw(i,k)+Radtend%htrsw(i,k)*xmu(i)) +! Diag%dt3dt(i,k,3) = Diag%dt3dt(i,k,3) + tem*dtf +! enddo +! enddo +! endif +! Diag%du3dt(:,:,1) = Diag%du3dt(:,:,1) + dudt(:,:) * dtf +! Diag%du3dt(:,:,2) = Diag%du3dt(:,:,2) - dudt(:,:) * dtf +! Diag%dv3dt(:,:,1) = Diag%dv3dt(:,:,1) + dvdt(:,:) * dtf +! Diag%dv3dt(:,:,2) = Diag%dv3dt(:,:,2) - dvdt(:,:) * dtf +! ! update dqdt_v to include moisture tendency due to vertical diffusion +! ! if (lgocart) then +! ! do k = 1, levs +! ! do i = 1, im +! ! dqdt_v(i,k) = dqdt(i,k,1) * dtf +! ! enddo +! ! enddo +! ! endif ! do k = 1, levs ! do i = 1, im -! dqdt_v(i,k) = dqdt(i,k,1) * dtf +! tem = dqdt(i,k,1) * dtf +! Diag%dq3dt(i,k,1) = Diag%dq3dt(i,k,1) + tem ! enddo ! enddo +! if (Model%ntoz > 0) then +! Diag%dq3dt(:,:,5) = Diag%dq3dt(:,:,5) + dqdt(i,k,Model%ntoz) * dtf +! endif ! endif - do k = 1, levs - do i = 1, im - tem = dqdt(i,k,1) * dtf - Diag%dq3dt(i,k,1) = Diag%dq3dt(i,k,1) + tem - enddo - enddo - if (Model%ntoz > 0) then - Diag%dq3dt(:,:,5) = Diag%dq3dt(:,:,5) + dqdt(i,k,Model%ntoz) * dtf - endif - endif - - endif ! end if_lssav +! +! endif ! end if_lssav !-------------------------------------------------------lssav if loop ---------- ! ! Orographic gravity wave drag parameterization diff --git a/makefile b/makefile index 95c891e1b..44c094835 100644 --- a/makefile +++ b/makefile @@ -120,6 +120,7 @@ SRCS_f90 = \ ./physics/gcm_shoc.f90 \ ./physics/gcycle.f90 \ ./physics/get_prs_fv3.f90 \ + ./physics/GFS_PBL_generic.f90 \ ./physics/h2ointerp.f90 \ ./physics/m_micro_driver.f90 \ ./physics/module_nst_model.f90 \ @@ -186,4 +187,3 @@ include ./depend ifneq (clean,$(findstring clean,$(MAKECMDGOALS))) -include depend endif - diff --git a/physics/GFS_PBL_generic.f90 b/physics/GFS_PBL_generic.f90 new file mode 100644 index 000000000..dc400afea --- /dev/null +++ b/physics/GFS_PBL_generic.f90 @@ -0,0 +1,106 @@ +!> \file GFS_PBL_generic.f90 +!! Contains code related to PBL schemes to be used within the GFS physics suite. + + module GFS_PBL_generic + + contains + +!! \section arg_table_GFS_PBL_generic_pre +!! | local var name | longname | description | units | rank | type | kind | intent | optional | +!! |----------------|--------------------------------------------------------|----------------------------------------------------|---------------|------|---------|-----------|--------|----------| +!! | im | horizontal_loop_extent | horizontal loop extent, start at 1 | index | 0 | integer | | in | F | +!! | levs | vertical_dimension | vertical layer dimension | index | 0 | integer | | in | F | +!! | kinver | index_of_highest_temperature_inversion | index of highest temperature inversion | index | 1 | integer | | in | F | +!! + subroutine GFS_PBL_generic_pre (im, levs, kinver) + + integer , intent(in) :: im, levs + integer, dimension(im), intent(inout) :: kinver + + kinver(:) = levs + + end subroutine GFS_PBL_generic_pre + +!! \section arg_table_GFS_PBL_generic_post +!! | local var name | longname | description | units | rank | type | kind | intent | optional | +!! |----------------|--------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| +!! | Grid | FV3-GFS_Grid_type | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_typedefs%GFS_grid_type | | in | F | +!! | Model | FV3-GFS_Control_type | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_typedefs%GFS_control_type | | in | F | +!! | Radtend | FV3-GFS_Radtend_type | Fortran DDT containing FV3-GFS radiation tendencies needed in physics | DDT | 0 | GFS_typedefs%GFS_radtend_type | | in | F | +!! | dusfc1 | instantaneous_surface_x_momentum_flux | surface momentum flux in the x-direction valid for current call | Pa | 1 | real | kind_phys | in | F | +!! | dvsfc1 | instantaneous_surface_y_momentum_flux | surface momentum flux in the y-direction valid for current call | Pa | 1 | real | kind_phys | in | F | +!! | dtsfc1 | surface_upward_sensible_heat_flux | surface upward sensible heat flux valid for current call | W m-2 | 1 | real | kind_phys | in | F | +!! | dqsfc1 | surface_upward_latent_heat_flux | surface upward latent heat flux valid for current call | W m-2 | 1 | real | kind_phys | in | F | +!! | dudt | tendency_of_x_wind_due_to_model_physics | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | in | F | +!! | dvdt | tendency_of_y_wind_due_to_model_physics | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | in | F | +!! | dtdt | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | in | F | +!! | dqdt | tendency_of_tracers_due_to_model_physics | updated tendency of the tracers | kg kg-1 s-1 | 3 | real | kind_phys | in | F | +!! | xmu | time_step_zenith_angle_adjust_factor_for_sw | time step zenith angle adjust factor for shortwave | none | 2 | real | kind_phys | in | F | +!! | Diag | FV3-GFS_diag_type | Fortran DDT containing FV3-GFS fields targeted for diagnostic output | DDT | 0 | GFS_typedefs%GFS_diag_type | | in | F | +!! + subroutine GFS_PBL_generic_post (Grid, Model, Radtend, dusfc1, dvsfc1, dtsfc1, dqsfc1, & + dudt, dvdt, dtdt, dqdt, xmu, Diag) + + use machine, only: kind_phys + use GFS_typedefs, only: GFS_diag_type, GFS_radtend_type, GFS_model_type, GFS_grid_type + + type(GFS_grid_type), intent(in) :: Grid + type(GFS_radtend_type), intent(in) :: Radtend + type(GFS_control_type), intent(in) :: Model + type(GFS_diag_type), intent(inout) :: Diag + + real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: dusfc1, dvsfc1, dtsfc1, dqsfc1, xmu + real(kind=kind_phys), dimension(size(Grid%xlon,1), Model%levs), intent(in) :: dudt, dvdt, dtdt + real(kind=kind_phys), dimension(size(Grid%xlon,1), Model%levs, Model%ntrac), intent(in) :: dqdt + + integer :: i, k + real(kind=kind_phys) :: tem + + if (Model%lssav) then + Diag%dusfc (:) = Diag%dusfc(:) + dusfc1(:)*Model%dtf + Diag%dvsfc (:) = Diag%dvsfc(:) + dvsfc1(:)*Model%dtf + Diag%dtsfc (:) = Diag%dtsfc(:) + dtsfc1(:)*Model%dtf + Diag%dqsfc (:) = Diag%dqsfc(:) + dqsfc1(:)*Model%dtf + Diag%dusfci(:) = dusfc1(:) + Diag%dvsfci(:) = dvsfc1(:) + Diag%dtsfci(:) = dtsfc1(:) + Diag%dqsfci(:) = dqsfc1(:) + ! if (lprnt) then + ! write(0,*)' dusfc=',dusfc(ipr),' dusfc1=',dusfc1(ipr),' dtf=', + ! & dtf,' kdt=',kdt,' lat=',lat + ! endif + + if (Model%ldiag3d) then + do k = 1, Model%levs + do i = 1, size(Grid%xlon,1) + tem = dtdt(i,k) - (Radtend%htrlw(i,k)+Radtend%htrsw(i,k)*xmu(i)) + Diag%dt3dt(i,k,3) = Diag%dt3dt(i,k,3) + tem*Model%dtf + enddo + enddo + Diag%du3dt(:,:,1) = Diag%du3dt(:,:,1) + dudt(:,:) * Model%dtf + Diag%du3dt(:,:,2) = Diag%du3dt(:,:,2) - dudt(:,:) * Model%dtf + Diag%dv3dt(:,:,1) = Diag%dv3dt(:,:,1) + dvdt(:,:) * Model%dtf + Diag%dv3dt(:,:,2) = Diag%dv3dt(:,:,2) - dvdt(:,:) * Model%dtf + ! update dqdt_v to include moisture tendency due to vertical diffusion + ! if (lgocart) then + ! do k = 1, levs + ! do i = 1, im + ! dqdt_v(i,k) = dqdt(i,k,1) * dtf + ! enddo + ! enddo + ! endif + do k = 1, Model%levs + do i = 1, size(Grid%xlon,1) + tem = dqdt(i,k,1) * Model%dtf + Diag%dq3dt(i,k,1) = Diag%dq3dt(i,k,1) + tem + enddo + enddo + if (Model%ntoz > 0) then + Diag%dq3dt(:,:,5) = Diag%dq3dt(:,:,5) + dqdt(i,k,Model%ntoz) * Model%dtf + endif + endif + + endif ! end if_lssav + end subroutine GFS_PBL_generic_post + + end module From b2e307569ac19287cd072949a733b1b0121f205e Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Fri, 3 Nov 2017 15:30:27 -0600 Subject: [PATCH 11/48] saving changes due to GFS_PBL_generic interstitial --- GFS_layer/GFS_physics_driver.F90 | 6 +++--- physics/GFS_PBL_generic.f90 | 34 +++++++++++++++++++++++++------- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/GFS_layer/GFS_physics_driver.F90 b/GFS_layer/GFS_physics_driver.F90 index a9fdc24ba..3e8bddea3 100644 --- a/GFS_layer/GFS_physics_driver.F90 +++ b/GFS_layer/GFS_physics_driver.F90 @@ -792,7 +792,7 @@ subroutine GFS_physics_driver & endif endif ! end if_lssav_block - call GFS_PBL_generic_pre(im, levs, kinver) + call GFS_PBL_generic_pre (im, levs, kinver) kcnv(:) = 0 !kinver(:) = levs @@ -1198,7 +1198,7 @@ subroutine GFS_physics_driver & Statein%ugrs, Statein%vgrs, Statein%tgrs, Statein%qgrs, & Radtend%htrsw, Radtend%htrlw, xmu, Statein%prsik(:,1), & rb, Sfcprop%zorl, Diag%u10m, Diag%v10m, Sfcprop%ffmm, & - Sfcprop%ffhh, Sfcprop%tsfc, qss, hflx, evap, stress, & + Sfcprop%ffhh, Sfcprop%tsfc, hflx, evap, stress, & wind, kpbl, Statein%prsi, del, Statein%prsl, & Statein%prslk, Statein%phii, Statein%phil, dtp, & Model%dspheat, dusfc1, dvsfc1, dtsfc1, dqsfc1, Diag%hpbl,& @@ -1274,7 +1274,7 @@ subroutine GFS_physics_driver & Coupling%dqsfci_cpl(:) = dqsfc1(:) endif - call GFS_PBL_generic_post(Grid, Model, Radtend, dusfc1, dvsfc1, & + call GFS_PBL_generic_post (Grid, Model, Radtend, dusfc1, dvsfc1, & dtsfc1, dqsfc1, dudt, dvdt, dtdt, dqdt, xmu, Diag) ! !-------------------------------------------------------lssav if loop ---------- ! if (Model%lssav) then diff --git a/physics/GFS_PBL_generic.f90 b/physics/GFS_PBL_generic.f90 index dc400afea..c982e280e 100644 --- a/physics/GFS_PBL_generic.f90 +++ b/physics/GFS_PBL_generic.f90 @@ -1,27 +1,47 @@ !> \file GFS_PBL_generic.f90 !! Contains code related to PBL schemes to be used within the GFS physics suite. - module GFS_PBL_generic + module GFS_PBL_generic_pre contains -!! \section arg_table_GFS_PBL_generic_pre + subroutine GFS_PBL_generic_pre_init () + end subroutine GFS_PBL_generic_pre_init + + subroutine GFS_PBL_generic_pre_finalize() + subroutine GFS_PBL_generic_pre_finalize + +!> \section arg_table_GFS_PBL_generic_pre_run Argument Table !! | local var name | longname | description | units | rank | type | kind | intent | optional | !! |----------------|--------------------------------------------------------|----------------------------------------------------|---------------|------|---------|-----------|--------|----------| !! | im | horizontal_loop_extent | horizontal loop extent, start at 1 | index | 0 | integer | | in | F | !! | levs | vertical_dimension | vertical layer dimension | index | 0 | integer | | in | F | !! | kinver | index_of_highest_temperature_inversion | index of highest temperature inversion | index | 1 | integer | | in | F | !! - subroutine GFS_PBL_generic_pre (im, levs, kinver) + subroutine GFS_PBL_generic_pre_run (im, levs, kinver) integer , intent(in) :: im, levs integer, dimension(im), intent(inout) :: kinver kinver(:) = levs - end subroutine GFS_PBL_generic_pre + end subroutine GFS_PBL_generic_pre_run + + end module + + module GFS_PBL_generic_post + + contains + + subroutine GFS_PBL_generic_post_init () + end subroutine GFS_PBL_generic_post_init + + subroutine GFS_PBL_generic_post_finalize () + end subroutine GFS_PBL_generic_post_finalize + + -!! \section arg_table_GFS_PBL_generic_post +!> \section arg_table_GFS_PBL_generic_post_run Argument Table !! | local var name | longname | description | units | rank | type | kind | intent | optional | !! |----------------|--------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| !! | Grid | FV3-GFS_Grid_type | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_typedefs%GFS_grid_type | | in | F | @@ -38,7 +58,7 @@ end subroutine GFS_PBL_generic_pre !! | xmu | time_step_zenith_angle_adjust_factor_for_sw | time step zenith angle adjust factor for shortwave | none | 2 | real | kind_phys | in | F | !! | Diag | FV3-GFS_diag_type | Fortran DDT containing FV3-GFS fields targeted for diagnostic output | DDT | 0 | GFS_typedefs%GFS_diag_type | | in | F | !! - subroutine GFS_PBL_generic_post (Grid, Model, Radtend, dusfc1, dvsfc1, dtsfc1, dqsfc1, & + subroutine GFS_PBL_generic_post_run (Grid, Model, Radtend, dusfc1, dvsfc1, dtsfc1, dqsfc1, & dudt, dvdt, dtdt, dqdt, xmu, Diag) use machine, only: kind_phys @@ -101,6 +121,6 @@ subroutine GFS_PBL_generic_post (Grid, Model, Radtend, dusfc1, dvsfc1, dtsfc1, d endif endif ! end if_lssav - end subroutine GFS_PBL_generic_post + end subroutine GFS_PBL_generic_post_run end module From 41fd8e8157d904f121f8d5bd0bccc579bb6285f1 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Mon, 13 Nov 2017 14:40:56 -0700 Subject: [PATCH 12/48] longname changes --- physics/GFS_PBL_generic.f90 | 4 ++-- physics/moninedmf.f | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/physics/GFS_PBL_generic.f90 b/physics/GFS_PBL_generic.f90 index c982e280e..f3792a970 100644 --- a/physics/GFS_PBL_generic.f90 +++ b/physics/GFS_PBL_generic.f90 @@ -49,8 +49,8 @@ end subroutine GFS_PBL_generic_post_finalize !! | Radtend | FV3-GFS_Radtend_type | Fortran DDT containing FV3-GFS radiation tendencies needed in physics | DDT | 0 | GFS_typedefs%GFS_radtend_type | | in | F | !! | dusfc1 | instantaneous_surface_x_momentum_flux | surface momentum flux in the x-direction valid for current call | Pa | 1 | real | kind_phys | in | F | !! | dvsfc1 | instantaneous_surface_y_momentum_flux | surface momentum flux in the y-direction valid for current call | Pa | 1 | real | kind_phys | in | F | -!! | dtsfc1 | surface_upward_sensible_heat_flux | surface upward sensible heat flux valid for current call | W m-2 | 1 | real | kind_phys | in | F | -!! | dqsfc1 | surface_upward_latent_heat_flux | surface upward latent heat flux valid for current call | W m-2 | 1 | real | kind_phys | in | F | +!! | dtsfc1 | instantaneous_surface_upward_sensible_heat_flux | surface upward sensible heat flux valid for current call | W m-2 | 1 | real | kind_phys | in | F | +!! | dqsfc1 | instantaneous_surface_upward_latent_heat_flux | surface upward latent heat flux valid for current call | W m-2 | 1 | real | kind_phys | in | F | !! | dudt | tendency_of_x_wind_due_to_model_physics | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | in | F | !! | dvdt | tendency_of_y_wind_due_to_model_physics | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | in | F | !! | dtdt | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | in | F | diff --git a/physics/moninedmf.f b/physics/moninedmf.f index d5a0800aa..6eebdefd5 100755 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -58,7 +58,7 @@ end subroutine edmf_finalize !! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | !! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | in | F | !! | spd1 | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | in | F | -!! | kpbl | vertical_index_of_top_of_atmosphere_boundary_layer | PBL top model level index | index | 1 | integer | | out | F | +!! | kpbl | vertical_index_at_top_of_atmosphere_boundary_layer | PBL top model level index | index | 1 | integer | | out | F | !! | prsi | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | !! | del | air_pressure_difference_between_midlayers | pres(k) - pres(k+1) | Pa | 2 | real | kind_phys | in | F | !! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | @@ -67,10 +67,10 @@ end subroutine edmf_finalize !! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | !! | delt | time_step_for_physics | time step for physics | s | 0 | real | kind_phys | in | F | !! | dspheat | flag_TKE_dissipation_heating | flag for using TKE dissipation heating | flag | 0 | logical | | in | F | -!! | dusfc | x_momentum_flux | x momentum flux | Pa | 1 | real | kind_phys | out | F | -!! | dvsfc | y_momentum_flux | y momentum flux | Pa | 1 | real | kind_phys | out | F | -!! | dtsfc | surface_upward_sensible_heat_flux | surface upward sensible heat flux | W m-2 | 1 | real | kind_phys | out | F | -!! | dqsfc | surface_upward_latent_heat_flux | surface upward latent heat flux | W m-2 | 1 | real | kind_phys | out | F | +!! | dusfc | instantaneous_x_momentum_flux | x momentum flux | Pa | 1 | real | kind_phys | out | F | +!! | dvsfc | instantaneous_y_momentum_flux | y momentum flux | Pa | 1 | real | kind_phys | out | F | +!! | dtsfc | instantaneous_surface_upward_sensible_heat_flux | surface upward sensible heat flux | W m-2 | 1 | real | kind_phys | out | F | +!! | dqsfc | instantaneous_surface_upward_latent_heat_flux | surface upward latent heat flux | W m-2 | 1 | real | kind_phys | out | F | !! | hpbl | atmosphere_boundary_layer_thickness | PBL thickness | m | 1 | real | kind_phys | out | F | !! | hgamt | countergradient_mixing_term_for_temperature | countergradient mixing term for temperature | K | 1 | real | kind_phys | out | F | !! | hgamq | countergradient_mixing_term_for_water_vapor | countergradient mixing term for water vapor | kg kg-1 | 1 | real | kind_phys | out | F | From 693b4462ff0ff795591bb0491c9565c0ed830851 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Mon, 13 Nov 2017 16:25:05 -0700 Subject: [PATCH 13/48] changed GFS_physics_driver.F90 for module changes in GFS_PBL_generic.f90 --- GFS_layer/GFS_physics_driver.F90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/GFS_layer/GFS_physics_driver.F90 b/GFS_layer/GFS_physics_driver.F90 index 3e8bddea3..65f7d2284 100644 --- a/GFS_layer/GFS_physics_driver.F90 +++ b/GFS_layer/GFS_physics_driver.F90 @@ -16,8 +16,8 @@ module module_physics_driver GFS_tbd_type, GFS_cldprop_type, & GFS_radtend_type, GFS_diag_type use edmf, only: edmf_run - use GFS_PBL_generic, only: GFS_PBL_generic_pre, & - GFS_PBL_generic_post + use GFS_PBL_generic_pre, only: GFS_PBL_generic_pre_run + use GFS_PBL_generic_post, only: GFS_PBL_generic_post_run implicit none @@ -792,7 +792,7 @@ subroutine GFS_physics_driver & endif endif ! end if_lssav_block - call GFS_PBL_generic_pre (im, levs, kinver) + call GFS_PBL_generic_pre_run (im, levs, kinver) kcnv(:) = 0 !kinver(:) = levs @@ -1274,7 +1274,7 @@ subroutine GFS_physics_driver & Coupling%dqsfci_cpl(:) = dqsfc1(:) endif - call GFS_PBL_generic_post (Grid, Model, Radtend, dusfc1, dvsfc1, & + call GFS_PBL_generic_post_run (Grid, Model, Radtend, dusfc1, dvsfc1, & dtsfc1, dqsfc1, dudt, dvdt, dtdt, dqdt, xmu, Diag) ! !-------------------------------------------------------lssav if loop ---------- ! if (Model%lssav) then From 96e2adb2a2aad4c93e3eb26bd9827c806d4dae80 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Mon, 13 Nov 2017 16:59:41 -0700 Subject: [PATCH 14/48] fixing compilation errors in GFS_PBL_generic.f90 --- physics/GFS_PBL_generic.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/GFS_PBL_generic.f90 b/physics/GFS_PBL_generic.f90 index f3792a970..88e583b63 100644 --- a/physics/GFS_PBL_generic.f90 +++ b/physics/GFS_PBL_generic.f90 @@ -9,7 +9,7 @@ subroutine GFS_PBL_generic_pre_init () end subroutine GFS_PBL_generic_pre_init subroutine GFS_PBL_generic_pre_finalize() - subroutine GFS_PBL_generic_pre_finalize + end subroutine GFS_PBL_generic_pre_finalize !> \section arg_table_GFS_PBL_generic_pre_run Argument Table !! | local var name | longname | description | units | rank | type | kind | intent | optional | From 6ac3349149da748cc8f06ecd5a1bb73d98c0e233 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Mon, 13 Nov 2017 17:20:29 -0700 Subject: [PATCH 15/48] fixing compilation errors in GFS_PBL_generic.f90 --- physics/GFS_PBL_generic.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/GFS_PBL_generic.f90 b/physics/GFS_PBL_generic.f90 index 88e583b63..51435c28d 100644 --- a/physics/GFS_PBL_generic.f90 +++ b/physics/GFS_PBL_generic.f90 @@ -62,7 +62,7 @@ subroutine GFS_PBL_generic_post_run (Grid, Model, Radtend, dusfc1, dvsfc1, dtsfc dudt, dvdt, dtdt, dqdt, xmu, Diag) use machine, only: kind_phys - use GFS_typedefs, only: GFS_diag_type, GFS_radtend_type, GFS_model_type, GFS_grid_type + use GFS_typedefs, only: GFS_diag_type, GFS_radtend_type, GFS_control_type, GFS_grid_type type(GFS_grid_type), intent(in) :: Grid type(GFS_radtend_type), intent(in) :: Radtend From 0ee96b8787e471bb4b30556b6a3b3c3d4108e3a0 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Mon, 13 Nov 2017 18:53:16 -0700 Subject: [PATCH 16/48] put tridiagonal solver subroutines in their own file, tridi.f; modified makefile to compile this file; other PBL schemes used tridin and tridi2 in moninedmf.f, so these subroutines don't really belong in EDMF module --- makefile | 1 + physics/moninedmf.f | 212 ++++++++++++++++++++++---------------------- physics/tridi.f | 105 ++++++++++++++++++++++ 3 files changed, 212 insertions(+), 106 deletions(-) create mode 100644 physics/tridi.f diff --git a/makefile b/makefile index 44c094835..7d390e201 100644 --- a/makefile +++ b/makefile @@ -111,6 +111,7 @@ SRCS_f = \ ./physics/shalcv_fixdp.f \ ./physics/shalcv_opr.f \ ./physics/tracer_const_h.f \ + ./physics/tridi.f \ ./physics/tridi2t3.f SRCS_f90 = \ diff --git a/physics/moninedmf.f b/physics/moninedmf.f index 6eebdefd5..81ac9dc56 100755 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -1047,7 +1047,7 @@ subroutine edmf_run (ix,im,km,ntrac,ntcw,dv,du,tau,rtg, & ! solve tridiagonal problem for heat and moisture ! !> The tridiagonal system is solved by calling the internal ::edmf_tridin subroutine. - call edmf_tridin(im,km,ntrac,al,ad,au,a1,a2,au,a1,a2) + call tridin(im,km,ntrac,al,ad,au,a1,a2,au,a1,a2) ! ! recover tendencies of heat and moisture @@ -1161,7 +1161,7 @@ subroutine edmf_run (ix,im,km,ntrac,ntcw,dv,du,tau,rtg, & ! ! solve tridiagonal problem for momentum ! - call edmf_tridi2(im,km,al,ad,au,a1,a2,au,a1,a2) + call tridi2(im,km,al,ad,au,a1,a2,au,a1,a2) ! ! recover tendencies of momentum ! @@ -1204,113 +1204,113 @@ subroutine edmf_run (ix,im,km,ntrac,ntcw,dv,du,tau,rtg, & !! \brief Routine to solve the tridiagonal system to calculate temperature and moisture at \f$ t + \Delta t \f$; part of two-part process to calculate time tendencies due to vertical diffusion. !! !! Origin of subroutine unknown. - subroutine edmf_tridi2(l,n,cl,cm,cu,r1,r2,au,a1,a2) -cc - use machine , only : kind_phys - implicit none - integer k,n,l,i - real(kind=kind_phys) fk -cc - real(kind=kind_phys) cl(l,2:n),cm(l,n),cu(l,n-1),r1(l,n),r2(l,n), & - & au(l,n-1),a1(l,n),a2(l,n) -c----------------------------------------------------------------------- - do i=1,l - fk = 1./cm(i,1) - au(i,1) = fk*cu(i,1) - a1(i,1) = fk*r1(i,1) - a2(i,1) = fk*r2(i,1) - enddo - do k=2,n-1 - do i=1,l - fk = 1./(cm(i,k)-cl(i,k)*au(i,k-1)) - au(i,k) = fk*cu(i,k) - a1(i,k) = fk*(r1(i,k)-cl(i,k)*a1(i,k-1)) - a2(i,k) = fk*(r2(i,k)-cl(i,k)*a2(i,k-1)) - enddo - enddo - do i=1,l - fk = 1./(cm(i,n)-cl(i,n)*au(i,n-1)) - a1(i,n) = fk*(r1(i,n)-cl(i,n)*a1(i,n-1)) - a2(i,n) = fk*(r2(i,n)-cl(i,n)*a2(i,n-1)) - enddo - do k=n-1,1,-1 - do i=1,l - a1(i,k) = a1(i,k)-au(i,k)*a1(i,k+1) - a2(i,k) = a2(i,k)-au(i,k)*a2(i,k+1) - enddo - enddo -c----------------------------------------------------------------------- - return - end - -c----------------------------------------------------------------------- +C subroutine edmf_tridi2(l,n,cl,cm,cu,r1,r2,au,a1,a2) +c +C use machine , only : kind_phys +C implicit none +C integer k,n,l,i +C real(kind=kind_phys) fk +c +C real(kind=kind_phys) cl(l,2:n),cm(l,n),cu(l,n-1),r1(l,n),r2(l,n), & +C & au(l,n-1),a1(l,n),a2(l,n) +C----------------------------------------------------------------------- +C do i=1,l +C fk = 1./cm(i,1) +C au(i,1) = fk*cu(i,1) +C a1(i,1) = fk*r1(i,1) +C a2(i,1) = fk*r2(i,1) +C enddo +C do k=2,n-1 +C do i=1,l +C fk = 1./(cm(i,k)-cl(i,k)*au(i,k-1)) +C au(i,k) = fk*cu(i,k) +C a1(i,k) = fk*(r1(i,k)-cl(i,k)*a1(i,k-1)) +C a2(i,k) = fk*(r2(i,k)-cl(i,k)*a2(i,k-1)) +C enddo +C enddo +C do i=1,l +C fk = 1./(cm(i,n)-cl(i,n)*au(i,n-1)) +C a1(i,n) = fk*(r1(i,n)-cl(i,n)*a1(i,n-1)) +C a2(i,n) = fk*(r2(i,n)-cl(i,n)*a2(i,n-1)) +C enddo +C do k=n-1,1,-1 +C do i=1,l +C a1(i,k) = a1(i,k)-au(i,k)*a1(i,k+1) +C a2(i,k) = a2(i,k)-au(i,k)*a2(i,k+1) +C enddo +C enddo +C----------------------------------------------------------------------- +C return +C end +C +C----------------------------------------------------------------------- !> \ingroup HEDMF !! \brief Routine to solve the tridiagonal system to calculate u- and v-momentum at \f$ t + \Delta t \f$; part of two-part process to calculate time tendencies due to vertical diffusion. !! !! Origin of subroutine unknown. - subroutine edmf_tridin(l,n,nt,cl,cm,cu,r1,r2,au,a1,a2) -cc - use machine , only : kind_phys - implicit none - integer is,k,kk,n,nt,l,i - real(kind=kind_phys) fk(l) -cc - real(kind=kind_phys) cl(l,2:n), cm(l,n), cu(l,n-1), & - & r1(l,n), r2(l,n*nt), & - & au(l,n-1), a1(l,n), a2(l,n*nt), & - & fkk(l,2:n-1) -c----------------------------------------------------------------------- - do i=1,l - fk(i) = 1./cm(i,1) - au(i,1) = fk(i)*cu(i,1) - a1(i,1) = fk(i)*r1(i,1) - enddo - do k = 1, nt - is = (k-1) * n - do i = 1, l - a2(i,1+is) = fk(i) * r2(i,1+is) - enddo - enddo - do k=2,n-1 - do i=1,l - fkk(i,k) = 1./(cm(i,k)-cl(i,k)*au(i,k-1)) - au(i,k) = fkk(i,k)*cu(i,k) - a1(i,k) = fkk(i,k)*(r1(i,k)-cl(i,k)*a1(i,k-1)) - enddo - enddo - do kk = 1, nt - is = (kk-1) * n - do k=2,n-1 - do i=1,l - a2(i,k+is) = fkk(i,k)*(r2(i,k+is)-cl(i,k)*a2(i,k+is-1)) - enddo - enddo - enddo - do i=1,l - fk(i) = 1./(cm(i,n)-cl(i,n)*au(i,n-1)) - a1(i,n) = fk(i)*(r1(i,n)-cl(i,n)*a1(i,n-1)) - enddo - do k = 1, nt - is = (k-1) * n - do i = 1, l - a2(i,n+is) = fk(i)*(r2(i,n+is)-cl(i,n)*a2(i,n+is-1)) - enddo - enddo - do k=n-1,1,-1 - do i=1,l - a1(i,k) = a1(i,k) - au(i,k)*a1(i,k+1) - enddo - enddo - do kk = 1, nt - is = (kk-1) * n - do k=n-1,1,-1 - do i=1,l - a2(i,k+is) = a2(i,k+is) - au(i,k)*a2(i,k+is+1) - enddo - enddo - enddo -c----------------------------------------------------------------------- - return - end +C subroutine edmf_tridin(l,n,nt,cl,cm,cu,r1,r2,au,a1,a2) +c +C use machine , only : kind_phys +C implicit none +C integer is,k,kk,n,nt,l,i +C real(kind=kind_phys) fk(l) +c +C real(kind=kind_phys) cl(l,2:n), cm(l,n), cu(l,n-1), & +C & r1(l,n), r2(l,n*nt), & +C & au(l,n-1), a1(l,n), a2(l,n*nt), & +C & fkk(l,2:n-1) +C----------------------------------------------------------------------- +C do i=1,l +C fk(i) = 1./cm(i,1) +C au(i,1) = fk(i)*cu(i,1) +C a1(i,1) = fk(i)*r1(i,1) +C enddo +C do k = 1, nt +C is = (k-1) * n +C do i = 1, l +C a2(i,1+is) = fk(i) * r2(i,1+is) +C enddo +C enddo +C do k=2,n-1 +C do i=1,l +C fkk(i,k) = 1./(cm(i,k)-cl(i,k)*au(i,k-1)) +C au(i,k) = fkk(i,k)*cu(i,k) +C a1(i,k) = fkk(i,k)*(r1(i,k)-cl(i,k)*a1(i,k-1)) +C enddo +C enddo +C do kk = 1, nt +C is = (kk-1) * n +C do k=2,n-1 +C do i=1,l +C a2(i,k+is) = fkk(i,k)*(r2(i,k+is)-cl(i,k)*a2(i,k+is-1)) +C enddo +C enddo +C enddo +C do i=1,l +C fk(i) = 1./(cm(i,n)-cl(i,n)*au(i,n-1)) +C a1(i,n) = fk(i)*(r1(i,n)-cl(i,n)*a1(i,n-1)) +C enddo +C do k = 1, nt +C is = (k-1) * n +C do i = 1, l +C a2(i,n+is) = fk(i)*(r2(i,n+is)-cl(i,n)*a2(i,n+is-1)) +C enddo +C enddo +C do k=n-1,1,-1 +C do i=1,l +C a1(i,k) = a1(i,k) - au(i,k)*a1(i,k+1) +C enddo +C enddo +C do kk = 1, nt +C is = (kk-1) * n +C do k=n-1,1,-1 +C do i=1,l +C a2(i,k+is) = a2(i,k+is) - au(i,k)*a2(i,k+is+1) +C enddo +C enddo +C enddo +C----------------------------------------------------------------------- +C return +C end !> @} end module edmf diff --git a/physics/tridi.f b/physics/tridi.f new file mode 100644 index 000000000..ca53cbc9b --- /dev/null +++ b/physics/tridi.f @@ -0,0 +1,105 @@ + subroutine tridi2(l,n,cl,cm,cu,r1,r2,au,a1,a2) +cc + use machine , only : kind_phys + implicit none + integer k,n,l,i + real(kind=kind_phys) fk +cc + real(kind=kind_phys) cl(l,2:n),cm(l,n),cu(l,n-1),r1(l,n),r2(l,n), & + & au(l,n-1),a1(l,n),a2(l,n) +c----------------------------------------------------------------------- + do i=1,l + fk = 1./cm(i,1) + au(i,1) = fk*cu(i,1) + a1(i,1) = fk*r1(i,1) + a2(i,1) = fk*r2(i,1) + enddo + do k=2,n-1 + do i=1,l + fk = 1./(cm(i,k)-cl(i,k)*au(i,k-1)) + au(i,k) = fk*cu(i,k) + a1(i,k) = fk*(r1(i,k)-cl(i,k)*a1(i,k-1)) + a2(i,k) = fk*(r2(i,k)-cl(i,k)*a2(i,k-1)) + enddo + enddo + do i=1,l + fk = 1./(cm(i,n)-cl(i,n)*au(i,n-1)) + a1(i,n) = fk*(r1(i,n)-cl(i,n)*a1(i,n-1)) + a2(i,n) = fk*(r2(i,n)-cl(i,n)*a2(i,n-1)) + enddo + do k=n-1,1,-1 + do i=1,l + a1(i,k) = a1(i,k)-au(i,k)*a1(i,k+1) + a2(i,k) = a2(i,k)-au(i,k)*a2(i,k+1) + enddo + enddo +c----------------------------------------------------------------------- + return + end + +c----------------------------------------------------------------------- + + subroutine tridin(l,n,nt,cl,cm,cu,r1,r2,au,a1,a2) +cc + use machine , only : kind_phys + implicit none + integer is,k,kk,n,nt,l,i + real(kind=kind_phys) fk(l) +cc + real(kind=kind_phys) cl(l,2:n), cm(l,n), cu(l,n-1), & + & r1(l,n), r2(l,n*nt), & + & au(l,n-1), a1(l,n), a2(l,n*nt), & + & fkk(l,2:n-1) +c----------------------------------------------------------------------- + do i=1,l + fk(i) = 1./cm(i,1) + au(i,1) = fk(i)*cu(i,1) + a1(i,1) = fk(i)*r1(i,1) + enddo + do k = 1, nt + is = (k-1) * n + do i = 1, l + a2(i,1+is) = fk(i) * r2(i,1+is) + enddo + enddo + do k=2,n-1 + do i=1,l + fkk(i,k) = 1./(cm(i,k)-cl(i,k)*au(i,k-1)) + au(i,k) = fkk(i,k)*cu(i,k) + a1(i,k) = fkk(i,k)*(r1(i,k)-cl(i,k)*a1(i,k-1)) + enddo + enddo + do kk = 1, nt + is = (kk-1) * n + do k=2,n-1 + do i=1,l + a2(i,k+is) = fkk(i,k)*(r2(i,k+is)-cl(i,k)*a2(i,k+is-1)) + enddo + enddo + enddo + do i=1,l + fk(i) = 1./(cm(i,n)-cl(i,n)*au(i,n-1)) + a1(i,n) = fk(i)*(r1(i,n)-cl(i,n)*a1(i,n-1)) + enddo + do k = 1, nt + is = (k-1) * n + do i = 1, l + a2(i,n+is) = fk(i)*(r2(i,n+is)-cl(i,n)*a2(i,n+is-1)) + enddo + enddo + do k=n-1,1,-1 + do i=1,l + a1(i,k) = a1(i,k) - au(i,k)*a1(i,k+1) + enddo + enddo + do kk = 1, nt + is = (kk-1) * n + do k=n-1,1,-1 + do i=1,l + a2(i,k+is) = a2(i,k+is) - au(i,k)*a2(i,k+is+1) + enddo + enddo + enddo +c----------------------------------------------------------------------- + return + end From c893141f9e5920739b67bba057fc9f5ecf11d306 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Mon, 13 Nov 2017 19:00:35 -0700 Subject: [PATCH 17/48] fixing columns in tridi.f for compilation --- physics/tridi.f | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/physics/tridi.f b/physics/tridi.f index ca53cbc9b..a8f29f928 100644 --- a/physics/tridi.f +++ b/physics/tridi.f @@ -5,9 +5,9 @@ subroutine tridi2(l,n,cl,cm,cu,r1,r2,au,a1,a2) integer k,n,l,i real(kind=kind_phys) fk cc - real(kind=kind_phys) cl(l,2:n),cm(l,n),cu(l,n-1),r1(l,n),r2(l,n), & - & au(l,n-1),a1(l,n),a2(l,n) -c----------------------------------------------------------------------- + real(kind=kind_phys) cl(l,2:n),cm(l,n),cu(l,n-1),r1(l,n),r2(l,n),& + & au(l,n-1),a1(l,n),a2(l,n) +c---------------------------------------------------------------------- do i=1,l fk = 1./cm(i,1) au(i,1) = fk*cu(i,1) @@ -47,9 +47,9 @@ subroutine tridin(l,n,nt,cl,cm,cu,r1,r2,au,a1,a2) real(kind=kind_phys) fk(l) cc real(kind=kind_phys) cl(l,2:n), cm(l,n), cu(l,n-1), & - & r1(l,n), r2(l,n*nt), & - & au(l,n-1), a1(l,n), a2(l,n*nt), & - & fkk(l,2:n-1) + & r1(l,n), r2(l,n*nt), & + & au(l,n-1), a1(l,n), a2(l,n*nt), & + & fkk(l,2:n-1) c----------------------------------------------------------------------- do i=1,l fk(i) = 1./cm(i,1) From 4c7200685d08f7a2abbc9ebf520cee346e04ce32 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Mon, 13 Nov 2017 19:07:10 -0700 Subject: [PATCH 18/48] fixed column in tridi.f --- physics/tridi.f | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/tridi.f b/physics/tridi.f index a8f29f928..dbf03e62b 100644 --- a/physics/tridi.f +++ b/physics/tridi.f @@ -5,7 +5,7 @@ subroutine tridi2(l,n,cl,cm,cu,r1,r2,au,a1,a2) integer k,n,l,i real(kind=kind_phys) fk cc - real(kind=kind_phys) cl(l,2:n),cm(l,n),cu(l,n-1),r1(l,n),r2(l,n),& + real(kind=kind_phys) cl(l,2:n),cm(l,n),cu(l,n-1),r1(l,n),r2(l,n), & & au(l,n-1),a1(l,n),a2(l,n) c---------------------------------------------------------------------- do i=1,l From e729c2300852b4a37f05eeec2c1abd8bd26f7d4c Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Wed, 15 Nov 2017 14:52:11 -0700 Subject: [PATCH 19/48] longname fix in moninedmf.f --- physics/moninedmf.f | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/physics/moninedmf.f b/physics/moninedmf.f index 81ac9dc56..e16362a7f 100755 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -67,8 +67,8 @@ end subroutine edmf_finalize !! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | !! | delt | time_step_for_physics | time step for physics | s | 0 | real | kind_phys | in | F | !! | dspheat | flag_TKE_dissipation_heating | flag for using TKE dissipation heating | flag | 0 | logical | | in | F | -!! | dusfc | instantaneous_x_momentum_flux | x momentum flux | Pa | 1 | real | kind_phys | out | F | -!! | dvsfc | instantaneous_y_momentum_flux | y momentum flux | Pa | 1 | real | kind_phys | out | F | +!! | dusfc | instantaneous_surface_x_momentum_flux | x momentum flux | Pa | 1 | real | kind_phys | out | F | +!! | dvsfc | instantaneous_surface_y_momentum_flux | y momentum flux | Pa | 1 | real | kind_phys | out | F | !! | dtsfc | instantaneous_surface_upward_sensible_heat_flux | surface upward sensible heat flux | W m-2 | 1 | real | kind_phys | out | F | !! | dqsfc | instantaneous_surface_upward_latent_heat_flux | surface upward latent heat flux | W m-2 | 1 | real | kind_phys | out | F | !! | hpbl | atmosphere_boundary_layer_thickness | PBL thickness | m | 1 | real | kind_phys | out | F | From 2ef4c22c64784bb00d43be426c9573a16a84adb5 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Wed, 15 Nov 2017 14:58:31 -0700 Subject: [PATCH 20/48] Added code necessary for the generic deep convection interstitial schemes - created GFS_DCNV_generic.f90 with modules for pre and post - moved code from GFS_physics_driver.f90 to this file - call the new subroutines from GFS_physics_driver.f90 - edited makefile to compile new file - edits to sasasdeep_run table in mfdeepcnv.f - NOT TESTED YET (committing to test on Theia) --- GFS_layer/GFS_physics_driver.F90 | 66 +++++++++-------- makefile | 1 + physics/GFS_DCNV_generic.f90 | 118 +++++++++++++++++++++++++++++++ 3 files changed, 157 insertions(+), 28 deletions(-) create mode 100644 physics/GFS_DCNV_generic.f90 diff --git a/GFS_layer/GFS_physics_driver.F90 b/GFS_layer/GFS_physics_driver.F90 index 65f7d2284..d8bbb38e9 100644 --- a/GFS_layer/GFS_physics_driver.F90 +++ b/GFS_layer/GFS_physics_driver.F90 @@ -18,6 +18,9 @@ module module_physics_driver use edmf, only: edmf_run use GFS_PBL_generic_pre, only: GFS_PBL_generic_pre_run use GFS_PBL_generic_post, only: GFS_PBL_generic_post_run +! use sasas_deep, only: sasasdeep_run + use GFS_DCNV_generic_pre, only: GFS_DCNV_generic_pre_run + use GFS_DCNV_generic_post, only: GFS_DCNV_generic_post_run implicit none @@ -463,6 +466,9 @@ subroutine GFS_physics_driver & del, rhc, dtdt, dudt, dvdt, gwdcu, gwdcv, dtdtc, rainp, & ud_mf, dd_mf, dt_mf, prnum, dkt, sigmatot, sigmafrac + real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levs) :: & + initial_u, initial_v, initial_t, initial_qv + !--- GFDL modification for FV3 real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levs+1) ::& del_gz @@ -1501,17 +1507,19 @@ subroutine GFS_physics_driver & ! &,' lat=',lat,' kdt=',kdt,' me=',me ! if (lprnt) write(7000,*)' bef convection gv0=',gv0(ipr,:) - if (Model%ldiag3d) then - dtdt(:,:) = Stateout%gt0(:,:) - dudt(:,:) = Stateout%gu0(:,:) - dvdt(:,:) = Stateout%gv0(:,:) - elseif (Model%cnvgwd) then - dtdt(:,:) = Stateout%gt0(:,:) - endif ! end if_ldiag3d/cnvgwd + ! if (Model%ldiag3d) then + ! dtdt(:,:) = Stateout%gt0(:,:) + ! dudt(:,:) = Stateout%gu0(:,:) + ! dvdt(:,:) = Stateout%gv0(:,:) + ! elseif (Model%cnvgwd) then + ! dtdt(:,:) = Stateout%gt0(:,:) + ! endif ! end if_ldiag3d/cnvgwd + ! + ! if (Model%ldiag3d .or. Model%lgocart) then + ! dqdt(:,:,1) = Stateout%gq0(:,:,1) + ! endif ! end if_ldiag3d/lgocart - if (Model%ldiag3d .or. Model%lgocart) then - dqdt(:,:,1) = Stateout%gq0(:,:,1) - endif ! end if_ldiag3d/lgocart + call GFS_DCNV_generic_pre_run (Model, Stateout, Grid, initial_u, initial_v, initial_t, intial_qv) #ifdef GFS_HYDRO call get_phi(im, ix, levs, ntrac, Stateout%gt0, Stateout%gq0, & @@ -1864,26 +1872,28 @@ subroutine GFS_physics_driver & ! write(0,*)' aftcnvgq1=',(gq0(ipr,k,ntcw),k=1,levs) ! endif ! - do i = 1, im - Diag%rainc(:) = frain * rain1(:) - enddo +! do i = 1, im +! Diag%rainc(:) = frain * rain1(:) +! enddo +! ! +! if (Model%lssav) then +! Diag%cldwrk (:) = Diag%cldwrk (:) + cld1d(:) * dtf +! Diag%cnvprcp(:) = Diag%cnvprcp(:) + Diag%rainc(:) ! - if (Model%lssav) then - Diag%cldwrk (:) = Diag%cldwrk (:) + cld1d(:) * dtf - Diag%cnvprcp(:) = Diag%cnvprcp(:) + Diag%rainc(:) - - if (Model%ldiag3d) then - Diag%dt3dt(:,:,4) = Diag%dt3dt(:,:,4) + (Stateout%gt0(:,:)-dtdt(:,:)) * frain - Diag%dq3dt(:,:,2) = Diag%dq3dt(:,:,2) + (Stateout%gq0(:,:,1)-dqdt(:,:,1)) * frain - Diag%du3dt(:,:,3) = Diag%du3dt(:,:,3) + (Stateout%gu0(:,:)-dudt(:,:)) * frain - Diag%dv3dt(:,:,3) = Diag%dv3dt(:,:,3) + (Stateout%gv0(:,:)-dvdt(:,:)) * frain - - Diag%upd_mf(:,:) = Diag%upd_mf(:,:) + ud_mf(:,:) * (con_g*frain) - Diag%dwn_mf(:,:) = Diag%dwn_mf(:,:) + dd_mf(:,:) * (con_g*frain) - Diag%det_mf(:,:) = Diag%det_mf(:,:) + dt_mf(:,:) * (con_g*frain) - endif ! if (ldiag3d) +! if (Model%ldiag3d) then +! Diag%dt3dt(:,:,4) = Diag%dt3dt(:,:,4) + (Stateout%gt0(:,:)-dtdt(:,:)) * frain +! Diag%dq3dt(:,:,2) = Diag%dq3dt(:,:,2) + (Stateout%gq0(:,:,1)-dqdt(:,:,1)) * frain +! Diag%du3dt(:,:,3) = Diag%du3dt(:,:,3) + (Stateout%gu0(:,:)-dudt(:,:)) * frain +! Diag%dv3dt(:,:,3) = Diag%dv3dt(:,:,3) + (Stateout%gv0(:,:)-dvdt(:,:)) * frain +! +! Diag%upd_mf(:,:) = Diag%upd_mf(:,:) + ud_mf(:,:) * (con_g*frain) +! Diag%dwn_mf(:,:) = Diag%dwn_mf(:,:) + dd_mf(:,:) * (con_g*frain) +! Diag%det_mf(:,:) = Diag%det_mf(:,:) + dt_mf(:,:) * (con_g*frain) +! endif ! if (ldiag3d) +! +! endif ! end if_lssav - endif ! end if_lssav + call GFS_DCNV_generic_post_run (Grid, Model, Stateout, frain, rain1, cld1d, initial_u, intial_v, intial_t, initial_qv, ud_mf, dd_mf, dt_mf, Diag) ! ! update dqdt_v to include moisture tendency due to deep convection if (Model%lgocart) then diff --git a/makefile b/makefile index 7d390e201..5ebbce687 100644 --- a/makefile +++ b/makefile @@ -121,6 +121,7 @@ SRCS_f90 = \ ./physics/gcm_shoc.f90 \ ./physics/gcycle.f90 \ ./physics/get_prs_fv3.f90 \ + ./physics/GFS_DCNV_generic.f90 \ ./physics/GFS_PBL_generic.f90 \ ./physics/h2ointerp.f90 \ ./physics/m_micro_driver.f90 \ diff --git a/physics/GFS_DCNV_generic.f90 b/physics/GFS_DCNV_generic.f90 new file mode 100644 index 000000000..7a5b1fae9 --- /dev/null +++ b/physics/GFS_DCNV_generic.f90 @@ -0,0 +1,118 @@ +!> \file GFS_DCNV_generic.f90 +!! Contains code related to deep convective schemes to be used within the GFS physics suite. + + module GFS_DCNV_generic_pre + + contains + + subroutine GFS_DCNV_generic_pre_init () + end subroutine GFS_DCNV_generic_pre_init + + subroutine GFS_DCNV_generic_pre_finalize() + end subroutine GFS_DCNV_generic_pre_finalize + +!> \section arg_table_GFS_DCNV_generic_pre_run Argument Table +!! | local var name | longname | description | units | rank | type | kind | intent | optional | +!! |----------------|--------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| +!! | Model | FV3-GFS_Control_type | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_typedefs%GFS_control_type | | in | F | +!! | Stateout | FV3-GFS_Stateout_type | Fortran DDT containing FV3-GFS prognostic state to return to dycore | DDT | 0 | GFS_typedefs%GFS_stateout_type| | in | F | +!! | Grid | FV3-GFS_Grid_type | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_typedefs%GFS_grid_type | | in | F | +!! | initial_u | x_wind_initial | x-wind before entering a physics scheme | m s-1 | 2 | real | kind_phys | inout | F | +!! | initial_v | y_wind_initial | y-wind before entering a physics scheme | m s-1 | 2 | real | kind_phys | inout | F | +!! | initial_t | air_temperature_initial | air temperature before entering a physics scheme | K | 2 | real | kind_phys | inout | F | +!! | initial_qv | water_vapor_specific_humidity_initial | water vapor specific humidity before entering a physics scheme | kg kg-1 | 2 | real | kind_phys | inout | F | +!! + subroutine GFS_DCNV_generic_pre_run (Model, Stateout, Grid, initial_u, initial_v, initial_t, intial_qv) + use machine, only: kind_phys + use GFS_typedefs, only: GFS_control_type, GFS_stateout_type, GFS_grid_type + + type(GFS_control_type), intent(in) :: Model + type(GFS_stateout_type), intent(in) :: Stateout + type(GFS_grid_type), intent(in) :: Grid + real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levs), intent(inout) :: initial_u, initial_v, intial_t, intial_qv + + if (Model%ldiag3d) then + initial_t(:,:) = Stateout%gt0(:,:) + initial_u(:,:) = Stateout%gu0(:,:) + initial_v(:,:) = Stateout%gv0(:,:) + elseif (Model%cnvgwd) then + initial_t(:,:) = Stateout%gt0(:,:) + endif ! end if_ldiag3d/cnvgwd + + if (Model%ldiag3d .or. Model%lgocart) then + initial_qv(:,:) = Stateout%gq0(:,:,1) + endif ! end if_ldiag3d/lgocart + + end subroutine GFS_DCNV_generic_pre_run + + end module + + module GFS_DCNV_generic_post + + contains + + subroutine GFS_DCNV_generic_post_init () + end subroutine GFS_DCNV_generic_post_init + + subroutine GFS_DCNV_generic_post_finalize () + end subroutine GFS_DCNV_generic_post_finalize + +!> \section arg_table_GFS_PBL_generic_post_run Argument Table +!! | local var name | longname | description | units | rank | type | kind | intent | optional | +!! |----------------|-----------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| +!! | Grid | FV3-GFS_Grid_type | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_typedefs%GFS_grid_type | | in | F | +!! | Model | FV3-GFS_Control_type | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_typedefs%GFS_control_type | | in | F | +!! | frain | dynamics_to_physics_timestep_ratio | ratio of dynamics timestep to physics timestep | none | 0 | real | kind_phys | in | F | +!! | rain1 | instantaneous_rainfall_amount | instantaneous rainfall amount | m | 1 | real | kind_phys | in | F | +!! | cld1d | cloud_work_function | cloud work function | m2 s-2 | 1 | real | kind_phys | in | F | +!! | initial_u | x_wind_initial | x-wind before entering a physics scheme | m s-1 | 2 | real | kind_phys | in | F | +!! | initial_v | y_wind_initial | y-wind before entering a physics scheme | m s-1 | 2 | real | kind_phys | in | F | +!! | initial_t | air_temperature_initial | air temperature before entering a physics scheme | K | 2 | real | kind_phys | in | F | +!! | initial_qv | water_vapor_specific_humidity_initial | water vapor specific humidity before entering a physics scheme | kg kg-1 | 2 | real | kind_phys | in | F | +!! | ud_mf | instantaneous_atmosphere_updraft_convective_mass_flux | (updraft mass flux) * delt | kg m-2 | 2 | real | kind_phys | in | F | +!! | dd_mf | instantaneous_atmosphere_downdraft_convective_mass_flux | (downdraft mass flux) * delt | kg m-2 | 2 | real | kind_phys | in | F | +!! | dt_mf | instantaneous_atmosphere_detrainment_convective_mass_flux | (detrainment mass flux) * delt | kg m-2 | 2 | real | kind_phys | in | F | +!! | Diag | FV3-GFS_diag_type | Fortran DDT containing FV3-GFS fields targeted for diagnostic output | DDT | 0 | GFS_typedefs%GFS_diag_type | | inout | F | +!! + subroutine GFS_DCNV_generic_post_run (Grid, Model, Stateout, frain, rain1, cld1d, initial_u, intial_v, intial_t, initial_qv, ud_mf, dd_mf, dt_mf, Diag) + + use machine, only: kind_phys + use GFS_typedefs, only: GFS_grid_type, GFS_control_type, GFS_stateout_type, GFS_diag_type + use physcons, only: con_g + + type(GFS_grid_type), intent(in) :: Grid + type(GFS_control_type), intent(in) :: Model + type(GFS_stateout_type), intent(in) :: Stateout + type(GFS_diag_type), intent(inout) :: Diag + + real(kind=kind_phys), intent(in) :: frain + real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: rain1, cld1d + real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levs), intent(in) :: initial_u, initial_v, intial_t, intial_qv + real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levs), intent(in) :: ud_mf, dd_mf, dt_mf + + integer :: i + + + do i = 1, size(Grid%xlon,1) + Diag%rainc(:) = frain * rain1(:) + enddo + ! + if (Model%lssav) then + Diag%cldwrk (:) = Diag%cldwrk (:) + cld1d(:) * Model%dtf + Diag%cnvprcp(:) = Diag%cnvprcp(:) + Diag%rainc(:) + + if (Model%ldiag3d) then + Diag%dt3dt(:,:,4) = Diag%dt3dt(:,:,4) + (Stateout%gt0(:,:)-initial_t(:,:)) * frain + Diag%dq3dt(:,:,2) = Diag%dq3dt(:,:,2) + (Stateout%gq0(:,:,1)-initial_qv(:,:)) * frain + Diag%du3dt(:,:,3) = Diag%du3dt(:,:,3) + (Stateout%gu0(:,:)-initial_u(:,:)) * frain + Diag%dv3dt(:,:,3) = Diag%dv3dt(:,:,3) + (Stateout%gv0(:,:)-initial_v(:,:)) * frain + + Diag%upd_mf(:,:) = Diag%upd_mf(:,:) + ud_mf(:,:) * (con_g*frain) + Diag%dwn_mf(:,:) = Diag%dwn_mf(:,:) + dd_mf(:,:) * (con_g*frain) + Diag%det_mf(:,:) = Diag%det_mf(:,:) + dt_mf(:,:) * (con_g*frain) + endif ! if (ldiag3d) + + endif ! end if_lssav + end subroutine GFS_DCNV_generic_post_run + + end module From 215e3977a090718fd7a9402c9394962b8d15ba0b Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Wed, 15 Nov 2017 15:06:43 -0700 Subject: [PATCH 21/48] typo fixes to GFS_DCNV_generic.f90 found when compiling --- physics/GFS_DCNV_generic.f90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/physics/GFS_DCNV_generic.f90 b/physics/GFS_DCNV_generic.f90 index 7a5b1fae9..65389c741 100644 --- a/physics/GFS_DCNV_generic.f90 +++ b/physics/GFS_DCNV_generic.f90 @@ -22,14 +22,14 @@ end subroutine GFS_DCNV_generic_pre_finalize !! | initial_t | air_temperature_initial | air temperature before entering a physics scheme | K | 2 | real | kind_phys | inout | F | !! | initial_qv | water_vapor_specific_humidity_initial | water vapor specific humidity before entering a physics scheme | kg kg-1 | 2 | real | kind_phys | inout | F | !! - subroutine GFS_DCNV_generic_pre_run (Model, Stateout, Grid, initial_u, initial_v, initial_t, intial_qv) + subroutine GFS_DCNV_generic_pre_run (Model, Stateout, Grid, initial_u, initial_v, initial_t, initial_qv) use machine, only: kind_phys use GFS_typedefs, only: GFS_control_type, GFS_stateout_type, GFS_grid_type type(GFS_control_type), intent(in) :: Model type(GFS_stateout_type), intent(in) :: Stateout type(GFS_grid_type), intent(in) :: Grid - real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levs), intent(inout) :: initial_u, initial_v, intial_t, intial_qv + real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levs), intent(inout) :: initial_u, initial_v, initial_t, initial_qv if (Model%ldiag3d) then initial_t(:,:) = Stateout%gt0(:,:) @@ -74,7 +74,7 @@ end subroutine GFS_DCNV_generic_post_finalize !! | dt_mf | instantaneous_atmosphere_detrainment_convective_mass_flux | (detrainment mass flux) * delt | kg m-2 | 2 | real | kind_phys | in | F | !! | Diag | FV3-GFS_diag_type | Fortran DDT containing FV3-GFS fields targeted for diagnostic output | DDT | 0 | GFS_typedefs%GFS_diag_type | | inout | F | !! - subroutine GFS_DCNV_generic_post_run (Grid, Model, Stateout, frain, rain1, cld1d, initial_u, intial_v, intial_t, initial_qv, ud_mf, dd_mf, dt_mf, Diag) + subroutine GFS_DCNV_generic_post_run (Grid, Model, Stateout, frain, rain1, cld1d, initial_u, initial_v, initial_t, initial_qv, ud_mf, dd_mf, dt_mf, Diag) use machine, only: kind_phys use GFS_typedefs, only: GFS_grid_type, GFS_control_type, GFS_stateout_type, GFS_diag_type @@ -87,7 +87,7 @@ subroutine GFS_DCNV_generic_post_run (Grid, Model, Stateout, frain, rain1, cld1d real(kind=kind_phys), intent(in) :: frain real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: rain1, cld1d - real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levs), intent(in) :: initial_u, initial_v, intial_t, intial_qv + real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levs), intent(in) :: initial_u, initial_v, initial_t, initial_qv real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levs), intent(in) :: ud_mf, dd_mf, dt_mf integer :: i From e0290016c99587415d905ba5e76435fd43f13cb0 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Wed, 15 Nov 2017 15:10:23 -0700 Subject: [PATCH 22/48] fixed typo in GFS_physics_driver.F90 found when compiling --- GFS_layer/GFS_physics_driver.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GFS_layer/GFS_physics_driver.F90 b/GFS_layer/GFS_physics_driver.F90 index d8bbb38e9..073300c51 100644 --- a/GFS_layer/GFS_physics_driver.F90 +++ b/GFS_layer/GFS_physics_driver.F90 @@ -1519,7 +1519,7 @@ subroutine GFS_physics_driver & ! dqdt(:,:,1) = Stateout%gq0(:,:,1) ! endif ! end if_ldiag3d/lgocart - call GFS_DCNV_generic_pre_run (Model, Stateout, Grid, initial_u, initial_v, initial_t, intial_qv) + call GFS_DCNV_generic_pre_run (Model, Stateout, Grid, initial_u, initial_v, initial_t, initial_qv) #ifdef GFS_HYDRO call get_phi(im, ix, levs, ntrac, Stateout%gt0, Stateout%gq0, & @@ -1893,7 +1893,7 @@ subroutine GFS_physics_driver & ! ! endif ! end if_lssav - call GFS_DCNV_generic_post_run (Grid, Model, Stateout, frain, rain1, cld1d, initial_u, intial_v, intial_t, initial_qv, ud_mf, dd_mf, dt_mf, Diag) + call GFS_DCNV_generic_post_run (Grid, Model, Stateout, frain, rain1, cld1d, initial_u, initial_v, initial_t, initial_qv, ud_mf, dd_mf, dt_mf, Diag) ! ! update dqdt_v to include moisture tendency due to deep convection if (Model%lgocart) then From d7e16bab8091fcf6067c67a5b1d6bcd9beb186a2 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Wed, 15 Nov 2017 15:56:53 -0700 Subject: [PATCH 23/48] found some more lines in GFS_physics_driver.F90 that belong in DCNV_generic_post --- GFS_layer/GFS_physics_driver.F90 | 18 +++++++++--------- physics/GFS_DCNV_generic.f90 | 22 ++++++++++++++++++---- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/GFS_layer/GFS_physics_driver.F90 b/GFS_layer/GFS_physics_driver.F90 index 073300c51..1f8db1231 100644 --- a/GFS_layer/GFS_physics_driver.F90 +++ b/GFS_layer/GFS_physics_driver.F90 @@ -1904,15 +1904,15 @@ subroutine GFS_physics_driver & Coupling%cnvqci (:,:) = Coupling%cnvqci (:,:) + (clw(:,:,1)+clw(:,:,2))*frain endif ! if (lgocart) ! - if ((Model%npdf3d == 3) .and. (Model%num_p3d == 4)) then - num2 = Model%num_p3d + 2 - num3 = num2 + 1 - Tbd%phy_f3d(:,:,num2) = cnvw(:,:) - Tbd%phy_f3d(:,:,num3) = cnvc(:,:) - elseif ((Model%npdf3d == 0) .and. (Model%ncnvcld3d == 1)) then - num2 = Model%num_p3d + 1 - Tbd%phy_f3d(:,:,num2) = cnvw(:,:) - endif + ! if ((Model%npdf3d == 3) .and. (Model%num_p3d == 4)) then + ! num2 = Model%num_p3d + 2 + ! num3 = num2 + 1 + ! Tbd%phy_f3d(:,:,num2) = cnvw(:,:) + ! Tbd%phy_f3d(:,:,num3) = cnvc(:,:) + ! elseif ((Model%npdf3d == 0) .and. (Model%ncnvcld3d == 1)) then + ! num2 = Model%num_p3d + 1 + ! Tbd%phy_f3d(:,:,num2) = cnvw(:,:) + ! endif ! if (lprnt) write(7000,*)' bef cnvgwd gu0=',gu0(ipr,:) ! &,' lat=',lat,' kdt=',kdt,' me=',me diff --git a/physics/GFS_DCNV_generic.f90 b/physics/GFS_DCNV_generic.f90 index 65389c741..27e020290 100644 --- a/physics/GFS_DCNV_generic.f90 +++ b/physics/GFS_DCNV_generic.f90 @@ -72,9 +72,11 @@ end subroutine GFS_DCNV_generic_post_finalize !! | ud_mf | instantaneous_atmosphere_updraft_convective_mass_flux | (updraft mass flux) * delt | kg m-2 | 2 | real | kind_phys | in | F | !! | dd_mf | instantaneous_atmosphere_downdraft_convective_mass_flux | (downdraft mass flux) * delt | kg m-2 | 2 | real | kind_phys | in | F | !! | dt_mf | instantaneous_atmosphere_detrainment_convective_mass_flux | (detrainment mass flux) * delt | kg m-2 | 2 | real | kind_phys | in | F | -!! | Diag | FV3-GFS_diag_type | Fortran DDT containing FV3-GFS fields targeted for diagnostic output | DDT | 0 | GFS_typedefs%GFS_diag_type | | inout | F | +!! | Diag | FV3-GFS_Diag_type | Fortran DDT containing FV3-GFS fields targeted for diagnostic output | DDT | 0 | GFS_typedefs%GFS_diag_type | | inout | F | +!! | Tbd | FV3-GFS_Tbd_type | Fortran DDT containing FV3-GFS miscellaneous data | DDT | 0 | GFS_typedefs%GFS_tbd_type | | inout | F | !! - subroutine GFS_DCNV_generic_post_run (Grid, Model, Stateout, frain, rain1, cld1d, initial_u, initial_v, initial_t, initial_qv, ud_mf, dd_mf, dt_mf, Diag) + subroutine GFS_DCNV_generic_post_run (Grid, Model, Stateout, frain, rain1, cld1d, initial_u, initial_v, initial_t, initial_qv, & + ud_mf, dd_mf, dt_mf, cnvw, cnvc, Diag, Tbd) use machine, only: kind_phys use GFS_typedefs, only: GFS_grid_type, GFS_control_type, GFS_stateout_type, GFS_diag_type @@ -84,14 +86,15 @@ subroutine GFS_DCNV_generic_post_run (Grid, Model, Stateout, frain, rain1, cld1d type(GFS_control_type), intent(in) :: Model type(GFS_stateout_type), intent(in) :: Stateout type(GFS_diag_type), intent(inout) :: Diag + type(GFS_tbd_type), intent(inout) :: Tbd real(kind=kind_phys), intent(in) :: frain real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: rain1, cld1d real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levs), intent(in) :: initial_u, initial_v, initial_t, initial_qv real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levs), intent(in) :: ud_mf, dd_mf, dt_mf + real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levs), intent(in) :: cnvw, cnvc - integer :: i - + integer :: i, num2, num3 do i = 1, size(Grid%xlon,1) Diag%rainc(:) = frain * rain1(:) @@ -113,6 +116,17 @@ subroutine GFS_DCNV_generic_post_run (Grid, Model, Stateout, frain, rain1, cld1d endif ! if (ldiag3d) endif ! end if_lssav + + if ((Model%npdf3d == 3) .and. (Model%num_p3d == 4)) then + num2 = Model%num_p3d + 2 + num3 = num2 + 1 + Tbd%phy_f3d(:,:,num2) = cnvw(:,:) + Tbd%phy_f3d(:,:,num3) = cnvc(:,:) + elseif ((Model%npdf3d == 0) .and. (Model%ncnvcld3d == 1)) then + num2 = Model%num_p3d + 1 + Tbd%phy_f3d(:,:,num2) = cnvw(:,:) + endif + end subroutine GFS_DCNV_generic_post_run end module From 67f98a3285e7e1520034a5be2b1d52611b38e5cc Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Wed, 15 Nov 2017 16:09:14 -0700 Subject: [PATCH 24/48] propogated change from dudt, dvdt, dtdt, dqdt to initial_u, ... after the call to GFS_DCNV_generic_pre_run to try to fix B4B error introduced in commit e029001 --- GFS_layer/GFS_physics_driver.F90 | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/GFS_layer/GFS_physics_driver.F90 b/GFS_layer/GFS_physics_driver.F90 index 1f8db1231..70646a8e8 100644 --- a/GFS_layer/GFS_physics_driver.F90 +++ b/GFS_layer/GFS_physics_driver.F90 @@ -1897,7 +1897,7 @@ subroutine GFS_physics_driver & ! ! update dqdt_v to include moisture tendency due to deep convection if (Model%lgocart) then - Coupling%dqdti (:,:) = (Stateout%gq0(:,:,1) - dqdt(:,:,1)) * frain + Coupling%dqdti (:,:) = (Stateout%gq0(:,:,1) - initial_qv(:,:)) * frain Coupling%upd_mfi(:,:) = Coupling%upd_mfi(:,:) + ud_mf(:,:) * frain Coupling%dwn_mfi(:,:) = Coupling%dwn_mfi(:,:) + dd_mf(:,:) * frain Coupling%det_mfi(:,:) = Coupling%det_mfi(:,:) + dt_mf(:,:) * frain @@ -1930,7 +1930,7 @@ subroutine GFS_physics_driver & do k = 1, levs do i = 1, im if (k >= kbot(i) .and. k <= ktop(i)) then - cumabs(i) = cumabs(i) + (Stateout%gt0(i,k)-dtdt(i,k)) * del(i,k) + cumabs(i) = cumabs(i) + (Stateout%gt0(i,k)-initial_t(i,k)) * del(i,k) work3(i) = work3(i) + del(i,k) endif enddo @@ -2088,10 +2088,10 @@ subroutine GFS_physics_driver & !----------------Convective gravity wave drag parameterization over -------- if (Model%ldiag3d) then - dtdt(:,:) = Stateout%gt0(:,:) + initial_t(:,:) = Stateout%gt0(:,:) endif if (Model%ldiag3d .or. Model%lgocart) then - dqdt(:,:,1) = Stateout%gq0(:,:,1) + initial_qv(:,:) = Stateout%gq0(:,:,1) endif ! write(0,*)' before do_shoc shal clstp=',clstp,' kdt=',kdt, @@ -2188,14 +2188,14 @@ subroutine GFS_physics_driver & if (Model%lgocart) then do k = 1, levs do i = 1, im - tem = (Stateout%gq0(i,k,1)-dqdt(i,k,1)) * frain + tem = (Stateout%gq0(i,k,1)-initial_qv(i,k)) * frain Coupling%dqdti(i,k) = Coupling%dqdti(i,k) + tem enddo enddo endif if (Model%ldiag3d) then - Diag%dt3dt(:,:,5) = Diag%dt3dt(:,:,5) + (Stateout%gt0(:,:)-dtdt(:,:)) * frain - Diag%dq3dt(:,:,3) = Diag%dq3dt(:,:,3) + (Stateout%gq0(:,:,1)-dqdt(:,:,1)) * frain + Diag%dt3dt(:,:,5) = Diag%dt3dt(:,:,5) + (Stateout%gt0(:,:)-initial_t(:,:)) * frain + Diag%dq3dt(:,:,3) = Diag%dq3dt(:,:,3) + (Stateout%gq0(:,:,1)-initial_qv(:,:)) * frain endif endif ! end if_lssav ! @@ -2342,15 +2342,15 @@ subroutine GFS_physics_driver & ! enddo ! endif if (Model%ldiag3d) then - Diag%dt3dt(:,:,4) = Diag%dt3dt(:,:,4) + (Stateout%gt0(:,:) -dtdt(:,:) ) * frain - Diag%dq3dt(:,:,2) = Diag%dq3dt(:,:,2) + (Stateout%gq0(:,:,1)-dqdt(:,:,1)) * frain + Diag%dt3dt(:,:,4) = Diag%dt3dt(:,:,4) + (Stateout%gt0(:,:) -initial_t(:,:) ) * frain + Diag%dq3dt(:,:,2) = Diag%dq3dt(:,:,2) + (Stateout%gq0(:,:,1)-initial_qv(:,:)) * frain endif endif endif ! moist convective adjustment over ! if (Model%ldiag3d .or. Model%do_aw) then - dtdt(:,:) = Stateout%gt0(:,:) - dqdt(:,:,1) = Stateout%gq0(:,:,1) + initial_t(:,:) = Stateout%gt0(:,:) + initial_qv(:,:) = Stateout%gq0(:,:,1) do n=Model%ntcw,Model%ntcw+Model%ncld-1 dqdt(:,:,n) = Stateout%gq0(:,:,n) enddo @@ -2558,8 +2558,8 @@ subroutine GFS_physics_driver & do k = 1,levs do i = 1,im tem1 = sigmafrac(i,k) - Stateout%gt0(i,k) = Stateout%gt0(i,k) - tem1 * (Stateout%gt0(i,k)-dtdt(i,k)) - tem2 = tem1 * (Stateout%gq0(i,k,1)-dqdt(i,k,1)) + Stateout%gt0(i,k) = Stateout%gt0(i,k) - tem1 * (Stateout%gt0(i,k)-initial_t(i,k)) + tem2 = tem1 * (Stateout%gq0(i,k,1)-initial_qv(i,k)) Stateout%gq0(i,k,1) = Stateout%gq0(i,k,1) - tem2 temrain1(i) = temrain1(i) - (Statein%prsi(i,k)-Statein%prsi(i,k+1)) & * tem2 * onebg @@ -2613,8 +2613,8 @@ subroutine GFS_physics_driver & Diag%totprcp(:) = Diag%totprcp(:) + Diag%rain(:) if (Model%ldiag3d) then - Diag%dt3dt(:,:,6) = Diag%dt3dt(:,:,6) + (Stateout%gt0(:,:)-dtdt(:,:)) * frain - Diag%dq3dt(:,:,4) = Diag%dq3dt(:,:,4) + (Stateout%gq0(:,:,1)-dqdt(:,:,1)) * frain + Diag%dt3dt(:,:,6) = Diag%dt3dt(:,:,6) + (Stateout%gt0(:,:)-initial_t(:,:)) * frain + Diag%dq3dt(:,:,4) = Diag%dq3dt(:,:,4) + (Stateout%gq0(:,:,1)-initial_qv(:,:)) * frain endif endif From c743938cbf9810b259392c7010c1aa1448f750c6 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Wed, 15 Nov 2017 16:14:16 -0700 Subject: [PATCH 25/48] added GFS_tbd_type in use statement --- physics/GFS_DCNV_generic.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/GFS_DCNV_generic.f90 b/physics/GFS_DCNV_generic.f90 index 27e020290..56646d691 100644 --- a/physics/GFS_DCNV_generic.f90 +++ b/physics/GFS_DCNV_generic.f90 @@ -79,7 +79,7 @@ subroutine GFS_DCNV_generic_post_run (Grid, Model, Stateout, frain, rain1, cld1d ud_mf, dd_mf, dt_mf, cnvw, cnvc, Diag, Tbd) use machine, only: kind_phys - use GFS_typedefs, only: GFS_grid_type, GFS_control_type, GFS_stateout_type, GFS_diag_type + use GFS_typedefs, only: GFS_grid_type, GFS_control_type, GFS_stateout_type, GFS_diag_type, GFS_tbd_type use physcons, only: con_g type(GFS_grid_type), intent(in) :: Grid From 97ec943cad8f5b6fd92c042bce3650d5521e226d Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Wed, 15 Nov 2017 16:16:26 -0700 Subject: [PATCH 26/48] added Tbd to call to GFS_DCNV_generic_post_run in GFS_physics_driver.F90 --- GFS_layer/GFS_physics_driver.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GFS_layer/GFS_physics_driver.F90 b/GFS_layer/GFS_physics_driver.F90 index 70646a8e8..390cf3f67 100644 --- a/GFS_layer/GFS_physics_driver.F90 +++ b/GFS_layer/GFS_physics_driver.F90 @@ -1893,7 +1893,7 @@ subroutine GFS_physics_driver & ! ! endif ! end if_lssav - call GFS_DCNV_generic_post_run (Grid, Model, Stateout, frain, rain1, cld1d, initial_u, initial_v, initial_t, initial_qv, ud_mf, dd_mf, dt_mf, Diag) + call GFS_DCNV_generic_post_run (Grid, Model, Stateout, frain, rain1, cld1d, initial_u, initial_v, initial_t, initial_qv, ud_mf, dd_mf, dt_mf, Diag, Tbd) ! ! update dqdt_v to include moisture tendency due to deep convection if (Model%lgocart) then From fd942aca64969d5da61247e8d427e2076091cc2d Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Wed, 15 Nov 2017 16:19:19 -0700 Subject: [PATCH 27/48] fixed call to GFS_DCNV_generic_post_run again --- GFS_layer/GFS_physics_driver.F90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GFS_layer/GFS_physics_driver.F90 b/GFS_layer/GFS_physics_driver.F90 index 390cf3f67..ca5a68f6e 100644 --- a/GFS_layer/GFS_physics_driver.F90 +++ b/GFS_layer/GFS_physics_driver.F90 @@ -1893,7 +1893,8 @@ subroutine GFS_physics_driver & ! ! endif ! end if_lssav - call GFS_DCNV_generic_post_run (Grid, Model, Stateout, frain, rain1, cld1d, initial_u, initial_v, initial_t, initial_qv, ud_mf, dd_mf, dt_mf, Diag, Tbd) + call GFS_DCNV_generic_post_run (Grid, Model, Stateout, frain, rain1, cld1d, & + initial_u, initial_v, initial_t, initial_qv, ud_mf, dd_mf, dt_mf, cnvw, cnvc, Diag, Tbd) ! ! update dqdt_v to include moisture tendency due to deep convection if (Model%lgocart) then From beba967413ddb884a0fa57aed6783f443a76da19 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Thu, 16 Nov 2017 11:45:54 -0700 Subject: [PATCH 28/48] added first GFS_suite_interstitial subroutine (not compiled yet) --- GFS_layer/GFS_physics_driver.F90 | 50 +++++++++++++----------- makefile | 1 + physics/GFS_DCNV_generic.f90 | 2 +- physics/GFS_suite_interstitial.f90 | 62 ++++++++++++++++++++++++++++++ 4 files changed, 91 insertions(+), 24 deletions(-) create mode 100644 physics/GFS_suite_interstitial.f90 diff --git a/GFS_layer/GFS_physics_driver.F90 b/GFS_layer/GFS_physics_driver.F90 index ca5a68f6e..61e5a73ed 100644 --- a/GFS_layer/GFS_physics_driver.F90 +++ b/GFS_layer/GFS_physics_driver.F90 @@ -21,6 +21,7 @@ module module_physics_driver ! use sasas_deep, only: sasasdeep_run use GFS_DCNV_generic_pre, only: GFS_DCNV_generic_pre_run use GFS_DCNV_generic_post, only: GFS_DCNV_generic_post_run + use GFS_suite_interstitial_1, only: GFS_suite_interstitial_1_run implicit none @@ -525,25 +526,26 @@ subroutine GFS_physics_driver & ! ! --- ... figure out number of extra tracers ! - tottracer = 0 ! no convective transport of tracers - if (Model%trans_trac .or. Model%cscnv) then - if (Model%ntcw > 0) then - if (Model%ntoz < Model%ntcw) then - trc_shft = Model%ntcw + Model%ncld - 1 - else - trc_shft = Model%ntoz - endif - elseif (Model%ntoz > 0) then - trc_shft = Model%ntoz - else - trc_shft = 1 - endif + ! tottracer = 0 ! no convective transport of tracers + ! if (Model%trans_trac .or. Model%cscnv) then + ! if (Model%ntcw > 0) then + ! if (Model%ntoz < Model%ntcw) then + ! trc_shft = Model%ntcw + Model%ncld - 1 + ! else + ! trc_shft = Model%ntoz + ! endif + ! elseif (Model%ntoz > 0) then + ! trc_shft = Model%ntoz + ! else + ! trc_shft = 1 + ! endif + ! + ! tracers = Model%ntrac - trc_shft + ! tottracer = tracers + ! if (Model%ntoz > 0) tottracer = tottracer + 1 ! ozone is added separately + ! endif + ! if (Model%ntke > 0) ntk = Model%ntke - trc_shft + 3 - tracers = Model%ntrac - trc_shft - tottracer = tracers - if (Model%ntoz > 0) tottracer = tottracer + 1 ! ozone is added separately - endif - if (Model%ntke > 0) ntk = Model%ntke - trc_shft + 3 ! if (lprnt) write(0,*)' trans_trac=',trans_trac,' tottracer=', & ! write(0,*)' trans_trac=',trans_trac,' tottracer=', & @@ -551,12 +553,14 @@ subroutine GFS_physics_driver & ! &, ntrac-ncld+2,' clstp=',clstp,' kdt=',kdt ! &,' ntk=',ntk,' lat=',lat - skip_macro = .false. + ! skip_macro = .false. + ! + ! allocate ( clw(ix,levs,tottracer+2) ) + ! if (Model%imfdeepcnv >= 0 .or. Model%imfshalcnv > 0) then + ! allocate (cnvc(ix,levs), cnvw(ix,levs)) + ! endif - allocate ( clw(ix,levs,tottracer+2) ) - if (Model%imfdeepcnv >= 0 .or. Model%imfshalcnv > 0) then - allocate (cnvc(ix,levs), cnvw(ix,levs)) - endif + call GFS_suite_interstitial_1_run (Model, Grid, tottracer, trc_shft, tracers, ntk, skip_macro, clw, cnvc, cnvw) ! ! --- set initial quantities for stochastic physics deltas if (Model%do_sppt) then diff --git a/makefile b/makefile index 5ebbce687..6d475771e 100644 --- a/makefile +++ b/makefile @@ -123,6 +123,7 @@ SRCS_f90 = \ ./physics/get_prs_fv3.f90 \ ./physics/GFS_DCNV_generic.f90 \ ./physics/GFS_PBL_generic.f90 \ + ./physics/GFS_suite_interstitial.f90 \ ./physics/h2ointerp.f90 \ ./physics/m_micro_driver.f90 \ ./physics/module_nst_model.f90 \ diff --git a/physics/GFS_DCNV_generic.f90 b/physics/GFS_DCNV_generic.f90 index 56646d691..6f8bf0813 100644 --- a/physics/GFS_DCNV_generic.f90 +++ b/physics/GFS_DCNV_generic.f90 @@ -57,7 +57,7 @@ end subroutine GFS_DCNV_generic_post_init subroutine GFS_DCNV_generic_post_finalize () end subroutine GFS_DCNV_generic_post_finalize -!> \section arg_table_GFS_PBL_generic_post_run Argument Table +!> \section arg_table_GFS_DCNV_generic_post_run Argument Table !! | local var name | longname | description | units | rank | type | kind | intent | optional | !! |----------------|-----------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| !! | Grid | FV3-GFS_Grid_type | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_typedefs%GFS_grid_type | | in | F | diff --git a/physics/GFS_suite_interstitial.f90 b/physics/GFS_suite_interstitial.f90 new file mode 100644 index 000000000..0009e843c --- /dev/null +++ b/physics/GFS_suite_interstitial.f90 @@ -0,0 +1,62 @@ +!> \file GFS_suite_interstitial.f90 +!! Contains code related to more than one scheme in the GFS physics suite. + + module GFS_suite_interstitial_1 + + contains + + subroutine GFS_suite_interstitial_1_init () + end subroutine GFS_suite_interstitial_1_init + + subroutine GFS_suite_interstitial_1_finalize() + end subroutine GFS_suite_interstitial_1_finalize + +!> \section arg_table_GFS_suite_interstitial_1_run Argument Table +!! | local var name | longname | description | units | rank | type | kind | intent | optional | +!! |----------------|--------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| +!! | Model | FV3-GFS_Control_type | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_typedefs%GFS_control_type | | in | F | +!! | tottracer | number_of_total_tracers | total number of tracers | count | 0 | integer | | out | F | +!! | trc_shft | start_index_of_other_tracers | beginning index of the non-water tracer species | index | 0 | integer | | out | F | +!! | tracers | number_of_water_tracers | number of water-related tracers | index | 0 | integer | | out | F | +!! | ntk | index_of_TKE | index of TKE in the tracer array | index | 0 | integer | | out | F | +!! + subroutine GFS_suite_interstitial_1_run (Model, Grid, tottracer, trc_shft, tracers, ntk, skip_macro, clw, cnvc, cnvw) + + use GFS_typedefs, only: GFS_control_type, GFS_grid_type + + type(GFS_control_type), intent(in) :: Model + type(GFS_grid_type), intent(in) :: Grid + integer, intent(out) :: tottracer, trc_shft, tracers, ntk + logical, dimension(size(Grid%xlon,1)), intent(out) :: skip_macro + real(kind=kind_phys), allocatable, intent(out) :: clw(:,:,:), cnvc(:,:), cnvw(:,:) + + tottracer = 0 ! no convective transport of tracers + if (Model%trans_trac .or. Model%cscnv) then + if (Model%ntcw > 0) then + if (Model%ntoz < Model%ntcw) then + trc_shft = Model%ntcw + Model%ncld - 1 + else + trc_shft = Model%ntoz + endif + elseif (Model%ntoz > 0) then + trc_shft = Model%ntoz + else + trc_shft = 1 + endif + + tracers = Model%ntrac - trc_shft + tottracer = tracers + if (Model%ntoz > 0) tottracer = tottracer + 1 ! ozone is added separately + endif + if (Model%ntke > 0) ntk = Model%ntke - trc_shft + 3 + + skip_macro = .false. + + allocate ( clw(size(Grid%xlon,1),Model%levs,tottracer+2) ) + if (Model%imfdeepcnv >= 0 .or. Model%imfshalcnv > 0) then + allocate (cnvc(size(Grid%xlon,1),Model%levs), cnvw(size(Grid%xlon,1),Model%levs)) + endif + + end subroutine GFS_suite_interstitial_1_run + + end module From 5d2eec2f752a013a9509773f1a7851c54848912b Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Thu, 16 Nov 2017 11:49:54 -0700 Subject: [PATCH 29/48] added use statement for kind_phys --- physics/GFS_suite_interstitial.f90 | 1 + 1 file changed, 1 insertion(+) diff --git a/physics/GFS_suite_interstitial.f90 b/physics/GFS_suite_interstitial.f90 index 0009e843c..74d7069a0 100644 --- a/physics/GFS_suite_interstitial.f90 +++ b/physics/GFS_suite_interstitial.f90 @@ -22,6 +22,7 @@ end subroutine GFS_suite_interstitial_1_finalize !! subroutine GFS_suite_interstitial_1_run (Model, Grid, tottracer, trc_shft, tracers, ntk, skip_macro, clw, cnvc, cnvw) + use machine, only: kind_phys use GFS_typedefs, only: GFS_control_type, GFS_grid_type type(GFS_control_type), intent(in) :: Model From 6d3d47d155c7f2624448350f0e8847359b1bccd4 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Thu, 16 Nov 2017 12:09:03 -0700 Subject: [PATCH 30/48] table updates --- physics/GFS_DCNV_generic.f90 | 2 ++ physics/GFS_suite_interstitial.f90 | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/physics/GFS_DCNV_generic.f90 b/physics/GFS_DCNV_generic.f90 index 6f8bf0813..b3614888a 100644 --- a/physics/GFS_DCNV_generic.f90 +++ b/physics/GFS_DCNV_generic.f90 @@ -72,6 +72,8 @@ end subroutine GFS_DCNV_generic_post_finalize !! | ud_mf | instantaneous_atmosphere_updraft_convective_mass_flux | (updraft mass flux) * delt | kg m-2 | 2 | real | kind_phys | in | F | !! | dd_mf | instantaneous_atmosphere_downdraft_convective_mass_flux | (downdraft mass flux) * delt | kg m-2 | 2 | real | kind_phys | in | F | !! | dt_mf | instantaneous_atmosphere_detrainment_convective_mass_flux | (detrainment mass flux) * delt | kg m-2 | 2 | real | kind_phys | in | F | +!! | cnvw | convective_cloud_water_specific_humidity | convective cloud water specific humidity | kg kg-1 | 2 | real | kind_phys | out | F | +!! | cnvc | convective_cloud_cover | convective cloud cover | frac | 2 | real | kind_phys | out | F | !! | Diag | FV3-GFS_Diag_type | Fortran DDT containing FV3-GFS fields targeted for diagnostic output | DDT | 0 | GFS_typedefs%GFS_diag_type | | inout | F | !! | Tbd | FV3-GFS_Tbd_type | Fortran DDT containing FV3-GFS miscellaneous data | DDT | 0 | GFS_typedefs%GFS_tbd_type | | inout | F | !! diff --git a/physics/GFS_suite_interstitial.f90 b/physics/GFS_suite_interstitial.f90 index 74d7069a0..32807ccc9 100644 --- a/physics/GFS_suite_interstitial.f90 +++ b/physics/GFS_suite_interstitial.f90 @@ -15,10 +15,15 @@ end subroutine GFS_suite_interstitial_1_finalize !! | local var name | longname | description | units | rank | type | kind | intent | optional | !! |----------------|--------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| !! | Model | FV3-GFS_Control_type | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_typedefs%GFS_control_type | | in | F | +!! | Grid | FV3-GFS_Grid_type | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_typedefs%GFS_grid_type | | in | F | !! | tottracer | number_of_total_tracers | total number of tracers | count | 0 | integer | | out | F | !! | trc_shft | start_index_of_other_tracers | beginning index of the non-water tracer species | index | 0 | integer | | out | F | !! | tracers | number_of_water_tracers | number of water-related tracers | index | 0 | integer | | out | F | !! | ntk | index_of_TKE | index of TKE in the tracer array | index | 0 | integer | | out | F | +!! | skip_macro | flag_skip_macro | flag to skip cloud macrophysics in Morrison scheme | flag | 1 | logical | | out | F | +!! | clw | convective_transportable_tracers | array to contain cloud water and other convective trans. tracers | kg kg-1 | 3 | real | kind_phys | out | F | +!! | cnvw | convective_cloud_water_specific_humidity | convective cloud water specific humidity | kg kg-1 | 2 | real | kind_phys | out | F | +!! | cnvc | convective_cloud_cover | convective cloud cover | frac | 2 | real | kind_phys | out | F | !! subroutine GFS_suite_interstitial_1_run (Model, Grid, tottracer, trc_shft, tracers, ntk, skip_macro, clw, cnvc, cnvw) From c618a996ed7be7355bf3f4a0b1bdc894de436f25 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Fri, 17 Nov 2017 10:49:11 -0700 Subject: [PATCH 31/48] changes to longname table in DCNV_generic and start on GFS_suite_interstitial_2 --- physics/GFS_DCNV_generic.f90 | 1 + physics/GFS_suite_interstitial.f90 | 51 ++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/physics/GFS_DCNV_generic.f90 b/physics/GFS_DCNV_generic.f90 index b3614888a..5891cbb78 100644 --- a/physics/GFS_DCNV_generic.f90 +++ b/physics/GFS_DCNV_generic.f90 @@ -62,6 +62,7 @@ end subroutine GFS_DCNV_generic_post_finalize !! |----------------|-----------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| !! | Grid | FV3-GFS_Grid_type | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_typedefs%GFS_grid_type | | in | F | !! | Model | FV3-GFS_Control_type | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_typedefs%GFS_control_type | | in | F | +!! | Stateout | FV3-GFS_Stateout_type | Fortran DDT containing FV3-GFS prognostic state to return to dycore | DDT | 0 | GFS_typedefs%GFS_stateout_type| | in | F | !! | frain | dynamics_to_physics_timestep_ratio | ratio of dynamics timestep to physics timestep | none | 0 | real | kind_phys | in | F | !! | rain1 | instantaneous_rainfall_amount | instantaneous rainfall amount | m | 1 | real | kind_phys | in | F | !! | cld1d | cloud_work_function | cloud work function | m2 s-2 | 1 | real | kind_phys | in | F | diff --git a/physics/GFS_suite_interstitial.f90 b/physics/GFS_suite_interstitial.f90 index 32807ccc9..a9f61fd12 100644 --- a/physics/GFS_suite_interstitial.f90 +++ b/physics/GFS_suite_interstitial.f90 @@ -66,3 +66,54 @@ subroutine GFS_suite_interstitial_1_run (Model, Grid, tottracer, trc_shft, trace end subroutine GFS_suite_interstitial_1_run end module + + module GFS_suite_interstitial_2 + + contains + + subroutine GFS_suite_interstitial_2_init () + end subroutine GFS_suite_interstitial_2_init + + subroutine GFS_suite_interstitial_2_finalize() + end subroutine GFS_suite_interstitial_2_finalize + +!> \section arg_table_GFS_suite_interstitial_2_run Argument Table +!! | local var name | longname | description | units | rank | type | kind | intent | optional | +!! |----------------|--------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| +!! + subroutine GFS_suite_interstitial_2_run (Model, Grid, Sfcprop, Statein, Diag, rhbbot, rhpbl, rhbtop, frain, islmsk, work1, work2, garea, dudt, dvdt, dtdt, dtdtc, dqdt) + + use machine, only: kind_phys + use GFS_typedefs, only: GFS_control_type, GFS_grid_type + + type(GFS_control_type), intent(in) :: Model + type(GFS_grid_type), intent(in) :: Grid + + real(kind=kind_phys), intent(out) :: rhbbot, rhpbl, rhbtop + + integer i + + rhbbot = Model%crtrh(1) + rhpbl = Model%crtrh(2) + rhbtop = Model%crtrh(3) + + frain = Model%dtf / Model%dtp + + do i = 1, size(Grid%xlon,1) + islmsk(i) = nint(Sfcprop%slmsk(i)) + work1(i) = (log(Grid%area(i)) - dxmin) * dxinv + work1(i) = max(0.0, min(1.0,work1(i))) + work2(i) = 1.0 - work1(i) + Diag%psurf(i) = Statein%pgr(i) + garea(i) = Grid%area(i) + end do + + dudt(:,:) = 0. + dvdt(:,:) = 0. + dtdt(:,:) = 0. + dtdtc(:,:) = 0. + dqdt(:,:,:) = 0. + + end subroutine GFS_suite_interstitial_2_run + + end module From e1b121f96655e5f9a090c045f5e18a69e04a0c74 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Fri, 17 Nov 2017 12:57:42 -0700 Subject: [PATCH 32/48] GFS_suite_interstitial_2 ready to compile/test --- GFS_layer/GFS_physics_driver.F90 | 35 +++++++++++++++++------------- physics/GFS_suite_interstitial.f90 | 14 +++++++++--- 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/GFS_layer/GFS_physics_driver.F90 b/GFS_layer/GFS_physics_driver.F90 index 61e5a73ed..f83ba0d8f 100644 --- a/GFS_layer/GFS_physics_driver.F90 +++ b/GFS_layer/GFS_physics_driver.F90 @@ -22,6 +22,7 @@ module module_physics_driver use GFS_DCNV_generic_pre, only: GFS_DCNV_generic_pre_run use GFS_DCNV_generic_post, only: GFS_DCNV_generic_post_run use GFS_suite_interstitial_1, only: GFS_suite_interstitial_1_run + use GFS_suite_interstitial_2, only: GFS_suite_interstitial_2_run implicit none @@ -605,18 +606,22 @@ subroutine GFS_physics_driver & call get_prs_fv3 (ix, levs, ntrac, Statein%phii, Statein%prsi, & Statein%tgrs, Statein%qgrs, del, del_gz) #endif + + call GFS_suite_interstitial_2_run (Model, Grid, Sfcprop, Statein, & + Diag, rhbbot, rhpbl, rhbtop, frain, islmsk, work1, work2, garea, & + dudt, dvdt, dtdt, dtdtc, dqdt ) ! - rhbbot = Model%crtrh(1) - rhpbl = Model%crtrh(2) - rhbtop = Model%crtrh(3) + ! rhbbot = Model%crtrh(1) + ! rhpbl = Model%crtrh(2) + ! rhbtop = Model%crtrh(3) ! ! --- ... frain=factor for centered difference scheme correction of rain amount. - frain = dtf / dtp + ! frain = dtf / dtp do i = 1, im sigmaf(i) = max( Sfcprop%vfrac(i),0.01 ) - islmsk(i) = nint(Sfcprop%slmsk(i)) + ! islmsk(i) = nint(Sfcprop%slmsk(i)) if (islmsk(i) == 2) then if (Model%isot == 1) then @@ -642,17 +647,17 @@ subroutine GFS_physics_driver & ! !GFDL work1(i) = (log(coslat(i) / (nlons(i)*latr)) - dxmin) * dxinv ! work1(i) = (log(Grid%dx(i)) - dxmin) * dxinv - work1(i) = (log(Grid%area(i)) - dxmin) * dxinv - work1(i) = max(0.0, min(1.0,work1(i))) - work2(i) = 1.0 - work1(i) - Diag%psurf(i) = Statein%pgr(i) + ! work1(i) = (log(Grid%area(i)) - dxmin) * dxinv + ! work1(i) = max(0.0, min(1.0,work1(i))) + ! work2(i) = 1.0 - work1(i) + ! Diag%psurf(i) = Statein%pgr(i) work3(i) = Statein%prsik(i,1) / Statein%prslk(i,1) !GFDL tem1 = con_rerth * (con_pi+con_pi)*coslat(i)/nlons(i) !GFDL tem2 = con_rerth * con_pi / latr !GFDL garea(i) = tem1 * tem2 tem1 = Grid%dx(i) tem2 = Grid%dx(i) - garea(i) = Grid%area(i) + ! garea(i) = Grid%area(i) dlength(i) = sqrt( tem1*tem1+tem2*tem2 ) cldf(i) = Model%cgwf(1)*work1(i) + Model%cgwf(2)*work2(i) wcbmax(i) = Model%cs_parm(1)*work1(i) + Model%cs_parm(2)*work2(i) @@ -679,11 +684,11 @@ subroutine GFS_physics_driver & smsoil(:,:) = Sfcprop%smc(:,:) stsoil(:,:) = Sfcprop%stc(:,:) slsoil(:,:) = Sfcprop%slc(:,:) !! clu: slc -> slsoil - dudt(:,:) = 0. - dvdt(:,:) = 0. - dtdt(:,:) = 0. - dtdtc(:,:) = 0. - dqdt(:,:,:) = 0. + ! dudt(:,:) = 0. + ! dvdt(:,:) = 0. + ! dtdt(:,:) = 0. + ! dtdtc(:,:) = 0. + ! dqdt(:,:,:) = 0. ! --- ... initialize dtdt with heating rate from dcyc2 diff --git a/physics/GFS_suite_interstitial.f90 b/physics/GFS_suite_interstitial.f90 index a9f61fd12..020890349 100644 --- a/physics/GFS_suite_interstitial.f90 +++ b/physics/GFS_suite_interstitial.f90 @@ -84,12 +84,20 @@ end subroutine GFS_suite_interstitial_2_finalize subroutine GFS_suite_interstitial_2_run (Model, Grid, Sfcprop, Statein, Diag, rhbbot, rhpbl, rhbtop, frain, islmsk, work1, work2, garea, dudt, dvdt, dtdt, dtdtc, dqdt) use machine, only: kind_phys - use GFS_typedefs, only: GFS_control_type, GFS_grid_type + use use physcons, only: dxmin, dxinv + use GFS_typedefs, only: GFS_control_type, GFS_grid_type, GFS_sfcprop_type, GFS_statein_type, GFS_diag_type type(GFS_control_type), intent(in) :: Model type(GFS_grid_type), intent(in) :: Grid - - real(kind=kind_phys), intent(out) :: rhbbot, rhpbl, rhbtop + type(GFS_sfcprop_type), intent(in) :: Sfcprop + type(GFS_statein_type), intent(in) :: Statein + type(GFS_diag_type), intent(inout) :: Diag + + real(kind=kind_phys), intent(out) :: rhbbot, rhpbl, rhbtop, frain + integer, dimension(size(Grid%xlon,1)), intent(out) :: islmsk + real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(out) :: work1, work2, garea + real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levs), intent(out) :: dudt, dvdt, dtdt, dtdtc + real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levs,Model%ntrac), intent(out) :: dqdt integer i From f30d707a1cc751a9e4ecebdaad5dfe91a3bf36ff Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Fri, 17 Nov 2017 13:02:05 -0700 Subject: [PATCH 33/48] fixed typo in GFS_suite_interstitial.f90 --- physics/GFS_suite_interstitial.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/GFS_suite_interstitial.f90 b/physics/GFS_suite_interstitial.f90 index 020890349..3d9625a71 100644 --- a/physics/GFS_suite_interstitial.f90 +++ b/physics/GFS_suite_interstitial.f90 @@ -84,7 +84,7 @@ end subroutine GFS_suite_interstitial_2_finalize subroutine GFS_suite_interstitial_2_run (Model, Grid, Sfcprop, Statein, Diag, rhbbot, rhpbl, rhbtop, frain, islmsk, work1, work2, garea, dudt, dvdt, dtdt, dtdtc, dqdt) use machine, only: kind_phys - use use physcons, only: dxmin, dxinv + use physcons, only: dxmin, dxinv use GFS_typedefs, only: GFS_control_type, GFS_grid_type, GFS_sfcprop_type, GFS_statein_type, GFS_diag_type type(GFS_control_type), intent(in) :: Model From 6b377a7dccdba237a7e42fae8ba2a21f2239b505 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Fri, 17 Nov 2017 14:44:34 -0700 Subject: [PATCH 34/48] commit of uncompiled/untested GFS_suite_interstitial_3 --- GFS_layer/GFS_physics_driver.F90 | 97 +++++++++++------------ physics/GFS_suite_interstitial.f90 | 120 +++++++++++++++++++++++++++-- 2 files changed, 163 insertions(+), 54 deletions(-) diff --git a/GFS_layer/GFS_physics_driver.F90 b/GFS_layer/GFS_physics_driver.F90 index f83ba0d8f..f9f3e036c 100644 --- a/GFS_layer/GFS_physics_driver.F90 +++ b/GFS_layer/GFS_physics_driver.F90 @@ -608,7 +608,7 @@ subroutine GFS_physics_driver & #endif call GFS_suite_interstitial_2_run (Model, Grid, Sfcprop, Statein, & - Diag, rhbbot, rhpbl, rhbtop, frain, islmsk, work1, work2, garea, & + Diag, rhbbot, rhpbl, rhbtop, frain, islmsk, work1, work2, & dudt, dvdt, dtdt, dtdtc, dqdt ) ! ! rhbbot = Model%crtrh(1) @@ -657,7 +657,7 @@ subroutine GFS_physics_driver & !GFDL garea(i) = tem1 * tem2 tem1 = Grid%dx(i) tem2 = Grid%dx(i) - ! garea(i) = Grid%area(i) + garea(i) = Grid%area(i) dlength(i) = sqrt( tem1*tem1+tem2*tem2 ) cldf(i) = Model%cgwf(1)*work1(i) + Model%cgwf(2)*work2(i) wcbmax(i) = Model%cs_parm(1)*work1(i) + Model%cs_parm(2)*work2(i) @@ -764,52 +764,53 @@ subroutine GFS_physics_driver & gabsbdlw(:) = Radtend%semis(:) * adjsfcdlw(:) - if (Model%lssav) then ! --- ... accumulate/save output variables - -! --- ... sunshine duration time is defined as the length of time (in mdl output -! interval) that solar radiation falling on a plane perpendicular to the -! direction of the sun >= 120 w/m2 - - do i = 1, im - if ( xcosz(i) >= czmin ) then ! zenth angle > 89.994 deg - tem1 = adjsfcdsw(i) / xcosz(i) - if ( tem1 >= 120.0 ) then - Diag%suntim(i) = Diag%suntim(i) + dtf - endif - endif - enddo - -! --- ... sfc lw fluxes used by atmospheric model are saved for output - - if (Model%cplflx) then - do i = 1, im - if (flag_cice(i)) adjsfculw(i) = ulwsfc_cice(i) - enddo - endif - Diag%dlwsfc(:) = Diag%dlwsfc(:) + adjsfcdlw(:)*dtf - Diag%ulwsfc(:) = Diag%ulwsfc(:) + adjsfculw(:)*dtf - Diag%psmean(:) = Diag%psmean(:) + Statein%pgr(:)*dtf ! mean surface pressure - - if (Model%ldiag3d) then - if (Model%lsidea) then - Diag%dt3dt(:,:,1) = Diag%dt3dt(:,:,1) + Radtend%lwhd(:,:,1)*dtf - Diag%dt3dt(:,:,2) = Diag%dt3dt(:,:,2) + Radtend%lwhd(:,:,2)*dtf - Diag%dt3dt(:,:,3) = Diag%dt3dt(:,:,3) + Radtend%lwhd(:,:,3)*dtf - Diag%dt3dt(:,:,4) = Diag%dt3dt(:,:,4) + Radtend%lwhd(:,:,4)*dtf - Diag%dt3dt(:,:,5) = Diag%dt3dt(:,:,5) + Radtend%lwhd(:,:,5)*dtf - Diag%dt3dt(:,:,6) = Diag%dt3dt(:,:,6) + Radtend%lwhd(:,:,6)*dtf - else - do k = 1, levs - Diag%dt3dt(:,k,1) = Diag%dt3dt(:,k,1) + Radtend%htrlw(:,k)*dtf - Diag%dt3dt(:,k,2) = Diag%dt3dt(:,k,2) + Radtend%htrsw(:,k)*dtf*xmu(:) - enddo - endif - endif - endif ! end if_lssav_block - +! if (Model%lssav) then ! --- ... accumulate/save output variables +! +! ! --- ... sunshine duration time is defined as the length of time (in mdl output +! ! interval) that solar radiation falling on a plane perpendicular to the +! ! direction of the sun >= 120 w/m2 +! +! do i = 1, im +! if ( xcosz(i) >= czmin ) then ! zenth angle > 89.994 deg +! tem1 = adjsfcdsw(i) / xcosz(i) +! if ( tem1 >= 120.0 ) then +! Diag%suntim(i) = Diag%suntim(i) + dtf +! endif +! endif +! enddo +! +! ! --- ... sfc lw fluxes used by atmospheric model are saved for output +! +! if (Model%cplflx) then +! do i = 1, im +! if (flag_cice(i)) adjsfculw(i) = ulwsfc_cice(i) +! enddo +! endif +! Diag%dlwsfc(:) = Diag%dlwsfc(:) + adjsfcdlw(:)*dtf +! Diag%ulwsfc(:) = Diag%ulwsfc(:) + adjsfculw(:)*dtf +! Diag%psmean(:) = Diag%psmean(:) + Statein%pgr(:)*dtf ! mean surface pressure +! +! if (Model%ldiag3d) then +! if (Model%lsidea) then +! Diag%dt3dt(:,:,1) = Diag%dt3dt(:,:,1) + Radtend%lwhd(:,:,1)*dtf +! Diag%dt3dt(:,:,2) = Diag%dt3dt(:,:,2) + Radtend%lwhd(:,:,2)*dtf +! Diag%dt3dt(:,:,3) = Diag%dt3dt(:,:,3) + Radtend%lwhd(:,:,3)*dtf +! Diag%dt3dt(:,:,4) = Diag%dt3dt(:,:,4) + Radtend%lwhd(:,:,4)*dtf +! Diag%dt3dt(:,:,5) = Diag%dt3dt(:,:,5) + Radtend%lwhd(:,:,5)*dtf +! Diag%dt3dt(:,:,6) = Diag%dt3dt(:,:,6) + Radtend%lwhd(:,:,6)*dtf +! else +! do k = 1, levs +! Diag%dt3dt(:,k,1) = Diag%dt3dt(:,k,1) + Radtend%htrlw(:,k)*dtf +! Diag%dt3dt(:,k,2) = Diag%dt3dt(:,k,2) + Radtend%htrsw(:,k)*dtf*xmu(:) +! enddo +! endif +! endif +! endif ! end if_lssav_block + call GFS_suite_interstitial_3_run (Model, Grid, Statein, Radtend, xcosz, & + adjsfcdsw, adjsfcdlw, adjsfculw, xmu, kcnv, hflx, evap, Diag) call GFS_PBL_generic_pre_run (im, levs, kinver) - kcnv(:) = 0 + !kcnv(:) = 0 !kinver(:) = levs invrsn(:) = .false. tx1(:) = 0.0 @@ -866,8 +867,8 @@ subroutine GFS_physics_driver & drain(:) = 0.0 ep1d(:) = 0.0 runof(:) = 0.0 - hflx(:) = 0.0 - evap(:) = 0.0 + !hflx(:) = 0.0 + !evap(:) = 0.0 evbs(:) = 0.0 evcw(:) = 0.0 trans(:) = 0.0 diff --git a/physics/GFS_suite_interstitial.f90 b/physics/GFS_suite_interstitial.f90 index 3d9625a71..cfdbf511a 100644 --- a/physics/GFS_suite_interstitial.f90 +++ b/physics/GFS_suite_interstitial.f90 @@ -78,10 +78,27 @@ subroutine GFS_suite_interstitial_2_finalize() end subroutine GFS_suite_interstitial_2_finalize !> \section arg_table_GFS_suite_interstitial_2_run Argument Table -!! | local var name | longname | description | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| +!! | local var name | longname | description | units | rank | type | kind | intent | optional | +!! |----------------|-------------------------------------------------------------------------|-------------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| +!! | Model | FV3-GFS_Control_type | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_typedefs%GFS_control_type | | in | F | +!! | Grid | FV3-GFS_Grid_type | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_typedefs%GFS_grid_type | | in | F | +!! | Sfcprop | FV3-GFS_Sfcprop_type | Fortran DDT containing FV3-GFS surface fields | DDT | 0 | GFS_typedefs%GFS_sfcprop_type | | in | F | +!! | Statein | FV3-GFS_Statein_type | Fortran DDT containing FV3-GFS prognostic state data in from dycore | DDT | 0 | GFS_typedefs%GFS_statein_type | | in | F | +!! | Diag | FV3-GFS_diag_type | Fortran DDT containing FV3-GFS fields targeted for diagnostic output | DDT | 0 | GFS_typedefs%GFS_diag_type | | inout | F | +!! | rhbbot | critical_relative_humidity_at_surface | critical relative humidity at the surface | frac | 0 | real | kind_phys | out | F | +!! | rhpbl | critical_relative_humidity_at_PBL_top | critical relative humidity at the PBL top | frac | 0 | real | kind_phys | out | F | +!! | rhbtop | critical_relative_humidity_at_top_of_atmosphere | critical relative humidity at the top of atmosphere | frac | 0 | real | kind_phys | out | F | +!! | frain | dynamics_to_physics_timestep_ratio | ratio of dynamics timestep to physics timestep | none | 0 | real | kind_phys | out | F | +!! | islmsk | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | out | F | +!! | work1 | grid_related_coefficient | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | out | F | +!! | work2 | grid_related_coefficient_complement | complement to work1 | none | 1 | real | kind_phys | out | F | +!! | dudt | tendency_of_x_wind_due_to_model_physics | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | out | F | +!! | dvdt | tendency_of_y_wind_due_to_model_physics | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | out | F | +!! | dtdt | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | out | F | +!! | dtdtc | tendency_of_air_temperature_due_to_radiative_heating_assuming_clear_sky | clear sky radiative (shortwave + longwave) heating rate at current time | K s-1 | 2 | real | kind_phys | out | F | +!! | dqdt | tendency_of_tracers_due_to_model_physics | updated tendency of the tracers | kg kg-1 s-1 | 3 | real | kind_phys | out | F | !! - subroutine GFS_suite_interstitial_2_run (Model, Grid, Sfcprop, Statein, Diag, rhbbot, rhpbl, rhbtop, frain, islmsk, work1, work2, garea, dudt, dvdt, dtdt, dtdtc, dqdt) + subroutine GFS_suite_interstitial_2_run (Model, Grid, Sfcprop, Statein, Diag, rhbbot, rhpbl, rhbtop, frain, islmsk, work1, work2, dudt, dvdt, dtdt, dtdtc, dqdt) use machine, only: kind_phys use physcons, only: dxmin, dxinv @@ -95,11 +112,11 @@ subroutine GFS_suite_interstitial_2_run (Model, Grid, Sfcprop, Statein, Diag, rh real(kind=kind_phys), intent(out) :: rhbbot, rhpbl, rhbtop, frain integer, dimension(size(Grid%xlon,1)), intent(out) :: islmsk - real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(out) :: work1, work2, garea + real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(out) :: work1, work2 real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levs), intent(out) :: dudt, dvdt, dtdt, dtdtc real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levs,Model%ntrac), intent(out) :: dqdt - integer i + integer :: i rhbbot = Model%crtrh(1) rhpbl = Model%crtrh(2) @@ -113,7 +130,6 @@ subroutine GFS_suite_interstitial_2_run (Model, Grid, Sfcprop, Statein, Diag, rh work1(i) = max(0.0, min(1.0,work1(i))) work2(i) = 1.0 - work1(i) Diag%psurf(i) = Statein%pgr(i) - garea(i) = Grid%area(i) end do dudt(:,:) = 0. @@ -125,3 +141,95 @@ subroutine GFS_suite_interstitial_2_run (Model, Grid, Sfcprop, Statein, Diag, rh end subroutine GFS_suite_interstitial_2_run end module + + module GFS_suite_interstitial_3 + + contains + + subroutine GFS_suite_interstitial_3_init () + end subroutine GFS_suite_interstitial_3_init + + subroutine GFS_suite_interstitial_3_finalize() + end subroutine GFS_suite_interstitial_3_finalize + +!> \section arg_table_GFS_suite_interstitial_3_run Argument Table +!! | local var name | longname | description | units | rank | type | kind | intent | optional | +!! |----------------|--------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| +!! | Model | FV3-GFS_Control_type | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_typedefs%GFS_control_type | | in | F | +!! | Grid | FV3-GFS_Grid_type | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_typedefs%GFS_grid_type | | in | F | +!! | tottracer | number_of_total_tracers | total number of tracers | count | 0 | integer | | out | F | +!! | trc_shft | start_index_of_other_tracers | beginning index of the non-water tracer species | index | 0 | integer | | out | F | +!! | tracers | number_of_water_tracers | number of water-related tracers | index | 0 | integer | | out | F | +!! | ntk | index_of_TKE | index of TKE in the tracer array | index | 0 | integer | | out | F | +!! | skip_macro | flag_skip_macro | flag to skip cloud macrophysics in Morrison scheme | flag | 1 | logical | | out | F | +!! | clw | convective_transportable_tracers | array to contain cloud water and other convective trans. tracers | kg kg-1 | 3 | real | kind_phys | out | F | +!! | cnvw | convective_cloud_water_specific_humidity | convective cloud water specific humidity | kg kg-1 | 2 | real | kind_phys | out | F | +!! | cnvc | convective_cloud_cover | convective cloud cover | frac | 2 | real | kind_phys | out | F | +!! + subroutine GFS_suite_interstitial_3_run (Model, Grid, Statein, Radtend, xcosz, adjsfcdsw, adjsfcdlw, adjsfculw, xmu, kcnv, hflx, evap, Diag) + + use machine, only: kind_phys + use GFS_typedefs, only: GFS_control_type, GFS_grid_type, GFS_statein_type, GFS_radtend_type, GFS_diag_type + + type(GFS_control_type), intent(in) :: Model + type(GFS_grid_type), intent(in) :: Grid + type(GFS_statein_type), intent(in) :: Statein + type(GFS_radtend_type), intent(in) :: Radtend + type(GFS_diag_type), intent(inout) :: Diag + + integer, dimension(size(Grid%xlon,1)), intent(out) :: kcnv + real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: xcosz, adjsfcdsw, adjsfcdlw, adjsfculw, xmu + real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(out) :: hflx, evap + + real(kind=kind_phys), parameter :: czmin = 0.0001 ! cos(89.994) + + integer :: i + + real(kind=kind_phys) :: tem1 + + if (Model%lssav) then ! --- ... accumulate/save output variables + + ! --- ... sunshine duration time is defined as the length of time (in mdl output + ! interval) that solar radiation falling on a plane perpendicular to the + ! direction of the sun >= 120 w/m2 + + do i = 1, size(Grid%xlon,1) + if ( xcosz(i) >= czmin ) then ! zenth angle > 89.994 deg + tem1 = adjsfcdsw(i) / xcosz(i) + if ( tem1 >= 120.0 ) then + Diag%suntim(i) = Diag%suntim(i) + Model%dtf + endif + endif + enddo + + ! --- ... sfc lw fluxes used by atmospheric model are saved for output + + Diag%dlwsfc(:) = Diag%dlwsfc(:) + adjsfcdlw(:)*Model%dtf + Diag%ulwsfc(:) = Diag%ulwsfc(:) + adjsfculw(:)*Model%dtf + Diag%psmean(:) = Diag%psmean(:) + Statein%pgr(:)*Model%dtf ! mean surface pressure + + if (Model%ldiag3d) then + if (Model%lsidea) then + Diag%dt3dt(:,:,1) = Diag%dt3dt(:,:,1) + Radtend%lwhd(:,:,1)*Model%dtf + Diag%dt3dt(:,:,2) = Diag%dt3dt(:,:,2) + Radtend%lwhd(:,:,2)*Model%dtf + Diag%dt3dt(:,:,3) = Diag%dt3dt(:,:,3) + Radtend%lwhd(:,:,3)*Model%dtf + Diag%dt3dt(:,:,4) = Diag%dt3dt(:,:,4) + Radtend%lwhd(:,:,4)*Model%dtf + Diag%dt3dt(:,:,5) = Diag%dt3dt(:,:,5) + Radtend%lwhd(:,:,5)*Model%dtf + Diag%dt3dt(:,:,6) = Diag%dt3dt(:,:,6) + Radtend%lwhd(:,:,6)*Model%dtf + else + do k = 1, Model%levs + Diag%dt3dt(:,k,1) = Diag%dt3dt(:,k,1) + Radtend%htrlw(:,k)*Model%dtf + Diag%dt3dt(:,k,2) = Diag%dt3dt(:,k,2) + Radtend%htrsw(:,k)*Model%dtf*xmu(:) + enddo + endif + endif + endif ! end if_lssav_block + + kcnv(:) = 0 + + hflx(:) = 0.0 + evap(:) = 0.0 + + end subroutine GFS_suite_interstitial_3_run + +end module From da922399cf74a111f684326a7cf6171dbfc44bab Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Fri, 17 Nov 2017 15:00:04 -0700 Subject: [PATCH 35/48] added use GFS_suite_interstitial_3 to driver --- GFS_layer/GFS_physics_driver.F90 | 3 ++- physics/GFS_suite_interstitial.f90 | 31 ++++++++++++++++-------------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/GFS_layer/GFS_physics_driver.F90 b/GFS_layer/GFS_physics_driver.F90 index f9f3e036c..36e0c7c21 100644 --- a/GFS_layer/GFS_physics_driver.F90 +++ b/GFS_layer/GFS_physics_driver.F90 @@ -23,6 +23,7 @@ module module_physics_driver use GFS_DCNV_generic_post, only: GFS_DCNV_generic_post_run use GFS_suite_interstitial_1, only: GFS_suite_interstitial_1_run use GFS_suite_interstitial_2, only: GFS_suite_interstitial_2_run + use GFS_suite_interstitial_3, only: GFS_suite_interstitial_3_run implicit none @@ -807,7 +808,7 @@ subroutine GFS_physics_driver & ! endif ! endif ! end if_lssav_block call GFS_suite_interstitial_3_run (Model, Grid, Statein, Radtend, xcosz, & - adjsfcdsw, adjsfcdlw, adjsfculw, xmu, kcnv, hflx, evap, Diag) + adjsfcdsw, adjsfcdlw, adjsfculw, xmu, Diag, kcnv, hflx, evap) call GFS_PBL_generic_pre_run (im, levs, kinver) !kcnv(:) = 0 diff --git a/physics/GFS_suite_interstitial.f90 b/physics/GFS_suite_interstitial.f90 index cfdbf511a..284a03183 100644 --- a/physics/GFS_suite_interstitial.f90 +++ b/physics/GFS_suite_interstitial.f90 @@ -153,20 +153,23 @@ subroutine GFS_suite_interstitial_3_finalize() end subroutine GFS_suite_interstitial_3_finalize !> \section arg_table_GFS_suite_interstitial_3_run Argument Table -!! | local var name | longname | description | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| -!! | Model | FV3-GFS_Control_type | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_typedefs%GFS_control_type | | in | F | -!! | Grid | FV3-GFS_Grid_type | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_typedefs%GFS_grid_type | | in | F | -!! | tottracer | number_of_total_tracers | total number of tracers | count | 0 | integer | | out | F | -!! | trc_shft | start_index_of_other_tracers | beginning index of the non-water tracer species | index | 0 | integer | | out | F | -!! | tracers | number_of_water_tracers | number of water-related tracers | index | 0 | integer | | out | F | -!! | ntk | index_of_TKE | index of TKE in the tracer array | index | 0 | integer | | out | F | -!! | skip_macro | flag_skip_macro | flag to skip cloud macrophysics in Morrison scheme | flag | 1 | logical | | out | F | -!! | clw | convective_transportable_tracers | array to contain cloud water and other convective trans. tracers | kg kg-1 | 3 | real | kind_phys | out | F | -!! | cnvw | convective_cloud_water_specific_humidity | convective cloud water specific humidity | kg kg-1 | 2 | real | kind_phys | out | F | -!! | cnvc | convective_cloud_cover | convective cloud cover | frac | 2 | real | kind_phys | out | F | +!! | local var name | longname | description | units | rank | type | kind | intent | optional | +!! |----------------|--------------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| +!! | Model | FV3-GFS_Control_type | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_typedefs%GFS_control_type | | in | F | +!! | Grid | FV3-GFS_Grid_type | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_typedefs%GFS_grid_type | | in | F | +!! | Statein | FV3-GFS_Statein_type | Fortran DDT containing FV3-GFS prognostic state data in from dycore | DDT | 0 | GFS_typedefs%GFS_statein_type | | in | F | +!! | Radtend | FV3-GFS_Radtend_type | Fortran DDT containing FV3-GFS radiation tendencies needed in physics | DDT | 0 | GFS_typedefs%GFS_radtend_type | | in | F | +!! | xcosz | instantaneous_cosine_of_zenith_angle | cosine of zenith angle at current time | none | 1 | real | kind_phys | in | F | +!! | adjsfcdsw | surface_downwelling_shortwave_flux | surface downwelling shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | +!! | adjsfcdlw | surface_downwelling_longwave_flux | surface downwelling longwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | +!! | adjsfculw | surface_upwelling_longwave_flux | surface upwelling longwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | +!! | xmu | zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes | zenith angle temporal adjustment factor for shortwave fluxes | none | 1 | real | kind_phys | in | F | +!! | Diag | FV3-GFS_diag_type | Fortran DDT containing FV3-GFS fields targeted for diagnostic output | DDT | 0 | GFS_typedefs%GFS_diag_type | | inout | F | +!! | kcnv | flag_deep_convection | flag indicating whether convection occurs in column (0 or 1) | index | 1 | integer | | out | F | +!! | heat | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | out | F | +!! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | out | F | !! - subroutine GFS_suite_interstitial_3_run (Model, Grid, Statein, Radtend, xcosz, adjsfcdsw, adjsfcdlw, adjsfculw, xmu, kcnv, hflx, evap, Diag) + subroutine GFS_suite_interstitial_3_run (Model, Grid, Statein, Radtend, xcosz, adjsfcdsw, adjsfcdlw, adjsfculw, xmu, Diag, kcnv, hflx, evap) use machine, only: kind_phys use GFS_typedefs, only: GFS_control_type, GFS_grid_type, GFS_statein_type, GFS_radtend_type, GFS_diag_type @@ -178,7 +181,7 @@ subroutine GFS_suite_interstitial_3_run (Model, Grid, Statein, Radtend, xcosz, a type(GFS_diag_type), intent(inout) :: Diag integer, dimension(size(Grid%xlon,1)), intent(out) :: kcnv - real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: xcosz, adjsfcdsw, adjsfcdlw, adjsfculw, xmu + real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: xcosz, adjsfcdsw, adjsfcdlw, adjsfculw, xmu real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(out) :: hflx, evap real(kind=kind_phys), parameter :: czmin = 0.0001 ! cos(89.994) From f43067f2b34a17f2f4a5477b077a1eacd9dcb079 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Fri, 17 Nov 2017 15:24:35 -0700 Subject: [PATCH 36/48] added GFS_suite_update_stateout --- GFS_layer/GFS_physics_driver.F90 | 19 +++++++------ physics/GFS_suite_interstitial.f90 | 43 ++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 8 deletions(-) diff --git a/GFS_layer/GFS_physics_driver.F90 b/GFS_layer/GFS_physics_driver.F90 index 36e0c7c21..9236343ed 100644 --- a/GFS_layer/GFS_physics_driver.F90 +++ b/GFS_layer/GFS_physics_driver.F90 @@ -24,6 +24,7 @@ module module_physics_driver use GFS_suite_interstitial_1, only: GFS_suite_interstitial_1_run use GFS_suite_interstitial_2, only: GFS_suite_interstitial_2_run use GFS_suite_interstitial_3, only: GFS_suite_interstitial_3_run + use GFS_suite_update_stateout, only: GFS_suite_update_stateout_run implicit none @@ -1085,10 +1086,10 @@ subroutine GFS_physics_driver & Diag%uswsfci(:) = adjsfcdsw(:) - adjsfcnsw(:) Diag%dswsfci(:) = adjsfcdsw(:) Diag%gfluxi(:) = gflx(:) - Diag%t1(:) = Statein%tgrs(:,1) - Diag%q1(:) = Statein%qgrs(:,1,1) - Diag%u1(:) = Statein%ugrs(:,1) - Diag%v1(:) = Statein%vgrs(:,1) + ! Diag%t1(:) = Statein%tgrs(:,1) + ! Diag%q1(:) = Statein%qgrs(:,1,1) + ! Diag%u1(:) = Statein%ugrs(:,1) + ! Diag%v1(:) = Statein%vgrs(:,1) ! --- ... update near surface fields @@ -1428,10 +1429,12 @@ subroutine GFS_physics_driver & ! write(0,*)' dtdt=',(dtdt(ipr,ik),k=1,10) ! endif - Stateout%gt0(:,:) = Statein%tgrs(:,:) + dtdt(:,:) * dtp - Stateout%gu0(:,:) = Statein%ugrs(:,:) + dudt(:,:) * dtp - Stateout%gv0(:,:) = Statein%vgrs(:,:) + dvdt(:,:) * dtp - Stateout%gq0(:,:,:) = Statein%qgrs(:,:,:) + dqdt(:,:,:) * dtp + ! Stateout%gt0(:,:) = Statein%tgrs(:,:) + dtdt(:,:) * dtp + ! Stateout%gu0(:,:) = Statein%ugrs(:,:) + dudt(:,:) * dtp + ! Stateout%gv0(:,:) = Statein%vgrs(:,:) + dvdt(:,:) * dtp + ! Stateout%gq0(:,:,:) = Statein%qgrs(:,:,:) + dqdt(:,:,:) * dtp + + call GFS_suite_update_stateout_run (Statein, Model, Grid, dudt, dvdt, dtdt, dqdt, Stateout) ! if (lprnt) then ! write(7000,*)' ugrs=',ugrs(ipr,:) diff --git a/physics/GFS_suite_interstitial.f90 b/physics/GFS_suite_interstitial.f90 index 284a03183..41afb730e 100644 --- a/physics/GFS_suite_interstitial.f90 +++ b/physics/GFS_suite_interstitial.f90 @@ -233,6 +233,49 @@ subroutine GFS_suite_interstitial_3_run (Model, Grid, Statein, Radtend, xcosz, a hflx(:) = 0.0 evap(:) = 0.0 + Diag%t1(:) = Statein%tgrs(:,1) + Diag%q1(:) = Statein%qgrs(:,1,1) + Diag%u1(:) = Statein%ugrs(:,1) + Diag%v1(:) = Statein%vgrs(:,1) + end subroutine GFS_suite_interstitial_3_run + module GFS_suite_update_stateout + + contains + + subroutine GFS_suite_update_stateout_init () + end subroutine GFS_suite_update_stateout_init + + subroutine GFS_suite_update_stateout_finalize() + end subroutine GFS_suite_update_stateout_finalize + +!> \section arg_table_GFS_suite_update_stateout_run Argument Table +!! | local var name | longname | description | units | rank | type | kind | intent | optional | +!! |----------------|--------------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| +!! | dudt | tendency_of_x_wind_due_to_model_physics | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | in | F | +!! | dvdt | tendency_of_y_wind_due_to_model_physics | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | in | F | +!! | dtdt | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | in | F | +!! | dqdt | tendency_of_tracers_due_to_model_physics | updated tendency of the tracers | kg kg-1 s-1 | 3 | real | kind_phys | in | F | +!! + subroutine GFS_suite_update_stateout_run (Statein, Model, Grid, dudt, dvdt, dtdt, dqdt, Stateout) + + use machine, only: kind_phys + use GFS_typedefs, only: GFS_control_type, GFS_statein_type, GFS_grid_type, GFS_stateout_type + + type(GFS_control_type), intent(in) :: Model + type(GFS_statein_type), intent(in) :: Statein + type(GFS_grid_type), intent(in) :: Grid + type(GFS_stateout_type), intent(inout) :: Stateout + + real(kind=kind_phys), dimension(size(Grid%xlon,1), Model%levs), intent(in) :: dudt, dvdt, dtdt + real(kind=kind_phys), dimension(size(Grid%xlon,1), Model%levs, Model%ntrac), intent(in) :: dqdt + + Stateout%gt0(:,:) = Statein%tgrs(:,:) + dtdt(:,:) * Model%dtp + Stateout%gu0(:,:) = Statein%ugrs(:,:) + dudt(:,:) * Model%dtp + Stateout%gv0(:,:) = Statein%vgrs(:,:) + dvdt(:,:) * Model%dtp + Stateout%gq0(:,:,:) = Statein%qgrs(:,:,:) + dqdt(:,:,:) * Model%dtp + + end subroutine GFS_suite_update_stateout_run + end module From 8f02530d787d9c222bc98a50897586be08619f3c Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Fri, 17 Nov 2017 15:30:49 -0700 Subject: [PATCH 37/48] table for GFS_suite_update_stateout --- physics/GFS_suite_interstitial.f90 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/physics/GFS_suite_interstitial.f90 b/physics/GFS_suite_interstitial.f90 index 41afb730e..e0b34bce0 100644 --- a/physics/GFS_suite_interstitial.f90 +++ b/physics/GFS_suite_interstitial.f90 @@ -251,12 +251,16 @@ subroutine GFS_suite_update_stateout_finalize() end subroutine GFS_suite_update_stateout_finalize !> \section arg_table_GFS_suite_update_stateout_run Argument Table -!! | local var name | longname | description | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| +!! | local var name | longname | description | units | rank | type | kind | intent | optional | +!! |----------------|--------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| +!! | Statein | FV3-GFS_Statein_type | Fortran DDT containing FV3-GFS prognostic state data in from dycore | DDT | 0 | GFS_typedefs%GFS_statein_type | | in | F | +!! | Model | FV3-GFS_Control_type | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_typedefs%GFS_control_type | | in | F | +!! | Grid | FV3-GFS_Grid_type | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_typedefs%GFS_grid_type | | in | F | !! | dudt | tendency_of_x_wind_due_to_model_physics | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | in | F | !! | dvdt | tendency_of_y_wind_due_to_model_physics | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | in | F | !! | dtdt | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | in | F | !! | dqdt | tendency_of_tracers_due_to_model_physics | updated tendency of the tracers | kg kg-1 s-1 | 3 | real | kind_phys | in | F | +!! | Stateout | FV3-GFS_Stateout_type | Fortran DDT containing FV3-GFS prognostic state to return to dycore | DDT | 0 | GFS_typedefs%GFS_stateout_type| | inout | F | !! subroutine GFS_suite_update_stateout_run (Statein, Model, Grid, dudt, dvdt, dtdt, dqdt, Stateout) From 8d64353cd340a62bdde1e81680e5fb68743921a6 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Fri, 17 Nov 2017 16:23:07 -0700 Subject: [PATCH 38/48] added GFS_suite_interstitial_4 --- GFS_layer/GFS_physics_driver.F90 | 30 ++++++++------- physics/GFS_suite_interstitial.f90 | 62 ++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 14 deletions(-) diff --git a/GFS_layer/GFS_physics_driver.F90 b/GFS_layer/GFS_physics_driver.F90 index 9236343ed..018a027d7 100644 --- a/GFS_layer/GFS_physics_driver.F90 +++ b/GFS_layer/GFS_physics_driver.F90 @@ -25,6 +25,7 @@ module module_physics_driver use GFS_suite_interstitial_2, only: GFS_suite_interstitial_2_run use GFS_suite_interstitial_3, only: GFS_suite_interstitial_3_run use GFS_suite_update_stateout, only: GFS_suite_update_stateout_run + use GFS_suite_interstitial_4, only: GFS_suite_interstitial_4_run implicit none @@ -1550,13 +1551,14 @@ subroutine GFS_physics_driver & ! print *,' phii2=',phii(ipr,k=1,levs) ! print *,' phil2=',phil(ipr,:) ! endif - - clw(:,:,1) = 0.0 - clw(:,:,2) = -999.9 - if ((Model%imfdeepcnv >= 0) .or. (Model%imfshalcnv > 0)) then - cnvc(:,:) = 0.0 - cnvw(:,:) = 0.0 - endif + call GFS_suite_interstitial_4_run (Model, Grid, Statein, rhbbot, & + rhbtop, work1, work2, clw, cnvc, cnvw, ktop, kbot, rhc) + ! clw(:,:,1) = 0.0 + ! clw(:,:,2) = -999.9 + ! if ((Model%imfdeepcnv >= 0) .or. (Model%imfshalcnv > 0)) then + ! cnvc(:,:) = 0.0 + ! cnvw(:,:) = 0.0 + ! endif ! write(0,*)' before cnv clstp=',clstp,' kdt=',kdt,' lat=',lat @@ -1586,13 +1588,13 @@ subroutine GFS_physics_driver & ! -------------------------------------------- if (Model%ntcw > 0) then - do k=1,levs - do i=1,im - tem = rhbbot - (rhbbot-rhbtop) * (1.0-Statein%prslk(i,k)) - tem = rhc_max * work1(i) + tem * work2(i) - rhc(i,k) = max(0.0, min(1.0,tem)) - enddo - enddo + ! do k=1,levs + ! do i=1,im + ! tem = rhbbot - (rhbbot-rhbtop) * (1.0-Statein%prslk(i,k)) + ! tem = rhc_max * work1(i) + tem * work2(i) + ! rhc(i,k) = max(0.0, min(1.0,tem)) + ! enddo + ! enddo if (Model%ncld == 2) then clw(:,:,1) = Stateout%gq0(:,:,Model%ntiw) ! ice clw(:,:,2) = Stateout%gq0(:,:,Model%ntcw) ! water diff --git a/physics/GFS_suite_interstitial.f90 b/physics/GFS_suite_interstitial.f90 index e0b34bce0..71b14055a 100644 --- a/physics/GFS_suite_interstitial.f90 +++ b/physics/GFS_suite_interstitial.f90 @@ -240,6 +240,8 @@ subroutine GFS_suite_interstitial_3_run (Model, Grid, Statein, Radtend, xcosz, a end subroutine GFS_suite_interstitial_3_run + end module + module GFS_suite_update_stateout contains @@ -283,3 +285,63 @@ subroutine GFS_suite_update_stateout_run (Statein, Model, Grid, dudt, dvdt, dtdt end subroutine GFS_suite_update_stateout_run end module + +module GFS_suite_interstitial_4 + +contains + +subroutine GFS_suite_interstitial_4_init () +end subroutine GFS_suite_interstitial_4_init + +subroutine GFS_suite_interstitial_4_finalize() +end subroutine GFS_suite_interstitial_4_finalize + +!> \section arg_table_GFS_suite_interstitial_4_run Argument Table +!! | local var name | longname | description | units | rank | type | kind | intent | optional | +!! |----------------|--------------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| +!! | clw | convective_transportable_tracers | array to contain cloud water and other convective trans. tracers | kg kg-1 | 3 | real | kind_phys | out | F | +!! | cnvw | convective_cloud_water_specific_humidity | convective cloud water specific humidity | kg kg-1 | 2 | real | kind_phys | out | F | +!! | cnvc | convective_cloud_cover | convective cloud cover | frac | 2 | real | kind_phys | out | F | +!! +subroutine GFS_suite_interstitial_4_run (Model, Grid, Statein, rhbbot, rhbtop, work1, work2, clw, cnvc, cnvw, ktop, kbot, rhc) + + use machine, only: kind_phys + use GFS_typedefs, only: GFS_control_type, GFS_grid_type, GFS_statein_type + use physcons, only: rhc_max + + type(GFS_control_type), intent(in) :: Model + type(GFS_grid_type), intent(in) :: Grid + type(GFS_statein_type), intent(in) :: Statein + + real(kind=kind_phys), intent(in) :: rhbbot, rhbtop + real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: work1, work2 + real(kind=kind_phys), intent(inout) :: clw(:,:,:), cnvc(:,:), cnvw(:,:) + integer, dimension(size(Grid%xlon,1)), intent(inout) :: ktop, kbot + real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levs), intent(out) :: rhc + + integer :: i,k + real(kind=kind_phys) :: tem + + clw(:,:,1) = 0.0 + clw(:,:,2) = -999.9 + if ((Model%imfdeepcnv >= 0) .or. (Model%imfshalcnv > 0)) then + cnvc(:,:) = 0.0 + cnvw(:,:) = 0.0 + endif + + ktop(:) = 1 + kbot(:) = Model%levs + + if (Model%ntcw > 0) then + do k=1,Model%levs + do i=1, size(Grid%xlon,1) + tem = rhbbot - (rhbbot-rhbtop) * (1.0-Statein%prslk(i,k)) + tem = rhc_max * work1(i) + tem * work2(i) + rhc(i,k) = max(0.0, min(1.0,tem)) + enddo + enddo + endif + +end subroutine GFS_suite_interstitial_4_run + +end module From d3cd2b16c95eb0dce3c887e836d03894b03780e2 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Fri, 17 Nov 2017 16:32:48 -0700 Subject: [PATCH 39/48] table for GFS_suite_interstitial_4 --- physics/GFS_suite_interstitial.f90 | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/physics/GFS_suite_interstitial.f90 b/physics/GFS_suite_interstitial.f90 index 71b14055a..4ed87b522 100644 --- a/physics/GFS_suite_interstitial.f90 +++ b/physics/GFS_suite_interstitial.f90 @@ -297,11 +297,21 @@ subroutine GFS_suite_interstitial_4_finalize() end subroutine GFS_suite_interstitial_4_finalize !> \section arg_table_GFS_suite_interstitial_4_run Argument Table -!! | local var name | longname | description | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| -!! | clw | convective_transportable_tracers | array to contain cloud water and other convective trans. tracers | kg kg-1 | 3 | real | kind_phys | out | F | -!! | cnvw | convective_cloud_water_specific_humidity | convective cloud water specific humidity | kg kg-1 | 2 | real | kind_phys | out | F | -!! | cnvc | convective_cloud_cover | convective cloud cover | frac | 2 | real | kind_phys | out | F | +!! | local var name | longname | description | units | rank | type | kind | intent | optional | +!! |----------------|--------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| +!! | Model | FV3-GFS_Control_type | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_typedefs%GFS_control_type | | in | F | +!! | Grid | FV3-GFS_Grid_type | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_typedefs%GFS_grid_type | | in | F | +!! | Statein | FV3-GFS_Statein_type | Fortran DDT containing FV3-GFS prognostic state data in from dycore | DDT | 0 | GFS_typedefs%GFS_statein_type | | in | F | +!! | rhbbot | critical_relative_humidity_at_surface | critical relative humidity at the surface | frac | 0 | real | kind_phys | in | F | +!! | rhbtop | critical_relative_humidity_at_top_of_atmosphere | critical relative humidity at the top of atmosphere | frac | 0 | real | kind_phys | in | F | +!! | work1 | grid_related_coefficient | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | in | F | +!! | work2 | grid_related_coefficient_complement | complement to work1 | none | 1 | real | kind_phys | in | F | +!! | clw | convective_transportable_tracers | array to contain cloud water and other convective trans. tracers | kg kg-1 | 3 | real | kind_phys | inout | F | +!! | cnvw | convective_cloud_water_specific_humidity | convective cloud water specific humidity | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | cnvc | convective_cloud_cover | convective cloud cover | frac | 2 | real | kind_phys | inout | F | +!! | ktop | vertical_index_at_cloud_top | vertical index at cloud top | index | 1 | integer | | inout | F | +!! | kbot | vertical_index_at_cloud_base | vertical index at cloud base | index | 1 | integer | | inout | F | +!! | rhc | critical_relative_humidity | critical relative humidity | frac | 2 | real | kind_phys | out | F | !! subroutine GFS_suite_interstitial_4_run (Model, Grid, Statein, rhbbot, rhbtop, work1, work2, clw, cnvc, cnvw, ktop, kbot, rhc) From 228216e8439bd8cc5b2f046eaf028682cf9d3258 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Fri, 17 Nov 2017 17:19:56 -0700 Subject: [PATCH 40/48] added GFS_suite_interstitial_5 --- GFS_layer/GFS_physics_driver.F90 | 8 +++++--- physics/GFS_suite_interstitial.f90 | 29 +++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/GFS_layer/GFS_physics_driver.F90 b/GFS_layer/GFS_physics_driver.F90 index 018a027d7..d015f4c0e 100644 --- a/GFS_layer/GFS_physics_driver.F90 +++ b/GFS_layer/GFS_physics_driver.F90 @@ -26,6 +26,7 @@ module module_physics_driver use GFS_suite_interstitial_3, only: GFS_suite_interstitial_3_run use GFS_suite_update_stateout, only: GFS_suite_update_stateout_run use GFS_suite_interstitial_4, only: GFS_suite_interstitial_4_run + use GFS_suite_interstitial_5, only: GFS_suite_interstitial_5_run implicit none @@ -2773,12 +2774,13 @@ subroutine GFS_physics_driver & enddo endif - deallocate (clw) + call GFS_suite_interstitial_5_run (clw, cnvc, cnvw) + !deallocate (clw) if (Model%do_shoc) then deallocate (qpl, qpi, ncpl, ncpi) endif - if (allocated(cnvc)) deallocate(cnvc) - if (allocated(cnvw)) deallocate(cnvw) + ! if (allocated(cnvc)) deallocate(cnvc) + ! if (allocated(cnvw)) deallocate(cnvw) ! deallocate (fscav, fswtr) ! diff --git a/physics/GFS_suite_interstitial.f90 b/physics/GFS_suite_interstitial.f90 index 4ed87b522..db7a784b5 100644 --- a/physics/GFS_suite_interstitial.f90 +++ b/physics/GFS_suite_interstitial.f90 @@ -354,4 +354,33 @@ subroutine GFS_suite_interstitial_4_run (Model, Grid, Statein, rhbbot, rhbtop, w end subroutine GFS_suite_interstitial_4_run +module GFS_suite_interstitial_5 + +contains + +subroutine GFS_suite_interstitial_5_init () +end subroutine GFS_suite_interstitial_5_init + +subroutine GFS_suite_interstitial_5_finalize() +end subroutine GFS_suite_interstitial_5_finalize + +!> \section arg_table_GFS_suite_interstitial_5_run Argument Table +!! | local var name | longname | description | units | rank | type | kind | intent | optional | +!! |----------------|--------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| +!! | clw | convective_transportable_tracers | array to contain cloud water and other convective trans. tracers | kg kg-1 | 3 | real | kind_phys | inout | F | +!! | cnvw | convective_cloud_water_specific_humidity | convective cloud water specific humidity | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | cnvc | convective_cloud_cover | convective cloud cover | frac | 2 | real | kind_phys | inout | F | +!! +subroutine GFS_suite_interstitial_5_run (clw, cnvc, cnvw) + + use machine, only: kind_phys + + real(kind=kind_phys), intent(inout) :: clw(:,:,:), cnvc(:,:), cnvw(:,:) + + deallocate (clw) + if (allocated(cnvc)) deallocate(cnvc) + if (allocated(cnvw)) deallocate(cnvw) + +end subroutine GFS_suite_interstitial_5_run + end module From 26d5f269c9066b321f43e5ce979a91ddc83a6553 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Fri, 17 Nov 2017 17:23:00 -0700 Subject: [PATCH 41/48] fixed end module statement --- physics/GFS_suite_interstitial.f90 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/physics/GFS_suite_interstitial.f90 b/physics/GFS_suite_interstitial.f90 index db7a784b5..a92103e4e 100644 --- a/physics/GFS_suite_interstitial.f90 +++ b/physics/GFS_suite_interstitial.f90 @@ -354,6 +354,8 @@ subroutine GFS_suite_interstitial_4_run (Model, Grid, Statein, rhbbot, rhbtop, w end subroutine GFS_suite_interstitial_4_run +end module GFS_suite_interstitial_4 + module GFS_suite_interstitial_5 contains From 51560a114003666763194976ea55575728608a4b Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Fri, 17 Nov 2017 17:29:43 -0700 Subject: [PATCH 42/48] added allocatable to arrays in deallocation subroutine --- physics/GFS_suite_interstitial.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/GFS_suite_interstitial.f90 b/physics/GFS_suite_interstitial.f90 index a92103e4e..d1b797cf1 100644 --- a/physics/GFS_suite_interstitial.f90 +++ b/physics/GFS_suite_interstitial.f90 @@ -377,7 +377,7 @@ subroutine GFS_suite_interstitial_5_run (clw, cnvc, cnvw) use machine, only: kind_phys - real(kind=kind_phys), intent(inout) :: clw(:,:,:), cnvc(:,:), cnvw(:,:) + real(kind=kind_phys), allocatable, intent(inout) :: clw(:,:,:), cnvc(:,:), cnvw(:,:) deallocate (clw) if (allocated(cnvc)) deallocate(cnvc) From e02e98a1844e0fd57ce4d6f1003f5a69a80ed197 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Fri, 17 Nov 2017 20:32:11 -0700 Subject: [PATCH 43/48] longname updates --- physics/GFS_PBL_generic.f90 | 2 +- physics/GFS_suite_interstitial.f90 | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/physics/GFS_PBL_generic.f90 b/physics/GFS_PBL_generic.f90 index 51435c28d..5faa7e831 100644 --- a/physics/GFS_PBL_generic.f90 +++ b/physics/GFS_PBL_generic.f90 @@ -56,7 +56,7 @@ end subroutine GFS_PBL_generic_post_finalize !! | dtdt | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | in | F | !! | dqdt | tendency_of_tracers_due_to_model_physics | updated tendency of the tracers | kg kg-1 s-1 | 3 | real | kind_phys | in | F | !! | xmu | time_step_zenith_angle_adjust_factor_for_sw | time step zenith angle adjust factor for shortwave | none | 2 | real | kind_phys | in | F | -!! | Diag | FV3-GFS_diag_type | Fortran DDT containing FV3-GFS fields targeted for diagnostic output | DDT | 0 | GFS_typedefs%GFS_diag_type | | in | F | +!! | Diag | FV3-GFS_Diag_type | Fortran DDT containing FV3-GFS fields targeted for diagnostic output | DDT | 0 | GFS_typedefs%GFS_diag_type | | in | F | !! subroutine GFS_PBL_generic_post_run (Grid, Model, Radtend, dusfc1, dvsfc1, dtsfc1, dqsfc1, & dudt, dvdt, dtdt, dqdt, xmu, Diag) diff --git a/physics/GFS_suite_interstitial.f90 b/physics/GFS_suite_interstitial.f90 index d1b797cf1..d5c5ed67d 100644 --- a/physics/GFS_suite_interstitial.f90 +++ b/physics/GFS_suite_interstitial.f90 @@ -22,8 +22,8 @@ end subroutine GFS_suite_interstitial_1_finalize !! | ntk | index_of_TKE | index of TKE in the tracer array | index | 0 | integer | | out | F | !! | skip_macro | flag_skip_macro | flag to skip cloud macrophysics in Morrison scheme | flag | 1 | logical | | out | F | !! | clw | convective_transportable_tracers | array to contain cloud water and other convective trans. tracers | kg kg-1 | 3 | real | kind_phys | out | F | -!! | cnvw | convective_cloud_water_specific_humidity | convective cloud water specific humidity | kg kg-1 | 2 | real | kind_phys | out | F | !! | cnvc | convective_cloud_cover | convective cloud cover | frac | 2 | real | kind_phys | out | F | +!! | cnvw | convective_cloud_water_specific_humidity | convective cloud water specific humidity | kg kg-1 | 2 | real | kind_phys | out | F | !! subroutine GFS_suite_interstitial_1_run (Model, Grid, tottracer, trc_shft, tracers, ntk, skip_macro, clw, cnvc, cnvw) @@ -84,7 +84,7 @@ end subroutine GFS_suite_interstitial_2_finalize !! | Grid | FV3-GFS_Grid_type | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_typedefs%GFS_grid_type | | in | F | !! | Sfcprop | FV3-GFS_Sfcprop_type | Fortran DDT containing FV3-GFS surface fields | DDT | 0 | GFS_typedefs%GFS_sfcprop_type | | in | F | !! | Statein | FV3-GFS_Statein_type | Fortran DDT containing FV3-GFS prognostic state data in from dycore | DDT | 0 | GFS_typedefs%GFS_statein_type | | in | F | -!! | Diag | FV3-GFS_diag_type | Fortran DDT containing FV3-GFS fields targeted for diagnostic output | DDT | 0 | GFS_typedefs%GFS_diag_type | | inout | F | +!! | Diag | FV3-GFS_Diag_type | Fortran DDT containing FV3-GFS fields targeted for diagnostic output | DDT | 0 | GFS_typedefs%GFS_diag_type | | inout | F | !! | rhbbot | critical_relative_humidity_at_surface | critical relative humidity at the surface | frac | 0 | real | kind_phys | out | F | !! | rhpbl | critical_relative_humidity_at_PBL_top | critical relative humidity at the PBL top | frac | 0 | real | kind_phys | out | F | !! | rhbtop | critical_relative_humidity_at_top_of_atmosphere | critical relative humidity at the top of atmosphere | frac | 0 | real | kind_phys | out | F | @@ -164,7 +164,7 @@ end subroutine GFS_suite_interstitial_3_finalize !! | adjsfcdlw | surface_downwelling_longwave_flux | surface downwelling longwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | !! | adjsfculw | surface_upwelling_longwave_flux | surface upwelling longwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | !! | xmu | zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes | zenith angle temporal adjustment factor for shortwave fluxes | none | 1 | real | kind_phys | in | F | -!! | Diag | FV3-GFS_diag_type | Fortran DDT containing FV3-GFS fields targeted for diagnostic output | DDT | 0 | GFS_typedefs%GFS_diag_type | | inout | F | +!! | Diag | FV3-GFS_Diag_type | Fortran DDT containing FV3-GFS fields targeted for diagnostic output | DDT | 0 | GFS_typedefs%GFS_diag_type | | inout | F | !! | kcnv | flag_deep_convection | flag indicating whether convection occurs in column (0 or 1) | index | 1 | integer | | out | F | !! | heat | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | out | F | !! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | out | F | @@ -307,8 +307,8 @@ end subroutine GFS_suite_interstitial_4_finalize !! | work1 | grid_related_coefficient | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | in | F | !! | work2 | grid_related_coefficient_complement | complement to work1 | none | 1 | real | kind_phys | in | F | !! | clw | convective_transportable_tracers | array to contain cloud water and other convective trans. tracers | kg kg-1 | 3 | real | kind_phys | inout | F | -!! | cnvw | convective_cloud_water_specific_humidity | convective cloud water specific humidity | kg kg-1 | 2 | real | kind_phys | inout | F | !! | cnvc | convective_cloud_cover | convective cloud cover | frac | 2 | real | kind_phys | inout | F | +!! | cnvw | convective_cloud_water_specific_humidity | convective cloud water specific humidity | kg kg-1 | 2 | real | kind_phys | inout | F | !! | ktop | vertical_index_at_cloud_top | vertical index at cloud top | index | 1 | integer | | inout | F | !! | kbot | vertical_index_at_cloud_base | vertical index at cloud base | index | 1 | integer | | inout | F | !! | rhc | critical_relative_humidity | critical relative humidity | frac | 2 | real | kind_phys | out | F | @@ -370,8 +370,8 @@ end subroutine GFS_suite_interstitial_5_finalize !! | local var name | longname | description | units | rank | type | kind | intent | optional | !! |----------------|--------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| !! | clw | convective_transportable_tracers | array to contain cloud water and other convective trans. tracers | kg kg-1 | 3 | real | kind_phys | inout | F | -!! | cnvw | convective_cloud_water_specific_humidity | convective cloud water specific humidity | kg kg-1 | 2 | real | kind_phys | inout | F | !! | cnvc | convective_cloud_cover | convective cloud cover | frac | 2 | real | kind_phys | inout | F | +!! | cnvw | convective_cloud_water_specific_humidity | convective cloud water specific humidity | kg kg-1 | 2 | real | kind_phys | inout | F | !! subroutine GFS_suite_interstitial_5_run (clw, cnvc, cnvw) From 36ef5b425fc7272492bf9afbe22e32fc86ac327d Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Fri, 17 Nov 2017 20:52:10 -0700 Subject: [PATCH 44/48] longname table updates --- physics/GFS_PBL_generic.f90 | 30 +++++----- physics/moninedmf.f | 106 ++++++++++++++++++------------------ 2 files changed, 68 insertions(+), 68 deletions(-) diff --git a/physics/GFS_PBL_generic.f90 b/physics/GFS_PBL_generic.f90 index 5faa7e831..de15fd0a4 100644 --- a/physics/GFS_PBL_generic.f90 +++ b/physics/GFS_PBL_generic.f90 @@ -42,21 +42,21 @@ end subroutine GFS_PBL_generic_post_finalize !> \section arg_table_GFS_PBL_generic_post_run Argument Table -!! | local var name | longname | description | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| -!! | Grid | FV3-GFS_Grid_type | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_typedefs%GFS_grid_type | | in | F | -!! | Model | FV3-GFS_Control_type | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_typedefs%GFS_control_type | | in | F | -!! | Radtend | FV3-GFS_Radtend_type | Fortran DDT containing FV3-GFS radiation tendencies needed in physics | DDT | 0 | GFS_typedefs%GFS_radtend_type | | in | F | -!! | dusfc1 | instantaneous_surface_x_momentum_flux | surface momentum flux in the x-direction valid for current call | Pa | 1 | real | kind_phys | in | F | -!! | dvsfc1 | instantaneous_surface_y_momentum_flux | surface momentum flux in the y-direction valid for current call | Pa | 1 | real | kind_phys | in | F | -!! | dtsfc1 | instantaneous_surface_upward_sensible_heat_flux | surface upward sensible heat flux valid for current call | W m-2 | 1 | real | kind_phys | in | F | -!! | dqsfc1 | instantaneous_surface_upward_latent_heat_flux | surface upward latent heat flux valid for current call | W m-2 | 1 | real | kind_phys | in | F | -!! | dudt | tendency_of_x_wind_due_to_model_physics | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | in | F | -!! | dvdt | tendency_of_y_wind_due_to_model_physics | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | in | F | -!! | dtdt | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | in | F | -!! | dqdt | tendency_of_tracers_due_to_model_physics | updated tendency of the tracers | kg kg-1 s-1 | 3 | real | kind_phys | in | F | -!! | xmu | time_step_zenith_angle_adjust_factor_for_sw | time step zenith angle adjust factor for shortwave | none | 2 | real | kind_phys | in | F | -!! | Diag | FV3-GFS_Diag_type | Fortran DDT containing FV3-GFS fields targeted for diagnostic output | DDT | 0 | GFS_typedefs%GFS_diag_type | | in | F | +!! | local var name | longname | description | units | rank | type | kind | intent | optional | +!! |----------------|--------------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| +!! | Grid | FV3-GFS_Grid_type | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_typedefs%GFS_grid_type | | in | F | +!! | Model | FV3-GFS_Control_type | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_typedefs%GFS_control_type | | in | F | +!! | Radtend | FV3-GFS_Radtend_type | Fortran DDT containing FV3-GFS radiation tendencies needed in physics | DDT | 0 | GFS_typedefs%GFS_radtend_type | | in | F | +!! | dusfc1 | instantaneous_surface_x_momentum_flux | surface momentum flux in the x-direction valid for current call | Pa | 1 | real | kind_phys | in | F | +!! | dvsfc1 | instantaneous_surface_y_momentum_flux | surface momentum flux in the y-direction valid for current call | Pa | 1 | real | kind_phys | in | F | +!! | dtsfc1 | instantaneous_surface_upward_sensible_heat_flux | surface upward sensible heat flux valid for current call | W m-2 | 1 | real | kind_phys | in | F | +!! | dqsfc1 | instantaneous_surface_upward_latent_heat_flux | surface upward latent heat flux valid for current call | W m-2 | 1 | real | kind_phys | in | F | +!! | dudt | tendency_of_x_wind_due_to_model_physics | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | in | F | +!! | dvdt | tendency_of_y_wind_due_to_model_physics | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | in | F | +!! | dtdt | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | in | F | +!! | dqdt | tendency_of_tracers_due_to_model_physics | updated tendency of the tracers | kg kg-1 s-1 | 3 | real | kind_phys | in | F | +!! | xmu | zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes | zenith angle temporal adjustment factor for shortwave fluxes | none | 2 | real | kind_phys | in | F | +!! | Diag | FV3-GFS_Diag_type | Fortran DDT containing FV3-GFS fields targeted for diagnostic output | DDT | 0 | GFS_typedefs%GFS_diag_type | | in | F | !! subroutine GFS_PBL_generic_post_run (Grid, Model, Radtend, dusfc1, dvsfc1, dtsfc1, dqsfc1, & dudt, dvdt, dtdt, dqdt, xmu, Diag) diff --git a/physics/moninedmf.f b/physics/moninedmf.f index e16362a7f..cd8f15fdb 100755 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -28,59 +28,59 @@ end subroutine edmf_finalize !! The scheme works on a basic level by calculating background diffusion coefficients and updating them according to which processes are occurring in the column. The most important difference in diffusion coefficients occurs between those levels in the PBL and those above the PBL, so the PBL height calculation is of utmost importance. An initial estimate is calculated in a "predictor" step in order to calculate Monin-Obukhov similarity values and a corrector step recalculates the PBL height based on updated surface thermal characteristics. Using the PBL height and the similarity parameters, the diffusion coefficients are updated below the PBL top based on Hong and Pan (1996) \cite hong_and_pan_1996 (including counter-gradient terms). Diffusion coefficients in the free troposphere (above the PBL top) are calculated according to Louis (1979) \cite louis_1979 with updated Richardson number-dependent functions. If it is diagnosed that PBL top-down mixing is occurring according to Lock et al. (2000) \cite lock_et_al_2000 , then then diffusion coefficients are updated accordingly. Finally, for convective boundary layers (defined as when the Obukhov length exceeds a threshold), the counter-gradient terms are replaced using the mass flux scheme of Siebesma et al. (2007) \cite siebesma_et_al_2007 . In order to return time tendencies, a fully implicit solution is found using tridiagonal matrices, and time tendencies are "backed out." Before returning, the time tendency of temperature is updated to reflect heating due to TKE dissipation following Han et al. (2015) \cite han_et_al_2015 . !! !! \section arg_table_edmf_run -!! | local var name | longname | description | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|----------------------------------------------------|---------------|------|---------|-----------|--------|----------| -!! | ix | horizontal_dimension | horizontal dimension | index | 0 | integer | | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent, start at 1 | index | 0 | integer | | in | F | -!! | km | vertical_dimension | vertical layer dimension | index | 0 | integer | | in | F | -!! | ntrac | number_of_vertical_diffusion_tracers | number of tracers to diffuse vertically | count | 0 | integer | | in | F | -!! | ntcw | index_for_liquid_cloud_condensate | cloud condensate index in tracer array | index | 0 | integer | | in | F | -!! | dv | tendency_of_y_wind_due_to_model_physics | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | inout | F | -!! | du | tendency_of_x_wind_due_to_model_physics | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | inout | F | -!! | tau | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | inout | F | -!! | rtg | tendency_of_tracers_due_to_model_physics | updated tendency of the tracers | kg kg-1 s-1 | 3 | real | kind_phys | inout | F | -!! | u1 | x_wind | x component of layer wind | m s-1 | 2 | real | kind_phys | in | F | -!! | v1 | y_wind | y component of layer wind | m s-1 | 2 | real | kind_phys | in | F | -!! | t1 | air_temperature | layer mean air temperature | K | 2 | real | kind_phys | in | F | -!! | q1 | tracer_concentration | layer mean tracer concentration | kg kg-1 | 3 | real | kind_phys | in | F | -!! | swh | tendency_of_air_temperature_due_to_shortwave_heating | total sky shortwave heating rate | K s-1 | 2 | real | kind_phys | in | F | -!! | hlw | tendency_of_air_temperature_due_to_longwave_heating | total sky longwave heating rate | K s-1 | 2 | real | kind_phys | in | F | -!! | xmu | time_step_zenith_angle_adjust_factor_for_sw | time step zenith angle adjust factor for shortwave | none | 2 | real | kind_phys | in | F | -!! | psk | exner_function_at_lowest_model_interface | exner function at the surface interface | none | 1 | real | kind_phys | in | F | -!! | rbsoil | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | in | F | -!! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | in | F | -!! | u10m | x_wind_at_10m | x component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | -!! | v10m | y_wind_at_10m | y component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | -!! | fm | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | in | F | -!! | fh | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | in | F | -!! | tsea | surface_skin_temperature | surface temperature | K | 1 | real | kind_phys | in | F | -!! | heat | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | -!! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | in | F | -!! | spd1 | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | in | F | -!! | kpbl | vertical_index_at_top_of_atmosphere_boundary_layer | PBL top model level index | index | 1 | integer | | out | F | -!! | prsi | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | -!! | del | air_pressure_difference_between_midlayers | pres(k) - pres(k+1) | Pa | 2 | real | kind_phys | in | F | -!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | prslk | dimensionless_exner_function | Exner function at layers | none | 2 | real | kind_phys | in | F | -!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | -!! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | -!! | delt | time_step_for_physics | time step for physics | s | 0 | real | kind_phys | in | F | -!! | dspheat | flag_TKE_dissipation_heating | flag for using TKE dissipation heating | flag | 0 | logical | | in | F | -!! | dusfc | instantaneous_surface_x_momentum_flux | x momentum flux | Pa | 1 | real | kind_phys | out | F | -!! | dvsfc | instantaneous_surface_y_momentum_flux | y momentum flux | Pa | 1 | real | kind_phys | out | F | -!! | dtsfc | instantaneous_surface_upward_sensible_heat_flux | surface upward sensible heat flux | W m-2 | 1 | real | kind_phys | out | F | -!! | dqsfc | instantaneous_surface_upward_latent_heat_flux | surface upward latent heat flux | W m-2 | 1 | real | kind_phys | out | F | -!! | hpbl | atmosphere_boundary_layer_thickness | PBL thickness | m | 1 | real | kind_phys | out | F | -!! | hgamt | countergradient_mixing_term_for_temperature | countergradient mixing term for temperature | K | 1 | real | kind_phys | out | F | -!! | hgamq | countergradient_mixing_term_for_water_vapor | countergradient mixing term for water vapor | kg kg-1 | 1 | real | kind_phys | out | F | -!! | dkt | atmosphere_heat_diffusivity | diffusivity for heat | m2 s-1 | 1 | real | kind_phys | out | F | -!! | kinver | index_of_highest_temperature_inversion | index of highest temperature inversion | index | 1 | integer | | in | F | -!! | xkzm_m | atmosphere_momentum_diffusivity_background | background value of momentum diffusivity | m2 s-1 | 0 | real | kind_phys | in | F | -!! | xkzm_h | atmosphere_heat_diffusivity_background | background value of heat diffusivity | m2 s-1 | 0 | real | kind_phys | in | F | -!! | xkzm_s | diffusivity_background_sigma_level | sigma level threshold for background diffusivity | none | 0 | real | kind_phys | in | F | -!! | lprnt | flag_print | flag for printing diagnostics to output | flag | 0 | logical | | in | F | -!! | ipr | horizontal_index_of_printed_column | horizontal index of printed column | index | 0 | integer | | in | F | +!! | local var name | longname | description | units | rank | type | kind | intent | optional | +!! |----------------|--------------------------------------------------------------|----------------------------------------------------|---------------|------|---------|-----------|--------|----------| +!! | ix | horizontal_dimension | horizontal dimension | index | 0 | integer | | in | F | +!! | im | horizontal_loop_extent | horizontal loop extent, start at 1 | index | 0 | integer | | in | F | +!! | km | vertical_dimension | vertical layer dimension | index | 0 | integer | | in | F | +!! | ntrac | number_of_vertical_diffusion_tracers | number of tracers to diffuse vertically | count | 0 | integer | | in | F | +!! | ntcw | index_for_liquid_cloud_condensate | cloud condensate index in tracer array | index | 0 | integer | | in | F | +!! | dv | tendency_of_y_wind_due_to_model_physics | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | inout | F | +!! | du | tendency_of_x_wind_due_to_model_physics | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | inout | F | +!! | tau | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | inout | F | +!! | rtg | tendency_of_tracers_due_to_model_physics | updated tendency of the tracers | kg kg-1 s-1 | 3 | real | kind_phys | inout | F | +!! | u1 | x_wind | x component of layer wind | m s-1 | 2 | real | kind_phys | in | F | +!! | v1 | y_wind | y component of layer wind | m s-1 | 2 | real | kind_phys | in | F | +!! | t1 | air_temperature | layer mean air temperature | K | 2 | real | kind_phys | in | F | +!! | q1 | tracer_concentration | layer mean tracer concentration | kg kg-1 | 3 | real | kind_phys | in | F | +!! | swh | tendency_of_air_temperature_due_to_shortwave_heating | total sky shortwave heating rate | K s-1 | 2 | real | kind_phys | in | F | +!! | hlw | tendency_of_air_temperature_due_to_longwave_heating | total sky longwave heating rate | K s-1 | 2 | real | kind_phys | in | F | +!! | xmu | zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes | zenith angle temporal adjustment factor for shortwave | none | 2 | real | kind_phys | in | F | +!! | psk | exner_function_at_lowest_model_interface | exner function at the surface interface | none | 1 | real | kind_phys | in | F | +!! | rbsoil | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | in | F | +!! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | in | F | +!! | u10m | x_wind_at_10m | x component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | +!! | v10m | y_wind_at_10m | y component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | +!! | fm | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | in | F | +!! | fh | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | in | F | +!! | tsea | surface_skin_temperature | surface temperature | K | 1 | real | kind_phys | in | F | +!! | heat | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | +!! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | +!! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | in | F | +!! | spd1 | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | in | F | +!! | kpbl | vertical_index_at_top_of_atmosphere_boundary_layer | PBL top model level index | index | 1 | integer | | out | F | +!! | prsi | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | +!! | del | air_pressure_difference_between_midlayers | pres(k) - pres(k+1) | Pa | 2 | real | kind_phys | in | F | +!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | +!! | prslk | dimensionless_exner_function | Exner function at layers | none | 2 | real | kind_phys | in | F | +!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | +!! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | +!! | delt | time_step_for_physics | time step for physics | s | 0 | real | kind_phys | in | F | +!! | dspheat | flag_TKE_dissipation_heating | flag for using TKE dissipation heating | flag | 0 | logical | | in | F | +!! | dusfc | instantaneous_surface_x_momentum_flux | x momentum flux | Pa | 1 | real | kind_phys | out | F | +!! | dvsfc | instantaneous_surface_y_momentum_flux | y momentum flux | Pa | 1 | real | kind_phys | out | F | +!! | dtsfc | instantaneous_surface_upward_sensible_heat_flux | surface upward sensible heat flux | W m-2 | 1 | real | kind_phys | out | F | +!! | dqsfc | instantaneous_surface_upward_latent_heat_flux | surface upward latent heat flux | W m-2 | 1 | real | kind_phys | out | F | +!! | hpbl | atmosphere_boundary_layer_thickness | PBL thickness | m | 1 | real | kind_phys | out | F | +!! | hgamt | countergradient_mixing_term_for_temperature | countergradient mixing term for temperature | K | 1 | real | kind_phys | out | F | +!! | hgamq | countergradient_mixing_term_for_water_vapor | countergradient mixing term for water vapor | kg kg-1 | 1 | real | kind_phys | out | F | +!! | dkt | atmosphere_heat_diffusivity | diffusivity for heat | m2 s-1 | 1 | real | kind_phys | out | F | +!! | kinver | index_of_highest_temperature_inversion | index of highest temperature inversion | index | 1 | integer | | in | F | +!! | xkzm_m | atmosphere_momentum_diffusivity_background | background value of momentum diffusivity | m2 s-1 | 0 | real | kind_phys | in | F | +!! | xkzm_h | atmosphere_heat_diffusivity_background | background value of heat diffusivity | m2 s-1 | 0 | real | kind_phys | in | F | +!! | xkzm_s | diffusivity_background_sigma_level | sigma level threshold for background diffusivity | none | 0 | real | kind_phys | in | F | +!! | lprnt | flag_print | flag for printing diagnostics to output | flag | 0 | logical | | in | F | +!! | ipr | horizontal_index_of_printed_column | horizontal index of printed column | index | 0 | integer | | in | F | !! !! \section general General Algorithm !! -# Compute preliminary variables from input arguments. From 2cd977d4d03f03aa29f85d7d6fc9655af5efa166 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Tue, 28 Nov 2017 21:05:41 -0700 Subject: [PATCH 45/48] added GFS_SCNV_generic_pre,post --- GFS_layer/GFS_physics_driver.F90 | 60 ++++++++++--------- makefile | 1 + physics/GFS_SCNV_generic.f90 | 99 ++++++++++++++++++++++++++++++++ 3 files changed, 133 insertions(+), 27 deletions(-) create mode 100644 physics/GFS_SCNV_generic.f90 diff --git a/GFS_layer/GFS_physics_driver.F90 b/GFS_layer/GFS_physics_driver.F90 index d015f4c0e..ea6b51a73 100644 --- a/GFS_layer/GFS_physics_driver.F90 +++ b/GFS_layer/GFS_physics_driver.F90 @@ -21,6 +21,8 @@ module module_physics_driver ! use sasas_deep, only: sasasdeep_run use GFS_DCNV_generic_pre, only: GFS_DCNV_generic_pre_run use GFS_DCNV_generic_post, only: GFS_DCNV_generic_post_run + use GFS_SCNV_generic_pre, only: GFS_SCNV_generic_pre_run + use GFS_SCNV_generic_post, only: GFS_SCNV_generic_post_run use GFS_suite_interstitial_1, only: GFS_suite_interstitial_1_run use GFS_suite_interstitial_2, only: GFS_suite_interstitial_2_run use GFS_suite_interstitial_3, only: GFS_suite_interstitial_3_run @@ -2105,12 +2107,14 @@ subroutine GFS_physics_driver & ! &,' lat=',lat,' kdt=',kdt,' me=',me !----------------Convective gravity wave drag parameterization over -------- - if (Model%ldiag3d) then - initial_t(:,:) = Stateout%gt0(:,:) - endif - if (Model%ldiag3d .or. Model%lgocart) then - initial_qv(:,:) = Stateout%gq0(:,:,1) - endif + ! if (Model%ldiag3d) then + ! initial_t(:,:) = Stateout%gt0(:,:) + ! endif + ! if (Model%ldiag3d .or. Model%lgocart) then + ! initial_qv(:,:) = Stateout%gq0(:,:,1) + ! endif + + call GFS_SCNV_generic_pre_run (Model, Stateout, Grid, initial_t, initial_qv) ! write(0,*)' before do_shoc shal clstp=',clstp,' kdt=',kdt, ! & ' lat=',lat @@ -2201,27 +2205,29 @@ subroutine GFS_physics_driver & endif ! end if_imfshalcnv endif ! end if_shal_cnv - if (Model%lssav) then -! update dqdt_v to include moisture tendency due to shallow convection - if (Model%lgocart) then - do k = 1, levs - do i = 1, im - tem = (Stateout%gq0(i,k,1)-initial_qv(i,k)) * frain - Coupling%dqdti(i,k) = Coupling%dqdti(i,k) + tem - enddo - enddo - endif - if (Model%ldiag3d) then - Diag%dt3dt(:,:,5) = Diag%dt3dt(:,:,5) + (Stateout%gt0(:,:)-initial_t(:,:)) * frain - Diag%dq3dt(:,:,3) = Diag%dq3dt(:,:,3) + (Stateout%gq0(:,:,1)-initial_qv(:,:)) * frain - endif - endif ! end if_lssav -! - do k = 1, levs - do i = 1, im - if (clw(i,k,2) <= -999.0) clw(i,k,2) = 0.0 - enddo - enddo +! if (Model%lssav) then +! ! update dqdt_v to include moisture tendency due to shallow convection +! if (Model%lgocart) then +! do k = 1, levs +! do i = 1, im +! tem = (Stateout%gq0(i,k,1)-initial_qv(i,k)) * frain +! Coupling%dqdti(i,k) = Coupling%dqdti(i,k) + tem +! enddo +! enddo +! endif +! if (Model%ldiag3d) then +! Diag%dt3dt(:,:,5) = Diag%dt3dt(:,:,5) + (Stateout%gt0(:,:)-initial_t(:,:)) * frain +! Diag%dq3dt(:,:,3) = Diag%dq3dt(:,:,3) + (Stateout%gq0(:,:,1)-initial_qv(:,:)) * frain +! endif +! endif ! end if_lssav +! ! +! do k = 1, levs +! do i = 1, im +! if (clw(i,k,2) <= -999.0) clw(i,k,2) = 0.0 +! enddo +! enddo + + call GFS_SCNV_generic_post_run (Model, Stateout, Grid, initial_t, initial_qv, frain, Diag, clw) ! if (lprnt) then ! write(0,*)' prsl=',prsl(ipr,:) diff --git a/makefile b/makefile index db63831ef..afeaa4f7a 100644 --- a/makefile +++ b/makefile @@ -122,6 +122,7 @@ SRCS_f90 = \ ./physics/gcycle.f90 \ ./physics/get_prs_fv3.f90 \ ./physics/GFS_DCNV_generic.f90 \ + ./physics/GFS_SCNV_generic.f90 \ ./physics/GFS_PBL_generic.f90 \ ./physics/GFS_suite_interstitial.f90 \ ./physics/h2ointerp.f90 \ diff --git a/physics/GFS_SCNV_generic.f90 b/physics/GFS_SCNV_generic.f90 new file mode 100644 index 000000000..9f909f5d0 --- /dev/null +++ b/physics/GFS_SCNV_generic.f90 @@ -0,0 +1,99 @@ +!> \file GFS_SCNV_generic.f90 +!! Contains code related to shallow convective schemes to be used within the GFS physics suite. + + module GFS_SCNV_generic_pre + + contains + + subroutine GFS_SCNV_generic_pre_init () + end subroutine GFS_SCNV_generic_pre_init + + subroutine GFS_SCNV_generic_pre_finalize() + end subroutine GFS_SCNV_generic_pre_finalize + +!> \section arg_table_GFS_SCNV_generic_pre_run Argument Table +!! | local var name | longname | description | units | rank | type | kind | intent | optional | +!! |----------------|--------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| +!! | Model | FV3-GFS_Control_type | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_typedefs%GFS_control_type | | in | F | +!! | Stateout | FV3-GFS_Stateout_type | Fortran DDT containing FV3-GFS prognostic state to return to dycore | DDT | 0 | GFS_typedefs%GFS_stateout_type| | in | F | +!! | Grid | FV3-GFS_Grid_type | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_typedefs%GFS_grid_type | | in | F | +!! | initial_t | air_temperature_initial | air temperature before entering a physics scheme | K | 2 | real | kind_phys | inout | F | +!! | initial_qv | water_vapor_specific_humidity_initial | water vapor specific humidity before entering a physics scheme | kg kg-1 | 2 | real | kind_phys | inout | F | +!! + subroutine GFS_SCNV_generic_pre_run (Model, Stateout, Grid, initial_t, initial_qv) + + use machine, only: kind_phys + use GFS_typedefs, only: GFS_control_type, GFS_stateout_type, GFS_grid_type + + type(GFS_control_type), intent(in) :: Model + type(GFS_stateout_type), intent(in) :: Stateout + type(GFS_grid_type), intent(in) :: Grid + real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levs), intent(inout) :: initial_t, initial_qv + + if (Model%ldiag3d) then + initial_t(:,:) = Stateout%gt0(:,:) + endif + if (Model%ldiag3d .or. Model%lgocart) then + initial_qv(:,:) = Stateout%gq0(:,:,1) + endif + + end subroutine GFS_SCNV_generic_pre_run + + end module + + module GFS_SCNV_generic_post + + contains + + subroutine GFS_SCNV_generic_post_init () + end subroutine GFS_SCNV_generic_post_init + + subroutine GFS_SCNV_generic_post_finalize () + end subroutine GFS_SCNV_generic_post_finalize + +!> \section arg_table_GFS_SCNV_generic_post_run Argument Table +!! | local var name | longname | description | units | rank | type | kind | intent | optional | +!! |----------------|-----------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| +!! | Model | FV3-GFS_Control_type | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_typedefs%GFS_control_type | | in | F | +!! | Grid | FV3-GFS_Grid_type | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_typedefs%GFS_grid_type | | in | F | +!! | Stateout | FV3-GFS_Stateout_type | Fortran DDT containing FV3-GFS prognostic state to return to dycore | DDT | 0 | GFS_typedefs%GFS_stateout_type| | in | F | +!! | initial_t | air_temperature_initial | air temperature before entering a physics scheme | K | 2 | real | kind_phys | in | F | +!! | initial_qv | water_vapor_specific_humidity_initial | water vapor specific humidity before entering a physics scheme | kg kg-1 | 2 | real | kind_phys | in | F | +!! | frain | dynamics_to_physics_timestep_ratio | ratio of dynamics timestep to physics timestep | none | 0 | real | kind_phys | in | F | +!! | Diag | FV3-GFS_Diag_type | Fortran DDT containing FV3-GFS fields targeted for diagnostic output | DDT | 0 | GFS_typedefs%GFS_diag_type | | inout | F | +!! | clw | convective_transportable_tracers | array to contain cloud water and other convective trans. tracers | kg kg-1 | 3 | real | kind_phys | inout | F | +!! + subroutine GFS_SCNV_generic_post_run (Model, Stateout, Grid, initial_t, initial_qv, frain, Diag, clw) + + use machine, only: kind_phys + use GFS_typedefs, only: GFS_grid_type, GFS_control_type, GFS_stateout_type, GFS_diag_type + + type(GFS_grid_type), intent(in) :: Grid + type(GFS_control_type), intent(in) :: Model + type(GFS_stateout_type), intent(in) :: Stateout + type(GFS_diag_type), intent(inout) :: Diag + + + real(kind=kind_phys), intent(in) :: frain + real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levs), intent(in) :: initial_t, initial_qv + + real(kind=kind_phys), intent(inout) :: clw(:,:,:) + + integer :: i, k + + if (Model%lssav) then + if (Model%ldiag3d) then + Diag%dt3dt(:,:,5) = Diag%dt3dt(:,:,5) + (Stateout%gt0(:,:)-initial_t(:,:)) * frain + Diag%dq3dt(:,:,3) = Diag%dq3dt(:,:,3) + (Stateout%gq0(:,:,1)-initial_qv(:,:)) * frain + endif + endif ! end if_lssav +! + do k = 1, Model%levs + do i = 1, size(Grid%xlon,1) + if (clw(i,k,2) <= -999.0) clw(i,k,2) = 0.0 + enddo + enddo + + end subroutine GFS_SCNV_generic_post_run + + end module From 4172e151e062c49b1aa212e1de32e8389bc1fd70 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Mon, 4 Dec 2017 14:47:02 -0700 Subject: [PATCH 46/48] fixed some standard name conflicts in GFS_SCNV_generic --- physics/GFS_SCNV_generic.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/GFS_SCNV_generic.f90 b/physics/GFS_SCNV_generic.f90 index 9f909f5d0..f504d892e 100644 --- a/physics/GFS_SCNV_generic.f90 +++ b/physics/GFS_SCNV_generic.f90 @@ -55,8 +55,8 @@ end subroutine GFS_SCNV_generic_post_finalize !! | local var name | longname | description | units | rank | type | kind | intent | optional | !! |----------------|-----------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| !! | Model | FV3-GFS_Control_type | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_typedefs%GFS_control_type | | in | F | -!! | Grid | FV3-GFS_Grid_type | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_typedefs%GFS_grid_type | | in | F | !! | Stateout | FV3-GFS_Stateout_type | Fortran DDT containing FV3-GFS prognostic state to return to dycore | DDT | 0 | GFS_typedefs%GFS_stateout_type| | in | F | +!! | Grid | FV3-GFS_Grid_type | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_typedefs%GFS_grid_type | | in | F | !! | initial_t | air_temperature_initial | air temperature before entering a physics scheme | K | 2 | real | kind_phys | in | F | !! | initial_qv | water_vapor_specific_humidity_initial | water vapor specific humidity before entering a physics scheme | kg kg-1 | 2 | real | kind_phys | in | F | !! | frain | dynamics_to_physics_timestep_ratio | ratio of dynamics timestep to physics timestep | none | 0 | real | kind_phys | in | F | From 7d74d985e9e38247906e5ac3e228dbb6149258f5 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Thu, 7 Dec 2017 10:19:08 -0700 Subject: [PATCH 47/48] fixed rank error for xmu in moninedmf.f --- physics/moninedmf.f | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/moninedmf.f b/physics/moninedmf.f index cd8f15fdb..d003ea97f 100755 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -45,7 +45,7 @@ end subroutine edmf_finalize !! | q1 | tracer_concentration | layer mean tracer concentration | kg kg-1 | 3 | real | kind_phys | in | F | !! | swh | tendency_of_air_temperature_due_to_shortwave_heating | total sky shortwave heating rate | K s-1 | 2 | real | kind_phys | in | F | !! | hlw | tendency_of_air_temperature_due_to_longwave_heating | total sky longwave heating rate | K s-1 | 2 | real | kind_phys | in | F | -!! | xmu | zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes | zenith angle temporal adjustment factor for shortwave | none | 2 | real | kind_phys | in | F | +!! | xmu | zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes | zenith angle temporal adjustment factor for shortwave | none | 1 | real | kind_phys | in | F | !! | psk | exner_function_at_lowest_model_interface | exner function at the surface interface | none | 1 | real | kind_phys | in | F | !! | rbsoil | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | in | F | !! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | in | F | From fe088b1b23057207186efd3793af8b96ec5b44f6 Mon Sep 17 00:00:00 2001 From: llpcarson Date: Mon, 18 Dec 2017 15:53:36 -0700 Subject: [PATCH 48/48] Add the end-subroutine stmt --- physics/moninedmf.f | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/moninedmf.f b/physics/moninedmf.f index d003ea97f..55450e871 100755 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -1196,7 +1196,7 @@ subroutine edmf_run (ix,im,km,ntrac,ntcw,dv,du,tau,rtg, & ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! return - end + end subroutine edmf_run !> @} c-----------------------------------------------------------------------