From 5492b85c466bf8428c67cfe15e6d843f43e5687b Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Wed, 13 Sep 2017 16:56:40 -0600 Subject: [PATCH 01/16] Add doxygen formatting for all 2017 operational GFS physics - no functional changes (just comments) - updated docs/txt/mainpage.txt to have the list of schemes - follow the table format found in physics/mfdeepcnv.f --- GFS_layer/GFS_radiation_driver.F90 | 20 +- physics/docs/ccpp_dox | 38 ++- physics/docs/txt/mainpage.txt | 58 +---- physics/gscond.f | 140 +++++------ physics/gwdc.f | 182 +++++++------- physics/gwdps.f | 378 ++++++++++++++--------------- physics/mfdeepcnv.f | 113 ++++++--- physics/mfpbl.f | 2 +- physics/mfshalcnv.f | 58 +++-- physics/moninedmf.f | 10 +- physics/ozphys.f | 24 +- physics/physcons.f90 | 84 +++---- physics/physparam.f | 138 +++++------ physics/precpd.f | 106 ++++---- physics/radiation_aerosols.f | 150 ++++++------ physics/radiation_astronomy.f | 20 +- physics/radiation_clouds.f | 76 +++--- physics/radiation_gases.f | 36 +-- physics/radiation_surface.f | 24 +- physics/radlw_main.f | 114 ++++----- physics/radsw_main.f | 2 +- physics/sfc_drv.f | 49 ++-- physics/sfc_nst.f | 34 ++- physics/sfc_sice.f | 33 ++- 24 files changed, 1008 insertions(+), 881 deletions(-) diff --git a/GFS_layer/GFS_radiation_driver.F90 b/GFS_layer/GFS_radiation_driver.F90 index 56aac8ca0..9e2f66f70 100644 --- a/GFS_layer/GFS_radiation_driver.F90 +++ b/GFS_layer/GFS_radiation_driver.F90 @@ -1,7 +1,7 @@ !> \file grrad.f This file is the radiation driver module. It prepares !! the atmospheric profiles and invokes the main radiation calculation. -!> \defgroup rad RRTMG Shortwave/Longwave Radiation Scheme +!> \defgroup RRTMG RRTMG Shortwave/Longwave Radiation !> @{ !! \brief The GFS radiation scheme !! \details Radiative processes are among the most complex and @@ -1018,7 +1018,7 @@ subroutine GFS_radiation_driver & type(GFS_cldprop_type), intent(in) :: Cldprop type(GFS_radtend_type), intent(inout) :: Radtend type(GFS_diag_type), intent(inout) :: Diag - + ! ================= subprogram documentation block ================ ! ! ! @@ -1180,7 +1180,7 @@ subroutine GFS_radiation_driver & integer, dimension(size(Grid%xlon,1),3) :: mbota, mtopa !--- REAL VARIABLES - real(kind=kind_phys) :: raddt, es, qs, delt, tem0d + real(kind=kind_phys) :: raddt, es, qs, delt, tem0d real(kind=kind_phys), dimension(size(Grid%xlon,1)) :: & tsfa, cvt1, cvb1, tem1d, tsfg, tskn @@ -1328,7 +1328,7 @@ subroutine GFS_radiation_driver & !> - Call coszmn(), to compute cosine of zenith angle. call coszmn (Grid%xlon,Grid%sinlat, & ! --- inputs - Grid%coslat,Model%solhr, IM, me, & + Grid%coslat,Model%solhr, IM, me, & Radtend%coszen, Radtend%coszdg) ! --- outputs !> - Call getgases(), to set up non-prognostic gas volume mixing @@ -1609,12 +1609,12 @@ subroutine GFS_radiation_driver & htswc, Diag%topfsw, Radtend%sfcfsw, & ! --- outputs hsw0=htsw0, fdncmp=scmpsw) ! --- optional else - call swrad (plyr, plvl, tlyr, tlvl, qlyr, olyr, & ! --- inputs + call swrad (plyr, plvl, tlyr, tlvl, qlyr, olyr, & ! --- inputs gasvmr, clouds, Tbd%icsdsw, faersw, & sfcalb, Radtend%coszen, Model%solcon, & nday, idxday, IM, LMK, LMP, Model%lprnt,& - htswc, Diag%topfsw, Radtend%sfcfsw, & ! --- outputs - FDNCMP=scmpsw) ! --- optional + htswc, Diag%topfsw, Radtend%sfcfsw, & ! --- outputs + FDNCMP=scmpsw) ! --- optional endif do k = 1, LM @@ -1636,7 +1636,7 @@ subroutine GFS_radiation_driver & ! --- repopulate the points above levr if (Model%levr < Model%levs) then do k = LM,Model%levs - Radtend%swhc(:,k) = Radtend%swhc(:,LM) + Radtend%swhc(:,k) = Radtend%swhc(:,LM) enddo endif endif @@ -1693,7 +1693,7 @@ subroutine GFS_radiation_driver & call setemis (Grid%xlon, Grid%xlat, Sfcprop%slmsk, & ! --- inputs Sfcprop%snowd, Sfcprop%sncovr, Sfcprop%zorl, & - tsfg, tsfa, Sfcprop%hprim, IM, & + tsfg, tsfa, Sfcprop%hprim, IM, & Radtend%semis) ! --- outputs !> - Call module_radlw_main::lwrad(), to compute LW heating rates and @@ -1736,7 +1736,7 @@ subroutine GFS_radiation_driver & ! --- repopulate the points above levr if (Model%levr < Model%levs) then do k = LM,Model%levs - Radtend%lwhc(:,k) = Radtend%lwhc(:,LM) + Radtend%lwhc(:,k) = Radtend%lwhc(:,LM) enddo endif endif diff --git a/physics/docs/ccpp_dox b/physics/docs/ccpp_dox index d4867bdff..0623fcf32 100644 --- a/physics/docs/ccpp_dox +++ b/physics/docs/ccpp_dox @@ -98,7 +98,43 @@ WARN_NO_PARAMDOC = NO WARN_AS_ERROR = NO WARN_FORMAT = WARN_LOGFILE = -INPUT = ../mfdeepcnv.f \ +INPUT = txt/mainpage.txt \ +### Radiation + ../../GFS_layer/GFS_radiation_driver.F90 \ + ../radiation_aerosols.f \ + ../radiation_astronomy.f \ + ../radiation_clouds.f \ + ../radiation_gases.f \ + ../radiation_surface.f \ + ../radlw_datatb.f \ + ../radlw_main.f \ + ../radlw_param.f \ + ../radsw_datatb.f \ + ../radsw_main.f \ + ../radsw_param.f \ +### Deep Convection + ../mfdeepcnv.f \ +### Shallow Convection + ../mfshalcnv.f \ +### PBL + ../moninedmf.f \ + ../mfpbl.f \ +### Microphysics + ../precpd.f \ + ../gscond.f \ +### Land Surface + ../sfc_drv.f \ + ../sfc_diff.f \ +### Sea Ice Surface + ../sfc_sice.f \ +### Ocean Surface + ../sfc_nst.f \ +### Orographic Gravity Wave + ../gwdps.f \ +### Convective Gravity Wave + ../gwdc.f \ +### Prognostic Ozone + ../ozphys.f INPUT_ENCODING = UTF-8 FILE_PATTERNS = *.f \ *.txt diff --git a/physics/docs/txt/mainpage.txt b/physics/docs/txt/mainpage.txt index 40032dd78..fcfecb8d1 100644 --- a/physics/docs/txt/mainpage.txt +++ b/physics/docs/txt/mainpage.txt @@ -1,47 +1,15 @@ /** -\mainpage GFS Operational Physics - -The documentation found here corresponds to the state of the operational GFS physics suite as of 2016. The suite is considered to contain -both driving routines and the individual physical parameterizations. Documentation for the driving routines can be accessed using the following links: - - gbphys() (GFS physics driver) - - grrad() (GFS radiation driver) - - radupdate() (GFS time-sensitive preparation for radiation) - -Documentation for the operational physics suite can be access through these links:: - - \ref rad - - \ref PBL - - \ref SAS - - \ref SASHAL - - \ref MPscheme - - \ref gwd - -Separate documentation of the initial version of the Interoperable Physics Driver is found here - -\section structure Structure -\image html GFS_Operational_Physics.png "This diagram represents the GFS physics calling structure. Colors represent layers of abstraction in the code, with cooler colors being deeper in the calling hierarchy. Labels represent subroutine names and those in parentheses reflect that they are one of many options (the subroutines that are written are the current operational schemes). The sfc_* subroutine represents sfc_diff and other subroutines that are called depending on the underlying surface (sea, ice, land)." -The operational GFS physics suite is called from the GSM dycore according to the diagram above. -The highest tiers (red and orange) can be considered part of the GSM model and are located within -the "atmos/gsm/phys" directory of NEMS. The lower tiers (green and blue) consist of driving routines -(green) and the parameterization code (blue) and are found in the "atmos/phys" directory of NEMS. -In this way, the bottom two tiers are currently considered the GFS physics suite -- the parameterization -code and the code necessary to connect it to a dycore. The Interoperable Physics Driver (IPD), currently -found within the "nuopc_physics.F90" file, is an additional layer of abstraction (yellow) between the -orange and green tiers. Although it functions as a "wrapper" to the green tier at present, it will -likely evolve to replace much of its functionality. Functionality found in the green tier that is not -generalizable, that is inextricably linked to the GFS physics suite, will be part of the pre/post GFS -physics routine that interfaces with the IPD. - -\section plan Future Plans -NCEP plans to improve the physics package based on the ongoing physics developments which include: -- Modified deep and shallow convection parameterizations with scale and aerosol awareness. -- TKE-based moist EDMF PBL parameterizations to further improve vertical turbulence mixing in the stratocumulus-topped PBL as well as in the dry PBL. -- WSM6 & Thompson cloud microphysics parameterizations. -- Simplified Higher Order Closure (SHOC) model with prognostic TKE that unifies the boundary layer and shallow convection. -- Chikira-Sugiyama deep convection parameterization with prognostic closure and with Arakawa-Wu scale-aware extension. -- Morrison-Gettelman double moment microphysics with interactive aerosols. -- The next major Noah LSM upgrade is planned for the unification among different NCEP models. The Noah LSM in the current GFS will be upgraded from version 2.7.1 to version 3.3, which includes many physics upgrades and new land datasets. -- Implementation of a unified GW physics for both orographic and non-orographic waves. -- Changes to the convective gravity wave drag parameterization to include a gravity-wave spectrum with both stationary waves and waves of varying phase speeds. - -\n see also http://www.emc.ncep.noaa.gov/GFS/doc.php +\mainpage 2017 GFS Operational Physics + +The documentation found here corresponds to the state of the operational GFS physics suite as of 2017. Documentation for the operational physics suite can be access through these links:: + - \ref RRTMG + - \ref SASAS + - \ref SASHAL + - \ref HEDMF + - \ref Zhao-Carr + - \ref NOAH + - \ref GFS_Ice + - \ref GFS_NSST + - \ref GFS_gwd + - \ref GFS_ozn */ diff --git a/physics/gscond.f b/physics/gscond.f index 52fc3a16f..4a6abf717 100644 --- a/physics/gscond.f +++ b/physics/gscond.f @@ -1,35 +1,35 @@ !> \file gscond.f -!! This file contains the subroutine that calculates grid-scale -!! condensation and evaporation for use in the Zhao and Carr (1997) +!! This file contains the subroutine that calculates grid-scale +!! condensation and evaporation for use in the Zhao and Carr (1997) !! \cite zhao_and_carr_1997 scheme. -!> \defgroup MPscheme Grid-scale Condensation, Evaporation and Precipitation +!> \defgroup Zhao-Carr Zhao-Carr Microphysics !! @{ !! \brief The GFS scheme for large-scale condensation and precipitation !! , based on Zhao and Carr (1997) \cite zhao_and_carr_1997 !! and Sundqvist et al. (1989) \cite sundqvist_et_al_1989 . !! \image html schematic_MPS.png "Figure 1: Schematic illustration of the precipitation scheme" width=10cm !! \details Figure 1 shows a schematic illustration of this scheme. -!! There are two sources of prognostic cloud condensate, convective +!! There are two sources of prognostic cloud condensate, convective !! detrainment (see convection) and grid-sale -!! condensate. The sinks of cloud condensate are grid-scale -!! precipitation and evaporation of the cloud condensate. Evaporation -!! of rain in the unsaturated layers below the level of condensation -!! is also taken into account. All precipitation that penetrates the -!! lowest atmospheric layer is allowed to fall to the surface. -!! Subsequent to the May 2001 implementation, excessive amounts of -!! light precipitation were noted. This was addressed through a minor -!! implementation in August 2001, which involved a slight modification -!! of the autoconversion rate of ice. At the same time, an -!! empirically-based calculation of the effective radius for ice -!! crystals (Heymsfield and McFarquhar 1996 +!! condensate. The sinks of cloud condensate are grid-scale +!! precipitation and evaporation of the cloud condensate. Evaporation +!! of rain in the unsaturated layers below the level of condensation +!! is also taken into account. All precipitation that penetrates the +!! lowest atmospheric layer is allowed to fall to the surface. +!! Subsequent to the May 2001 implementation, excessive amounts of +!! light precipitation were noted. This was addressed through a minor +!! implementation in August 2001, which involved a slight modification +!! of the autoconversion rate of ice. At the same time, an +!! empirically-based calculation of the effective radius for ice +!! crystals (Heymsfield and McFarquhar 1996 !! \cite heymsfield_and_mcfarquhar_1996) was introduced. !> \section tune Important Tunable Parameters !! The parameters below, which can be set through a namelist, influence -!! the amount of cloud condensate in the atmosphere and thus the cloud +!! the amount of cloud condensate in the atmosphere and thus the cloud !! radiative properties: !! - PSAUTCO, PRAUTCO: Auto conversion coefficients (ice and water) -!! - WMINCO(2): Coefficients for minimum value of cloud condensate to +!! - WMINCO(2): Coefficients for minimum value of cloud condensate to !! conversion from condensate (water and ice) to precipitation !! - EVPCO: Coefficient for evaporation of precipitation !! @@ -38,16 +38,16 @@ !! - Routine PRECPD is called from GBPHYS after call to GSCOND !> \defgroup condense Grid-Scale Condensation and Evaporation of Cloud -!! This subroutine computes grid-scale condensation and evaporation of +!! This subroutine computes grid-scale condensation and evaporation of !! cloud condensate. !! -!> There are two sources of condensation, one from large-scale -!! processes and the other from convective processes. Both of them -!! produce either cloud water or cloud ice, depending on the cloud +!> There are two sources of condensation, one from large-scale +!! processes and the other from convective processes. Both of them +!! produce either cloud water or cloud ice, depending on the cloud !! substance at and above the grid point at current and previous time -!! steps, and on the temperature. Evaporation of cloud is allowed at +!! steps, and on the temperature. Evaporation of cloud is allowed at !! points where the relative humidity is lower than the critical value -!! required for condensation. +!! required for condensation. !! @{ !> \param[in] ix horizontal dimension @@ -58,24 +58,24 @@ !! \param[in] prsl pressure values for model layers !! \param[in] ps surface pressure (Pa) !! \param[in,out] q model layer specific humidity (gm/gm) -!! \param[in,out] cwm model layer cloud condensate +!! \param[in,out] cwm model layer cloud condensate !! \param[in,out] t model layer mean temperature (K) -!! \param[in,out] tp model layer mean temperature (K) saved for +!! \param[in,out] tp model layer mean temperature (K) saved for !! restart -!! \param[in,out] qp model layer specific humidity (gm/gm) saved +!! \param[in,out] qp model layer specific humidity (gm/gm) saved !! for restart !! \param[in,out] psp surface pressure (Pa) saved for restart !! \param[in,out] tp1 updated model layer mean temperature (K) saved !! for restart !! \param[in,out] qp1 updated model layer specific humidity (gm/gm) !! saved for restart -!! \param[in,out] psp1 updated surface pressure (Pa) saved for +!! \param[in,out] psp1 updated surface pressure (Pa) saved for !! restart -!! \param[in] u the critical value of relative humidity for +!! \param[in] u the critical value of relative humidity for !! large-scale condensation !! \param[in] lprnt logical print flag !! \param[in] ipr check print point for debugging -!! +!! !! \section def Definition of symbols !! - \f$C_{g}\f$: grid-scale condensation rate (\f$s^{-1}\f$) !! - \f$E_{c}\f$: evaporation rate of cloud (\f$s^{-1}\f$) @@ -128,7 +128,7 @@ subroutine gscond (im,ix,km,dt,dtf,prsl,ps,q,cwm,t & real (kind=kind_phys) qi(im), qint(im), u(im,km), ccrik, e0 &, cond, rdt, us, cclimit, climit &, tmt0, tmt15, qik, cwmik - &, ai, qw, u00ik, tik, pres, pp0, fi + &, ai, qw, u00ik, tik, pres, pp0, fi &, at, aq, ap, fiw, elv, qc, rqik &, rqikk, tx1, tx2, tx3, es, qs &, tsq, delq, condi, cone0, us00, ccrik1 @@ -171,7 +171,7 @@ subroutine gscond (im,ix,km,dt,dtf,prsl,ps,q,cwm,t & ! endif ! !************************************************************* -!> -# Begining of grid-scale condensation/evaporation loop (start of +!> -# Begining of grid-scale condensation/evaporation loop (start of !! k-loop, i-loop) !************************************************************* ! @@ -180,7 +180,7 @@ subroutine gscond (im,ix,km,dt,dtf,prsl,ps,q,cwm,t & ! vprs(:) = 0.001 * fpvs(t(:,k)) ! fpvs in pa !----------------------------------------------------------------------- !------------------qw, qi and qint-------------------------------------- - do i = 1, im + do i = 1, im tmt0 = t(i,k)-273.16 tmt15 = min(tmt0,cons_m15) qik = max(q(i,k),epsq) @@ -209,26 +209,26 @@ subroutine gscond (im,ix,km,dt,dtf,prsl,ps,q,cwm,t & !> -# Compute ice-water identification number IW. !!\n The distinction between cloud water and cloud ice is made by the -!! cloud identification number IW, which is zero for cloud water and -!! unity for cloud ice (Table 2 in zhao and Carr (1997) +!! cloud identification number IW, which is zero for cloud water and +!! unity for cloud ice (Table 2 in zhao and Carr (1997) !! \cite zhao_and_carr_1997): -!! - All clouds are defined to consist of liquid water below the -!! freezing level (\f$T\geq 0^oC\f$) and of ice particles above the +!! - All clouds are defined to consist of liquid water below the +!! freezing level (\f$T\geq 0^oC\f$) and of ice particles above the !! \f$T=-15^oC\f$ level. -!! - In the temperature region between \f$-15^oC\f$ and \f$0^oC\f$, -!! clouds may be composed of liquid water or ice. If there are cloud +!! - In the temperature region between \f$-15^oC\f$ and \f$0^oC\f$, +!! clouds may be composed of liquid water or ice. If there are cloud !! ice particles above this point at the previous or current time step, -!! or if the cloud at this point at the previous time step consists of -!! ice particles, then the cloud substance at this point is considered +!! or if the cloud at this point at the previous time step consists of +!! ice particles, then the cloud substance at this point is considered !! to be ice particles because of the cloud seeding effect and the -!! memory of its content. Otherwise, all clouds in this region are +!! memory of its content. Otherwise, all clouds in this region are !! considered to contain supercooled cloud water. !-------------------ice-water id number iw------------------------------ if(tmt0.lt.-15.0) then u00ik = u(i,k) - fi = qik - u00ik*qi(i) - if(fi > d00.or.cwmik > climit) then + fi = qik - u00ik*qi(i) + if(fi > d00.or.cwmik > climit) then iw(i,k) = 1 else iw(i,k) = 0 @@ -249,8 +249,8 @@ subroutine gscond (im,ix,km,dt,dtf,prsl,ps,q,cwm,t & !> -# Condensation and evaporation of cloud !--------------condensation and evaporation of cloud-------------------- do i = 1, im -!> - Compute the changes in t, q and p (\f$A_{t}\f$,\f$A_{q}\f$ and -!! \f$A_{p}\f$) caused by all the processes except grid-scale +!> - Compute the changes in t, q and p (\f$A_{t}\f$,\f$A_{q}\f$ and +!! \f$A_{p}\f$) caused by all the processes except grid-scale !! condensation and evaporation. !!\f[ !! A_{t}=(t-tp)/dt @@ -272,7 +272,7 @@ subroutine gscond (im,ix,km,dt,dtf,prsl,ps,q,cwm,t & at = (tik-tp(i,k)) * rdt aq = (qik-qp(i,k)) * rdt ap = (pres-pp0) * rdt -!> - Calculate the saturation specific humidity \f$q_{s}\f$ and the +!> - Calculate the saturation specific humidity \f$q_{s}\f$ and the !! relative humidity \f$f\f$ using IW. !----------------the satuation specific humidity------------------------ fiw = float(iwik) @@ -281,49 +281,49 @@ subroutine gscond (im,ix,km,dt,dtf,prsl,ps,q,cwm,t & ! if (lprnt) print *,' qc=',qc,' qint=',qint(i),' qi=',qi(i) !----------------the relative humidity---------------------------------- if(qc.le.1.0e-10) then - rqik=d00 + rqik=d00 else rqik = qik/qc endif -!> - According to Sundqvist et al. (1989) \cite sundqvist_et_al_1989, -!! estimate cloud fraction \f$b\f$ at a grid point from relative -!! humidity \f$f\f$ using the equation +!> - According to Sundqvist et al. (1989) \cite sundqvist_et_al_1989, +!! estimate cloud fraction \f$b\f$ at a grid point from relative +!! humidity \f$f\f$ using the equation !!\f[ !! b=1-\left ( \frac{f_{s}-f}{f_{s}-u} \right )^{1/2} !!\f] !! for \f$f>u\f$; and \f$b=0\f$ for \f$f1.0\times10^{-3}\f$, condense water vapor !! in to cloud condensate (\f$C_{g}\f$). -!!\n Using \f$q=fq_{s}\f$, \f$q_{s}=\epsilon e_{s}/p\f$, and the -!! Clausius-Clapeyron equation \f$de_{s}/dT=\epsilon Le_{s}/RT^{2}\f$, +!!\n Using \f$q=fq_{s}\f$, \f$q_{s}=\epsilon e_{s}/p\f$, and the +!! Clausius-Clapeyron equation \f$de_{s}/dT=\epsilon Le_{s}/RT^{2}\f$, !! where \f$q_{s}\f$ is the saturation specific humidity,\f$e_{s}\f$ !! is the saturation vapor pressure, \f$R\f$ is the specific gas -!! constant for dry air, \f$f\f$ is the relative humidity, and +!! constant for dry air, \f$f\f$ is the relative humidity, and !! \f$\epsilon=0.622\f$, the expression for \f$C_{g}\f$ has the form !!\f[ !! C_{g}=\frac{M-q_{s}f_{t}}{1+(f\epsilon L^{2}q_{s}/RC_{p}T^{2})}+E_{c} @@ -345,10 +345,10 @@ subroutine gscond (im,ix,km,dt,dtf,prsl,ps,q,cwm,t & !! M=A_{q}-\frac{f\epsilon Lq_{s}}{RT^{2}}A_{t}+\frac{fq_{s}}{p}A_{p} !!\f] !! To close the system, an equation for the relative humidity tendency -!! \f$f_{t}\f$ was derived by Sundqvist et al. (1989) +!! \f$f_{t}\f$ was derived by Sundqvist et al. (1989) !! \cite sundqvist_et_al_1989 using the hypothesis that the quantity !! \f$M+E_{c}\f$ is divided into one part,\f$bM\f$,which condenses -!! in the already cloudy portion of a grid square, and another part, +!! in the already cloudy portion of a grid square, and another part, !! \f$(1-b)M+E_{c}\f$,which is used to increase the relative humidity !! of the cloud-free portion and the cloudiness in the square. The !! equation is written as @@ -356,7 +356,7 @@ subroutine gscond (im,ix,km,dt,dtf,prsl,ps,q,cwm,t & !! f_{t}=\frac{2(1-b)(f_{s}-u)[(1-b)M+E_{c}]}{2q_{s}(1-b)(f_{s}-u)+cwm/b} !!\f] !! - Check and correct if over condensation occurs. -!! - Update t, q and cwm (according to Eqs(6) and (7) in Zhao and +!! - Update t, q and cwm (according to Eqs(6) and (7) in Zhao and !! Carr (1997) \cite zhao_and_carr_1997) !!\f[ !! cwm=cwm+(C_{g}-E_{c})\times dt @@ -367,7 +367,7 @@ subroutine gscond (im,ix,km,dt,dtf,prsl,ps,q,cwm,t & !!\f[ !! t=t+\frac{L}{C_{p}}(C_{g}-E_{c})\times dt !!\f] -!!\n where \f$L\f$ is the latent heat of condensation/deposition, and +!!\n where \f$L\f$ is the latent heat of condensation/deposition, and !! \f$C_{p}\f$ is the specific heat of air at constant pressure. !----------------cloud cover ratio ccrik-------------------------------- @@ -388,7 +388,7 @@ subroutine gscond (im,ix,km,dt,dtf,prsl,ps,q,cwm,t & ! if no cloud exists then evaporate any existing cloud condensate !----------------evaporation of cloud water----------------------------- e0 = d00 - if (ccrik <= cclimit.and. cwmik > climit) then + if (ccrik <= cclimit.and. cwmik > climit) then ! ! first iteration - increment halved ! @@ -437,7 +437,7 @@ subroutine gscond (im,ix,km,dt,dtf,prsl,ps,q,cwm,t & cond = d00 ! if (ccrik .gt. 0.20 .and. qc .gt. epsq) then if (ccrik .gt. cclimit .and. qc .gt. epsq) then - us00 = us - u00ik + us00 = us - u00ik ccrik1 = 1.0 - ccrik aa = eps*elv*pres*qik ab = ccrik*ccrik1*qc*us00 diff --git a/physics/gwdc.f b/physics/gwdc.f index fd37d74d0..49a56277a 100644 --- a/physics/gwdc.f +++ b/physics/gwdc.f @@ -1,34 +1,34 @@ !> \file gwdc.f This file is the original code for parameterization of -!! stationary convection forced gravity wave drag based on Chun and +!! stationary convection forced gravity wave drag based on Chun and !! Baik(1998) \cite chun_and_baik_1998 -!> \ingroup gwd -!> \defgroup convective Convective Gravity Wave Drag +!> \ingroup GFS_gwd +!> \defgroup GFS_cgwd GFS Convective Gravity Wave Drag !! This subroutine is the parameterization of convective gravity wave -!! drag based on the theory given by Chun and Baik (1998) -!! \cite chun_and_baik_1998 modified for implementation into the +!! drag based on the theory given by Chun and Baik (1998) +!! \cite chun_and_baik_1998 modified for implementation into the !! GFS/CFS by Ake Johansson(Aug 2005). !! -!> Parameterizing subgrid-scale convection-induced gravity wave +!> Parameterizing subgrid-scale convection-induced gravity wave !! momentum flux for use in large-scale models inherently requires !! some information from subgrid-scale cumulus parameterization. !! The methodology for parameterizing the zonal momentum flux induced !! by thermal forcing can be summarized as follows. From the cloud-base !! to cloud-top height, the effect of the momentum flux !! induced by subgrid-scale diabatic forcing is not considered because -!! subgrid-scale cumulus convection in large-scale models is only +!! subgrid-scale cumulus convection in large-scale models is only !! activated in a conditionally unstable atmosphere. Below the cloud -!! base, the momentum flux is also not considered because of the wave -!! momentum cancellation. At the cloud top, the momentum flux is -!! obtained by eq.(18) and (19) in Chun and Baik (1998) +!! base, the momentum flux is also not considered because of the wave +!! momentum cancellation. At the cloud top, the momentum flux is +!! obtained by eq.(18) and (19) in Chun and Baik (1998) !! \cite chun_and_baik_1998. Above the cloud top, there are two ways to !! construct the momentum flux profile. One way is to specify a !! vertical structure of the momentum flux normalized by the cloud-top -!! value, similar to what has been done for mountain drag +!! value, similar to what has been done for mountain drag !! parameterization. The other way is to apply the wave saturation !! hypothesis in order to find wave breaking levels in terms of the -!! Richardon number criterion using the nonlinearity factor of -!! thermally induced waves. +!! Richardon number criterion using the nonlinearity factor of +!! thermally induced waves. !!@{ !> \param[in] IM horizontal number of used pts @@ -43,28 +43,28 @@ !> \param[in] PMID1 mean layer pressure !> \param[in] PINT1 pressure at layer interfaces !> \param[in] DPMID1 mean layer delta p -!> \param[in] QMAX maximum convective heating rate (k/s) in a -!! horizontal grid point calculated +!> \param[in] QMAX maximum convective heating rate (k/s) in a +!! horizontal grid point calculated !! from cumulus parameterization !> \param[in] KTOP vertical level index for cloud top !> \param[in] KBOT vertical level index for cloud bottom !> \param[in] KCNV (0,1) dependent on whether convection occur or not !> \param[in] CLDF deep convective cloud fraction at the cloud top !> \param[in] GRAV gravity defined in physcon -!> \param[in] CP specific heat at constant pressure defined in +!> \param[in] CP specific heat at constant pressure defined in !! physcon !> \param[in] RD gas constant air defined in physcon !> \param[in] FV con_fvirt = con_rv/con_rd-1 -!> \param[in] DLENGTH grid spacing in the direction of basic wind at +!> \param[in] DLENGTH grid spacing in the direction of basic wind at !! the cloud top !> \param[in] LPRNT logical print flag !> \param[in] IPR check print point for debugging !> \param[in] FHOUR forecast hour !> \param[out] UTGWC zonal wind tendency !> \param[out] VTGWC meridional wind tendency -!> \param[out] TAUCTX wave stress at the cloud top projected in the +!> \param[out] TAUCTX wave stress at the cloud top projected in the !! east -!> \param[out] TAUCTY wave stress at the cloud top projected in the +!> \param[out] TAUCTY wave stress at the cloud top projected in the !! north !! !> \section al_gwdc General Algorithm @@ -82,7 +82,7 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, ! 2013 S. Moorthi - Updated and optimized code for T1534 GFS implementation ! ??? ?? 2015 J. Alpert - reducing the magnitude of tauctmax to fix blow up in L64 GFS ! S. Kar & M. Young -! aug 15 2016 - S. Moorthi - Fix for exessive dissipation which led to blow up in +! aug 15 2016 - S. Moorthi - Fix for exessive dissipation which led to blow up in ! 128 level runs with NEMS/GSM !*********************************************************************** @@ -101,7 +101,7 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, ! dpmid : midpoint delta p ( pi(k)-pi(k-1) ) ! lat : latitude index ! qmax : deep convective heating -! kcldtop : Vertical level index for cloud top ( mid level ) +! kcldtop : Vertical level index for cloud top ( mid level ) ! kcldbot : Vertical level index for cloud bottom ( mid level ) ! kcnv : (0,1) dependent on whether convection occur or not ! @@ -121,7 +121,7 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, &, tauctx, taucty real(kind=kind_phys), dimension(im) :: cldf,dlength real(kind=kind_phys), dimension(ix,km) :: u1,v1,t1,q1, & - & pmid1,dpmid1 + & pmid1,dpmid1 ! &, cumchr1 real(kind=kind_phys), dimension(iy,km) :: utgwc,vtgwc real(kind=kind_phys), dimension(ix,km+1) :: pint1 @@ -142,19 +142,19 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, ! parallel to the wind vector at the cloud top ( mid level ) ! tauctx : Wave stress at the cloud top projected in the east ! taucty : Wave stress at the cloud top projected in the north -! qmax : Maximum deep convective heating rate ( K s-1 ) in a +! qmax : Maximum deep convective heating rate ( K s-1 ) in a ! horizontal grid point calculated from cumulus para- ! meterization. ( mid level ) ! wtgwc : Wind tendency in direction to the wind vector at the cloud top level ! due to convectively generated gravity waves ( mid level ) -! utgwcl : Zonal wind tendency due to convectively generated +! utgwcl : Zonal wind tendency due to convectively generated ! gravity waves ( mid level ) ! vtgwcl : Meridional wind tendency due to convectively generated ! gravity waves ( mid level ) ! taugwci : Profile of wave stress calculated using basic-wind -! parallel to the wind vector at the cloud top +! parallel to the wind vector at the cloud top ! taugwcxi : Profile of zonal component of gravity wave stress -! taugwcyi : Profile of meridional component of gravity wave stress +! taugwcyi : Profile of meridional component of gravity wave stress ! ! taugwci, taugwcxi, and taugwcyi are defined at the interface level ! @@ -164,7 +164,7 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, ! rhom : Air density ( mid level ) ! ti : Temperature ( interface level ) ! basicum : Basic-wind profile. Basic-wind is parallel to the wind -! vector at the cloud top level. (mid level) +! vector at the cloud top level. (mid level) ! basicui : Basic-wind profile. Basic-wind is parallel to the wind ! vector at the cloud top level. ( interface level ) ! riloc : Local Richardson number ( interface level ) @@ -174,9 +174,9 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, ! break : Horizontal location where wave breaking is occurred. ! critic : Horizontal location where critical level filtering is ! occurred. -! dogwdc : Logical flag whether the GWDC parameterization is +! dogwdc : Logical flag whether the GWDC parameterization is ! calculated at a grid point or not. -! +! ! dogwdc is used in order to lessen CPU time for GWDC calculation. ! !----------------------------------------------------------------------- @@ -212,7 +212,7 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, & ti(:,:), riloc(:,:), & rimin(:,:), pint(:,:) ! real(kind=kind_phys), allocatable :: ugwdc(:,:), vgwdc(:,:), - real(kind=kind_phys), allocatable :: + real(kind=kind_phys), allocatable :: ! & plnmid(:,:), wtgwc(:,:), & plnmid(:,:), taugw(:,:), & utgwcl(:,:), vtgwcl(:,:), @@ -227,7 +227,7 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, ! ucltop : Zonal wind at the cloud top ( mid level ) ! vcltop : Meridional wind at the cloud top ( mid level ) ! windcltop : Wind speed at the cloud top ( mid level ) -! shear : Vertical shear of basic wind +! shear : Vertical shear of basic wind ! cosphi : Cosine of angle of wind vector at the cloud top ! sinphi : Sine of angle of wind vector at the cloud top ! c1 : Tunable parameter @@ -348,7 +348,7 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, & rimin(npt,km+1), pint(npt,km+1)) ! allocate (ugwdc(npt,km), vgwdc(npt,km), - allocate + allocate ! & (plnmid(npt,km), wtgwc(npt,km), & (plnmid(npt,km), velco(npt,km), & utgwcl(npt,km), vtgwcl(npt,km), @@ -460,7 +460,7 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, ! 4 ======== pint(4) dpint(4) ! 4 -------- pmid(4) dpmid(4) ! ........ -! 17 ======== pint(17) dpint(17) +! 17 ======== pint(17) dpint(17) ! 17 -------- pmid(17) dpmid(17) ! 18 ======== pint(18) dpint(18) ! 18 -------- pmid(18) dpmid(18) @@ -492,7 +492,7 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, ! ! -!> - The top interface temperature, density, and Brunt-Vaisala +!> - The top interface temperature, density, and Brunt-Vaisala !! frequencies (\f$N\f$) are calculated assuming an isothermal !! atmosphere above the top mid level. @@ -500,7 +500,7 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, rhoi(i,1) = pint(i,1)/(rd*ti(i,1)) bruni(i,1) = sqrt ( gsqr / (cp*ti(i,1)) ) ! -!> - The bottom interface temperature, density, and Brunt-Vaisala +!> - The bottom interface temperature, density, and Brunt-Vaisala !! frequencies (\f$N\f$) are calculated assuming an isothermal !! atmosphere below the bottom mid level. @@ -525,11 +525,11 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, qtem = spfh(i,k-1) * tem1 + spfh(i,k) * tem2 rhoi(i,k) = pint(i,k) / ( rd * ti(i,k)*(1.0+fv*qtem) ) dtdp = (t(i,k)-t(i,k-1)) / (pmid(i,k)-pmid(i,k-1)) - n2 = gsqr / ti(i,k) * ( 1./cp - rhoi(i,k)*dtdp ) + n2 = gsqr / ti(i,k) * ( 1./cp - rhoi(i,k)*dtdp ) bruni(i,k) = sqrt (max (n2min, n2)) enddo enddo - + deallocate (spfh) !----------------------------------------------------------------------- ! @@ -540,7 +540,7 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, do k = 1, km do i = 1, npt dtdp = (ti(i,k+1)-ti(i,k)) / (pint(i,k+1)-pint(i,k)) - n2 = gsqr / t(i,k) * ( 1./cp - rhom(i,k)*dtdp ) + n2 = gsqr / t(i,k) * ( 1./cp - rhom(i,k)*dtdp ) brunm(i,k) = sqrt (max (n2min, n2)) enddo enddo @@ -602,7 +602,7 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, !----------------------------------------------------------------------- ! -!> -# Calculate the cloud top wind components and speed. +!> -# Calculate the cloud top wind components and speed. !! Here, ucltop, vcltop, and windcltop are wind components and !! wind speed at mid-level cloud top index ! @@ -684,7 +684,7 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, ! 18 -------- U(18) ! 19 ======== UI(19) rhoi(19) bruni(19) riloc(19) ! -!----------------------------------------------------------------------- +!----------------------------------------------------------------------- do k=2,km do i=1,npt @@ -696,10 +696,10 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, tem = bruni(i,k) / shear riloc(i,k) = tem * tem if (riloc(i,k) >= rimax ) riloc(i,k) = rilarge - end if + end if enddo enddo - + do i=1,npt riloc(i,1) = riloc(i,2) riloc(i,km+1) = riloc(i,km) @@ -740,33 +740,33 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, ! it can be thought that there is deep convective cloud. However, ! deep convective heating between kcldbot and kcldtop is sometimes ! zero in spite of kcldtop less than kcldbot. In this case, -! maximum deep convective heating is assumed to be 1.e-30. +! maximum deep convective heating is assumed to be 1.e-30. ! ! B : kk is the vertical index for interface level cloud top ! ! C : Total convective fractional cover (cldf) is used as the -! convective cloud cover for GWDC calculation instead of +! convective cloud cover for GWDC calculation instead of ! convective cloud cover in each layer (concld). ! a1 = cldf*dlength ! You can see the difference between cldf(i) and concld(i) -! in (4.a.2) in Description of the NCAR Community Climate +! in (4.a.2) in Description of the NCAR Community Climate ! Model (CCM3). ! In NCAR CCM3, cloud fractional cover in each layer in a deep ! cumulus convection is determined assuming total convective -! cloud cover is randomly overlapped in each layer in the +! cloud cover is randomly overlapped in each layer in the ! cumulus convection. ! ! D : Wave stress at cloud top is calculated when the atmosphere ! is dynamically stable at the cloud top ! -! E : Cloud top wave stress and nonlinear parameter are calculated +! E : Cloud top wave stress and nonlinear parameter are calculated ! using density, temperature, and wind that are defined at mid ! level just below the interface level in which cloud top wave ! stress is defined. ! Nonlinct is defined at the interface level. -! +! ! F : If the atmosphere is dynamically unstable at the cloud top, -! GWDC calculation in current horizontal grid is skipped. +! GWDC calculation in current horizontal grid is skipped. ! ! G : If mean wind at the cloud top is less than zero, GWDC @@ -777,18 +777,18 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, !! using density, temperature, and wind that are defined at mid !! level just below the interface level in which cloud top wave !! stress is defined. -!! The parameter \f$\mu\f$ is the nonlinearity factor of thermally -!! induced internal gravity waves defined by eq.(17) in Chun and +!! The parameter \f$\mu\f$ is the nonlinearity factor of thermally +!! induced internal gravity waves defined by eq.(17) in Chun and !! Baik, 1998 \cite chun_and_baik_1998 !! \f[ !! \mu=\frac{gQ_{0}a_{1}}{c_{p}T_{0}NU^{2}} !! \f] !! where \f$Q_{0}\f$ is the maximum deep convective heating rate in a -!! horizontal grid point calculated from cumulus parameterization. +!! horizontal grid point calculated from cumulus parameterization. !! \f$a_{1}\f$ is the half-width of -!! the forcing function.\f$g\f$ is gravity. \f$c_{p}\f$ is specific -!! heat at constant pressure. \f$T_{0}\f$ is the layer mean -!! temperature (T1). As eqs.(18) and (19) \cite chun_and_baik_1998, +!! the forcing function.\f$g\f$ is gravity. \f$c_{p}\f$ is specific +!! heat at constant pressure. \f$T_{0}\f$ is the layer mean +!! temperature (T1). As eqs.(18) and (19) \cite chun_and_baik_1998, !! the zonal momentum flux is given by !! \f[ !! \tau_{x}=-[\rho U^{3}/(N\triangle x)]G(\mu) @@ -798,11 +798,11 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, !! G(\mu)=c_{1}c_2^2 \mu^{2} !! \f] !! wher \f$\rho\f$ is the local density. -!! The tunable parameter \f$c_1\f$ is related to the horizontal -!! structure of thermal forcing. The tunable parameter \f$c_2\f$ is -!! related to the basic-state wind and stability and the bottom and +!! The tunable parameter \f$c_1\f$ is related to the horizontal +!! structure of thermal forcing. The tunable parameter \f$c_2\f$ is +!! related to the basic-state wind and stability and the bottom and !! top heights of thermal forcing. If the atmosphere is dynamically -!! unstable at the cloud top, the convective GWD calculation is +!! unstable at the cloud top, the convective GWD calculation is !! skipped at that grid point. !! ! - If mean wind at the cloud top is less than zero, GWDC @@ -833,10 +833,10 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, do_gwc(i) = .true. else !F - tauctxl(i) = zero + tauctxl(i) = zero tauctyl(i) = zero do_gwc(i) = .false. - end if + end if !H enddo @@ -863,15 +863,15 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, ! ! Minimum RI is calculated for the following two cases ! -! (1) RIloc < 1.e+20 +! (1) RIloc < 1.e+20 ! (2) Riloc = 1.e+20 ----> Vertically uniform basic-state wind ! ! RIloc cannot be smaller than zero because N^2 becomes 1.E-32 in the -! case of N^2 < 0.. Thus the sign of RINUM is determined by +! case of N^2 < 0.. Thus the sign of RINUM is determined by ! 1 - nonlin*|c2|. ! !----------------------------------------------------------------------- -!> -# Calculate the minimum Richardson number including both the +!> -# Calculate the minimum Richardson number including both the !! basic-state condition and wave effects. !!\f[ !! Ri_{min}\approx\frac{Ri(1-\mu|c_{2}|)}{(1+\mu Ri^{1/2}|c_{2}|)^{2}} @@ -897,10 +897,10 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, ! if (lprnt .and. i == npr) write(7000,*)' k=',k,' crit1=', ! &crit1,' crit2=',crit2,' basicui=',basicui(i,k) - if ( abs(basicui(i,k)) > zero .and. crit1 > zero + if ( abs(basicui(i,k)) > zero .and. crit1 > zero & .and. crit2 > zero ) then tem = basicui(i,k) * basicui(i,k) - nonlin = gqmcldlen(i) / (bruni(i,k)*ti(i,k)*tem) + nonlin = gqmcldlen(i) / (bruni(i,k)*ti(i,k)*tem) tem = nonlin*abs(c2) if ( riloc(i,k) < rimaxm ) then tem1 = 1 + tem*sqrt(riloc(i,k)) @@ -926,7 +926,7 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, !----------------------------------------------------------------------- ! -!> -# Calculate the gravity wave stress profile using the wave +!> -# Calculate the gravity wave stress profile using the wave !! saturation hypothesis of Lindzen (1981) \cite lindzen_1981. ! ! Assuming kcldtop(i)=10 and kcldbot=16, @@ -938,20 +938,20 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, ! 2 ======== - 0.001 -1.e20 ! 2 -------- 0.000 ! 3 ======== - 0.001 -1.e20 -! 3 -------- -.xxx +! 3 -------- -.xxx ! 4 ======== - 0.001 2.600 2.000 ! 4 -------- 0.000 ! 5 ======== - 0.001 2.500 2.000 ! 5 -------- 0.000 ! 6 ======== - 0.001 1.500 0.110 -! 6 -------- +.xxx +! 6 -------- +.xxx ! 7 ======== - 0.005 2.000 3.000 ! 7 -------- 0.000 ! 8 ======== - 0.005 1.000 0.222 ! 8 -------- +.xxx ! 9 ======== - 0.010 1.000 2.000 ! 9 -------- 0.000 -! kcldtopi 10 ======== $$$ - 0.010 +! kcldtopi 10 ======== $$$ - 0.010 ! kcldtop 10 -------- $$$ yyyyy ! 11 ======== $$$ 0 ! 11 -------- $$$ @@ -966,22 +966,22 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, ! 16 ======== $$$ 0 ! kcldbot 16 -------- $$$ ! 17 ======== 0 -! 17 -------- +! 17 -------- ! 18 ======== 0 -! 18 -------- +! 18 -------- ! 19 ======== 0 ! !----------------------------------------------------------------------- ! ! Even though the cloud top level obtained in deep convective para- ! meterization is defined in mid-level, the cloud top level for -! the GWDC calculation is assumed to be the interface level just +! the GWDC calculation is assumed to be the interface level just ! above the mid-level cloud top vertical level index. ! !----------------------------------------------------------------------- -!> - When \f$Ri_{min}\f$ is set to 1/4 based on Lindzen's (1981) -!! \cite lindzen_1981 saturation hypothesis, the nonlinearity factor +!> - When \f$Ri_{min}\f$ is set to 1/4 based on Lindzen's (1981) +!! \cite lindzen_1981 saturation hypothesis, the nonlinearity factor !! for wave saturation can be derived by !! \f[ !! \mu_{s}=\frac{1}{|c_{2}|}[2\sqrt{2+\frac{1}{\sqrt{Ri}}}-(2+\frac{1}{\sqrt{Ri}})] @@ -998,22 +998,22 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, taugwci(i,k) = taugwci(i,k+1) elseif (rimin(i,k) > riminp) then tem = 2.0 + 1.0 / sqrt(riloc(i,k)) - nonlins = (1.0/abs(c2)) * (2.*sqrt(tem) - tem) + nonlins = (1.0/abs(c2)) * (2.*sqrt(tem) - tem) tem1 = basicui(i,k) tem2 = c2*nonlins*tem1 taugwci(i,k) = - rhoi(i,k) * c1 * tem1 * tem2 * tem2 & / (bruni(i,k)*dlen(i)) elseif (rimin(i,k) > riminm) then - taugwci(i,k) = zero -! taugwci(i,k) = taugwci(i,k+1) + taugwci(i,k) = zero +! taugwci(i,k) = taugwci(i,k+1) end if ! RImin else -!> - If the minimum \f$R_{i}\f$ at interface cloud top is less than +!> - If the minimum \f$R_{i}\f$ at interface cloud top is less than !! or equal to 1/4, the convective GWD calculation is skipped at that !! grid point. - taugwci(i,k) = zero + taugwci(i,k) = zero end if ! RIloc else taugwci(i,k) = zero @@ -1059,7 +1059,7 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, taugw(i,k) = (taugwci(i,k+1) - taugwci(i,k)) / dpmid(i,k) if (taugw(i,k) /= 0.0) then tem = deltim * taugw(i,k) - dtfac(i) = min(dtfac(i), abs(velco(i,k)/tem)) + dtfac(i) = min(dtfac(i), abs(velco(i,k)/tem)) endif else taugw(i,k) = 0.0 @@ -1164,8 +1164,8 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, !----------------------------------------------------------------------- ! -! The GWDC should accelerate the zonal and meridional wind in the -! opposite direction of the previous zonal and meridional wind, +! The GWDC should accelerate the zonal and meridional wind in the +! opposite direction of the previous zonal and meridional wind, ! respectively ! !----------------------------------------------------------------------- @@ -1176,10 +1176,10 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, !-------------------- x-component------------------- -! write(6,'(a)') +! write(6,'(a)') ! + '(GWDC) WARNING: The GWDC should accelerate the zonal wind ' -! write(6,'(a,a,i3,a,i3)') -! + 'in the opposite direction of the previous zonal wind', +! write(6,'(a,a,i3,a,i3)') +! + 'in the opposite direction of the previous zonal wind', ! + ' at I = ',i,' and J = ',lat ! write(6,'(4(1x,e17.10))') u(i,kk),v(i,kk),u(i,k),v(i,k) ! write(6,'(a,1x,e17.10))') 'Vcld . V =', @@ -1189,7 +1189,7 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, ! do k1=1,km ! write(6,'(i2,36x,2(1x,e17.10))') ! + k1,taugwcxi(i,k1),taugwci(i,k1) -! write(6,'(i2,2(1x,e17.10))') k1,utgwcl(i,k1),u(i,k1) +! write(6,'(i2,2(1x,e17.10))') k1,utgwcl(i,k1),u(i,k1) ! end do ! write(6,'(i2,36x,1x,e17.10)') (km+1),taugwcxi(i,km+1) ! end if @@ -1199,7 +1199,7 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, ! do k1=1,km ! write(6,'(i2,36x,2(1x,e17.10))') ! + k1,taugwci(i,k1) -! write(6,'(i2,2(1x,e17.10))') k1,wtgwc(i,k1),basicum(i,k1) +! write(6,'(i2,2(1x,e17.10))') k1,wtgwc(i,k1),basicum(i,k1) ! end do ! write(6,'(i2,36x,1x,e17.10)') (km+1),taugwci(i,km+1) @@ -1219,7 +1219,7 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, ! do k1=1,km ! write(6,'(i2,36x,2(1x,e17.10))') ! + k1,taugwcyi(i,k1),taugwci(i,k1) -! write(6,'(i2,2(1x,e17.10))') k1,vtgwc(i,k1),v(i,k1) +! write(6,'(i2,2(1x,e17.10))') k1,vtgwc(i,k1),v(i,k1) ! end do ! write(6,'(i2,36x,1x,e17.10)') (km+1),taugwcyi(i,km+1) ! end if @@ -1249,7 +1249,7 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, !----------------------------------------------------------------------- ! -! For GWDC performance analysis +! For GWDC performance analysis ! !----------------------------------------------------------------------- @@ -1265,7 +1265,7 @@ subroutine gwdc(im,ix,iy,km,lat,u1,v1,t1,q1,deltim, ! if ( abs(taugwci(i,k)-taugwci(i,kk)) > taumin ) then ! break(i) = 1.0 ! go to 2000 -! endif +! endif ! enddo !2000 continue diff --git a/physics/gwdps.f b/physics/gwdps.f index d1cf8131d..e92939c39 100644 --- a/physics/gwdps.f +++ b/physics/gwdps.f @@ -1,134 +1,134 @@ !> \file gwdps.f -!! This file is the parameterization of orographic gravity wave +!! This file is the parameterization of orographic gravity wave !! drag and mountain blocking. -!> \defgroup gwd Orographic and Convective Gravity Wave Drag +!> \defgroup GFS_gwd GFS Orographic and Convective Gravity Wave Drag !! @{ -!! Parameterization developed specifically for orographic and +!! Parameterization developed specifically for orographic and !! convective source of gravity waves are documented separately. -!! +!! !! At present, global models must be run with horizontal resolutions -!! that cannot typically resolve atmospheric phenomena shorter than -!! ~10-100 km or greater for weather prediction and ~100-1000 km or -!! greater for climate predicition. Many atmospheric processes have +!! that cannot typically resolve atmospheric phenomena shorter than +!! ~10-100 km or greater for weather prediction and ~100-1000 km or +!! greater for climate predicition. Many atmospheric processes have !! shorter horizontal scales than these "subgrid-scale" processes -!! interact with and affect the larger-scale atmosphere in important +!! interact with and affect the larger-scale atmosphere in important !! ways. !! -!! Atmospheric gravity waves are one such unresolved processes. These -!! waves are generated by lower atmospheric sources. e.g., flow over +!! Atmospheric gravity waves are one such unresolved processes. These +!! waves are generated by lower atmospheric sources. e.g., flow over !! irregularities at the Earth's surface such as mountains and valleys, !! uneven distribution of diabatic heat sources asscociated with -!! convective systems, and highly dynamic atmospheric processes such -!! as jet streams and fronts. The dissipation of these waves produces -!! synoptic-scale body forces on the atmospheric flow, known as -!! "gravity wave drag"(GWD), which affects both short-term evolution -!! of weather systems and long-term climate. However, the spatial -!! scales of these waves (in the range of ~5-500 km horizontally) are -!! too short to be fully captured in models, and so GWD must be -!! parameterized. In addition, the role of GWD in driving the global -!! middle atmosphere circulation and thus global mean wind/temperature -!! structures is well established. Thus, GWD parametrizations are now -!! critical components of virtually all large-scale atmospheric models. -!! GFS physics includes parameterizations of gravity waves from two +!! convective systems, and highly dynamic atmospheric processes such +!! as jet streams and fronts. The dissipation of these waves produces +!! synoptic-scale body forces on the atmospheric flow, known as +!! "gravity wave drag"(GWD), which affects both short-term evolution +!! of weather systems and long-term climate. However, the spatial +!! scales of these waves (in the range of ~5-500 km horizontally) are +!! too short to be fully captured in models, and so GWD must be +!! parameterized. In addition, the role of GWD in driving the global +!! middle atmosphere circulation and thus global mean wind/temperature +!! structures is well established. Thus, GWD parametrizations are now +!! critical components of virtually all large-scale atmospheric models. +!! GFS physics includes parameterizations of gravity waves from two !! important sources: mountains and convection. !! -!! Atmospheric flow is significantly influenced by orography creating -!! lift and frictional forces. The representation of orography and its -!! influence in numerical weather prediction models are necessarily -!! divided into the resolvable scales of motion and treated by +!! Atmospheric flow is significantly influenced by orography creating +!! lift and frictional forces. The representation of orography and its +!! influence in numerical weather prediction models are necessarily +!! divided into the resolvable scales of motion and treated by !! primitive equations, the remaining sub-grid scales to be treated by -!! parameterization. In terms of large scale NWP models, mountain -!! blocking of wind flow around sub-grid scale orograph is a process -!! that retards motion at various model vertical levels near or in the -!! boundary layer. Flow around the mountain encounters larger -!! frictional forces by being in contact with the mountain surfaces -!! for longer time as well as the interaction of the atmospheric -!! environment with vortex shedding which occurs in numerous +!! parameterization. In terms of large scale NWP models, mountain +!! blocking of wind flow around sub-grid scale orograph is a process +!! that retards motion at various model vertical levels near or in the +!! boundary layer. Flow around the mountain encounters larger +!! frictional forces by being in contact with the mountain surfaces +!! for longer time as well as the interaction of the atmospheric +!! environment with vortex shedding which occurs in numerous !! observations. Lott and Miller (1997) \cite lott_and_miller_1997, -!! incorporated the dividing streamline and mountain blocking in +!! incorporated the dividing streamline and mountain blocking in !! conjunction with sub-grid scale vertically propagating gravity wave -!! parameterization in the context of NWP. The dividing streamline is -!! seen as a source of gravity waves to the atmosphere above and +!! parameterization in the context of NWP. The dividing streamline is +!! seen as a source of gravity waves to the atmosphere above and !! nonlinear subgrid low-level mountain drag effect below. !! !! In a review paper on gravity waves in the middle atmosphere, Fritts -!! (1984) \cite fritts_1984 showed that a large portion of observed -!! gravity wave momentum flux has higher frequencies than those of -!! stationary mountain waves. This phenomenon was explained by cumulus -!! convection, which is an additional source of tropospheric gravity +!! (1984) \cite fritts_1984 showed that a large portion of observed +!! gravity wave momentum flux has higher frequencies than those of +!! stationary mountain waves. This phenomenon was explained by cumulus +!! convection, which is an additional source of tropospheric gravity !! waves, and is particularly important in summertime. When the surface -!! wind and stability are weak, the magnitude of the surface drag and +!! wind and stability are weak, the magnitude of the surface drag and !! the resultant influence of orographically-induced gravity wave drag -!! on the large-scale flow are relatively small compared with those in -!! wintertime (Palmer et al. 1986 \cite palmer_et_al_1986). In this +!! on the large-scale flow are relatively small compared with those in +!! wintertime (Palmer et al. 1986 \cite palmer_et_al_1986). In this !! situation, the relative importance of cumulus convection as a source -!! of gravity waves is larger. In addition, in the tropical regions +!! of gravity waves is larger. In addition, in the tropical regions !! where persistent convection exists, deep cumulus clouds impinging on -!! the stable stratosphere can generate gravity waves that influence +!! the stable stratosphere can generate gravity waves that influence !! the large-scale flow. !! !> \section outlines GWD parameterization in GFS -!! - Gravity-wave drag is simulated as described by Alpert et al. -!! (1988) \cite alpert_et_al_1988. The parameterization includes +!! - Gravity-wave drag is simulated as described by Alpert et al. +!! (1988) \cite alpert_et_al_1988. The parameterization includes !! determination of the momentum flux due to gravity waves at the -!! surface, as well as upper levels. The surface stress is a nonlinear -!! function of the surface wind speed and the local Froude number, -!! following Pierrehumbert (1987) \cite pierrehumbert_1987. Vertical -!! variations in the momentum flux occur when the local Richardson -!! number is less than 0.25 (the stress vanishes), or when wave -!! breaking occurs (local Froude number becomes critical); in the -!! latter case, the momentum flux is reduced according to the -!! Lindzen(1981) \cite lindzen_1981 wave saturation hypothesis. -!! Modifications are made to avoid instability when the critical layer -!! is near the surface, since the time scale for gravity-wave drag is -!! shorter than the model time step. +!! surface, as well as upper levels. The surface stress is a nonlinear +!! function of the surface wind speed and the local Froude number, +!! following Pierrehumbert (1987) \cite pierrehumbert_1987. Vertical +!! variations in the momentum flux occur when the local Richardson +!! number is less than 0.25 (the stress vanishes), or when wave +!! breaking occurs (local Froude number becomes critical); in the +!! latter case, the momentum flux is reduced according to the +!! Lindzen(1981) \cite lindzen_1981 wave saturation hypothesis. +!! Modifications are made to avoid instability when the critical layer +!! is near the surface, since the time scale for gravity-wave drag is +!! shorter than the model time step. !! -!! - The treatment of the GWD in the lower troposphere is enhanced -!! according to Kim and Arakawa (1995) \cite kim_and_arakawa_1995 . -!! Orographic Std Dev (HPRIME), Convexity(OC), Asymmetry (OA4) and Lx -!! (CLX4) are input topographic statistics needed (see Appendix in Kim +!! - The treatment of the GWD in the lower troposphere is enhanced +!! according to Kim and Arakawa (1995) \cite kim_and_arakawa_1995 . +!! Orographic Std Dev (HPRIME), Convexity(OC), Asymmetry (OA4) and Lx +!! (CLX4) are input topographic statistics needed (see Appendix in Kim !! and Arakawa (1995) \cite kim_and_arakawa_1995) . !! -!! - Mountain blocking influences are incorporated following the Lott -!! and Miller (1997) \cite lott_and_miller_1997 parameterization with -!! minor changes, including their dividing streamline concept. The -!! model subgrid scale orography is represented by four parameters, -!! after Baines and Palmer (1990) \cite baines_and_palmer_1990, the -!! standard deviation (HPRIME), the anisotropy (GAMMA), the slope -!! (SIGMA) and the geographical orientation of the orography (THETA). -!! These are calculated off-line as a function of model resolution in -!! the fortran code ml01rg2.f, with script mlb2.sh (see Appendix: -!! Specification of subgrid-scale orography in Lott and Miller (1997) +!! - Mountain blocking influences are incorporated following the Lott +!! and Miller (1997) \cite lott_and_miller_1997 parameterization with +!! minor changes, including their dividing streamline concept. The +!! model subgrid scale orography is represented by four parameters, +!! after Baines and Palmer (1990) \cite baines_and_palmer_1990, the +!! standard deviation (HPRIME), the anisotropy (GAMMA), the slope +!! (SIGMA) and the geographical orientation of the orography (THETA). +!! These are calculated off-line as a function of model resolution in +!! the fortran code ml01rg2.f, with script mlb2.sh (see Appendix: +!! Specification of subgrid-scale orography in Lott and Miller (1997) !! \cite lott_and_miller_1997). !! !! - The orographic GWD parameterizations automatically scales -!! with model resolution. For example, the T574L64 version of GFS uses -!! four times stronger mountain blocking and one half the strength of -!! gravity wave drag than the T383L64 version. +!! with model resolution. For example, the T574L64 version of GFS uses +!! four times stronger mountain blocking and one half the strength of +!! gravity wave drag than the T383L64 version. !! !! - The parameterization of stationary convectively-forced GWD follows -!! the development of Chun and Baik (1998) \cite chun_and_baik_1998 , -!! which was tested in GCMs by Chun et al. (2001,2004) -!! \cite chun_et_al_2001 \cite chun_et_al_2004 was implemented in GFS -!! by Ake Johansson (2008) and the work of the GCWMB staff. Modest -!! positive effects from using the parameterization are seen in the +!! the development of Chun and Baik (1998) \cite chun_and_baik_1998 , +!! which was tested in GCMs by Chun et al. (2001,2004) +!! \cite chun_et_al_2001 \cite chun_et_al_2004 was implemented in GFS +!! by Ake Johansson (2008) and the work of the GCWMB staff. Modest +!! positive effects from using the parameterization are seen in the !! tropical upper troposphere and lower stratosphere. !! !!\section intra_gwdps Intraphysics Communication -!! - Routine GWDPS (\ref orographic) is called from GBPHYS after call +!! - Routine GWDPS (\ref orographic) is called from GBPHYS after call !! to MONINEDMF -!! - Routine GWDC (\ref convective) is called from GBPHYS after call +!! - Routine GWDC (\ref convective) is called from GBPHYS after call !! to SASCNVN -!> \ingroup gwd -!> \defgroup orographic Orographic Gravity Wave Drag and Mountain Blocking -!! This subroutine includes orographic gravity wave drag and mountain +!> \ingroup GFS_gwd +!> \defgroup GFS_ogwd GFS Orographic Gravity Wave Drag and Mountain Blocking +!! This subroutine includes orographic gravity wave drag and mountain !! blocking. !! -!> The time tendencies of zonal and meridional wind are altered to -!! include the effect of mountain induced gravity wave drag from -!! subgrid scale orography including convective breaking, shear +!> The time tendencies of zonal and meridional wind are altered to +!! include the effect of mountain induced gravity wave drag from +!! subgrid scale orography including convective breaking, shear !! breaking and the presence of critical levels. !! @{ @@ -140,10 +140,10 @@ !> \param[in,out] B non-linear tendency for u wind component !> \param[in,out] C non-linear tendency for temperature (not used) !> \param[in] U1 zonal wind component of model layer wind (m/s) -!> \param[in] V1 meridional wind component of model layer wind +!> \param[in] V1 meridional wind component of model layer wind !! (m/s) !> \param[in] T1 model layer mean temperature (K) -!> \param[in] Q1 model layer mean specific humidity +!> \param[in] Q1 model layer mean specific humidity !> \param[in] KPBL index for the PBL top layer !> \param[in] PRSI pressure at layer interfaces !> \param[in] DEL positive increment of p/psfc across layer @@ -156,10 +156,10 @@ !> \param[in] HPRIME orographic standard deviation (m) (mtnvar(:,1)) !> \param[in] OC orographic Convexity (mtnvar(:,2)) !> \param[in] OA4 orographic Asymmetry (mtnvar(:,3:6)) -!> \param[in] CLX4 Lx, the fractional area covered by the -!! subgrid-scale orography higher than a critical height for a grid +!> \param[in] CLX4 Lx, the fractional area covered by the +!! subgrid-scale orography higher than a critical height for a grid !! box with the interval \f$ \triangle x \f$ (mtnvar(:,7:10)) -!> \param[in] THETA the angle of the mtn with that to the east (x) +!> \param[in] THETA the angle of the mtn with that to the east (x) !! axis (mtnvar(:,11)) !> \param[in] SIGMA orographic slope (mtnvar(:,13)) !> \param[in] GAMMA orographic anisotropy (mtnvar(:,12)) @@ -171,8 +171,8 @@ !> \param[in] RD see physcons::con_tird !> \param[in] RV see physcons::con_rv !> \param[in] IMX number of longitude points -!> \param[in] NMTVR number of topographic variables such as -!! variance etc used in the GWD parameterization,current operational, +!> \param[in] NMTVR number of topographic variables such as +!! variance etc used in the GWD parameterization,current operational, !! nmtvr=14 !> \param[in] CDMBGWD multiplication factors for cdmb and gwd !> \param[in] ME pe number - used for debug prints @@ -197,7 +197,7 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & !----- ALSO INCLUDED IS RI SMOOTH OVER A THICK LOWER LAYER !----- ALSO INCLUDED IS DECREASE IN DE-ACC AT TOP BY 1/2 !----- THE NMC GWD INCORPORATING BOTH GLAS(P&S) AND GFDL(MIGWD) -!----- MOUNTAIN INDUCED GRAVITY WAVE DRAG +!----- MOUNTAIN INDUCED GRAVITY WAVE DRAG !----- CODE FROM .FR30(V3MONNX) FOR MONIN3 !----- THIS VERSION (06 MAR 1987) !----- THIS VERSION (26 APR 1987) 3.G @@ -273,8 +273,8 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & ! OTHER INPUT VARIABLES UNMODIFIED. ! revision log: ! May 2013 J. Wang change cleff back to opn setting -! Jan 2014 J. Wang merge Henry and Fangin's dissipation heat in gfs to nems -! +! Jan 2014 J. Wang merge Henry and Fangin's dissipation heat in gfs to nems +! ! ! ******************************************************************** USE MACHINE , ONLY : kind_phys @@ -313,8 +313,8 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & parameter (FRC=1.0, CE=0.8, CEOFRC=CE/FRC, frmax=100., CG=0.5) parameter (GMAX=1.0, VELEPS=1.0, FACTOP=0.5) ! parameter (GMAX=1.0, CRITAC=5.0E-4, VELEPS=1.0, FACTOP=0.5) - parameter (RLOLEV=50000.0) -! parameter (RLOLEV=500.0) + parameter (RLOLEV=50000.0) +! parameter (RLOLEV=500.0) ! parameter (RLOLEV=0.5) ! real(kind=kind_phys) dpmin,hminmt,hncrit,minwnd,sigfac @@ -368,7 +368,7 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & &, dtaux, dtauy, pkp1log, pklog integer kmm1, kmm2, lcap, lcapp1, kbps, kbpsp1,kbpsm1 & &, kmps, idir, nwd, i, j, k, klcap, kp1, kmpbl, npt, npr & - &, kmll + &, kmll ! &, kmll,kmds,ihit,jhit logical lprnt ! @@ -406,12 +406,12 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & LCAPP1 = LCAP + 1 ! ! - IF ( NMTVR .eq. 14) then + IF ( NMTVR .eq. 14) then ! ---- for lm and gwd calculation points ipt = 0 npt = 0 DO I = 1,IM - IF ( (elvmax(i) .GT. HMINMT) + IF ( (elvmax(i) .GT. HMINMT) & .and. (hprime(i) .GT. hpmin) ) then npt = npt + 1 ipt(npt) = i @@ -429,10 +429,10 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & ! do i=1,npt iwklm(i) = 2 - IDXZB(i) = 0 + IDXZB(i) = 0 kreflm(i) = 0 enddo -! if (lprnt) +! if (lprnt) ! & print *,' in gwdps_lm.f npt,IM,IX,IY,km,me=',npt,IM,IX,IY,km,me ! ! @@ -445,7 +445,7 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & ! then do not need hncrit -- test with large hncrit first. ! KMLL = km / 2 ! maximum mtnlm height : # of vertical levels / 2 KMLL = kmm1 -! --- No mtn should be as high as KMLL (so we do not have to start at +! --- No mtn should be as high as KMLL (so we do not have to start at ! --- the top of the model but could do calc for all levels). ! DO I = 1, npt @@ -461,12 +461,12 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & pkp1log = phil(j,k+1) / G pklog = phil(j,k) / G !!!------- ELVMAX(J) = min (ELVMAX(J) + sigfac * hprime(j), hncrit) - if ( ( ELVMAX(j) .le. pkp1log ) .and. + if ( ( ELVMAX(j) .le. pkp1log ) .and. & ( ELVMAX(j) .ge. pklog ) ) THEN ! print *,' in gwdps_lm.f 1 =',k,ELVMAX(j),pklog,pkp1log,me -! --- wk for diags but can be saved and reused. +! --- wk for diags but can be saved and reused. wk(i) = G * ELVMAX(j) / ( phil(j,k+1) - phil(j,k) ) - iwklm(I) = MAX(iwklm(I), k+1 ) + iwklm(I) = MAX(iwklm(I), k+1 ) ! print *,' in gwdps_lm.f 2 npt=',npt,i,j,wk(i),iwklm(i),me endif ! @@ -484,16 +484,16 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & ! jhit = 0 ! do i = 1, npt ! j=ipt(i) -! if ( iwklm(i) .gt. ihit ) then +! if ( iwklm(i) .gt. ihit ) then ! ihit = iwklm(i) ! jhit = j ! endif ! enddo ! print *, ' mb: kdt,max(iwklm),jhit,phil,me=', ! & kdt,ihit,jhit,phil(jhit,ihit),me - + klevm1 = KMLL - 1 - DO K = 1, klevm1 + DO K = 1, klevm1 DO I = 1, npt j = ipt(i) RDZ = g / ( phil(j,k+1) - phil(j,k) ) @@ -518,7 +518,7 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & BNV2bar(I) = (PRSL(J,1)-PRSL(J,2)) * DELKS1(I) * BNV2LM(I,1) ENDDO -! --- find the dividing stream line height +! --- find the dividing stream line height ! --- starting from the level above the max mtn downward ! --- iwklm(i) is the k-index of mtn elvmax elevation !> - Find the dividing streamline height starting from the level above @@ -536,14 +536,14 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & ! --- make averages, guess dividing stream (DS) line layer. ! --- This is not used in the first cut except for testing and ! --- is the vert ave of quantities from the surface to mtn top. -! +! DO I = 1, npt DO K = 1, Kreflm(I) J = ipt(i) RDELKS = DEL(J,K) * DELKS(I) - UBAR(I) = UBAR(I) + RDELKS * U1(J,K) ! trial Mean U below - VBAR(I) = VBAR(I) + RDELKS * V1(J,K) ! trial Mean V below - ROLL(I) = ROLL(I) + RDELKS * RO(I,K) ! trial Mean RO below + UBAR(I) = UBAR(I) + RDELKS * U1(J,K) ! trial Mean U below + VBAR(I) = VBAR(I) + RDELKS * V1(J,K) ! trial Mean V below + ROLL(I) = ROLL(I) + RDELKS * RO(I,K) ! trial Mean RO below RDELKS = (PRSL(J,K)-PRSL(J,K+1)) * DELKS1(I) BNV2bar(I) = BNV2bar(I) + BNV2lm(I,K) * RDELKS ! --- these vert ave are for diags, testing and GWD to follow (*j*). @@ -552,7 +552,7 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & ! print *,' in gwdps_lm.f 5 =',i,kreflm(npt),BNV2bar(npt),me ! ! --- integrate to get PE in the trial layer. -! --- Need the first layer where PE>EK - as soon as +! --- Need the first layer where PE>EK - as soon as ! --- IDXZB is not 0 we have a hit and Zb is found. ! DO I = 1, npt @@ -568,38 +568,38 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & !!\f[ !! UDS=\max(\sqrt{U1^2+V1^2},minwnd) !!\f] -!! where \f$ minwnd=0.1 \f$, \f$U1\f$ and \f$V1\f$ are zonal and +!! where \f$ minwnd=0.1 \f$, \f$U1\f$ and \f$V1\f$ are zonal and !! meridional wind components of model layer wind. - UDS(I,K) = + UDS(I,K) = & MAX(SQRT(U1(J,K)*U1(J,K) + V1(J,K)*V1(J,K)), minwnd) ! --- Test to see if we found Zb previously IF (IDXZB(I) .eq. 0 ) then - PE(I) = PE(I) + BNV2lm(I,K) * - & ( G * ELVMAX(J) - phil(J,K) ) * + PE(I) = PE(I) + BNV2lm(I,K) * + & ( G * ELVMAX(J) - phil(J,K) ) * & ( PHII(J,K+1) - PHII(J,K) ) / (G*G) ! --- KE ! --- Wind projected on the line perpendicular to mtn range, U(Zb(K)). ! --- kenetic energy is at the layer Zb ! --- THETA ranges from -+90deg |_ to the mtn "largest topo variations" UP(I) = UDS(I,K) * cos(ANG(I,K)) - EK(I) = 0.5 * UP(I) * UP(I) + EK(I) = 0.5 * UP(I) * UP(I) ! --- Dividing Stream lime is found when PE =exceeds EK. IF ( PE(I) .ge. EK(I) ) IDXZB(I) = K ! --- Then mtn blocked flow is between Zb=k(IDXZB(I)) and surface ! -!> - The dividing streamline height (idxzb), of a subgrid scale -!! obstable, is found by comparing the potential (PE) and kinetic +!> - The dividing streamline height (idxzb), of a subgrid scale +!! obstable, is found by comparing the potential (PE) and kinetic !! energies (EK) of the upstream large scale wind and subgrid scale air !! parcel movements. the dividing streamline is found when -!! \f$PE\geq EK\f$. Mountain-blocked flow is defined to exist between -!! the surface and the dividing streamline height (\f$h_d\f$), which -!! can be found by solving an integral equation for \f$h_d\f$: +!! \f$PE\geq EK\f$. Mountain-blocked flow is defined to exist between +!! the surface and the dividing streamline height (\f$h_d\f$), which +!! can be found by solving an integral equation for \f$h_d\f$: !!\f[ !! \frac{U^{2}(h_{d})}{2}=\int_{h_{d}}^{H} N^{2}(z)(H-z)dz !!\f] !! where \f$H\f$ is the maximum subgrid scale elevation within the grid -!! box of actual orography, \f$h\f$, obtained from the GTOPO30 dataset +!! box of actual orography, \f$h\f$, obtained from the GTOPO30 dataset !! from the U.S. Geological Survey. ENDIF ENDDO @@ -628,12 +628,12 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & ! endif ! ! --- The drag for mtn blocked flow -! +! DO I = 1, npt J = ipt(i) ZLEN = 0. ! print *,' in gwdps_lm.f 9 =',i,j,IDXZB(i),me - IF ( IDXZB(I) .gt. 0 ) then + IF ( IDXZB(I) .gt. 0 ) then DO K = IDXZB(I), 1, -1 IF ( PHIL(J,IDXZB(I)) .gt. PHIL(J,K) ) then @@ -642,40 +642,40 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & !!\f[ !! ZLEN=\sqrt{[\frac{h_{d}-z}{z+h'}]} !!\f] -!! where \f$z\f$ is the height, \f$h'\f$ is the orographic standard +!! where \f$z\f$ is the height, \f$h'\f$ is the orographic standard !! deviation (HPRIME). - ZLEN = SQRT( ( PHIL(J,IDXZB(I)) - PHIL(J,K) ) / + ZLEN = SQRT( ( PHIL(J,IDXZB(I)) - PHIL(J,K) ) / & ( PHIL(J,K ) + G * hprime(J) ) ) ! --- lm eq 14: -!> - Calculate the drag coefficient to vary with the aspect ratio of +!> - Calculate the drag coefficient to vary with the aspect ratio of !! the obstable as seen by the incident flow (see eq.14 in Lott and -!! Miller (1997) \cite lott_and_miller_1997) +!! Miller (1997) \cite lott_and_miller_1997) !!\f[ !! R=\frac{\cos^{2}\psi+\gamma\sin^{2}\psi}{\gamma\cos^{2}\psi+\sin^{2}\psi} !!\f] -!! where \f$\psi\f$, which is derived from THETA, is the angle between -!! the incident flow direction and the normal ridge direcion. +!! where \f$\psi\f$, which is derived from THETA, is the angle between +!! the incident flow direction and the normal ridge direcion. !! \f$\gamma\f$ is the orographic anisotropy (GAMMA). - R = (cos(ANG(I,K))**2 + GAMMA(J) * sin(ANG(I,K))**2) / + R = (cos(ANG(I,K))**2 + GAMMA(J) * sin(ANG(I,K))**2) / & (gamma(J) * cos(ANG(I,K))**2 + sin(ANG(I,K))**2) ! --- (negitive of DB -- see sign at tendency) -!> - In each model layer below the dividing streamlines, a drag from +!> - In each model layer below the dividing streamlines, a drag from !! the blocked flow is exerted by the obstacle on the large scale flow. -!! The drag per unit area and per unit height is written (eq.15 in +!! The drag per unit area and per unit height is written (eq.15 in !! Lott and Miller (1997) \cite lott_and_miller_1997): !!\f[ !! D_{b}(z)=-C_{d}\max(2-\frac{1}{R},0)\rho\frac{\sigma}{2h'}ZLEN\max(\cos\psi,\gamma\sin\psi)\frac{UDS}{2} !!\f] -!! where \f$C_{d}\f$ is a specified constant, \f$\sigma\f$ is the -!! orographic slope. +!! where \f$C_{d}\f$ is a specified constant, \f$\sigma\f$ is the +!! orographic slope. DBTMP = 0.25 * CDmb * & MAX( 2. - 1. / R, 0. ) * sigma(J) * & MAX(cos(ANG(I,K)), gamma(J)*sin(ANG(I,K))) * - & ZLEN / hprime(J) - DB(I,K) = DBTMP * UDS(I,K) + & ZLEN / hprime(J) + DB(I,K) = DBTMP * UDS(I,K) ! -! if(lprnt .and. i .eq. npr) then +! if(lprnt .and. i .eq. npr) then ! print *,' in gwdps_lmi.f 10 npt=',npt,i,j,idxzb(i) ! &, DBTMP,R' ang=',ang(i,k),' gamma=',gamma(j),' K=',K ! print *,' in gwdps_lmi.f 11 K=',k,ZLEN,cos(ANG(I,K)) @@ -686,13 +686,13 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & ! if(lprnt) print *,' @K=1,ZLEN,DBTMP=',K,ZLEN,DBTMP endif ENDDO -! +! !............................. !............................. ! end mtn blocking section ! - ELSEIF ( NMTVR .ne. 14) then -! ---- for mb not present and gwd (nmtvr .ne .14) + ELSEIF ( NMTVR .ne. 14) then +! ---- for mb not present and gwd (nmtvr .ne .14) ipt = 0 npt = 0 DO I = 1,IM @@ -791,13 +791,13 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & enddo enddo ! -!> - Calculate the reference level index: kref=max(2,KPBL+1). where +!> - Calculate the reference level index: kref=max(2,KPBL+1). where !! KPBL is the index for the PBL top layer. KBPS = 1 KMPS = KM DO I=1,npt J = ipt(i) - kref(I) = MAX(IWK(I), KPBL(J)+1 ) ! reference level + kref(I) = MAX(IWK(I), KPBL(J)+1 ) ! reference level DELKS(I) = 1.0 / (PRSI(J,1) - PRSI(J,kref(I))) DELKS1(I) = 1.0 / (PRSL(J,1) - PRSL(J,kref(I))) UBAR (I) = 0.0 @@ -832,8 +832,8 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & ! NWD 1 2 3 4 5 6 7 8 ! WD W S SW NW E N NE SE ! -!> - Calculate low-level horizontal wind direction, the derived -!! orographic asymmetry parameter (OA), and the derived Lx (CLX). +!> - Calculate low-level horizontal wind direction, the derived +!! orographic asymmetry parameter (OA), and the derived Lx (CLX). DO I = 1,npt J = ipt(i) wdir = atan2(UBAR(I),VBAR(I)) + pi @@ -862,7 +862,7 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & ULOW (I) = 0.0 DTFAC(I) = 1.0 ICRILV(I) = .FALSE. ! INITIALIZE CRITICAL LEVEL CONTROL VECTOR - + ! !----COMPUTE THE "LOW LEVEL" WIND MAGNITUDE (M/S) ! @@ -881,7 +881,7 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & ! ENDIF ENDDO ENDDO -! +! ! ! find the interface level of the projected wind where ! low levels & upper levels meet above pbl @@ -919,15 +919,15 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & ! RATIO CONST. USE SIMPLIFIED RELATIONSHIP BETWEEN STANDARD ! DEVIATION & CRITICAL HGT ! -!> - Calculate enhancement factor (E),number of mountans (m') and +!> - Calculate enhancement factor (E),number of mountans (m') and !! aspect ratio constant. -!!\n As in eq.(4.9),(4.10),(4.11) in Kim and Arakawa (1995) -!! \cite kim_and_arakawa_1995, we define m' and E in such a way that they -!! depend on the geometry and location of the subgrid-scale orography -!! through OA and the nonlinearity of flow above the orography through -!! Fr. OC, which is the orographic convexity, and statistically -!! determine how protruded (sharp) the subgrid-scale orography is, is -!! included in the saturation flux G' in such a way that G' is +!!\n As in eq.(4.9),(4.10),(4.11) in Kim and Arakawa (1995) +!! \cite kim_and_arakawa_1995, we define m' and E in such a way that they +!! depend on the geometry and location of the subgrid-scale orography +!! through OA and the nonlinearity of flow above the orography through +!! Fr. OC, which is the orographic convexity, and statistically +!! determine how protruded (sharp) the subgrid-scale orography is, is +!! included in the saturation flux G' in such a way that G' is !! proportional to OC. The forms of E,m' and G' are: !!\f[ !! E(OA,F_{r_{0}})=(OA+2)^{\delta} @@ -944,17 +944,17 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & !!\f[ !! a^{2}=C_{G}OC^{-1} !!\f] -!! where \f$F_{r_{c}}(=1)\f$ is the critical Froude number, +!! where \f$F_{r_{c}}(=1)\f$ is the critical Froude number, !! \f$F_{r_{0}}\f$ is the Froude number. \f$C_{E}\f$,\f$C_{m}\f$, !! \f$C_{G}\f$ are constants. -!> - Calculate the reference-level drag \f$\tau_{0}\f$ (eq.(4.8) in +!> - Calculate the reference-level drag \f$\tau_{0}\f$ (eq.(4.8) in !! Kim and Arakawa (1995) \cite kim_and_arakawa_1995): !!\f[ !! \tau_0=E\frac{m'}{\triangle x}\frac{\rho_{0}U_0^3}{N_{0}}G' !!\f] -!! where \f$E\f$,\f$m'\f$, and \f$G'\f$ are the enhancement factor, -!! "the number of mountains", and the flux function defined above, +!! where \f$E\f$,\f$m'\f$, and \f$G'\f$ are the enhancement factor, +!! "the number of mountains", and the flux function defined above, !! respectively. EFACT = (OA(I) + 2.) ** (CEOFRC*FR) @@ -978,7 +978,7 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & SCOR(I) = BNV2(I,K) / TEM ! Scorer parameter below ref level ENDDO ! if(lprnt) print *,' taub=',taub -! +! !----SET UP BOTTOM VALUES OF STRESS ! DO K = 1, KBPS @@ -1005,12 +1005,12 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & ! !> - Compute the drag above the reference level (\f$k\geq kref\f$): !! - Calculate the ratio of the Scorer parameter (\f$R_{scor}\f$). -!! \n From a series of experiments, Kim and Arakawa (1995) -!! \cite kim_and_arakawa_1995 found that the magnitude of drag divergence -!! tends to be underestimated by the revised scheme in low-level +!! \n From a series of experiments, Kim and Arakawa (1995) +!! \cite kim_and_arakawa_1995 found that the magnitude of drag divergence +!! tends to be underestimated by the revised scheme in low-level !! downstream regions with wave breaking. Therefore, at low levels when -!! OA > 0 (i.e., in the "downstream" region) the saturation hypothesis -!! is replaced by the following formula based on the ratio of the +!! OA > 0 (i.e., in the "downstream" region) the saturation hypothesis +!! is replaced by the following formula based on the ratio of the !! the Scorer parameter: !!\f[ !! R_{scor}=\min \left[\frac{\tau_i}{\tau_{i+1}},1\right] @@ -1024,7 +1024,7 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & SCORK = BNV2(I,K) * TEMV * TEMV RSCOR = MIN(1.0, SCORK / SCOR(I)) SCOR(I) = SCORK - ELSE + ELSE RSCOR = 1. ENDIF ! @@ -1033,11 +1033,11 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & !! \tau=\frac{m'}{\triangle x}\rho NUh_d^2 !!\f] !! where \f$h_{d}\f$ is the displacement wave amplitude. In the absence -!! of wave breaking, the displacement amplitude for the \f$i^{th}\f$ -!! layer can be expressed using the drag for the layer immediately +!! of wave breaking, the displacement amplitude for the \f$i^{th}\f$ +!! layer can be expressed using the drag for the layer immediately !! below. Thus, assuming \f$\tau_i=\tau_{i+1}\f$, we can get: !!\f[ -!! h_{d_i}^2=\frac{\triangle x}{m'}\frac{\tau_{i+1}}{\rho_{i}N_{i}U_{i}} +!! h_{d_i}^2=\frac{\triangle x}{m'}\frac{\tau_{i+1}}{\rho_{i}N_{i}U_{i}} !!\f] BRVF = SQRT(BNV2(I,K)) ! Brunt-Vaisala Frequency @@ -1049,9 +1049,9 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & ! ! RIM is the MINIMUM-RICHARDSON NUMBER BY SHUTTS (1985) ! -!> - The minimum Richardson number (\f$Ri_{m}\f$) or local +!> - The minimum Richardson number (\f$Ri_{m}\f$) or local !! wave-modified Richardson number, which determines the onset of wave -!! breaking, is expressed in terms of \f$R_{i}\f$ and +!! breaking, is expressed in terms of \f$R_{i}\f$ and !! \f$F_{r_{d}}=Nh_{d}/U\f$: !!\f[ !! Ri_{m}=\frac{Ri(1-Fr_{d})}{(1+\sqrt{Ri}\cdot Fr_{d})^{2}} @@ -1068,17 +1068,17 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & !> - Check stability to employ the 'saturation hypothesis' of Lindzen !! (1981) \cite lindzen_1981 except at tropospheric downstream regions. !! \n Wave breaking occurs when \f$Ri_{m} - Calculate outputs: A, B, DUSFC, DVSFC (see parameter description). -!! - Below the dividing streamline height (k < idxzb), mountain -!! blocking(\f$D_{b}\f$) is applied. +!! - Below the dividing streamline height (k < idxzb), mountain +!! blocking(\f$D_{b}\f$) is applied. !! - Otherwise (k>= idxzb), orographic GWD (\f$\tau\f$) is applied. DO K = 1,KM DO I = 1,npt @@ -1163,7 +1163,7 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & A(J,K) = - DBIM * V1(J,K) + A(J,K) B(J,K) = - DBIM * U1(J,K) + B(J,K) ENG1 = ENG0*(1.0-DBIM*DELTIM)*(1.0-DBIM*DELTIM) -! if ( ABS(DBIM * U1(J,K)) .gt. .01 ) +! if ( ABS(DBIM * U1(J,K)) .gt. .01 ) ! & print *,' in gwdps_lmi.f KDT=',KDT,I,K,DB(I,K), ! & dbim,idxzb(I),U1(J,K),V1(J,K),me DUSFC(J) = DUSFC(J) - DBIM * V1(J,K) * DEL(J,K) @@ -1193,7 +1193,7 @@ SUBROUTINE GWDPS(IM,IX,IY,KM,A,B,C,U1,V1,T1,Q1,KPBL, & DUSFC(J) = TEM * DUSFC(J) DVSFC(J) = TEM * DVSFC(J) ENDDO -! +! ! MONITOR FOR EXCESSIVE GRAVITY WAVE DRAG TENDENCIES IF NCNT>0 ! ! IF(NCNT.GT.0) THEN diff --git a/physics/mfdeepcnv.f b/physics/mfdeepcnv.f index 3fd80606a..b4137413b 100755 --- a/physics/mfdeepcnv.f +++ b/physics/mfdeepcnv.f @@ -1,5 +1,50 @@ - subroutine mfdeepcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, - & q1,t1,u1,v1,cldwrk,rn,kbot,ktop,kcnv,islimsk,garea, +!> \file mfdeepcnv.f +!! This file contains the Scale-Aware Simplified Arakawa-Schubert deep convection parameterization. + +!> \defgroup SASAS Scale-Aware Simplified Arakawa-Schubert Deep Convection +!! @{ +!! \brief Brief description of the parameterization +!! \section diagram Calling Hierarchy Diagram +!! \section intraphysics Intraphysics Communication + +!> \brief Brief description of the subroutine +!! +!! | 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 | +!! | ix | horizontal_dimension | horizontal dimension | index | 0 | integer | | in | F | +!! | km | vertical_dimension | vertical layer dimension | index | 0 | integer | | in | F | +!! | delt | time_step | physics time step | s | 0 | real | kind_phys | in | F | +!! | delp | air_pressure_layer_difference | pres(k) - pres(k+1) | Pa | 2 | real | kind_phys | in | F | +!! | prslp | air_pressure_layer | mean layer pressure | Pa | 2 | real | kind_phys | in | F | +!! | psp | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | +!! | phil | geopotential | layer geopotential | m2 s-2 | 2 | real | kind_phys | in | F | +!! | ql1 | cloud_ice_specific_humidity | cloud ice specific humidity | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | ql2 | cloud_liquid_water_specific_humidity | cloud water specific humidity | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | q1 | water_vapor_specific_humidity | updated vapor specific humidity | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | t1 | air_temperature | updated temperature | K | 2 | real | kind_phys | inout | F | +!! | u1 | x_wind | updated x-direction wind | m s-1 | 2 | real | kind_phys | inout | F | +!! | v1 | y_wind | updated y-direction wind | m s-1 | 2 | real | kind_phys | inout | F | +!! | cldwrk | cloud_work_function | cloud work function | m2 s-2 | 1 | real | kind_phys | out | F | +!! | rn | convective_rainfall_amount | convective rain | m | 1 | real | kind_phys | out | F | +!! | kbot | index_for_cloud_base | index for cloud base | index | 1 | integer | | out | F | +!! | ktop | index_for_cloud_top | index for cloud top | index | 1 | integer | | out | F | +!! | kcnv | flag_deep_convection | deep convection: 0=no, 1=yes | flag | 1 | integer | | out | F | +!! | islimsk | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | in | F | +!! | garea | cell_area | grid cell area | m2 | 1 | real | kind_phys | in | F | +!! | dot | omega | layer mean vertical velocity | Pa s-1 | 2 | real | kind_phys | in | F | +!! | ncloud | number_of_hydrometeors | number of hydrometeors | count | 0 | integer | | in | F | +!! | ud_mf | atmosphere_updraft_convective_mass_flux | (updraft mass flux) * delt | kg m-2 | 2 | real | kind_phys | out | F | +!! | dd_mf | atmosphere_downdraft_convective_mass_flux | (downdraft mass flux) * delt | kg m-2 | 2 | real | kind_phys | out | F | +!! | dt_mf | atmosphere_updraft_convective_mass_flux_at_cloud_top | ud_mf at cloud top | kg m-2 | 2 | real | kind_phys | out | F | +!! | cnvw | atmosphere_convective_cloud_water_specific_humidity | convective cloud water | kg kg-1 | 2 | real | kind_phys | out | F | +!! | cnvc | cloud_binary_mask | convective cloud cover | flag | 2 | real | kind_phys | out | F | +!! +!! \section general General Algorithm +!! \section detailed Detailed Algorithm +!! @{ + subroutine mfdeepcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, & + & q1,t1,u1,v1,cldwrk,rn,kbot,ktop,kcnv,islimsk,garea, & & dot,ncloud,ud_mf,dd_mf,dt_mf,cnvw,cnvc) ! use machine , only : kind_phys @@ -10,20 +55,18 @@ subroutine mfdeepcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, &, eps => con_eps, epsm1 => con_epsm1 implicit none ! - integer im, ix, km, ncloud, - & kbot(im), ktop(im), kcnv(im) + integer im, ix, km, ncloud, & + & kbot(im), ktop(im), kcnv(im) ! &, me real(kind=kind_phys) delt real(kind=kind_phys) psp(im), delp(ix,km), prslp(ix,km) - real(kind=kind_phys) ps(im), del(ix,km), prsl(ix,km), - & ql(ix,km,2),q1(ix,km), t1(ix,km), - & u1(ix,km), v1(ix,km), -! & u1(ix,km), v1(ix,km), rcs(im), - & cldwrk(im), rn(im), garea(im), - & dot(ix,km), phil(ix,km), - & cnvw(ix,km),cnvc(ix,km), -! hchuang code change mass flux output - & ud_mf(im,km),dd_mf(im,km),dt_mf(im,km) + real(kind=kind_phys) ps(im), del(ix,km), prsl(ix,km), & + & ql(ix,km,2),q1(ix,km), t1(ix,km), & + & u1(ix,km), v1(ix,km), & !rcs(im), + & cldwrk(im), rn(im), garea(im), & + & dot(ix,km), phil(ix,km), & + & cnvw(ix,km),cnvc(ix,km), & + & ud_mf(im,km),dd_mf(im,km),dt_mf(im,km) ! hchuang code change mass flux output ! integer i, indx, jmn, k, kk, km1, n integer, dimension(im), intent(in) :: islimsk @@ -32,7 +75,7 @@ subroutine mfdeepcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, real(kind=kind_phys) clam, cxlamu, cxlamd, & xlamde, xlamdd, & crtlamu, crtlamd -! +! ! real(kind=kind_phys) detad real(kind=kind_phys) adw, aup, aafac, & beta, betal, betas, @@ -41,7 +84,7 @@ subroutine mfdeepcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, & dellat, delta, desdt, dg, & dh, dhh, dp, & dq, dqsdp, dqsdt, dt, - & dt2, dtmax, dtmin, + & dt2, dtmax, dtmin, & dxcrtas, dxcrtuf, & dv1h, dv2h, dv3h, & dv1q, dv2q, dv3q, @@ -50,7 +93,7 @@ subroutine mfdeepcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, & es, etah, & cthk, dthk, & evef, evfact, evfactl, fact1, - & fact2, factor, + & fact2, factor, & g, gamma, pprime, cm, & qlk, qrch, qs, & rain, rfact, shear, tfac, @@ -77,7 +120,7 @@ subroutine mfdeepcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, & delqbar(im), delqev(im), deltbar(im), & deltv(im), dtconv(im), edt(im), & edto(im), edtx(im), fld(im), - & hcdo(im,km), hmax(im), hmin(im), + & hcdo(im,km), hmax(im), hmin(im), & ucdo(im,km), vcdo(im,km),aa2(im), & pdot(im), po(im,km), & pwavo(im), pwevo(im), mbdt(im), @@ -109,7 +152,7 @@ subroutine mfdeepcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, ! cx = min([-0.7 ln(Nccn) + 24]*1.e-4, c0s) ! Nccn: CCN number concentration in cm^(-3) ! Until a realistic Nccn is provided, typical Nccns are assumed -! as Nccn=100 for sea and Nccn=7000 for land +! as Nccn=100 for sea and Nccn=7000 for land ! parameter(cm=1.0,delta=fv) parameter(fact1=(cvap-cliq)/rv,fact2=hvap/rv-fact1*t0c) @@ -130,7 +173,7 @@ subroutine mfdeepcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, c cloud water ! real(kind=kind_phys) tvo(im,km) real(kind=kind_phys) qlko_ktcon(im), dellal(im,km), tvo(im,km), - & dbyo(im,km), zo(im,km), + & dbyo(im,km), zo(im,km), & xlamue(im,km), xlamud(im,km), & fent1(im,km), fent2(im,km), frh(im,km), & heo(im,km), heso(im,km), @@ -274,9 +317,9 @@ subroutine mfdeepcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, ! pgcon = 0.7 ! Gregory et al. (1997, QJRMS) pgcon = 0.55 ! Zhang & Wu (2003,JAS) ! - w1l = -8.e-3 + w1l = -8.e-3 w2l = -4.e-2 - w3l = -5.e-3 + w3l = -5.e-3 w4l = -5.e-4 w1s = -2.e-4 w2s = -2.e-3 @@ -292,7 +335,7 @@ subroutine mfdeepcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, kmax(i) = km tx1(i) = 1.0 / ps(i) enddo -! +! do k = 1, km do i=1,im if (prsl(i,k)*tx1(i) > 0.04) kmax(i) = k + 1 @@ -307,7 +350,7 @@ subroutine mfdeepcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, enddo c c hydrostatic height assume zero terr and initially assume -c updraft entrainment rate as an inverse function of height +c updraft entrainment rate as an inverse function of height c do k = 1, km do i=1,im @@ -759,7 +802,7 @@ subroutine mfdeepcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, else tem = 0. endif - + val1 = -1. tem = max(tem,val1) val2 = 1. @@ -994,7 +1037,7 @@ subroutine mfdeepcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, if(totflg) return !! c -c estimate the onvective overshooting as the level +c estimate the onvective overshooting as the level c where the [aafac * cloud work function] becomes zero, c which is the final cloud top c @@ -1035,8 +1078,8 @@ subroutine mfdeepcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, enddo enddo c -c compute cloud moisture property, detraining cloud water -c and precipitation in overshooting layers +c compute cloud moisture property, detraining cloud water +c and precipitation in overshooting layers c do k = 2, km1 do i = 1, im @@ -1471,14 +1514,14 @@ subroutine mfdeepcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, tem2=eta(i,k-1)*(uo(i,k-1)-ucko(i,k-1)) ptem1=etad(i,k)*(uo(i,k)-ucdo(i,k)) ptem2=etad(i,k-1)*(uo(i,k-1)-ucdo(i,k-1)) - dellau(i,k) = dellau(i,k) + + dellau(i,k) = dellau(i,k) + & (aup*(tem1-tem2)-adw*edto(i)*(ptem1-ptem2))*g/dp cj tem1=eta(i,k)*(vo(i,k)-vcko(i,k)) tem2=eta(i,k-1)*(vo(i,k-1)-vcko(i,k-1)) ptem1=etad(i,k)*(vo(i,k)-vcdo(i,k)) ptem2=etad(i,k-1)*(vo(i,k-1)-vcdo(i,k-1)) - dellav(i,k) = dellav(i,k) + + dellav(i,k) = dellav(i,k) + & (aup*(tem1-tem2)-adw*edto(i)*(ptem1-ptem2))*g/dp cj endif @@ -1511,9 +1554,9 @@ subroutine mfdeepcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, c c------- final changed variable per unit mass flux c -! if grid size is less than a threshold value (dxcrtas), +! if grid size is less than a threshold value (dxcrtas), ! the quasi-equilibrium assumption of Arakawa-Schubert is not -! used any longer. +! used any longer. ! do i = 1, im asqecflg(i) = cnvflg(i) @@ -1910,7 +1953,7 @@ subroutine mfdeepcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, c compute cloud base mass flux as a function of the mean c updraft velcoity for the grid sizes where c the quasi-equilibrium assumption of Arakawa-Schubert is not -c valid any longer. +c valid any longer. c do i= 1, im if(cnvflg(i) .and. .not.asqecflg(i)) then @@ -1923,7 +1966,7 @@ subroutine mfdeepcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, enddo c c compute cloud base mass flux using -c the quasi-equilibrium assumption of Arakawa-Schubert +c the quasi-equilibrium assumption of Arakawa-Schubert c do i= 1, im if(asqecflg(i)) then @@ -2172,7 +2215,7 @@ subroutine mfdeepcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, do i = 1, im if (cnvflg(i) .and. rn(i) > 0.) then if (k >= kbcon(i) .and. k < ktcon(i)) then - cnvc(i,k) = 0.04 * log(1. + 675. * eta(i,k) * xmb(i)) + cnvc(i,k) = 0.04 * log(1. + 675. * eta(i,k) * xmb(i)) cnvc(i,k) = min(cnvc(i,k), 0.6) cnvc(i,k) = max(cnvc(i,k), 0.0) endif @@ -2247,3 +2290,5 @@ subroutine mfdeepcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, !! return end +!> @} +!> @} diff --git a/physics/mfpbl.f b/physics/mfpbl.f index d534c1e23..b510f658b 100755 --- a/physics/mfpbl.f +++ b/physics/mfpbl.f @@ -1,7 +1,7 @@ !> \file mfpbl.f !! This file contains the subroutine that calculates the updraft properties and mass flux for use in the Hybrid EDMF PBL scheme. -!> \ingroup PBL +!> \ingroup HEDMF !! \brief This subroutine is used for calculating the mass flux and updraft properties. !! !! The mfpbl routines works as follows: if the PBL is convective, first, the ascending parcel entrainment rate is calculated as a function of height. Next, a surface parcel is initiated according to surface layer properties and the updraft buoyancy is calculated as a function of height. Next, using the buoyancy and entrainment values, the parcel vertical velocity is calculated using a well known steady-state budget equation. With the profile of updraft vertical velocity, the PBL height is recalculated as the height where the updraft vertical velocity returns to 0, and the entrainment profile is updated with the new PBL height. Finally, the mass flux profile is calculated using the updraft vertical velocity and assumed updraft fraction and the updraft properties are calculated using the updated entrainment profile, surface values, and environmental profiles. diff --git a/physics/mfshalcnv.f b/physics/mfshalcnv.f index 422d937aa..e0015973a 100755 --- a/physics/mfshalcnv.f +++ b/physics/mfshalcnv.f @@ -1,5 +1,23 @@ - subroutine mfshalcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, - & q1,t1,u1,v1,rn,kbot,ktop,kcnv,islimsk,garea, +!> \file mfshalcnv.f +!! This file contains the Scale-Aware mass flux Shallow Convection scheme. + +!> \defgroup SASHAL Scale-Aware Mass Flux Shallow Convection +!! @{ +!! \brief Brief description of the parameterization +!! \section diagram Calling Hierarchy Diagram +!! \section intraphysics Intraphysics Communication + +!> \brief Brief description of the subroutine +!! +!! | 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 | +!! +!! \section general General Algorithm +!! \section detailed Detailed Algorithm +!! @{ + subroutine mfshalcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, & + & q1,t1,u1,v1,rn,kbot,ktop,kcnv,islimsk,garea, & & dot,ncloud,hpbl,ud_mf,dt_mf,cnvw,cnvc) ! & dot,ncloud,hpbl,ud_mf,dt_mf,cnvw,cnvc,me) ! @@ -11,20 +29,18 @@ subroutine mfshalcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, &, eps => con_eps, epsm1 => con_epsm1 implicit none ! - integer im, ix, km, ncloud, - & kbot(im), ktop(im), kcnv(im) + integer im, ix, km, ncloud, & + & kbot(im), ktop(im), kcnv(im) ! &, me real(kind=kind_phys) delt real(kind=kind_phys) psp(im), delp(ix,km), prslp(ix,km) - real(kind=kind_phys) ps(im), del(ix,km), prsl(ix,km), - & ql(ix,km,2),q1(ix,km), t1(ix,km), - & u1(ix,km), v1(ix,km), -! & u1(ix,km), v1(ix,km), rcs(im), - & rn(im), garea(im), - & dot(ix,km), phil(ix,km), hpbl(im), - & cnvw(ix,km),cnvc(ix,km) -! hchuang code change mass flux output - &, ud_mf(im,km),dt_mf(im,km) + real(kind=kind_phys) ps(im), del(ix,km), prsl(ix,km), & + & ql(ix,km,2),q1(ix,km), t1(ix,km), & + & u1(ix,km), v1(ix,km), & !rcs(im), + & rn(im), garea(im), & + & dot(ix,km), phil(ix,km), hpbl(im), & + & cnvw(ix,km),cnvc(ix,km) & + &, ud_mf(im,km),dt_mf(im,km) & ! hchuang code change mass flux output ! integer i,j,indx, k, kk, km1, n integer kpbl(im) @@ -50,7 +66,7 @@ subroutine mfshalcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, & w1, w1l, w1s, w2, & w2l, w2s, w3, w3l, & w3s, w4, w4l, w4s, - & rho, tem, tem1, tem2, + & rho, tem, tem1, tem2, & ptem, ptem1, & pgcon ! @@ -58,7 +74,7 @@ subroutine mfshalcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, & ktcon(im), ktcon1(im), ktconn(im), & kbm(im), kmax(im) ! - real(kind=kind_phys) aa1(im), cina(im), + real(kind=kind_phys) aa1(im), cina(im), & umean(im), tauadv(im), gdx(im), & delhbar(im), delq(im), delq2(im), & delqbar(im), delqev(im), deltbar(im), @@ -116,7 +132,7 @@ subroutine mfshalcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, ! real(kind=kind_phys) qlko_ktcon(im), dellal(im,km), tvo(im,km), real(kind=kind_phys) qlko_ktcon(im), dellal(im,km), & dbyo(im,km), zo(im,km), xlamue(im,km), - & heo(im,km), heso(im,km), + & heo(im,km), heso(im,km), & dellah(im,km), dellaq(im,km), & dellau(im,km), dellav(im,km), hcko(im,km), & ucko(im,km), vcko(im,km), qcko(im,km), @@ -214,9 +230,9 @@ subroutine mfshalcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, ! ! pgcon = 0.7 ! Gregory et al. (1997, QJRMS) pgcon = 0.55 ! Zhang & Wu (2003,JAS) - w1l = -8.e-3 + w1l = -8.e-3 w2l = -4.e-2 - w3l = -5.e-3 + w3l = -5.e-3 w4l = -5.e-4 w1s = -2.e-4 w2s = -2.e-3 @@ -231,7 +247,7 @@ subroutine mfshalcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, kmax(i) = km tx1(i) = 1.0 / ps(i) enddo -! +! do k = 1, km do i=1,im if (prsl(i,k)*tx1(i) > 0.70) kbm(i) = k + 1 @@ -653,7 +669,7 @@ subroutine mfshalcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, else tem = 0. endif - + val1 = -1. tem = max(tem,val1) val2 = 1. @@ -1437,3 +1453,5 @@ subroutine mfshalcnv(im,ix,km,delt,delp,prslp,psp,phil,ql, !! return end +!> @} +!> @} diff --git a/physics/moninedmf.f b/physics/moninedmf.f index bab282641..70448fc68 100755 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -2,7 +2,7 @@ !! Contains most of the hybrid eddy-diffusivity mass-flux scheme except for the !! subroutine that calculates the mass flux and updraft properties. -!> \defgroup PBL Hybrid Eddy-diffusivity Mass-flux Scheme +!> \defgroup HEDMF Hybrid Eddy-diffusivity Mass-flux PBL and Free Atmospheric Turbulence !! @{ !! \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. !! @@ -150,7 +150,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), & @@ -1188,11 +1188,11 @@ subroutine moninedmf(ix,im,km,ntrac,ntcw,dv,du,tau,rtg, & !> @} c----------------------------------------------------------------------- -!> \ingroup PBL +!> \ingroup HEDMF !! \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 @@ -1231,7 +1231,7 @@ subroutine tridi2(l,n,cl,cm,cu,r1,r2,au,a1,a2) return end c----------------------------------------------------------------------- -!> \ingroup PBL +!> \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. diff --git a/physics/ozphys.f b/physics/ozphys.f index 09530f742..9feea761a 100644 --- a/physics/ozphys.f +++ b/physics/ozphys.f @@ -1,8 +1,8 @@ !> \file ozphys.f !! This file is ozone sources and sinks. -!> \defgroup ozn Ozone Sources and Sinks -!! The operational GFS currently parameterizes ozone production and +!> \defgroup GFS_ozn GFS Ozone Sources and Sinks +!! The operational GFS currently parameterizes ozone production and !! destruction based on monthly mean coefficients provided by Naval !! Research Laboratory through CHEM2D chemistry model !! (McCormack et al. 2006 \cite mccormack_et_al_2006). @@ -12,11 +12,11 @@ !! Original version of these terms were provided by NASA/DAO based on !! NASA 2D Chemistry model - GSM is capable of running both versions !! -!! \section intra_oz Intraphysics Cummunication +!! \section intra_oz Intraphysics Communication !! - Routine OZPHYS is called from GBPHYS after call to RAYLEIGH_DAMP !! @{ -!! -!! \param[in] ix,im integer, horizontal dimension and num of used pts + +!> \param[in] ix,im integer, horizontal dimension and num of used pts !! \param[in] levs integer, vertical layer dimension !! \param[in] ko3 integer, number of layers for ozone data !! \param[in] dt real, physics time step in seconds @@ -27,9 +27,9 @@ !! (ln(Pa)) !! \param[in] prsl real, (ix,levs),mean layer pressure !! \param[in] prdout real, (ix,ko3,pl_coeff),ozone forcing data -!! \param[in] pl_coeff integer, number coefficients in ozone forcing +!! \param[in] pl_coeff integer, number coefficients in ozone forcing !! \param[in] delp real, (ix,levs) -!! \param[in] ldiag3d logical, flag for 3d diagnostic fields +!! \param[in] ldiag3d logical, flag for 3d diagnostic fields !! \param[out] ozp real, ozone change due to physics !! \param[in] me integer, pe number - used for debug prints !! \section gen_al General Algorithm @@ -47,9 +47,9 @@ subroutine ozphys (ix, im, levs, ko3, dt, ozi, ozo, tin, po3, & ! real, parameter :: gravi=1.0/grav integer im, ix, levs, ko3, pl_coeff,me - real(kind=kind_phys) ozi(ix,levs), ozo(ix,levs), po3(ko3), - & prsl(ix,levs), tin(ix,levs), delp(ix,levs), - & prdout(ix,ko3,pl_coeff), + real(kind=kind_phys) ozi(ix,levs), ozo(ix,levs), po3(ko3), & + & prsl(ix,levs), tin(ix,levs), delp(ix,levs), & + & prdout(ix,ko3,pl_coeff), & & ozp(ix,levs,pl_coeff), dt ! integer k,kmax,kmin,l,i,j @@ -114,7 +114,7 @@ subroutine ozphys (ix, im, levs, ko3, dt, ozi, ozo, tin, po3, & endif enddo enddo - if (pl_coeff == 2) then + if (pl_coeff == 2) then do i=1,im ozib(i) = ozi(i,l) ! no filling ozo(i,l) = (ozib(i) + prod(i,1)*dt) / (1.0 + prod(i,2)*dt) @@ -127,7 +127,7 @@ subroutine ozphys (ix, im, levs, ko3, dt, ozi, ozo, tin, po3, & enddo endif endif - if (pl_coeff == 4) then + if (pl_coeff == 4) then do i=1,im ozib(i) = ozi(i,l) ! no filling tem = prod(i,1) + prod(i,3)*tin(i,l) diff --git a/physics/physcons.f90 b/physics/physcons.f90 index 6148208be..a0f5dcd63 100644 --- a/physics/physcons.f90 +++ b/physics/physcons.f90 @@ -27,9 +27,9 @@ !!!!! end descriptions !!!!! !!!!! ========================================================== !!!!! -!> \ingroup rad +!> \ingroup RRTMG !! \defgroup physcons physcons -!! This module contains some of the most frequently used math and physics +!! This module contains some of the most frequently used math and physics !! constants for GCM models. !! @{ !========================================! @@ -45,65 +45,65 @@ module physcons ! !> \name Math constants !> pi - real(kind=kind_phys),parameter:: con_pi =3.1415926535897931 + real(kind=kind_phys),parameter:: con_pi =3.1415926535897931 !> square root of 2 - real(kind=kind_phys),parameter:: con_sqrt2 =1.414214e+0 + real(kind=kind_phys),parameter:: con_sqrt2 =1.414214e+0 !> square root of 3 - real(kind=kind_phys),parameter:: con_sqrt3 =1.732051e+0 + real(kind=kind_phys),parameter:: con_sqrt3 =1.732051e+0 !> \name Geophysics/Astronomy constants !> radius of earth (m) - real(kind=kind_phys),parameter:: con_rerth =6.3712e+6 + real(kind=kind_phys),parameter:: con_rerth =6.3712e+6 !> gravity (\f$m/s^{2}\f$) - real(kind=kind_phys),parameter:: con_g =9.80665e+0 + real(kind=kind_phys),parameter:: con_g =9.80665e+0 !> ang vel of earth (\f$s^{-1}\f$) - real(kind=kind_phys),parameter:: con_omega =7.2921e-5 + real(kind=kind_phys),parameter:: con_omega =7.2921e-5 !> std atms pressure (pa) - real(kind=kind_phys),parameter:: con_p0 =1.01325e5 + real(kind=kind_phys),parameter:: con_p0 =1.01325e5 ! real(kind=kind_phys),parameter:: con_solr =1.36822e+3 ! solar constant (W/m2)-aer(2001) !> solar constant (\f$W/m^{2}\f$)-liu(2002) - real(kind=kind_phys),parameter:: con_solr_old =1.3660e+3 + real(kind=kind_phys),parameter:: con_solr_old =1.3660e+3 !> solar constant (\f$W/m^{2}\f$)-nasa-sorce Tim(2008) - real(kind=kind_phys),parameter:: con_solr =1.3608e+3 + real(kind=kind_phys),parameter:: con_solr =1.3608e+3 ! real(kind=kind_phys),parameter:: con_solr =1.36742732e+3 ! solar constant (W/m2)-gfdl(1989) - OPR as of Jan 2006 !> \name Thermodynamics constants !> molar gas constant (\f$J/mol/K\f$) - real(kind=kind_phys),parameter:: con_rgas =8.314472 + real(kind=kind_phys),parameter:: con_rgas =8.314472 !> gas constant air (\f$J/kg/K\f$) - real(kind=kind_phys),parameter:: con_rd =2.8705e+2 + real(kind=kind_phys),parameter:: con_rd =2.8705e+2 !> gas constant H2O (\f$J/kg/K\f$) - real(kind=kind_phys),parameter:: con_rv =4.6150e+2 + real(kind=kind_phys),parameter:: con_rv =4.6150e+2 !> spec heat air at p (\f$J/kg/K\f$) - real(kind=kind_phys),parameter:: con_cp =1.0046e+3 + real(kind=kind_phys),parameter:: con_cp =1.0046e+3 !> spec heat air at v (\f$J/kg/K\f$) - real(kind=kind_phys),parameter:: con_cv =7.1760e+2 + real(kind=kind_phys),parameter:: con_cv =7.1760e+2 !> spec heat H2O gas (\f$J/kg/K\f$) - real(kind=kind_phys),parameter:: con_cvap =1.8460e+3 + real(kind=kind_phys),parameter:: con_cvap =1.8460e+3 !> spec heat H2O liq (\f$J/kg/K\f$) - real(kind=kind_phys),parameter:: con_cliq =4.1855e+3 + real(kind=kind_phys),parameter:: con_cliq =4.1855e+3 !> spec heat H2O ice (\f$J/kg/K\f$) - real(kind=kind_phys),parameter:: con_csol =2.1060e+3 + real(kind=kind_phys),parameter:: con_csol =2.1060e+3 !> lat heat H2O cond (\f$J/kg\f$) - real(kind=kind_phys),parameter:: con_hvap =2.5000e+6 + real(kind=kind_phys),parameter:: con_hvap =2.5000e+6 !> lat heat H2O fusion (\f$J/kg\f$) - real(kind=kind_phys),parameter:: con_hfus =3.3358e+5 + real(kind=kind_phys),parameter:: con_hfus =3.3358e+5 !> pres at H2O 3pt (Pa) - real(kind=kind_phys),parameter:: con_psat =6.1078e+2 + real(kind=kind_phys),parameter:: con_psat =6.1078e+2 !> temp at 0C (K) - real(kind=kind_phys),parameter:: con_t0c =2.7315e+2 + real(kind=kind_phys),parameter:: con_t0c =2.7315e+2 !> temp at H2O 3pt (K) - real(kind=kind_phys),parameter:: con_ttp =2.7316e+2 + real(kind=kind_phys),parameter:: con_ttp =2.7316e+2 !> temp freezing sea (K) - real(kind=kind_phys),parameter:: con_tice =2.7120e+2 + real(kind=kind_phys),parameter:: con_tice =2.7120e+2 !> joules per calorie - real(kind=kind_phys),parameter:: con_jcal =4.1855E+0 + real(kind=kind_phys),parameter:: con_jcal =4.1855E+0 !> sea water reference density (\f$kg/m^{3}\f$) - real(kind=kind_phys),parameter:: con_rhw0 =1022.0 + real(kind=kind_phys),parameter:: con_rhw0 =1022.0 !> min q for computing precip type - real(kind=kind_phys),parameter:: con_epsq =1.0E-12 + real(kind=kind_phys),parameter:: con_epsq =1.0E-12 !> \name Secondary constants @@ -120,35 +120,35 @@ module physcons ! !> \name Other Physics/Chemistry constants (source: 2002 CODATA) !> speed of light (\f$m/s\f$) - real(kind=kind_phys),parameter:: con_c =2.99792458e+8 + real(kind=kind_phys),parameter:: con_c =2.99792458e+8 !> planck constant (\f$J/s\f$) - real(kind=kind_phys),parameter:: con_plnk =6.6260693e-34 + real(kind=kind_phys),parameter:: con_plnk =6.6260693e-34 !> boltzmann constant (\f$J/K\f$) - real(kind=kind_phys),parameter:: con_boltz =1.3806505e-23 + real(kind=kind_phys),parameter:: con_boltz =1.3806505e-23 !> stefan-boltzmann (\f$W/m^{2}/K^{4}\f$) - real(kind=kind_phys),parameter:: con_sbc =5.670400e-8 + real(kind=kind_phys),parameter:: con_sbc =5.670400e-8 !> avogadro constant (\f$mol^{-1}\f$) - real(kind=kind_phys),parameter:: con_avgd =6.0221415e23 + real(kind=kind_phys),parameter:: con_avgd =6.0221415e23 !> vol of ideal gas at 273.15K, 101.325kPa (\f$m^{3}/mol\f$) - real(kind=kind_phys),parameter:: con_gasv =22413.996e-6 + real(kind=kind_phys),parameter:: con_gasv =22413.996e-6 ! real(kind=kind_phys),parameter:: con_amd =28.970 ! molecular wght of dry air (g/mol) !> molecular wght of dry air (\f$g/mol\f$) - real(kind=kind_phys),parameter:: con_amd =28.9644 + real(kind=kind_phys),parameter:: con_amd =28.9644 !> molecular wght of water vapor (\f$g/mol\f$) - real(kind=kind_phys),parameter:: con_amw =18.0154 + real(kind=kind_phys),parameter:: con_amw =18.0154 !> molecular wght of o3 (\f$g/mol\f$) - real(kind=kind_phys),parameter:: con_amo3 =47.9982 + real(kind=kind_phys),parameter:: con_amo3 =47.9982 ! real(kind=kind_phys),parameter:: con_amo3 =48.0 ! molecular wght of o3 (g/mol) !> molecular wght of co2 (\f$g/mol\f$) - real(kind=kind_phys),parameter:: con_amco2 =44.011 + real(kind=kind_phys),parameter:: con_amco2 =44.011 !> molecular wght of o2 (\f$g/mol\f$) - real(kind=kind_phys),parameter:: con_amo2 =31.9999 + real(kind=kind_phys),parameter:: con_amo2 =31.9999 !> molecular wght of ch4 (\f$g/mol\f$) - real(kind=kind_phys),parameter:: con_amch4 =16.043 + real(kind=kind_phys),parameter:: con_amch4 =16.043 !> molecular wght of n2o (\f$g/mol\f$) - real(kind=kind_phys),parameter:: con_amn2o =44.013 + real(kind=kind_phys),parameter:: con_amn2o =44.013 !> temperature the H.G.Nuc. ice starts - real(kind=kind_phys), parameter:: con_thgni =-38.15 + real(kind=kind_phys), parameter:: con_thgni =-38.15 !> \name Miscellaneous physics related constants (Moorthi - Jul 2014) diff --git a/physics/physparam.f b/physics/physparam.f index 0bcf182c9..e967186b7 100755 --- a/physics/physparam.f +++ b/physics/physparam.f @@ -19,18 +19,18 @@ ! ! !!!!! ========================================================== !!!!! -!> \ingroup rad +!> \ingroup RRTMG !> \defgroup physparam physparam !! @{ !> This module defines commonly used control variables and parameters -!! in physics related programs. +!! in physics related programs. !! !! Those variables are grouped together in accordance with functionaity -!! and are given brief descriptions and value specifications. There are +!! and are given brief descriptions and value specifications. There are !! two types of attributes (parameters vs. save) designated for the -!! control variables. Those with a "parameter" attribute are prescribed +!! control variables. Those with a "parameter" attribute are prescribed !! with a preferred option value, while the ones with a "save" attribute -!! are given a default value but could be changed at the model's +!! are given a default value but could be changed at the model's !! execution-time (usually through an input of name-list file or through !! run scripts). !========================================! @@ -61,76 +61,76 @@ module physparam ! !================================================================================== ! ............................................. ! -!> \name -1.1- Control flags for SW radiation +!> \name -1.1- Control flags for SW radiation ! ............................................. ! !> SW heating rate unit control flag: =1:k/day; =2:k/second. - integer,parameter :: iswrate = 2 - + integer,parameter :: iswrate = 2 + !> SW minor gases effect control flag (CH4 and O2): =0:no; =1:yes. !!\n =0: minor gases' effects are not included in calculations !!\n =1: minor gases' effects are included in calculations integer,parameter :: iswrgas = 1 - + !> SW optical property for liquid clouds !!\n =0:input cld opt depth, ignoring iswcice setting -!!\n =1:cloud optical property scheme based on Hu and Stamnes(1993) \cite +!!\n =1:cloud optical property scheme based on Hu and Stamnes(1993) \cite !! hu_and_stamnes_1993 method - integer,save :: iswcliq = 1 - + integer,save :: iswcliq = 1 + !> SW optical property for ice clouds (only iswcliq>0) -!!\n =1:optical property scheme based on Ebert and Curry (1992) +!!\n =1:optical property scheme based on Ebert and Curry (1992) !! \cite ebert_and_curry_1992 method -!!\n =2:optical property scheme based on Streamer v3.0 +!!\n =2:optical property scheme based on Streamer v3.0 !! \cite key_2002 method -!!\n =3:optical property scheme based on Fu's method (1996) +!!\n =3:optical property scheme based on Fu's method (1996) !! \cite fu_1996 method - integer,save :: iswcice = 3 - + integer,save :: iswcice = 3 + !> SW control flag for scattering process approximation -!!\n =1:two-stream delta-eddington (Joseph et al. 1976 +!!\n =1:two-stream delta-eddington (Joseph et al. 1976 !! \cite joseph_et_al_1976) -!!\n =2:two-stream PIFM (Zdunkowski et al. 1980 +!!\n =2:two-stream PIFM (Zdunkowski et al. 1980 !! \cite zdunkowski_et_al_1980) -!!\n =3:discrete ordinates (Liou, 1973 +!!\n =3:discrete ordinates (Liou, 1973 !! \cite liou_1973) - integer,parameter :: iswmode = 2 + integer,parameter :: iswmode = 2 ! ............................................. ! -!> \name -1.2- Control flags for LW radiation +!> \name -1.2- Control flags for LW radiation ! ............................................. ! !> LW heating rate unit: =1:k/day; =2:k/second. - integer,parameter :: ilwrate = 2 + integer,parameter :: ilwrate = 2 !> LW minor gases effect control flag (CH4,N2O,O2,and some CFCs): !!\n =0: minor gases' effects are not included in calculations !!\n =1: minor gases' effects are included in calculations - integer,parameter :: ilwrgas = 1 + integer,parameter :: ilwrgas = 1 !> LW optical property scheme for liquid clouds !!\n =0:input cloud optical properties directly, not computed within -!!\n =1:input cwp,rew, use Hu and Stamnes(1993) +!!\n =1:input cwp,rew, use Hu and Stamnes(1993) !! \cite hu_and_stamnes_1993 method - integer,save :: ilwcliq = 1 + integer,save :: ilwcliq = 1 !> LW optical property scheme for ice clouds (only ilwcliq>0) -!!\n =1:optical property scheme based on Ebert and Curry (1992) +!!\n =1:optical property scheme based on Ebert and Curry (1992) !! \cite ebert_and_curry_1992 method -!!\n =2:optical property scheme based on Streamer v3 +!!\n =2:optical property scheme based on Streamer v3 !! \cite key_2002 method -!!\n =3:optical property scheme use Fu's method (1998) +!!\n =3:optical property scheme use Fu's method (1998) !! \cite fu_et_al_1998 method - integer,save :: ilwcice = 3 + integer,save :: ilwcice = 3 ! ............................................. ! -!>\name -1.3- Control flag for LW aerosol property +!>\name -1.3- Control flag for LW aerosol property !> selects 1 band or multi bands for LW aerosol properties !!\n =.true.:aerosol properties calculated in 1 broad LW band !!\n =.false.:aerosol properties calculated in all LW bands !!\n variable names diff in Opr CFS - logical,parameter :: lalw1bd =.false. + logical,parameter :: lalw1bd =.false. !================================================================================== ! Section - 2 - @@ -139,7 +139,7 @@ module physparam ! !================================================================================== ! ............................................. ! -!>\name -2.1- For module radiation_astronomy +!>\name -2.1- For module radiation_astronomy ! ............................................. ! !> solar constant scheme control flag @@ -150,15 +150,15 @@ module physparam ! !!\n =3:CMIP5 TIM-scale TSI table (yearly) w 11-yr cycle approx !!\n =4:CMIP5 TIM-scale TSI table (monthly) w 11-yr cycle approx !!\n see ISOL in run scripts: Opr GFS=2; Opr CFS=1 - integer, save :: isolar = 0 + integer, save :: isolar = 0 !> external solar constant data table,solarconstant_noaa_a0.txt - character, save :: solar_file*26 + character, save :: solar_file*26 ! data solar_file / 'solarconstantdata.txt ' / data solar_file / 'solarconstant_noaa_a0.txt ' / ! ............................................. ! -!> \name -2.2- For module radiation_aerosols +!> \name -2.2- For module radiation_aerosols ! ............................................. ! !> aerosol model scheme control flag @@ -166,7 +166,7 @@ module physparam ! !!\n =1:monthly global distributed GOCART aerosol climatology !!\n =2: GOCART prognostic aerosol model !!\n Opr GFS=0; Opr CFS=n/a - integer, save :: iaermdl = 0 + integer, save :: iaermdl = 0 !> aerosol effect control flag !!\n 3-digit flag 'abc': !!\n a-stratospheric volcanic aerols @@ -174,27 +174,27 @@ module physparam ! !!\n c-tropospheric aerosols for SW !!\n =0:aerosol effect is not included; =1:aerosol effect is included !!\n Opr GFS/CFS =111; see IAER in run scripts - integer, save :: iaerflg = 0 + integer, save :: iaerflg = 0 !> LW aerosols effect control flag !!\n =.true.:aerosol effect is included in LW radiation !!\n =.false.:aerosol effect is not included in LW radiation - logical, save :: lalwflg = .true. + logical, save :: lalwflg = .true. !> SW aerosols effect control flag !!\n =.true.:aerosol effect is included in SW radiation !!\n =.false.:aerosol effect is not included in SW radiation - logical, save :: laswflg = .true. + logical, save :: laswflg = .true. !> stratospheric volcanic aerosol effect flag !!\n =.true.:historical events of stratosphere volcanic aerosol effect !! is included radiation (limited by data availability) !!\n =.false.:volcanic aerosol effect is not included in radiation - logical, save :: lavoflg = .true. + logical, save :: lavoflg = .true. !> external aerosols data file: aerosol.dat - character, save :: aeros_file*26 + character, save :: aeros_file*26 ! data aeros_file / 'climaeropac_global.txt ' / data aeros_file / 'aerosol.dat ' / ! ............................................. ! -!> \name -2.3- For module radiation_gases +!> \name -2.3- For module radiation_gases ! ............................................. ! !> co2 data source control flag @@ -202,8 +202,8 @@ module physparam ! !!\n =1:yearly global averaged annual mean from observations !!\n =2:monthly 15 degree horizontal resolution from observations !!\n Opr GFS/CFS=2; see ICO2 in run scripts - integer, save :: ico2flg = 0 -!> controls external data at initial time and data usage during + integer, save :: ico2flg = 0 +!> controls external data at initial time and data usage during !! forecast time !!\n =-2:as in 0,but superimpose with seasonal climatology cycle !!\n =-1:use user data,no extrapolation in overtime @@ -212,18 +212,18 @@ module physparam ! !!\n =yyyy0:use yyyy year of data, no extrapolation !!\n =yyyy1:use yyyy year of data, extrapolate when necessary !!\n Opr GFS/CFS=1; see ICTM in run scripts - integer, save :: ictmflg = 0 + integer, save :: ictmflg = 0 !> ozone data source control flag !!\n =0:use seasonal climatology ozone data -!!\n >0:use prognostic ozone scheme (also depend on other model control +!!\n >0:use prognostic ozone scheme (also depend on other model control !! variable at initial time) - integer, save :: ioznflg = 1 + integer, save :: ioznflg = 1 !> external co2 2d monthly obsv data table: co2historicaldata_2004.txt - character, save :: co2dat_file*26 + character, save :: co2dat_file*26 !> external co2 global annual mean data tb: co2historicaldata_glob.txt - character, save :: co2gbl_file*26 -!> external co2 user defined data table: co2userdata.txt - character, save :: co2usr_file*26 + character, save :: co2gbl_file*26 +!> external co2 user defined data table: co2userdata.txt + character, save :: co2usr_file*26 !> external co2 clim monthly cycle data tb: co2monthlycyc.txt character, save :: co2cyc_file*26 data co2dat_file / 'co2historicaldata_2004.txt' / !year is run-time selected @@ -232,75 +232,75 @@ module physparam ! data co2cyc_file / 'co2monthlycyc.txt ' / ! ............................................. ! -!>\name -2.4- For module radiation_clouds +!>\name -2.4- For module radiation_clouds ! ............................................. ! !> cloud optical property scheme control flag !!\n =0:use diagnostic cloud scheme for cloud cover and mean optical properties !!\n =1:use prognostic cloud scheme for cloud cover and cloud properties - integer, save :: icldflg = 1 + integer, save :: icldflg = 1 !> cloud micorphysics scheme control flag !!\n =1:modified Zhao/Carr/Sundqvist scheme (Moorthi, 2001) !!\n =2:Ferrier microphysics scheme (Ferrier et al. 2002) !!\n =3:as in 1 but with pdf method defined cloud cover - integer, save :: icmphys = 1 + integer, save :: icmphys = 1 !> cloud overlapping control flag for SW !!\n =0:use random cloud overlapping method !!\n =1:use maximum-random cloud overlapping method !!\n Opr GFS/CFS=1; see IOVR_SW in run scripts - integer, save :: iovrsw = 1 + integer, save :: iovrsw = 1 !> cloud overlapping control flag for LW !!\n =0:use random cloud overlapping method !!\n =1:use maximum-random cloud overlapping method !!\n Opr GFS/CFS=1; see IOVR_LW in run scripts - integer, save :: iovrlw = 1 + integer, save :: iovrlw = 1 !> eliminating CRICK control flag - logical, save :: lcrick =.false. + logical, save :: lcrick =.false. !> in-cld condensate control flag logical, save :: lcnorm =.false. !> precip effect on radiation flag (Ferrier microphysics) - logical, save :: lnoprec =.false. + logical, save :: lnoprec =.false. !> shallow convetion flag - logical, save :: lsashal =.false. + logical, save :: lsashal =.false. ! ............................................. ! -!>\name -2.5- For module radiation_surface +!>\name -2.5- For module radiation_surface ! ............................................. ! !> surface albedo scheme control flag !!\n =0:vegetation type based climatological albedo scheme !!\n =1:seasonal albedo derived from MODIS measurements - integer, save :: ialbflg = 0 + integer, save :: ialbflg = 0 !> surface emissivity scheme control flag !!\n =0:black-body surface emissivity(=1.0) !!\n =1:vegetation type based climatology emissivity(<1.0) !!\n Opr GFS/CFS=1; see IEMS in run scripts - integer, save :: iemsflg = 0 + integer, save :: iemsflg = 0 !> external sfc emissivity data table: sfc_emissivity_idx.txt - character, save :: semis_file*26 + character, save :: semis_file*26 data semis_file / 'sfc_emissivity_idx.txt ' / ! ............................................. ! -!> \name -2.6- general purpose +!> \name -2.6- general purpose ! ............................................. ! !> vertical profile indexing flag - integer, save :: ivflip = 1 + integer, save :: ivflip = 1 !> sub-column cloud approx flag in SW radiation !!\n =0:no McICA approximation in SW radiation !!\n =1:use McICA with precribed permutation seeds (test mode) !!\n =2:use McICA with randomly generated permutation seeds !!\n Opr GFS/CFS=2; see ISUBC_SW in run scripts - integer, save :: isubcsw = 0 + integer, save :: isubcsw = 0 !> sub-column cloud approx flag in LW radiation !!\n =0:no McICA approximation in LW radiation !!\n =1:use McICA with prescribed permutation seeds (test mode) !!\n =2:use McICA with randomly generatedo !!\n Opr GFS/CFS=2; see ISUBC_LW in run scripts - integer, save :: isubclw = 0 + integer, save :: isubclw = 0 !> initial permutaion seed for mcica radiation - integer, save :: ipsd0 = 0 + integer, save :: ipsd0 = 0 integer, save :: ipsdlim = 1e8 ! !...................................! diff --git a/physics/precpd.f b/physics/precpd.f index 9c4ac6949..2d65a7cc2 100644 --- a/physics/precpd.f +++ b/physics/precpd.f @@ -1,26 +1,26 @@ !> \file precpd.f -!! This file contains the subroutine that calculates precipitation +!! This file contains the subroutine that calculates precipitation !! processes from suspended cloud water/ice -!> \ingroup MPscheme +!> \ingroup Zhao-Carr !> \defgroup precip Precipitation (snow or rain) Production !! This subroutine computes the conversion from condensation to !! precipitation (snow or rain) or evaporation of rain. !! !> The parameterization of precipitation is required in order to remove -!! water from the atmosphere and transport it to the ground. In the +!! water from the atmosphere and transport it to the ground. In the !! scheme discussed here, simplifications in the precipitation -!! parameterization are used due to computational limitations required +!! parameterization are used due to computational limitations required !! by operational NWP models. First, consideration of particle size and -!! shape can be avoided by using the bulk parameterization method +!! shape can be avoided by using the bulk parameterization method !! introduced by Kessler (1969) \cite kessler_1969. Second, only two -!! types of precipitation, rain and snow, are considered in this +!! types of precipitation, rain and snow, are considered in this !! scheme. Third, only the most important microphysical processes -!! associated with the formation of rain and snow are included. -!! Figure 2 presents the microphysical processes considered in the -!! precipitation parameterization. +!! associated with the formation of rain and snow are included. +!! Figure 2 presents the microphysical processes considered in the +!! precipitation parameterization. !! \image html precpd-micop.png "Figure 2: Microphysical processes simulated in the precipitation scheme " width=5cm -!! Basically, there are four types of microphysical processes +!! Basically, there are four types of microphysical processes !! considered here: !! - production of rain from cloud water !! (\f$P_{racw}\f$, \f$P_{raut}\f$, \f$P_{sacw}\f$) @@ -30,21 +30,21 @@ !! (\f$P_{sm1}\f$, \f$P_{sm2}\f$) !! - the evaporation of precipitation !! (\f$E_{rr}\f$, \f$E_{rs}\f$) -!! -!! The following two equations can be used to calculate the +!! +!! The following two equations can be used to calculate the !! precipitation rates of rain and snow at each module level: !!\f[ -!! P_{r}(\eta)=\frac{p_{s}-p_{t}}{g\eta_{s}}\int_{\eta}^{\eta_{t}}(P_{raut}+P_{racw}+P_{sacw}+P_{sm1}+P_{sm2}-E_{rr})d\eta +!! P_{r}(\eta)=\frac{p_{s}-p_{t}}{g\eta_{s}}\int_{\eta}^{\eta_{t}}(P_{raut}+P_{racw}+P_{sacw}+P_{sm1}+P_{sm2}-E_{rr})d\eta !!\f] !! and !!\f[ -!! P_{s}(\eta)=\frac{p_{s}-p_{t}}{g\eta_{s}}\int_{\eta}^{\eta_{t}}(P_{saut}+P_{saci}-P_{sm1}-P_{sm2}-E_{rs})d\eta +!! P_{s}(\eta)=\frac{p_{s}-p_{t}}{g\eta_{s}}\int_{\eta}^{\eta_{t}}(P_{saut}+P_{saci}-P_{sm1}-P_{sm2}-E_{rs})d\eta !!\f] -!! where \f$p_{s}\f$ and\f$p_{t}\f$ are the surface pressure and the -!! pressure at the top of model domain, respectively, and \f$g\f$ is -!! gravity. The implementation of the precipitation scheme also -!! includes a simplified procedure of computing \f$P_{r}\f$ -!! and \f$P_{s}\f$ (Zhao and Carr(1997) \cite zhao_and_carr_1997). +!! where \f$p_{s}\f$ and\f$p_{t}\f$ are the surface pressure and the +!! pressure at the top of model domain, respectively, and \f$g\f$ is +!! gravity. The implementation of the precipitation scheme also +!! includes a simplified procedure of computing \f$P_{r}\f$ +!! and \f$P_{s}\f$ (Zhao and Carr(1997) \cite zhao_and_carr_1997). !! @{ !> \param[in] im horizontal number of used pts @@ -59,7 +59,7 @@ !! \param[out] rn precipitation over one time-step dt (m/dt) !! \param[out] sr "snow ratio", ratio of snow to total precipitation !! \param[out] rainp rainwater path -!! \param[in] u00k the critical value of relative humidity for +!! \param[in] u00k the critical value of relative humidity for !! large-scale condensation !! \param[in] psautco auto conversion coeff from ice to snow !! \n = 4.0E-4; defined in module_MP_GFS.F90 @@ -67,7 +67,7 @@ !! \n = 1.0E-4; defined in module_MP_GFS.F90 !! \param[in] evpco coeff for evaporation of largescale rain !! \n = 2.0E-5; defined in module_MP_GFS.F90 -!! \param[in] wminco coeff for water and ice minimum threshold to +!! \param[in] wminco coeff for water and ice minimum threshold to !! conversion from condensate to precipitation !! \n = \1.0E-5, 1.0E-5\; defined in module_MP_GFS.F90 !! \param[in] lprnt logical print flag @@ -87,7 +87,7 @@ subroutine precpd (im,ix,km,dt,del,prsl,q,cwm,t,rn,sr & ! ****************************************************************** ! * * ! * originally created by q. zhao jan. 1995 * -! * ------- * +! * ------- * ! * modified and rewritten by shrinivas moorthi oct. 1998 * ! * ----------------- * ! * and hua-lu pan * @@ -332,7 +332,7 @@ subroutine precpd (im,ix,km,dt,del,prsl,q,cwm,t,rn,sr & ! rq(n) = max(1.0e-10, rq(n)) ! -- relative humidity--- ! ! the global qsat computation is done in pa - pres1 = pres(n) + pres1 = pres(n) ! qw = es(n) qw = min(pres1, fpvs(tt(n))) qw = eps * qw / (pres1 + epsm1 * qw) @@ -353,7 +353,7 @@ subroutine precpd (im,ix,km,dt,del,prsl,q,cwm,t,rn,sr & ! if (tmt0(n).le.-40.) qint = qi ! !-------------------ice-water id number iw------------------------------ -!> -# Compute ice-water identification number IW (see algorithm in +!> -# Compute ice-water identification number IW (see algorithm in !! \ref condense). if(tmt0(n) < -15.) then fi = qk - u00k(i,k)*qi @@ -414,9 +414,9 @@ subroutine precpd (im,ix,km,dt,del,prsl,q,cwm,t,rn,sr & !!\f[ !! P_{saut}=a_{1}(cwm-wmini) !!\f] -!! Since snow production in this process is caused by the increase in -!! size of cloud ice particles due to depositional growth and -!! aggregation of small ice particles, \f$P_{saut}\f$ is a function of +!! Since snow production in this process is caused by the increase in +!! size of cloud ice particles due to depositional growth and +!! aggregation of small ice particles, \f$P_{saut}\f$ is a function of !! temperature as determined by coefficient \f$a_{1}\f$, given by !! \f[ !! a_{1}=psautco \times dt \times exp\left[ 0.025\left(T-273.15\right)\right] @@ -428,10 +428,10 @@ subroutine precpd (im,ix,km,dt,del,prsl,q,cwm,t,rn,sr & !! P_{saci}=C_{s}cwm P_{s} !!\f] !! where \f$P_{s}\f$ is the precipitation rate of snow. The collection -!! coefficient \f$C_{s}\f$ is a function of temperature since the open -!! structures of ice crystals at relative warm temperatures are more +!! coefficient \f$C_{s}\f$ is a function of temperature since the open +!! structures of ice crystals at relative warm temperatures are more !! likely to stick, given a collision, than crystals of other shapes -!! (Rogers 1979 \cite rogers_1979). Above the freezing level, +!! (Rogers 1979 \cite rogers_1979). Above the freezing level, !! \f$C_{s}\f$ is expressed by !!\f[ !! C_{s}=c_{1}exp\left[ 0.025\left(T-273.15\right)\right] @@ -461,7 +461,7 @@ subroutine precpd (im,ix,km,dt,del,prsl,q,cwm,t,rn,sr & else ! liquid water ! !> - Following Sundqvist et al. (1989) \cite sundqvist_et_al_1989, -!! the autoconversion of cloud water to rain (\f$P_{raut}\f$) can be +!! the autoconversion of cloud water to rain (\f$P_{raut}\f$) can be !! parameterized from the cloud water mixing ratio \f$m\f$ and cloud !! coverage \f$b\f$, that is, !!\f[ @@ -484,14 +484,14 @@ subroutine precpd (im,ix,km,dt,del,prsl,q,cwm,t,rn,sr & praut = min(praut, cwmk) ww(n) = ww(n) - praut ! -!> - Calculate the accretion of cloud water by rain \f$P_{racw}\f$, +!> - Calculate the accretion of cloud water by rain \f$P_{racw}\f$, !! can be expressed using the cloud mixing ratio \f$cwm\f$ and rainfall !! rate \f$P_{r}\f$: !!\f[ !! P_{saci}=C_{s}cwmP_{r} !!\f] -!! where \f$C_{r}=5.0\times10^{-4}m^{2}kg^{-1}s{-1}\f$ is the -!! collection coeffiecient. Note that this process is not included in +!! where \f$C_{r}=5.0\times10^{-4}m^{2}kg^{-1}s{-1}\f$ is the +!! collection coeffiecient. Note that this process is not included in !! current operational physcics. ! below is for zhao's precip formulation (water) ! @@ -514,25 +514,25 @@ subroutine precpd (im,ix,km,dt,del,prsl,q,cwm,t,rn,sr & enddo !> -# Evaporation of precipitation (\f$E_{rr}\f$ and \f$E_{rs}\f$) !!\n Evaporation of precipitation is an important process that moistens -!! the layers below cloud base. Through this process, some of the -!! precipitating water is evaporated back to the atmosphere and the +!! the layers below cloud base. Through this process, some of the +!! precipitating water is evaporated back to the atmosphere and the !! precipitation efficiency is reduced. !! - Evaporation of rain is calculated using the equation (Sundqvist !! 1988 \cite sundqvist_1988): !!\f[ !! E_{rr}= evpco \times (u-f)(P_{r})^{\beta} !!\f] -!! where \f$u\f$ is u00k, \f$f\f$ is the relative humidity. -!! \f$\beta = 0.5\f$ are empirical parameter. +!! where \f$u\f$ is u00k, \f$f\f$ is the relative humidity. +!! \f$\beta = 0.5\f$ are empirical parameter. !! - Evaporation of snow is calculated using the equation: !!\f[ !! E_{rs}=[C_{rs1}+C_{rs2}(T-273.15)](\frac{u-f}{u})P_{s} !!\f] !! where \f$C_{rs1}=5\times 10^{-6}m^{2}kg^{-1}s^{-1}\f$ and -!! \f$C_{rs2}=6.67\times 10^{-10}m^{2}kg^{-1}K^{-1}s^{-1}\f$. The -!! evaporation of melting snow below the freezing level is ignored in -!! this scheme because of the difficulty in the latent heat treatment -!! since the surface of a melting snowflake is usually covered by a +!! \f$C_{rs2}=6.67\times 10^{-10}m^{2}kg^{-1}K^{-1}s^{-1}\f$. The +!! evaporation of melting snow below the freezing level is ignored in +!! this scheme because of the difficulty in the latent heat treatment +!! since the surface of a melting snowflake is usually covered by a !! thin layer of liquid water. ! !-----evaporation of precipitation------------------------- @@ -579,30 +579,30 @@ subroutine precpd (im,ix,km,dt,del,prsl,q,cwm,t,rn,sr & enddo !> -# Melting of snow (\f$P_{sm1}\f$ and \f$P_{sm2}\f$) !!\n In this scheme, we allow snow melting to take place in certain -!! temperature regions below the freezing level in two ways. In both +!! temperature regions below the freezing level in two ways. In both !! cases, the melted snow is assumed to become raindrops. -!! - One is the continuous melting of snow due to the increase in -!! temperature as it falls down through the freezing level. This +!! - One is the continuous melting of snow due to the increase in +!! temperature as it falls down through the freezing level. This !! process is parameterized as a function of temperature and snow !! precipitation rate, that is, !!\f[ !! P_{sm1}=C_{sm}(T-273.15)^{2}P_{s} !!\f] !! where \f$C_{sm}=5\times 10^{-8}m^{2}kg^{-1}K^{-2}s^{-1}\f$ -!! cause the falling snow to melt almost completely before it reaches +!! cause the falling snow to melt almost completely before it reaches !! the \f$T=278.15 K\f$ level. !! - Another is the immediate melting of melting snow by collection of -!! the cloud water below the freezing level. In order to calculate the -!! melting rate, the collection rate of cloud water by melting snow is -!! computed first. Similar to the collection of cloud water by rain, -!! the collection of cloud water by melting snow can be parameterized +!! the cloud water below the freezing level. In order to calculate the +!! melting rate, the collection rate of cloud water by melting snow is +!! computed first. Similar to the collection of cloud water by rain, +!! the collection of cloud water by melting snow can be parameterized !! to be proportional to the cloud water mixing ratio \f$m\f$ and the !! precipitation rate of snow \f$P_{s}\f$: !!\f[ !! P_{sacw}=C_{r}cwmP_{s} !!\f] !! where \f$C_{r}\f$ is the collection coefficient, -!! \f$C_{r}=5.0\times 10^{-4}m^{2}kg^{-1}s^{-1}\f$ . The melting rate +!! \f$C_{r}=5.0\times 10^{-4}m^{2}kg^{-1}s^{-1}\f$ . The melting rate !! of snow then can be computed from !!\f[ !! P_{sm2}=C_{ws}P_{sacw} @@ -682,7 +682,7 @@ subroutine precpd (im,ix,km,dt,del,prsl,q,cwm,t,rn,sr & !-----------------------end of precipitation processes----------------- !********************************************************************** ! -!> -# Compute precipitation at surface (\f$rn\f$)and determine +!> -# Compute precipitation at surface (\f$rn\f$)and determine !! fraction of frozen precipitation (\f$sr\f$). !!\f[ !! rn= (P_{r}(\eta_{sfc})+P_{s}(\eta_{sfc}))/10^3 @@ -710,7 +710,7 @@ subroutine precpd (im,ix,km,dt,del,prsl,q,cwm,t,rn,sr & sr(i) = 0. else sr(i) = precsl1(n)/rid - endif + endif enddo ! return diff --git a/physics/radiation_aerosols.f b/physics/radiation_aerosols.f index 718345734..e8b2e5a1b 100644 --- a/physics/radiation_aerosols.f +++ b/physics/radiation_aerosols.f @@ -115,7 +115,7 @@ -!> \ingroup rad +!> \ingroup RRTMG !! \defgroup module_radiation_aerosols module_radiation_aerosols !> @{ !! This module contains climatological atmospheric aerosol schemes for @@ -132,7 +132,7 @@ !! !!\n References: !! - OPAC climatological aerosols: -!! Hou et al. 2002 \cite hou_et_al_2002; Hess et al. 1998 +!! Hou et al. 2002 \cite hou_et_al_2002; Hess et al. 1998 !! \cite hess_et_al_1998 !! - GOCART interactive aerosols: !! Chin et al., 2000 \cite chin_et_al_2000 @@ -184,12 +184,12 @@ module module_radiation_aerosols ! ! --- module control parameters set in subroutine "aer_init" !> number of actual bands for sw aerosols; calculated according to !! laswflg setting - integer, save :: NSWBND = NBDSW + integer, save :: NSWBND = NBDSW !> number of actual bands for lw aerosols; calculated according to !! lalwflg and lalw1bd settings - integer, save :: NLWBND = NBDLW + integer, save :: NLWBND = NBDLW !> total number of bands for sw+lw aerosols - integer, save :: NSWLWBD = NBDSW+NBDLW + integer, save :: NSWLWBD = NBDSW+NBDLW ! --------------------------------------------------------------------- ! ! section-1 : module variables for spectral band interpolation ! @@ -510,14 +510,14 @@ module module_radiation_aerosols ! ! aerosol units (mass concentration for geos3/mixing ratio for geos4) !> num of lon-points in geos dataset - integer, parameter :: IMXG = 144 + integer, parameter :: IMXG = 144 !> num of lat-points in geos dataset - integer, parameter :: JMXG = 91 + integer, parameter :: JMXG = 91 !> num of vertical layers in geos dataset - integer, parameter :: KMXG = 30 -!* integer, parameter :: NMXG = 12 + integer, parameter :: KMXG = 30 +!* integer, parameter :: NMXG = 12 !> to be determined by set_aerspc - integer, save :: NMXG + integer, save :: NMXG real (kind=kind_phys), parameter :: dltx = 360.0 / float(IMXG) real (kind=kind_phys), parameter :: dlty = 180.0 / float(JMXG-1) @@ -566,9 +566,9 @@ module module_radiation_aerosols ! real (kind=kind_phys), save :: ctaer = f_zero ! user specified wgt !> option to get fcst gocart aerosol field - logical, save :: get_fcst = .true. + logical, save :: get_fcst = .true. !> option to get clim gocart aerosol field - logical, save :: get_clim = .true. + logical, save :: get_clim = .true. ! ------ gocart aerosol specification ------ ! => transported aerosol species: @@ -588,7 +588,7 @@ module module_radiation_aerosols ! ! OC (waso) and BC (soot) ! -!> index for rh dependent aerosol optical properties (2nd +!> index for rh dependent aerosol optical properties (2nd !! dimension for extrhd_grt, ssarhd_grt, and asyrhd_grt) integer, save :: isoot, iwaso, isuso, issam, isscm @@ -631,9 +631,9 @@ module module_radiation_aerosols ! ! - grid components to be included in the aeropt calculations !> number of aerosol grid components - integer, save :: num_gridcomp = 0 + integer, save :: num_gridcomp = 0 !> aerosol grid components - character, allocatable , save :: gridcomp(:)*2 + character, allocatable , save :: gridcomp(:)*2 !> default full-package setting integer, parameter :: max_num_gridcomp = 5 @@ -944,11 +944,11 @@ subroutine set_spectrum ! ! ! ==================== defination of variables =================== ! ! ! -!> - inputs: (module constants) -!! - NWVTOT: total num of wave numbers used in sw spectrum -!! - NWVTIR: total num of wave numbers used in the ir region -!! -!> - outputs: (in-scope variables) +!> - inputs: (module constants) +!! - NWVTOT: total num of wave numbers used in sw spectrum +!! - NWVTIR: total num of wave numbers used in the ir region +!! +!> - outputs: (in-scope variables) !! - solfwv(NWVTOT): solar flux for each individual wavenumber !! (\f$W/m^2\f$) !! - eirfwv(NWVTIR): ir flux(273k) for each individual wavenumber @@ -1066,7 +1066,7 @@ end subroutine aer_init !!@} -!> This subroutine is the opac-climatology aerosol initialization +!> This subroutine is the opac-climatology aerosol initialization !! program to set up necessary parameters and working arrays. !>\param solfwv (NWVTOT), solar flux for each individual wavenumber !! \f$(w/m^2)\f$ @@ -1259,7 +1259,7 @@ subroutine set_aercoef ! !===> ... begin here ! -!> -# Reading climatological aerosols optical data from aeros_file, +!> -# Reading climatological aerosols optical data from aeros_file, !! including: inquire (file=aeros_file, exist=file_exist) @@ -1304,56 +1304,56 @@ subroutine set_aercoef endif !> - ending wave num for 61 aerosol spectral bands - read(NIAERCM,21) cline + read(NIAERCM,21) cline 21 format(a80) read(NIAERCM,22) iendwv(:) 22 format(13i6) !> - atmos scale height for 5 domains, 7 profs - read(NIAERCM,21) cline + read(NIAERCM,21) cline read(NIAERCM,24) haer(:,:) 24 format(20f4.1) !> - reference pressure for 5 domains, 7 profs - read(NIAERCM,21) cline + read(NIAERCM,21) cline read(NIAERCM,26) prsref(:,:) 26 format(10f7.2) !> - rh independent ext coef for 61 bands, 6 species - read(NIAERCM,21) cline + read(NIAERCM,21) cline read(NIAERCM,28) rhidext0(:,:) 28 format(8e10.3) !> - rh independent sca coef for 61 bands, 6 species - read(NIAERCM,21) cline + read(NIAERCM,21) cline read(NIAERCM,28) rhidsca0(:,:) !> - rh independent ssa coef for 61 bands, 6 species - read(NIAERCM,21) cline + read(NIAERCM,21) cline read(NIAERCM,28) rhidssa0(:,:) !> - rh independent asy coef for 61 bands, 6 species - read(NIAERCM,21) cline + read(NIAERCM,21) cline read(NIAERCM,28) rhidasy0(:,:) !> - rh dependent ext coef for 61 bands, 8 rh lev, 4 species - read(NIAERCM,21) cline + read(NIAERCM,21) cline read(NIAERCM,28) rhdpext0(:,:,:) !> - rh dependent sca coef for 61 bands, 8 rh lev, 4 species - read(NIAERCM,21) cline + read(NIAERCM,21) cline read(NIAERCM,28) rhdpsca0(:,:,:) !> - rh dependent ssa coef for 61 bands, 8 rh lev, 4 species - read(NIAERCM,21) cline + read(NIAERCM,21) cline read(NIAERCM,28) rhdpssa0(:,:,:) !> - rh dependent asy coef for 61 bands, 8 rh lev, 4 species - read(NIAERCM,21) cline + read(NIAERCM,21) cline read(NIAERCM,28) rhdpasy0(:,:,:) !> - stratospheric background aeros for 61 bands - read(NIAERCM,21) cline + read(NIAERCM,21) cline read(NIAERCM,28) straext0(:) close (NIAERCM) @@ -1845,12 +1845,12 @@ subroutine aer_update & endif !> -# Call trop_update() to update monthly tropospheric aerosol data. - if ( lalwflg .or. laswflg ) then + if ( lalwflg .or. laswflg ) then call trop_update endif !> -# Call volc_update() to update yearly stratospheric volcanic aerosol data. - if ( lavoflg ) then + if ( lavoflg ) then call volc_update endif @@ -2448,7 +2448,7 @@ subroutine setaer & !> -# Compute stratosphere volcanic forcing: !! - select data in 4 lat bands, interpolation at the boundaries -!! - Find lower boundary of stratosphere: polar, fixed at 25000pa +!! - Find lower boundary of stratosphere: polar, fixed at 25000pa !! (250mb); tropic, fixed at 15000pa (150mb); mid-lat, interpolation !! - SW: add volcanic aerosol optical depth to the background value !! - Smoothing profile at boundary if needed @@ -2762,13 +2762,13 @@ end subroutine setaer !!\n (:,:,:,2): single scattering albedo !!\n (:,:,:,3): asymmetry parameter !!\param aerodp (IMAX,NSPC+1), vertically integrated aer-opt-depth -!!\section gel_aer_pro General Algorithm +!!\section gel_aer_pro General Algorithm !> @{ !----------------------------------- - subroutine aer_property & + subroutine aer_property & & ( prsi,prsl,prslk,tvly,rhlay,dz,hz,tracer, & ! --- inputs: - & alon,alat,slmsk, laersw,laerlw, & - & IMAX,NLAY,NLP1, & + & alon,alat,slmsk, laersw,laerlw, & + & IMAX,NLAY,NLP1, & & aerosw,aerolw,aerodp & ! --- outputs: & ) @@ -3189,9 +3189,9 @@ subroutine aer_property & contains ! ================= -!> This subroutine computes aerosols optical properties in NSWLWBD +!> This subroutine computes aerosols optical properties in NSWLWBD !! bands. there are seven different vertical profile structures. in the -!! troposphere, aerosol distribution at each grid point is composed +!! troposphere, aerosol distribution at each grid point is composed !! from up to six components out of ten different substances. !-------------------------------- subroutine radclimaer @@ -3506,27 +3506,27 @@ end subroutine aer_property !> The initialization program for gocart aerosols !! - determine weight and index for aerosol composition/luts !! - read in monthly global distribution of gocart aerosols -!! - read and map the tabulated aerosol optical spectral data onto +!! - read and map the tabulated aerosol optical spectral data onto !! corresponding SW/LW radiation spectral bands. !! -!>\param NWVTOT total num of wave numbers used in sw spectrum +!>\param NWVTOT total num of wave numbers used in sw spectrum !!\param solfwv (NWVTOT), solar flux for each individual !! wavenumber (w/m2) !!\param soltot total solar flux for the spectrual range (w/m2) -!!\param NWVTIR total num of wave numbers used in the ir region +!!\param NWVTIR total num of wave numbers used in the ir region !!\param eirfwv (NWVTIR), ir flux(273k) for each individual !! wavenumber (w/m2) -!!\param NBDSW num of bands calculated for sw aeros opt prop -!!\param NLWBND num of bands calculated for lw aeros opt prop +!!\param NBDSW num of bands calculated for sw aeros opt prop +!!\param NLWBND num of bands calculated for lw aeros opt prop !!\param NSWLWBD total num of bands calc for sw+lw aeros opt prop -!!\param imon month of the year -!!\param me print message control flag +!!\param imon month of the year +!!\param me print message control flag !!\param raddt !!\param fdaer !>\section gel_go_ini General Algorithm !! @{ !----------------------------------- - subroutine gocart_init & + subroutine gocart_init & & ( NWVTOT,solfwv,soltot,NWVTIR,eirfwv, & ! --- inputs: & NBDSW,NLWBND,NSWLWBD,imon,me,raddt,fdaer & ! --- outputs: ( none ) & ) @@ -4180,7 +4180,7 @@ subroutine rd_gocart_luts real (kind=kind_io8), Dimension( NP2 ) :: Angle, Cos_Angle, & & Cos_Weight real (kind=kind_io8), Dimension(n_p,nAero) :: RH, rm, reff - real (kind=kind_io8), Dimension(nWave,n_p,nAero) :: & + real (kind=kind_io8), Dimension(nWave,n_p,nAero) :: & & ext0, sca0, asy0 real (kind=kind_io8), Dimension(NP2,n_p,nWave,nAero) :: ph0 real (kind=kind_io8) :: wavelength(nWave), density(nAero), & @@ -4316,7 +4316,7 @@ end subroutine rd_gocart_luts !----------------------------------- ! ! !> This subroutine computes mean aerosols optical properties over each -!! SW/LW radiation spectral band for each of the species components. +!! SW/LW radiation spectral band for each of the species components. !! This program follows GFDL's approach for thick cloud optical property !! in SW radiation scheme (2000). !----------------------------- @@ -4863,33 +4863,33 @@ end subroutine gocart_init !! gocart aerosol species (merged from fcst and clim fields). !! !>\param alon IMAX, longitude of given points in degree -!!\param alat IMAX, latitude of given points in degree -!!\param prslk (IMAX,NLAY), pressure in cb +!!\param alat IMAX, latitude of given points in degree +!!\param prslk (IMAX,NLAY), pressure in cb !!\param rhlay (IMAX,NLAY), layer mean relative humidity !!\param dz (IMAX,NLAY), layer thickness in m -!!\param hz (IMAX,NLP1), level high in m -!!\param NSWLWBD total number of sw+ir bands for aeros opt prop -!!\param prsl (IMAX,NLAY), layer mean pressure in mb -!!\param tvly (IMAX,NLAY), layer mean virtual temperature in K +!!\param hz (IMAX,NLP1), level high in m +!!\param NSWLWBD total number of sw+ir bands for aeros opt prop +!!\param prsl (IMAX,NLAY), layer mean pressure in mb +!!\param tvly (IMAX,NLAY), layer mean virtual temperature in K !!\param trcly (IMAX,NLAY,NTRAC), layer mean specific tracer in g/g -!!\param IMAX horizontal dimension of arrays -!!\param NLAY,NLP1 vertical dimensions of arrays -!!\param ivflip control flag for direction of vertical index -!!\n =0: index from toa to surface -!!\n =1: index from surface to toa -!!\param lsswr,lslwr logical flag for sw/lw radiation calls -!!\param aerosw (IMAX,NLAY,NBDSW,NF_AESW), aeros opt properties for SW -!!\n (:,:,:,1): optical depth -!!\n (:,:,:,2): single scattering albedo -!!\n (:,:,:,3): asymmetry parameter -!!\param aerolw (IMAX,NLAY,NBDLW,NF_AELW), aeros opt properties for LW -!!\n (:,:,:,1): optical depth -!!\n (:,:,:,2): single scattering albedo -!!\n (:,:,:,3): asymmetry parameter +!!\param IMAX horizontal dimension of arrays +!!\param NLAY,NLP1 vertical dimensions of arrays +!!\param ivflip control flag for direction of vertical index +!!\n =0: index from toa to surface +!!\n =1: index from surface to toa +!!\param lsswr,lslwr logical flag for sw/lw radiation calls +!!\param aerosw (IMAX,NLAY,NBDSW,NF_AESW), aeros opt properties for SW +!!\n (:,:,:,1): optical depth +!!\n (:,:,:,2): single scattering albedo +!!\n (:,:,:,3): asymmetry parameter +!!\param aerolw (IMAX,NLAY,NBDLW,NF_AELW), aeros opt properties for LW +!!\n (:,:,:,1): optical depth +!!\n (:,:,:,2): single scattering albedo +!!\n (:,:,:,3): asymmetry parameter !>\section gen_setgo General Algorithm !!@{ !----------------------------------- - subroutine setgocartaer & + subroutine setgocartaer & & ( alon,alat,prslk,rhlay,dz,hz,NSWLWBD, & ! --- inputs: & prsl,tvly,trcly, & & IMAX,NLAY,NLP1, ivflip, lsswr,lslwr, & @@ -4964,7 +4964,7 @@ subroutine setgocartaer & ! --- locals: real (kind=kind_phys), dimension(NLAY) :: rh1, dz1 real (kind=kind_phys), dimension(NLAY,NSWLWBD)::tauae,ssaae,asyae - real (kind=kind_phys), dimension(NLAY,max_num_gridcomp) :: & + real (kind=kind_phys), dimension(NLAY,max_num_gridcomp) :: & & tauae_gocart real (kind=kind_phys) :: tmp1, tmp2 diff --git a/physics/radiation_astronomy.f b/physics/radiation_astronomy.f index 888de73fd..ac1bbd500 100644 --- a/physics/radiation_astronomy.f +++ b/physics/radiation_astronomy.f @@ -1,5 +1,5 @@ !> \file radiation_astronomy.f -!! This file sets up astronomical quantities for solar radiation +!! This file sets up astronomical quantities for solar radiation !! calculations. ! ========================================================== !!!!! @@ -75,7 +75,7 @@ -!> \ingroup rad +!> \ingroup RRTMG !! \defgroup module_radiation_astronomy module_radiation_astronomy !! @{ !> This module sets up astronomical quantities for solar radiation @@ -116,21 +116,21 @@ module module_radiation_astronomy ! !> \name Module variables (to be set in module_radiation_astronomy::sol_update) !> equation of time - real (kind=kind_phys) :: sollag=0.0 + real (kind=kind_phys) :: sollag=0.0 !> sine of the solar declination angle - real (kind=kind_phys) :: sindec=0.0 + real (kind=kind_phys) :: sindec=0.0 !> cosine of the solar declination angle - real (kind=kind_phys) :: cosdec=0.0 + real (kind=kind_phys) :: cosdec=0.0 !> solar angle increment per interation of cosz calc - real (kind=kind_phys) :: anginc=0.0 + real (kind=kind_phys) :: anginc=0.0 !> saved monthly solar constants (isolflg=4 only) - real (kind=kind_phys) :: smon_sav(12) + real (kind=kind_phys) :: smon_sav(12) data smon_sav(1:12) / 12*con_solr / !> saved year of data used - integer :: iyr_sav =0 + integer :: iyr_sav =0 !> total number of zenith angle iterations - integer :: nstp =6 + integer :: nstp =6 public sol_init, sol_update, coszmn @@ -301,7 +301,7 @@ end subroutine sol_init !> This subroutine computes solar parameters at forecast time. -!!\param jdate ncep absolute date and time at fcst time +!!\param jdate ncep absolute date and time at fcst time !! (yr, mon, day, t-zone, hr, min, sec, mil-sec) !!\param kyear usually kyear=jdate(1). if not, it is for hindcast !! mode, and it is usually the init cond time and diff --git a/physics/radiation_clouds.f b/physics/radiation_clouds.f index 0ea2f3a98..80b401032 100644 --- a/physics/radiation_clouds.f +++ b/physics/radiation_clouds.f @@ -145,7 +145,7 @@ !!!!! end descriptions !!!!! !!!!! ========================================================== !!!!! -!> \ingroup rad +!> \ingroup RRTMG !! \defgroup module_radiation_clouds module_radiation_clouds !! @{ !> This module computes cloud related quantities for radiation @@ -162,14 +162,14 @@ !! !! This module has three externally accessible subroutines: !! - cld_init() --- initialization routine -!! - progcld1() --- zhao/moorthi prognostic cloud scheme +!! - progcld1() --- zhao/moorthi prognostic cloud scheme !! - progcld2() --- ferrier prognostic cloud microphysics !! - progcld3() --- zhao/moorthi prognostic cloud + pdfcld !! - diagcld1() --- diagnostic cloud calculation routine !! -!! and two internally accessable only subroutines: -!! - gethml() --- get diagnostic hi, mid, low,total,BL clouds -!! - rhtable() --- rh lookup table for diag cloud scheme +!! and two internally accessable only subroutines: +!! - gethml() --- get diagnostic hi, mid, low,total,BL clouds +!! - rhtable() --- rh lookup table for diag cloud scheme !! !> \section gen_al General Algorithm !! @{ @@ -177,7 +177,7 @@ !!\n We define the fraction of liquid and ice cloud as: !!\n Fraction of ice cloud (F): \f$F=(273.16K-T)/20\f$ !!\n LWP = total cloud condensate path X (1-F) -!!\n IWP = total clod condensate path X F +!!\n IWP = total clod condensate path X F !! !! -# GFS Cloud Fraction !! \n The cloud fraction in a given grid box of the GFS model is @@ -202,7 +202,7 @@ !! (\f$r_{e}\f$) !>\n Two methods has been used to parameterize cloud properties in the !! GFS model. The first method makes use of a diagnostic cloud scheme, -!! in which cloud properties are determined based on model-predicted +!! in which cloud properties are determined based on model-predicted !! temperature, pressure, and boundary layer circulation from !! Harshvardhan et al. (1989) \cite harshvardhan_et_al_1989 . The !! diagnostic scheme is now replaced with a prognostic scheme that uses @@ -214,7 +214,7 @@ !! r_{ew} = 5+5\times F !!\f] !! Thus, the effective radius of cloud water droplets will reach to a -!! minimum values of \f$5\mu m\f$ when F=0, and to a maximum value of +!! minimum values of \f$5\mu m\f$ when F=0, and to a maximum value of !! \f$10\mu m\f$ when the ice fraction is increasing. !! \n For ice clouds, following Heymsfield and McFarquhar (1996) !! \cite heymsfield_and_mcfarquhar_1996, @@ -254,9 +254,9 @@ module module_radiation_clouds ! real (kind=kind_phys), parameter :: gfac=1.0e5/con_g & &, gord=con_g/con_rd !> number of fields in cloud array - integer, parameter, public :: NF_CLDS = 9 + integer, parameter, public :: NF_CLDS = 9 !> number of cloud vertical domains - integer, parameter, public :: NK_CLDS = 3 + integer, parameter, public :: NK_CLDS = 3 !> pressure limits of cloud domain interfaces (low,mid,high) in mb (0.1kPa) real (kind=kind_phys), save :: ptopc(NK_CLDS+1,2) @@ -269,29 +269,29 @@ module module_radiation_clouds ! real (kind=kind_phys), parameter :: ovcst = 1.0 - 1.0e-8 !> default liq radius to 10 micron - real (kind=kind_phys), parameter :: reliq_def = 10.0 + real (kind=kind_phys), parameter :: reliq_def = 10.0 !> default ice radius to 50 micron - real (kind=kind_phys), parameter :: reice_def = 50.0 + real (kind=kind_phys), parameter :: reice_def = 50.0 !> default rain radius to 1000 micron - real (kind=kind_phys), parameter :: rrain_def = 1000.0 + real (kind=kind_phys), parameter :: rrain_def = 1000.0 !> default snow radius to 250 micron - real (kind=kind_phys), parameter :: rsnow_def = 250.0 + real (kind=kind_phys), parameter :: rsnow_def = 250.0 !> rh in one percent interval - integer, parameter :: NBIN=100 + integer, parameter :: NBIN=100 !> =1,2 for eastern and western hemispheres - integer, parameter :: NLON=2 + integer, parameter :: NLON=2 !> =1,4 for 60n-30n,30n-equ,equ-30s,30s-60s - integer, parameter :: NLAT=4 + integer, parameter :: NLAT=4 !> =1,4 for bl,low,mid,hi cld type - integer, parameter :: MCLD=4 + integer, parameter :: MCLD=4 !> =1,2 for land,sea - integer, parameter :: NSEAL=2 + integer, parameter :: NSEAL=2 !> default cld single scat albedo - real (kind=kind_phys), parameter :: cldssa_def = 0.99 + real (kind=kind_phys), parameter :: cldssa_def = 0.99 !> default cld asymmetry factor - real (kind=kind_phys), parameter :: cldasy_def = 0.84 + real (kind=kind_phys), parameter :: cldasy_def = 0.84 ! --- xlabdy: lat bndry between tuning regions, +/- xlim for transition ! xlobdy: lon bndry between tuning regions @@ -316,9 +316,9 @@ module module_radiation_clouds ! real (kind=kind_phys) :: rhcl(NBIN,NLON,NLAT,MCLD,NSEAL) !> upper limit of boundary layer clouds - integer :: llyr = 2 + integer :: llyr = 2 !> maximum-random cloud overlapping method - integer :: iovr = 1 + integer :: iovr = 1 public progcld1, progcld2, progcld3, progclduni, diagcld1, & & cld_init @@ -427,7 +427,7 @@ subroutine cld_init & endif endif -!> -# Compute the top of BL cld (llyr), which is the topmost non +!> -# Compute the top of BL cld (llyr), which is the topmost non !! cld(low) layer for stratiform (at or above lowest 0.1 of the !! atmosphere). @@ -454,7 +454,7 @@ end subroutine cld_init !----------------------------------- !> @} -!> This subroutine computes cloud related quantities using +!> This subroutine computes cloud related quantities using !! zhao/moorthi's prognostic cloud microphysics scheme. !!\param plyr (IX,NLAY), model layer mean pressure in mb (100Pa) !!\param plvl (IX,NLP1), model level pressure in mb (100Pa) @@ -464,7 +464,7 @@ end subroutine cld_init !!\param qstl (IX,NLAY), layer saturate humidity in gm/gm !!\param rhly (IX,NLAY), layer relative humidity \f$ (=qlyr/qstl) \f$ !!\param clw (IX,NLAY), layer cloud condensate amount -!!\param xlat (IX), grid latitude in radians, default to pi/2 -> +!!\param xlat (IX), grid latitude in radians, default to pi/2 -> !! -pi/2 range, otherwise see in-line comment !!\param xlon (IX), grid longitude in radians (not used) !!\param slmsk (IX), sea/land mask array (sea:0,land:1,sea-ice:2) @@ -839,7 +839,7 @@ subroutine progcld1 & enddo endif -!> -# Compute effective ice cloud droplet radius following Heymsfield +!> -# Compute effective ice cloud droplet radius following Heymsfield !! and McFarquhar (1996) \cite heymsfield_and_mcfarquhar_1996. do k = 1, NLAY @@ -921,7 +921,7 @@ end subroutine progcld1 !!\param f_rain (IX,NLAY), fraction of layer rain water (ferrier micro-phys) !!\param r_rime (IX,NLAY), mass ratio of total ice to unrimed ice (>=1) !!\param flgmin (IX), minimum large ice fraction -!!\param xlat (IX), grid latitude in radians, default to pi/2 -> +!!\param xlat (IX), grid latitude in radians, default to pi/2 -> !! -pi/2 range, otherwise see in-line comment !!\param xlon (IX), grid longitude in radians (not used) !!\param slmsk (IX), sea/land mask array (sea:0,land:1,sea-ice:2) @@ -1147,7 +1147,7 @@ subroutine progcld2 & !> -# Call module_microphysics::rsipath2(), in Ferrier's scheme, to !! compute layer's cloud liquid, ice, rain, and snow water condensate -!! path and the partical effective radius for liquid droplet, rain drop, +!! path and the partical effective radius for liquid droplet, rain drop, !! and snow flake. call rsipath2 & ! --- inputs: @@ -1407,7 +1407,7 @@ end subroutine progcld2 !----------------------------------- !> @} -!> This subroutine computes cloud related quantities using +!> This subroutine computes cloud related quantities using !! zhao/moorthi's prognostic cloud microphysics scheme + pdfcld. !!\param plyr (ix,nlay), model layer mean pressure in mb (100pa) !!\param plvl (ix,nlp1), model level pressure in mb (100pa) @@ -1425,7 +1425,7 @@ end subroutine progcld2 !!\param nlay,nlp1 vertical layer/level dimensions !!\param deltaq (ix,nlay), half total water distribution width !!\param sup supersaturation -!!\param kdt +!!\param kdt !!\param me print control flag !!\param clouds (ix,nlay,nf_clds), cloud profiles !!\n (:,:,1) - layer total cloud fraction @@ -1839,7 +1839,7 @@ end subroutine progcld3 !----------------------------------- !> @} -!> This subroutine computes cloud related quantities using +!> This subroutine computes cloud related quantities using !! zhao/moorthi's prognostic cloud microphysics scheme. !!\param plyr (IX,NLAY), model layer mean pressure in mb (100Pa) !!\param plvl (IX,NLP1), model level pressure in mb (100Pa) @@ -1848,7 +1848,7 @@ end subroutine progcld3 !!\param qlyr (IX,NLAY), layer specific humidity in gm/gm !!\param clw (IX,NLAY), layer cloud liquid water amount !!\param ciw (IX,NLAY), layer cloud ice water amount -!!\param xlat (IX), grid latitude in radians, default to pi/2 -> +!!\param xlat (IX), grid latitude in radians, default to pi/2 -> !! -pi/2 range, otherwise see in-line comment !!\param xlon (IX), grid longitude in radians (not used) !!\param slmsk (IX), sea/land mask array (sea:0,land:1,sea-ice:2) @@ -2099,7 +2099,7 @@ subroutine progclduni & enddo endif -!> -# Compute effective ice cloud droplet radius following Heymsfield +!> -# Compute effective ice cloud droplet radius following Heymsfield !! and McFarquhar (1996) \cite heymsfield_and_mcfarquhar_1996. do k = 1, NLAY @@ -2463,7 +2463,7 @@ subroutine diagcld1 & do i = 1, IX -!> - Find the stratosphere cut off layer for high cloud (about +!> - Find the stratosphere cut off layer for high cloud (about !! 250mb). It is assumed to be above the layerwith dthdp less than !! -0.25 in the high cloud domain. @@ -2795,7 +2795,7 @@ end subroutine diagcld1 !! fractions and cloud top/bottom layer indices for model diagnostic !! output. The three cloud domain boundaries are defined by ptopc. The !! cloud overlapping method is defined by control flag 'iovr', which is -!! also used by LW and SW radiation programs. +!! also used by LW and SW radiation programs. !> \param plyr (IX,NLAY), model layer mean pressure in mb (100Pa) !> \param ptop1 (IX,4), pressure limits of cloud domain interfaces !! (sfc,low,mid,high) in mb (100Pa) @@ -2803,8 +2803,8 @@ end subroutine diagcld1 !> \param cldcnv (IX,NLAY), convective cloud (for diagnostic scheme only) !> \param IX horizontal dimension !> \param NLAY vertical layer dimensions -!> \param clds (IX,5), fraction of clouds for low, mid, hi, tot, bl -!> \param mtop (IX,3),vertical indices for low, mid, hi cloud tops +!> \param clds (IX,5), fraction of clouds for low, mid, hi, tot, bl +!> \param mtop (IX,3),vertical indices for low, mid, hi cloud tops !> \param mbot (IX,3),vertical indices for low, mid, hi cloud bases !! !>\section detail Detailed Algorithm diff --git a/physics/radiation_gases.f b/physics/radiation_gases.f index 79e049e1a..a2fa97a94 100644 --- a/physics/radiation_gases.f +++ b/physics/radiation_gases.f @@ -104,7 +104,7 @@ !!!!! ========================================================== !!!!! -!> \ingroup rad +!> \ingroup RRTMG !! \defgroup module_radiation_gases module_radiation_gases !! @{ !> This module sets up ozone climatological profiles and other constant @@ -139,22 +139,22 @@ module module_radiation_gases ! !>\name parameter constants !> number of gas species - integer, parameter, public :: NF_VGAS = 10 + integer, parameter, public :: NF_VGAS = 10 !> input co2 dat lon points - integer, parameter :: IMXCO2 = 24 + integer, parameter :: IMXCO2 = 24 !> input co2 data lat points - integer, parameter :: JMXCO2 = 12 + integer, parameter :: JMXCO2 = 12 !> earlist year 2-d co2 data available integer, parameter :: MINYEAR = 1957 - + !> horizontal resolution in degree - real (kind=kind_phys), parameter :: resco2=15.0 + real (kind=kind_phys), parameter :: resco2=15.0 !> rad->deg conversion - real (kind=kind_phys), parameter :: raddeg=180.0/con_pi + real (kind=kind_phys), parameter :: raddeg=180.0/con_pi !> pressure limitation for 2-d co2 (mb) - real (kind=kind_phys), parameter :: prsco2=788.0 + real (kind=kind_phys), parameter :: prsco2=788.0 !> half of pi - real (kind=kind_phys), parameter :: hfpi =0.5*con_pi + real (kind=kind_phys), parameter :: hfpi =0.5*con_pi !>\name parameter constants for gas volume mixing ratioes @@ -164,15 +164,15 @@ module module_radiation_gases ! real (kind=kind_phys), parameter :: o2vmr_def = 0.209 real (kind=kind_phys), parameter :: covmr_def = 1.50e-8 !> aer 2003 value - real (kind=kind_phys), parameter :: f11vmr_def = 3.520e-10 + real (kind=kind_phys), parameter :: f11vmr_def = 3.520e-10 !> aer 2003 value - real (kind=kind_phys), parameter :: f12vmr_def = 6.358e-10 + real (kind=kind_phys), parameter :: f12vmr_def = 6.358e-10 !> aer 2003 value - real (kind=kind_phys), parameter :: f22vmr_def = 1.500e-10 + real (kind=kind_phys), parameter :: f22vmr_def = 1.500e-10 !> aer 2003 value real (kind=kind_phys), parameter :: cl4vmr_def = 1.397e-10 !> gfdl 1999 value - real (kind=kind_phys), parameter :: f113vmr_def= 8.2000e-11 + real (kind=kind_phys), parameter :: f113vmr_def= 8.2000e-11 ! --- ozone seasonal climatology parameters defined in module ozne_def ! - 4x5 ozone data parameter @@ -888,9 +888,9 @@ end subroutine gas_update !! from observed values, all other gases are asigned to the !! climatological values. !!\param plvl (IMAX,LMAX+1), pressure at model layer interfaces (mb) -!!\param xlon (IMAX), grid longitude in radians, ok both 0->2pi +!!\param xlon (IMAX), grid longitude in radians, ok both 0->2pi !! or -pi -> +pi arrangements -!!\param xlat (IMAX), grid latitude in radians, default range to +!!\param xlat (IMAX), grid latitude in radians, default range to !! pi/2 -> -pi/2, otherwise see in-line comment !!\param IMAX, LMAX horizontal/vertical dimensions for output data !!\param gasdat (IMAX,LMAX,NF_VGAS) - gases volume mixing ratioes @@ -906,9 +906,9 @@ end subroutine gas_update !!\n (:,:,10) - cfc113 !----------------------------------- subroutine getgases & - & ( plvl, xlon, xlat, & ! --- inputs + & ( plvl, xlon, xlat, & ! --- inputs & IMAX, LMAX, & - & gasdat & ! --- outputs + & gasdat & ! --- outputs & ) ! =================================================================== ! @@ -1053,7 +1053,7 @@ end subroutine getgases !!\param xlat (IMAX), latitude in radians, default to pi/2 -> !! -pi/2 range, otherwise see in-line comment !!\param IMAX, LM horizontal and vertical dimensions -!!\param o3mmr (IMAX,LM), output ozone profile in mass mixing +!!\param o3mmr (IMAX,LM), output ozone profile in mass mixing !! ratio (g/g) !----------------------------------- subroutine getozn & diff --git a/physics/radiation_surface.f b/physics/radiation_surface.f index 12006c585..f3b8d63c9 100644 --- a/physics/radiation_surface.f +++ b/physics/radiation_surface.f @@ -1,5 +1,5 @@ !> \file radiation_surface.f -!! This file contains routines that set up surface albedo for SW +!! This file contains routines that set up surface albedo for SW !! radiation and surface emissivity for LW radiation. ! ========================================================== !!!!! @@ -74,7 +74,7 @@ !!!!! ========================================================== !!!!! -!> \ingroup rad +!> \ingroup RRTMG !! \defgroup module_radiation_surface module_radiation_surface !! @{ !> This module sets up surface albedo for sw radiation and surface @@ -100,13 +100,13 @@ module module_radiation_surface ! ! --- constant parameters !> num of sfc albedo components - integer, parameter, public :: NF_ALBD = 4 + integer, parameter, public :: NF_ALBD = 4 !> num of longitude points in global emis-type map - integer, parameter, public :: IMXEMS = 360 + integer, parameter, public :: IMXEMS = 360 !> num of latitude points in global emis-type map - integer, parameter, public :: JMXEMS = 180 + integer, parameter, public :: JMXEMS = 180 real (kind=kind_phys), parameter :: f_zero = 0.0 real (kind=kind_phys), parameter :: f_one = 1.0 @@ -180,7 +180,7 @@ subroutine sfc_init & if ( me == 0 ) print *, VTAGSFC ! print out version tag !> - Initialization of surface albedo section -!! \n physparam::ialbflg +!! \n physparam::ialbflg !! - = 0: using climatology surface albedo scheme for SW !! - = 1: using MODIS based land surface albedo for SW @@ -502,11 +502,11 @@ subroutine setalb & enddo ! end_do_i_loop !> -# If use modis based albedo for land area: - else + else do i = 1, IMAX -!> - Calculate snow cover input directly for land model, no +!> - Calculate snow cover input directly for land model, no !! conversion needed. fsno0 = sncovr(i) @@ -541,7 +541,7 @@ subroutine setalb & asend = 0.65 - 3.6875*a1 endif -!> - Calculate diffused snow albedo, land area use input max snow +!> - Calculate diffused snow albedo, land area use input max snow !! albedo. if (nint(slmsk(i)) == 2) then @@ -586,7 +586,7 @@ subroutine setalb & ! rfcs = 1.89 - 3.34*coszf(i) + 4.13*coszf(i)*coszf(i) & ! & - 2.02*coszf(i)*coszf(i)*coszf(i) - rfcs = 1.775/(1.0+1.55*coszf(i)) + rfcs = 1.775/(1.0+1.55*coszf(i)) if (tsknf(i) >= con_t0c) then asevb = max(asevd, 0.026/(coszf(i)**1.7+0.065) & @@ -627,7 +627,7 @@ end subroutine setalb !! -pi/2 range, otherwise see in-line comment !!\param slmsk (IMAX), sea(0),land(1),ice(2) mask on fcst model grid !!\param snowf (IMAX), snow depth water equivalent in mm -!!\param sncovr (IMAX), snow cover over land +!!\param sncovr (IMAX), snow cover over land !!\param zorlf (IMAX), surface roughness in cm !!\param tsknf (IMAX), ground surface temperature in K !!\param tairf (IMAX), lowest model layer air temperature in K @@ -687,7 +687,7 @@ subroutine setemis & ! --- inputs integer, intent(in) :: IMAX - real (kind=kind_phys), dimension(:), intent(in) :: & + real (kind=kind_phys), dimension(:), intent(in) :: & & xlon,xlat, slmsk, snowf,sncovr, zorlf, tsknf, tairf, hprif ! --- outputs diff --git a/physics/radlw_main.f b/physics/radlw_main.f index 701505296..9e2d96380 100644 --- a/physics/radlw_main.f +++ b/physics/radlw_main.f @@ -110,7 +110,7 @@ ! ! ! ! ! a rapid radiative transfer model ! -! for the longwave region ! +! for the longwave region ! ! for application to general circulation models ! ! ! ! ! @@ -228,7 +228,7 @@ ! apr 2012, b. ferrier and y. hou -- added conversion factor to fu's! ! cloud-snow optical property scheme. ! ! nov 2012, yu-tai hou -- modified control parameters thru ! -! module 'physparam'. ! +! module 'physparam'. ! ! ! !!!!! ============================================================== !!!!! !!!!! end descriptions !!!!! @@ -236,7 +236,7 @@ !> \defgroup module_radlw_main module_radlw_main -!! \ingroup rad +!! \ingroup RRTMG !! This module includes NCEP's modifications of the rrtmg-lw radiation !! code from AER. !! @@ -258,13 +258,13 @@ !! module 'module_radlw_main' and many of them are not directly !! accessable from places outside the module. !! -!!\author Eli J. Mlawer, emlawer@aer.com -!!\author Jennifer S. Delamere, jdelamer@aer.com -!!\author Michael J. Iacono, miacono@aer.com +!!\author Eli J. Mlawer, emlawer@aer.com +!!\author Jennifer S. Delamere, jdelamer@aer.com +!!\author Michael J. Iacono, miacono@aer.com !!\author Shepard A. Clough !!\version NCEP LW v5.1 Nov 2012 -RRTMG-LW v4.82 -!! -!! The authors wish to acknowledge the contributions of the +!! +!! The authors wish to acknowledge the contributions of the !! following people: Steven J. Taubman, Karen Cady-Pereira, !! Patrick D. Brown, Ronald E. Farren, Luke Chen, Robert Bergstrom. !! @@ -394,8 +394,8 @@ module module_radlw_main ! !!\param plvl model interface pressure in mb !!\param tlyr model layer mean temperature in K !!\param tlvl model interface temperature in K -!!\param qlyr layer specific humidity in gm/gm -!!\param olyr layer ozone concentration in gm/gm +!!\param qlyr layer specific humidity in gm/gm +!!\param olyr layer ozone concentration in gm/gm !!\param gasvmr atmospheric gases amount: !!\n (:,:,1) - co2 volume mixing ratio !!\n (:,:,2) - n2o volume mixing ratio @@ -423,7 +423,7 @@ module module_radlw_main ! !!\n (:,:,3) - layer cloud single scattering albedo !!\n (:,:,4) - layer cloud asymmetry factor !!\param icseed auxiliary special cloud related array. -!!\param aerosols aerosol optical properties +!!\param aerosols aerosol optical properties !!\n (:,:,:,1) - optical depth !!\n (:,:,:,2) - single scattering albedo !!\n (:,:,:,3) - asymmetry parameter @@ -715,7 +715,7 @@ subroutine lwrad & lhlwb = present ( hlwb ) lhlw0 = present ( hlw0 ) lflxprf= present ( flxprf ) - + colamt(:,:) = f_zero @@ -738,7 +738,7 @@ subroutine lwrad & ! endif ! --- ... loop over horizontal npts profiles - + lab_do_iplon : do iplon = 1, npts !> -# Read surface emissivity. @@ -1090,7 +1090,7 @@ subroutine lwrad & ! print *,'indfor',indfor ! endif -!> -# Call taumol() to calculte the gaseous optical depths and Plank +!> -# Call taumol() to calculte the gaseous optical depths and Plank !! fractions for each longwave spectral band. call taumol & @@ -1969,18 +1969,18 @@ end subroutine mcica_subcol !!\param rfrate ref ratios of binary species param !!\n (:,m,:)m=1-h2o/co2,2-h2o/o3,3-h2o/n2o, !! 4-h2o/ch4,5-n2o/co2,6-o3/co2 -!!\n (:,:,n)n=1,2: the rates of ref press at +!!\n (:,:,n)n=1,2: the rates of ref press at !! the 2 sides of the layer !!\param facij factors multiply the reference ks, i,j=0/1 for !! lower/higher of the 2 appropriate temperatures !! and altitudes. !!\param selffac scale factor for w. v. self-continuum equals !! (w. v. density)/(atmospheric density at 296k and 1013 mb) -!!\param selffrac factor for temperature interpolation of +!!\param selffrac factor for temperature interpolation of !! reference w. v. self-continuum data !!\param indself index of lower ref temp for selffac !!\param forfac scale factor for w. v. foreign-continuum -!!\param forfrac factor for temperature interpolation of +!!\param forfrac factor for temperature interpolation of !! reference w.v. foreign-continuum data !!\param indfor index of lower ref temp for forfac !!\param minorfrac factor for minor gases @@ -2251,7 +2251,7 @@ end subroutine setcoef !! randomly overlaping in a vertical column. !!\brief Original Code Description: this program calculates the upward !! fluxes, downward fluxes, and heating rates for an arbitrary clear or -!! cloudy atmosphere. The input to this program is the atmospheric +!! cloudy atmosphere. The input to this program is the atmospheric !! profile, all Planck function information, and the cloud fraction by !! layer. A variable diffusivity angle (secdif) is used for the angle !! integration. Bands 2-3 and 5-9 use a value for secdif that varies @@ -2585,7 +2585,7 @@ subroutine rtrn & enddo ! end do_ig_loop -!> -# Process longwave output from band for total and clear streams. +!> -# Process longwave output from band for total and clear streams. !! Calculate upward, downward, and net flux. flxfac = wtdiff * fluxfac @@ -2641,7 +2641,7 @@ end subroutine rtrn !> This subroutine computes the upward/downward radiative fluxes, and -!! heating rates for both clear or cloudy atmosphere. Clouds are +!! heating rates for both clear or cloudy atmosphere. Clouds are !! assumed as in maximum-randomly overlaping in a vertical column. !!\param semiss lw surface emissivity !!\param delp layer pressure thickness (mb) @@ -3629,13 +3629,13 @@ end subroutine rtrnmc !> This subroutine contains optical depths developed for the rapid !! radiative transfer model. !!\brief This file contains the subroutines taugbn (where n goes from -!! 1 to 16). taugbn calculates the optical depths and planck fractions +!! 1 to 16). taugbn calculates the optical depths and planck fractions !! per g-value and layer for band n. -!!\param laytrop tropopause layer index (unitless) layer at +!!\param laytrop tropopause layer index (unitless) layer at !! which switch is made for key species !!\param pavel layer pressures (mb) !!\param coldry column amount for dry air \f$(mol/cm^2)\f$ -!!\param colamt column amounts of h2o, co2, o3, n2o, ch4,o2, +!!\param colamt column amounts of h2o, co2, o3, n2o, ch4,o2, !! co \f$(mol/cm^2)\f$ !!\param colbrd column amount of broadening gases !!\param wx cross-section amounts \f$(mol/cm^2)\f$ @@ -3646,7 +3646,7 @@ end subroutine rtrnmc !!\n (:,:,n)n=1,2: the rates of ref press at the 2 !! sides of the layer !!\param facij factors multiply the reference ks, i,j of 0/1 -!! for lower/higher of the 2 appropriate +!! for lower/higher of the 2 appropriate !! temperatures and altitudes !!\param jp index of lower reference pressure !!\param jt, jt1 indices of lower reference temperatures for @@ -3855,7 +3855,7 @@ subroutine taumol & ! ================= !> band 1: 10-350 cm-1 (low key - h2o; low minor - n2); -!! (high key - h2o; high minor - n2) +!! (high key - h2o; high minor - n2) ! ---------------------------------- subroutine taugb01 ! .................................. @@ -3914,7 +3914,7 @@ subroutine taugb01 tauself = selffac(k) * (selfref(ig,inds) + selffrac(k) & & * (selfref(ig,indsp) - selfref(ig,inds))) taufor = forfac(k) * (forref(ig,indf) + forfrac(k) & - & * (forref(ig,indfp) - forref(ig,indf))) + & * (forref(ig,indfp) - forref(ig,indf))) taun2 = scalen2 * (ka_mn2(ig,indm) + minorfrac(k) & & * (ka_mn2(ig,indmp) - ka_mn2(ig,indm))) @@ -3945,7 +3945,7 @@ subroutine taugb01 do ig = 1, ng01 taufor = forfac(k) * (forref(ig,indf) + forfrac(k) & - & * (forref(ig,indfp) - forref(ig,indf))) + & * (forref(ig,indfp) - forref(ig,indf))) taun2 = scalen2 * (kb_mn2(ig,indm) + minorfrac(k) & & * (kb_mn2(ig,indmp) - kb_mn2(ig,indm))) @@ -4000,7 +4000,7 @@ subroutine taugb02 tauself = selffac(k) * (selfref(ig,inds) + selffrac(k) & & * (selfref(ig,indsp) - selfref(ig,inds))) taufor = forfac(k) * (forref(ig,indf) + forfrac(k) & - & * (forref(ig,indfp) - forref(ig,indf))) + & * (forref(ig,indfp) - forref(ig,indf))) taug(ns02+ig,k) = corradj * (colamt(k,1) & & * (fac00(k)*absa(ig,ind0) + fac10(k)*absa(ig,ind0p) & @@ -4024,7 +4024,7 @@ subroutine taugb02 do ig = 1, ng02 taufor = forfac(k) * (forref(ig,indf) + forfrac(k) & - & * (forref(ig,indfp) - forref(ig,indf))) + & * (forref(ig,indfp) - forref(ig,indf))) taug(ns02+ig,k) = colamt(k,1) & & * (fac00(k)*absb(ig,ind0) + fac10(k)*absb(ig,ind0p) & @@ -4087,7 +4087,7 @@ subroutine taugb03 specparm = colamt(k,1) / speccomb specmult = 8.0 * min(specparm, oneminus) js = 1 + int(specmult) - fs = mod(specmult, f_one) + fs = mod(specmult, f_one) ind0 = ((jp(k)-1)*5 + (jt(k)-1)) * nspa(3) + js speccomb1 = colamt(k,1) + rfrate(k,1,2)*colamt(k,2) @@ -4320,7 +4320,7 @@ subroutine taugb03 do ig = 1, ng03 taufor = forfac(k) * (forref(ig,indf) + forfrac(k) & - & * (forref(ig,indfp) - forref(ig,indf))) + & * (forref(ig,indfp) - forref(ig,indf))) n2om1 = kb_mn2o(ig,jmn2o,indm) + fmn2o & & * (kb_mn2o(ig,jmn2op,indm) - kb_mn2o(ig,jmn2o,indm)) n2om2 = kb_mn2o(ig,jmn2o,indmp) + fmn2o & @@ -4336,7 +4336,7 @@ subroutine taugb03 & + fac101*absb(ig,id101) + fac111*absb(ig,id111)) taug(ns03+ig,k) = tau_major + tau_major1 & - & + taufor + adjcoln2o*absn2o + & + taufor + adjcoln2o*absn2o fracs(ns03+ig,k) = fracrefb(ig,jpl) + fpl & & * (fracrefb(ig,jplp) - fracrefb(ig,jpl)) @@ -4495,7 +4495,7 @@ subroutine taugb04 tauself = selffac(k)* (selfref(ig,inds) + selffrac(k) & & * (selfref(ig,indsp) - selfref(ig,inds))) taufor = forfac(k) * (forref(ig,indf) + forfrac(k) & - & * (forref(ig,indfp) - forref(ig,indf))) + & * (forref(ig,indfp) - forref(ig,indf))) tau_major = speccomb & & * (fac000*absa(ig,id000) + fac010*absa(ig,id010) & @@ -4591,8 +4591,8 @@ subroutine taugb04 end subroutine taugb04 ! ---------------------------------- -!> Band 5: 700-820 cm-1 (low key - h2o,co2; low minor - o3, ccl4) -!! (high key - o3,co2) +!> Band 5: 700-820 cm-1 (low key - h2o,co2; low minor - o3, ccl4) +!! (high key - o3,co2) ! ---------------------------------- subroutine taugb05 ! .................................. @@ -4604,7 +4604,7 @@ subroutine taugb05 use module_radlw_kgb05 -! --- locals: +! --- locals: integer :: k, ind0, ind1, inds, indsp, indf, indfp, indm, indmp, & & id000, id010, id100, id110, id200, id210, jmo3, jmo3p, & & id001, id011, id101, id111, id201, id211, jpl, jplp, & @@ -4854,7 +4854,7 @@ subroutine taugb05 end subroutine taugb05 ! ---------------------------------- -!> Band 6: 820-980 cm-1 (low key - h2o; low minor - co2) +!> Band 6: 820-980 cm-1 (low key - h2o; low minor - co2) !! (high key - none; high minor - cfc11, cfc12) ! ---------------------------------- subroutine taugb06 @@ -4867,7 +4867,7 @@ subroutine taugb06 use module_radlw_kgb06 -! --- locals: +! --- locals: integer :: k, ind0, ind0p, ind1, ind1p, inds, indsp, indf, indfp, & & indm, indmp, ig @@ -5129,7 +5129,7 @@ subroutine taugb07 tauself = selffac(k)* (selfref(ig,inds) + selffrac(k) & & * (selfref(ig,indsp) - selfref(ig,inds))) taufor = forfac(k) * (forref(ig,indf) + forfrac(k) & - & * (forref(ig,indfp) - forref(ig,indf))) + & * (forref(ig,indfp) - forref(ig,indf))) co2m1 = ka_mco2(ig,jmco2,indm) + fmco2 & & * (ka_mco2(ig,jmco2p,indm) - ka_mco2(ig,jmco2,indm)) co2m2 = ka_mco2(ig,jmco2,indmp) + fmco2 & @@ -5202,8 +5202,8 @@ subroutine taugb07 end subroutine taugb07 ! ---------------------------------- -!> Band 8: 1080-1180 cm-1 (low key - h2o; low minor - co2,o3,n2o) -!! (high key - o3; high minor - co2, n2o) +!> Band 8: 1080-1180 cm-1 (low key - h2o; low minor - co2,o3,n2o) +!! (high key - o3; high minor - co2, n2o) ! ---------------------------------- subroutine taugb08 ! .................................. @@ -5328,7 +5328,7 @@ end subroutine taugb08 ! ---------------------------------- !> Band 9: 1180-1390 cm-1 (low key - h2o,ch4; low minor - n2o) -!! (high key - ch4; high minor - n2o) +!! (high key - ch4; high minor - n2o) ! ---------------------------------- subroutine taugb09 ! .................................. @@ -5514,7 +5514,7 @@ subroutine taugb09 tauself = selffac(k)* (selfref(ig,inds) + selffrac(k) & & * (selfref(ig,indsp) - selfref(ig,inds))) taufor = forfac(k) * (forref(ig,indf) + forfrac(k) & - & * (forref(ig,indfp) - forref(ig,indf))) + & * (forref(ig,indfp) - forref(ig,indf))) n2om1 = ka_mn2o(ig,jmn2o,indm) + fmn2o & & * (ka_mn2o(ig,jmn2op,indm) - ka_mn2o(ig,jmn2o,indm)) n2om2 = ka_mn2o(ig,jmn2o,indmp) + fmn2o & @@ -5529,7 +5529,7 @@ subroutine taugb09 & * (fac001*absa(ig,id001) + fac011*absa(ig,id011) & & + fac101*absa(ig,id101) + fac111*absa(ig,id111) & & + fac201*absa(ig,id201) + fac211*absa(ig,id211)) & - & + tauself + taufor + adjcoln2o*absn2o + & + tauself + taufor + adjcoln2o*absn2o fracs(ns09+ig,k) = fracrefa(ig,jpl) + fpl & & * (fracrefa(ig,jplp) - fracrefa(ig,jpl)) @@ -5613,7 +5613,7 @@ subroutine taugb10 tauself = selffac(k) * (selfref(ig,inds) + selffrac(k) & & * (selfref(ig,indsp) - selfref(ig,inds))) taufor = forfac(k) * (forref(ig,indf) + forfrac(k) & - & * (forref(ig,indfp) - forref(ig,indf))) + & * (forref(ig,indfp) - forref(ig,indf))) taug(ns10+ig,k) = colamt(k,1) & & * (fac00(k)*absa(ig,ind0) + fac10(k)*absa(ig,ind0p) & @@ -5652,8 +5652,8 @@ subroutine taugb10 end subroutine taugb10 ! ---------------------------------- -!> Band 11: 1480-1800 cm-1 (low - h2o; low minor - o2) -!! (high key - h2o; high minor - o2) +!> Band 11: 1480-1800 cm-1 (low - h2o; low minor - o2) +!! (high key - h2o; high minor - o2) ! ---------------------------------- subroutine taugb11 ! .................................. @@ -5728,7 +5728,7 @@ subroutine taugb11 do ig = 1, ng11 taufor = forfac(k) * (forref(ig,indf) + forfrac(k) & - & * (forref(ig,indfp) - forref(ig,indf))) + & * (forref(ig,indfp) - forref(ig,indf))) tauo2 = scaleo2 * (kb_mo2(ig,indm) + minorfrac(k) & & * (kb_mo2(ig,indmp) - kb_mo2(ig,indm))) @@ -5900,7 +5900,7 @@ subroutine taugb12 tauself = selffac(k)* (selfref(ig,inds) + selffrac(k) & & * (selfref(ig,indsp) - selfref(ig,inds))) taufor = forfac(k) * (forref(ig,indf) + forfrac(k) & - & * (forref(ig,indfp) - forref(ig,indf))) + & * (forref(ig,indfp) - forref(ig,indf))) taug(ns12+ig,k) = speccomb & & * (fac000*absa(ig,id000) + fac010*absa(ig,id010) & @@ -6129,7 +6129,7 @@ subroutine taugb13 tauself = selffac(k)* (selfref(ig,inds) + selffrac(k) & & * (selfref(ig,indsp) - selfref(ig,inds))) taufor = forfac(k) * (forref(ig,indf) + forfrac(k) & - & * (forref(ig,indfp) - forref(ig,indf))) + & * (forref(ig,indfp) - forref(ig,indf))) co2m1 = ka_mco2(ig,jmco2,indm) + fmco2 & & * (ka_mco2(ig,jmco2p,indm) - ka_mco2(ig,jmco2,indm)) co2m2 = ka_mco2(ig,jmco2,indmp) + fmco2 & @@ -6177,7 +6177,7 @@ subroutine taugb13 end subroutine taugb13 ! ---------------------------------- -!> Band 14: 2250-2380 cm-1 (low - co2; high - co2) +!> Band 14: 2250-2380 cm-1 (low - co2; high - co2) ! ---------------------------------- subroutine taugb14 ! .................................. @@ -6213,7 +6213,7 @@ subroutine taugb14 tauself = selffac(k) * (selfref(ig,inds) + selffrac(k) & & * (selfref(ig,indsp) - selfref(ig,inds))) taufor = forfac(k) * (forref(ig,indf) + forfrac(k) & - & * (forref(ig,indfp) - forref(ig,indf))) + & * (forref(ig,indfp) - forref(ig,indf))) taug(ns14+ig,k) = colamt(k,2) & & * (fac00(k)*absa(ig,ind0) + fac10(k)*absa(ig,ind0p) & @@ -6246,8 +6246,8 @@ subroutine taugb14 end subroutine taugb14 ! ---------------------------------- -!> Band 15: 2380-2600 cm-1 (low - n2o,co2; low minor - n2) -!! (high - nothing) +!> Band 15: 2380-2600 cm-1 (low - n2o,co2; low minor - n2) +!! (high - nothing) ! ---------------------------------- subroutine taugb15 ! .................................. @@ -6325,7 +6325,7 @@ subroutine taugb15 indmp = indm + 1 jplp = jpl + 1 jmn2p = jmn2 + 1 - + if (specparm < 0.125 .and. specparm1 < 0.125) then p0 = fs - f_one @@ -6421,7 +6421,7 @@ subroutine taugb15 tauself = selffac(k)* (selfref(ig,inds) + selffrac(k) & & * (selfref(ig,indsp) - selfref(ig,inds))) taufor = forfac(k) * (forref(ig,indf) + forfrac(k) & - & * (forref(ig,indfp) - forref(ig,indf))) + & * (forref(ig,indfp) - forref(ig,indf))) n2m1 = ka_mn2(ig,jmn2,indm) + fmn2 & & * (ka_mn2(ig,jmn2p,indm) - ka_mn2(ig,jmn2,indm)) n2m2 = ka_mn2(ig,jmn2,indmp) + fmn2 & @@ -6611,7 +6611,7 @@ subroutine taugb16 tauself = selffac(k)* (selfref(ig,inds) + selffrac(k) & & * (selfref(ig,indsp) - selfref(ig,inds))) taufor = forfac(k) * (forref(ig,indf) + forfrac(k) & - & * (forref(ig,indfp) - forref(ig,indf))) + & * (forref(ig,indfp) - forref(ig,indf))) taug(ns16+ig,k) = speccomb & & * (fac000*absa(ig,id000) + fac010*absa(ig,id010) & diff --git a/physics/radsw_main.f b/physics/radsw_main.f index 6897c02de..dce59ed5b 100644 --- a/physics/radsw_main.f +++ b/physics/radsw_main.f @@ -260,7 +260,7 @@ !!!!! ============================================================== !!!!! -!> \ingroup rad +!> \ingroup RRTMG !! \defgroup module_radsw_main module_radsw_main !! This module includes NCEP's modifications of the rrtmg-sw radiation !! code from AER. diff --git a/physics/sfc_drv.f b/physics/sfc_drv.f index 5195ed6a6..ae0918e51 100644 --- a/physics/sfc_drv.f +++ b/physics/sfc_drv.f @@ -1,3 +1,21 @@ +!> \file sfc_drv.f +!! This file contains the NOAH land surface scheme. + +!> \defgroup NOAH NOAH Land Surface +!! @{ +!! \brief Brief description of the parameterization +!! \section diagram Calling Hierarchy Diagram +!! \section intraphysics Intraphysics Communication + +!> \brief Brief description of the subroutine +!! +!! | 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 | +!! +!! \section general General Algorithm +!! \section detailed Detailed Algorithm +!! @{ ! ===================================================================== ! ! description: ! ! ! @@ -170,7 +188,7 @@ subroutine sfc_drv & & qsurf, gflux, drain, evap, hflx, ep, runoff, cmm, chh, & & evbs, evcw, sbsno, snowc, stm, snohf, smcwlt2, smcref2, & & zorl, wet1 - + ! --- locals: real (kind=kind_phys), dimension(im) :: rch, rho, & & q0, qs1, theta1, wind, weasd_old, snwdph_old, & @@ -192,7 +210,7 @@ subroutine sfc_drv & & snomlt, sncovr, soilw, soilm, ssoil, tsea, th2, tbot, & & xlai, zlvl, swdn, tem,z0 - integer :: couple, ice, nsoil, nroot, slope, stype, vtype + integer :: couple, ice, nsoil, nroot, slope, stype, vtype integer :: i, k logical :: flag(im) @@ -245,7 +263,7 @@ subroutine sfc_drv & endif enddo -! --- ... initialize variables +! --- ... initialize variables do i = 1, im if (flag_iter(i) .and. flag(i)) then @@ -276,8 +294,8 @@ subroutine sfc_drv & ! --- ... noah: prepare variables to run noah lsm ! 1. configuration information (c): ! ------------------------------ -! couple - couple-uncouple flag (=1: coupled, =0: uncoupled) -! ffrozp - flag for snow-rain detection (1.=snow, 0.=rain) +! couple - couple-uncouple flag (=1: coupled, =0: uncoupled) +! ffrozp - flag for snow-rain detection (1.=snow, 0.=rain) ! ice - sea-ice flag (=1: sea-ice, =0: land) ! dt - timestep (sec) (dt should not exceed 3600 secs) = delt ! zlvl - height (m) above ground of atmospheric forcing variables @@ -316,9 +334,9 @@ subroutine sfc_drv & solnet = snet(i) !..net sw rad flx (dn-up) at sfc in w/m2 sfcems = sfcemis(i) - sfcprs = prsl1(i) + sfcprs = prsl1(i) prcp = rhoh2o * tprcp(i) / delt - sfctmp = t1(i) + sfctmp = t1(i) th2 = theta1(i) q2 = q0(i) @@ -349,9 +367,9 @@ subroutine sfc_drv & slope = slopetyp(i) shdfac= sigmaf(i) - shdmin1d = shdmin(i) - shdmax1d = shdmax(i) - snoalb1d = snoalb(i) + shdmin1d = shdmin(i) + shdmax1d = shdmax(i) + snoalb1d = snoalb(i) ptu = 0.0 alb = sfalb(i) @@ -403,13 +421,13 @@ subroutine sfc_drv & & vtype, stype, slope, shdmin1d, alb, snoalb1d, & ! --- input/outputs: & tbot, cmc, tsea, stsoil, smsoil, slsoil, sneqv, chx, cmx, & - & z0, & + & z0, & ! --- outputs: & nroot, shdfac, snowh, albedo, eta, sheat, ec, & & edir, et, ett, esnow, drip, dew, beta, etp, ssoil, & & flx1, flx2, flx3, runoff1, runoff2, runoff3, & & snomlt, sncovr, rc, pc, rsmin, xlai, rcs, rct, rcq, & - & rcsoil, soilw, soilm, smcwlt, smcdry, smcref, smcmax) + & rcsoil, soilw, soilm, smcwlt, smcdry, smcref, smcmax) ! --- ... noah: prepare variables for return to parent mode ! 6. output (o): @@ -441,7 +459,7 @@ subroutine sfc_drv & tsurf(i) = tsea do k = 1, km - stc(i,k) = stsoil(k) + stc(i,k) = stsoil(k) smc(i,k) = smsoil(k) slc(i,k) = slsoil(k) enddo @@ -537,7 +555,7 @@ subroutine sfc_drv & slc(i,k) = slc_old(i,k) enddo else - tskin(i) = tsurf(i) + tskin(i) = tsurf(i) endif endif enddo @@ -546,4 +564,5 @@ subroutine sfc_drv & !................................... end subroutine sfc_drv !----------------------------------- - +!> @} +!> @} diff --git a/physics/sfc_nst.f b/physics/sfc_nst.f index 9155172d4..82c3b3cc4 100644 --- a/physics/sfc_nst.f +++ b/physics/sfc_nst.f @@ -1,4 +1,21 @@ +!> \file sfc_nst.f +!! This file contains the GFS NSST model. +!> \defgroup GFS_NSST GFS Near Sea Surface Temperature +!! @{ +!! \brief Brief description of the parameterization +!! \section diagram Calling Hierarchy Diagram +!! \section intraphysics Intraphysics Communication + +!> \brief Brief description of the subroutine +!! +!! | 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 | +!! +!! \section general General Algorithm +!! \section detailed Detailed Algorithm +!! @{ subroutine sfc_nst & !................................... ! --- inputs: @@ -189,7 +206,7 @@ subroutine sfc_nst & ! integer :: k,i ! - real (kind=kind_phys), dimension(im) :: q0, qss, rch, + real (kind=kind_phys), dimension(im) :: q0, qss, rch, & rho_a, theta1, tv1, wind, wndmag real(kind=kind_phys) elocp,tem @@ -197,7 +214,7 @@ subroutine sfc_nst & ! nstm related prognostic fields ! logical flag(im) - real (kind=kind_phys), dimension(im) :: + real (kind=kind_phys), dimension(im) :: & xt_old, xs_old, xu_old, xv_old, xz_old,zm_old,xtts_old, & xzts_old, ifd_old, tref_old, tskin_old, dt_cool_old,z_c_old @@ -291,8 +308,8 @@ subroutine sfc_nst & endif enddo -! run nst model: dtm + slm -! +! run nst model: dtm + slm +! zsea1 = 0.001*real(nstf_name(4)) zsea2 = 0.001*real(nstf_name(5)) do i = 1, im @@ -306,7 +323,7 @@ subroutine sfc_nst & call density(tsea,sss,rho_w) ! sea water density call rhocoef(tsea,sss,rho_w,alpha,beta) ! alpha & beta ! -! calculate sensible heat flux due to rainfall +! calculate sensible heat flux due to rainfall ! le = (2.501-.00237*tsea)*1e6 dwat = 2.11e-5*(t1(i)/t0k)**1.94 ! water vapor diffusivity @@ -382,7 +399,7 @@ subroutine sfc_nst & ! endif rich = ri_c - + call dtm_1p(kdt,timestep,rich,taux,tauy,nswsfc(i), & f_nsol,sss,sep,q_ts,hl_ts,rho_w,alpha,beta,alon, & sinlat(i),soltim,grav,le,d_conv(i), @@ -507,14 +524,14 @@ subroutine sfc_nst & ! qrain(i) = rig(i) zm(i) = wind(i) - + endif enddo ! restore nst-related prognostic fields for guess run do i=1, im if((islimsk(i) == 0) ) then - if(flag_guess(i)) then ! when it is guess of + if(flag_guess(i)) then ! when it is guess of xt(i) = xt_old(i) xs(i) = xs_old(i) xu(i) = xu_old(i) @@ -568,3 +585,4 @@ subroutine sfc_nst & return end +!> @} diff --git a/physics/sfc_sice.f b/physics/sfc_sice.f index 43dc075be..7014a62be 100644 --- a/physics/sfc_sice.f +++ b/physics/sfc_sice.f @@ -1,3 +1,21 @@ +!> \file sfc_sice.f +!! This file contains the GFS thermodynamics surface ice model. + +!> \defgroup GFS_Ice GFS Thermodynamics Surface Ice +!! @{ +!! \brief Brief description of the parameterization +!! \section diagram Calling Hierarchy Diagram +!! \section intraphysics Intraphysics Communication + +!> \brief Brief description of the subroutine +!! +!! | 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 | +!! +!! \section general General Algorithm +!! \section detailed Detailed Algorithm +!! @{ !----------------------------------- subroutine sfc_sice & !................................... @@ -151,7 +169,7 @@ subroutine sfc_sice & real (kind=kind_phys), parameter :: cimin=0.15 ! --- minimum ice concentration integer :: i, k - + logical :: flag(im) ! !===> ... begin here @@ -380,8 +398,11 @@ subroutine sfc_sice & contains ! ================= +!> @} !----------------------------------- +!> \brief Brief description of the subroutine +!! subroutine ice3lay !................................... ! --- inputs: @@ -429,7 +450,7 @@ subroutine ice3lay ! input/outputs: ! ! snowd - real, surface pressure im ! ! hice - real, sea-ice thickness im ! -! stsice - real, temp @ midpt of ice levels (deg c) im,kmi! +! stsice - real, temp @ midpt of ice levels (deg c) im,kmi! ! tice - real, surface temperature (deg c) im ! ! snof - real, snowfall rate (m/sec) im ! ! ! @@ -463,9 +484,9 @@ subroutine ice3lay real (kind=kind_phys), parameter :: tfi = -mu*si ! sea ice freezing temp = -mu*salinity real (kind=kind_phys), parameter :: tfw = -1.8 ! tfw - seawater freezing temp (c) real (kind=kind_phys), parameter :: tfi0 = tfi-0.0001 - real (kind=kind_phys), parameter :: dici = di*ci - real (kind=kind_phys), parameter :: dili = di*li - real (kind=kind_phys), parameter :: dsli = ds*li + real (kind=kind_phys), parameter :: dici = di*ci + real (kind=kind_phys), parameter :: dili = di*li + real (kind=kind_phys), parameter :: dsli = ds*li real (kind=kind_phys), parameter :: ki4 = ki*4.0 ! --- inputs: @@ -650,3 +671,5 @@ end subroutine ice3lay !................................... end subroutine sfc_sice !----------------------------------- + +!> @} From b0f6d877c8096eea9bfd3ad6ac6691c144f3c3ca Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Thu, 1 Mar 2018 12:16:24 -0700 Subject: [PATCH 02/16] added CMakeLists.txt to compile with GMTB SCM; added input.nml (from FV3v0); added new GFS_driver_gmtb_scm.F90 to initialize GFS physics in GMTB SCM --- CMakeLists.txt | 291 ++++++++++++++++++++ GFS_layer/GFS_driver_gmtb_scm.F90 | 436 ++++++++++++++++++++++++++++++ input.nml | 213 +++++++++++++++ 3 files changed, 940 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 GFS_layer/GFS_driver_gmtb_scm.F90 create mode 100644 input.nml diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..a23ed2bd4 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,291 @@ +#------------------------------------------------------------------------------ +cmake_minimum_required(VERSION 2.8.11) + +if(POLICY CMP0048) + cmake_policy(SET CMP0048 NEW) + project(check VERSION 0.0.1) +else(POLICY CMP0048) + project(check) + set(PROJECT_VERSION 0.0.1) + set(PROJECT_VERSION_MAJOR 0) + set(PROJECT_VERSION_MINOR 0) + set(PROJECT_VERSION_PATCH 1) +endif(POLICY CMP0048) + +#------------------------------------------------------------------------------ +set(PACKAGE "gfsphysics") +set(AUTHORS "Grant J. Firl") + +#------------------------------------------------------------------------------ +# Enable Fortran +enable_language(Fortran) + +#------------------------------------------------------------------------------ +# CMake Modules +# Set the CMake module path +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../cmake") + +#------------------------------------------------------------------------------ +# Find OpenMP for C/C++ +find_package(OpenMP) +if(OPENMP_FOUND) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") + message(STATUS "Enabled OpenMP support for C/C++ compiler") +else(OPENMP_FOUND) + message (STATUS "C/C++ compiler does not support OpenMP") +endif() + +#------------------------------------------------------------------------------ +# Find OpenMP for Fortran +FIND_PACKAGE(OpenMP_Fortran) +if(OpenMP_FLAG_DETECTED) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${OpenMP_Fortran_FLAGS}") + message(STATUS "Enabled OpenMP support for Fortran compiler") +else(OpenMP_FLAG_DETECTED) + message (STATUS "Fortran compiler does not support OpenMP") +endif() + +message (STATUS "CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}") +message (STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}") +message (STATUS "CMAKE_Fortran_FLAGS: ${CMAKE_Fortran_FLAGS}") + +#------------------------------------------------------------------------------ +# The Fortran compiler/linker flag inserted by cmake to create shared libraries +# with the Intel compiler is deprecated (-i_dynamic), correct here. +# CMAKE_Fortran_COMPILER_ID = {"Intel", "PGI", "GNU", "Clang", "MSVC", ...} +if ("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "Intel") + string(REPLACE "-i_dynamic" "-shared-intel" + CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS + "${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS}") + string(REPLACE "-i_dynamic" "-shared-intel" + CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS + "${CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS}") +endif() + +#------------------------------------------------------------------------------ +# Set a default build type if none was specified +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(STATUS "Setting build type to 'Debug' as none was specified.") + set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE) + + # Set the possible values of build type for cmake-gui + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" + "MinSizeRel" "RelWithDebInfo") +endif() + +#------------------------------------------------------------------------------ +# By default we want a shared library +option(BUILD_SHARED_LIBS "Build a shared library" ON) + +#------------------------------------------------------------------------------ +# Add the CCPP include/module directory +set(CCPP_INCLUDE_DIRS "" CACHE FILEPATH "Path to ccpp includes") +set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES ${CCPP_INCLUDE_DIRS}) + +#------------------------------------------------------------------------------ +# Add the CCPP library +set(CCPP_LIB_DIRS "" CACHE FILEPATH "Path to ccpp library") +link_directories(${CCPP_LIB_DIRS}) +list(APPEND LIBS "ccpp") + +#------------------------------------------------------------------------------ +# Set the sources +set(SOURCES + ./physics/machine.F + ./physics/physcons.f90 + ./physics/funcphys.f90 + ./GFS_layer/GFS_typedefs.F90 + ./physics/radlw_param.f + ./physics/physparam.f + ./physics/radsw_param.f + ./physics/radiation_aerosols.f + ./physics/iounitdef.f + ./physics/gfs_phy_tracer_config.f + ./physics/radiation_clouds.f + ./physics/module_bfmicrophysics.f + ./physics/radiation_gases.f + ./physics/ozne_def.f + ./physics/radiation_surface.f + ./physics//h2o_def.f + ./physics/sfcsub.F + ./physics/mersenne_twister.f + ./physics/rascnvv2.f + ./physics/GFDL_parse_tracers.F90 + ./physics/wam_f107_kp_mod.f90 + ./physics/num_parthds.F + ./physics/gocart_tracer_config_stub.f + ./GFS_layer/GFS_driver_gmtb_scm.F90 + ./physics/cldwat2m_micro.F + ./physics/wv_saturation.F + ./physics/aer_cloud.F + ./physics/rad_initialize.f + ./GFS_layer/GFS_radiation_driver.F90 + ./physics/radcons.f90 + ./physics/radiation_astronomy.f + ./physics/radsw_main.f + ./physics/radsw_datatb.f + ./physics/GFS_RRTMG_pre.F90 + ./physics/GFS_RRTMG_post.F90 + ./physics/GFS_radsw_pre.F90 + ./physics/GFS_radsw_post.F90 + ./physics/GFS_radlw_pre.F90 + ./physics/GFS_radlw_post.F90 + ./physics/radlw_main.f + ./physics/radlw_datatb.f + ./physics/set_soilveg.f + ./physics/namelist_soilveg.f + ./physics/GFS_phys_time_vary.f90 + ./physics/ozinterp.f90 + ./physics/h2ointerp.f90 + ./physics/gcycle.f90 + ./physics/GFS_rad_time_vary.f90 + ./physics/GFS_radupdate.f90 + ./physics/GFS_suite_interstitial.ccpp.f90 + ./physics/GFS_RRTMG_pre.F90 + ./physics/get_prs_fv3.f90 + ./physics/sfc_sice.f + ./physics/dcyc2.f + ./physics/GFS_surface_generic.f90 + ./physics/GFS_PBL_generic.f90 + ./physics/sfc_drv.f + ./physics/sflx.f + ./physics/sfc_diff.f + ./physics/GFS_surface_loop_control.f + ./physics/sfc_nst.f + ./physics/date_def.f + ./physics/module_nst_water_prop.f90 + ./physics/module_nst_parameters.f90 + ./physics/module_nst_model.f90 + ./physics/sfc_diag.f + ./physics/moninedmf.f + ./physics/mfpbl.f + ./physics/tridi.f + ./physics/gwdps.f + ./physics/rayleigh_damp.f + ./physics/ozphys.f + ./physics/GFS_DCNV_generic.f90 + ./physics/GFS_zhao_carr_pre.f90 + ./physics/mfdeepcnv.f + ./physics/gwdc.f + ./physics/GFS_SCNV_generic.f90 + ./physics/mfshalcnv.f + ./physics/cnvc90.f + ./physics/GFS_MP_generic_pre.f90 + ./physics/gscond.f + ./physics/precpd.f + ./physics/GFS_calpreciptype.f90 + ./physics/GFS_MP_generic_post.f90 + ./physics/radsw_cap.F90 + ./physics/GFS_DCNV_generic_post_cap.F90 + ./physics/GFS_RRTMG_post_cap.F90 + ./physics/ozphys_cap.F90 + ./physics/GFS_suite_interstitial_rad_reset_cap.F90 + ./physics/GFS_MP_generic_pre_cap.F90 + ./physics/GFS_MP_generic_post_cap.F90 + ./physics/gscond_cap.F90 + ./physics/GFS_SCNV_generic_pre_cap.F90 + ./physics/dcyc2t3_post_cap.F90 + ./physics/cnvc90_cap.F90 + ./physics/gwdc_cap.F90 + ./physics/GFS_RRTMG_pre_cap.F90 + ./physics/GFS_zhao_carr_pre_cap.F90 + ./physics/GFS_PBL_generic_pre_cap.F90 + ./physics/radlw_cap.F90 + ./physics/GFS_suite_interstitial_1_cap.F90 + ./physics/gwdps_pre_cap.F90 + ./physics/GFS_suite_interstitial_3_cap.F90 + ./physics/GFS_suite_interstitial_2_cap.F90 + ./physics/dcyc2t3_pre_cap.F90 + ./physics/lsm_noah_pre_cap.F90 + ./physics/sasasshal_post_cap.F90 + ./physics/precpd_cap.F90 + ./physics/sfc_ex_coef_cap.F90 + ./physics/GFS_radsw_post_cap.F90 + ./physics/GFS_PBL_generic_post_cap.F90 + ./physics/sasasshal_cap.F90 + ./physics/GFS_surface_loop_control_part0_cap.F90 + ./physics/GFS_phys_time_vary_2_cap.F90 + ./physics/GFS_phys_time_vary_1_cap.F90 + ./physics/gwdc_pre_cap.F90 + ./physics/GFS_surface_loop_control_part1_cap.F90 + ./physics/sfc_sice_cap.F90 + ./physics/sfc_nst_post_cap.F90 + ./physics/GFS_surface_generic_post_cap.F90 + ./physics/sfc_nst_cap.F90 + ./physics/edmf_cap.F90 + ./physics/GFS_surface_loop_control_part2_cap.F90 + ./physics/GFS_radlw_pre_cap.F90 + ./physics/sfc_sice_pre_cap.F90 + ./physics/ozphys_pre_cap.F90 + ./physics/GFS_radsw_pre_cap.F90 + ./physics/lsm_noah_cap.F90 + ./physics/GFS_suite_interstitial_phys_reset_cap.F90 + ./physics/gwdps_cap.F90 + ./physics/sfc_nst_pre_cap.F90 + ./physics/GFS_SCNV_generic_post_cap.F90 + ./physics/GFS_rad_time_vary_cap.F90 + ./physics/lsm_noah_post_cap.F90 + ./physics/sasasdeep_cap.F90 + ./physics/dcyc2t3_cap.F90 + ./physics/GFS_DCNV_generic_pre_cap.F90 + ./physics/sfc_diag_cap.F90 + ./physics/rayleigh_damp_cap.F90 + ./physics/GFS_radlw_post_cap.F90 + ./physics/sfc_sice_post_cap.F90 + ./physics/gwdc_post_cap.F90 + ./physics/GFS_suite_update_stateout_cap.F90 + ./physics/get_prs_fv3_cap.F90 + ./physics/GFS_surface_generic_pre_cap.F90 + ./physics/ozphys_post_cap.F90 + ./physics/GFS_calpreciptype_cap.F90 + ./physics/get_phi_fv3_cap.F90 + ./physics/gwdps_post_cap.F90 +) + +set(f_flags -ffree-line-length-none) + +SET_SOURCE_FILES_PROPERTIES(./physics/module_bfmicrophysics.f ./physics/rascnvv2.f ./physics/sflx.f ./physics/sfc_diff.f ./physics/sfc_diag.f PROPERTIES COMPILE_FLAGS -fdefault-real-8) +SET_SOURCE_FILES_PROPERTIES(./physics/module_nst_model.f90 ./physics/GFS_calpreciptype.f90 PROPERTIES COMPILE_FLAGS "-fdefault-real-8 -ffree-form") +SET_SOURCE_FILES_PROPERTIES(./physics/mersenne_twister.f PROPERTIES COMPILE_FLAGS "-fdefault-real-8 -fno-range-check") +SET_SOURCE_FILES_PROPERTIES(./physics/module_nst_water_prop.f90 PROPERTIES COMPILE_FLAGS "-ffree-line-length-none -fdefault-real-8 -ffree-form") +SET_SOURCE_FILES_PROPERTIES(./physics/aer_cloud.F ./physics/wv_saturation.F ./physics/cldwat2m_micro.F PROPERTIES COMPILE_FLAGS "-DNEMS_GSM -fdefault-real-8 -fdefault-double-8") + +#apply general fortran tags to all fortran source files +if(${CMAKE_VERSION} LESS 3.3) + string (REPLACE ";" " " f_flags_str "${f_flags}") + SET_PROPERTY(SOURCE ${GFS_phys_source_code} APPEND_STRING PROPERTY COMPILE_FLAGS " ${f_flags_str}") +else(${CMAKE_VERSION} LESS 3.3) + add_compile_options("$<$:${f_flags}>") +endif (${CMAKE_VERSION} LESS 3.3) + +SET(W3LIB_SRC ${CMAKE_SOURCE_DIR}/w3nco/v2.0.6/src) +SET(BACIOLIB_SRC ${CMAKE_SOURCE_DIR}/bacio/v2.0.1/src) +SET(SPLIB_SRC ${CMAKE_SOURCE_DIR}/sp/v2.0.2/src) + +#add "sibling" directories (must specify the build directory too) +ADD_SUBDIRECTORY(${W3LIB_SRC} ${CMAKE_BINARY_DIR}/w3nco) +ADD_SUBDIRECTORY(${BACIOLIB_SRC} ${CMAKE_BINARY_DIR}/bacio) +ADD_SUBDIRECTORY(${SPLIB_SRC} ${CMAKE_BINARY_DIR}/sp) + +INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/w3nco) +INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/sp) +INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/bacio) + +#------------------------------------------------------------------------------ +# Add the auto-generated caps +#add_custom_command( +# OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/scm_cap.f90 +# DEPENDS ${CCPP_MKCAP} +# COMMAND ${CCPP_MKCAP} -o ${CMAKE_CURRENT_BINARY_DIR}/scm_cap.f90 +# ${CMAKE_CURRENT_SOURCE_DIR}/scheme.xml +#) +#list(APPEND SOURCES ${CMAKE_CURRENT_BINARY_DIR}/scm_test1_cap.f90) + + +add_library(gfsphysics ${SOURCES}) +target_link_libraries(gfsphysics LINK_PUBLIC ${LIBS} w3 sp bacio) +set_target_properties(gfsphysics PROPERTIES VERSION ${PROJECT_VERSION} + SOVERSION ${PROJECT_VERSION_MAJOR} + COMPILE_FLAGS ${OpenMP_Fortran_FLAGS} + LINK_FLAGS ${OpenMP_Fortran_FLAGS}) diff --git a/GFS_layer/GFS_driver_gmtb_scm.F90 b/GFS_layer/GFS_driver_gmtb_scm.F90 new file mode 100644 index 000000000..cd76111af --- /dev/null +++ b/GFS_layer/GFS_driver_gmtb_scm.F90 @@ -0,0 +1,436 @@ +module GFS_driver_gmtb_scm + use machine, only: kind_phys + use GFS_typedefs, only: GFS_init_type, & + GFS_statein_type, GFS_stateout_type, & + GFS_sfcprop_type, GFS_coupling_type, & + GFS_control_type, GFS_grid_type, & + GFS_tbd_type, GFS_cldprop_type, & + GFS_radtend_type, GFS_diag_type, & + GFS_sfccycle_type, GFS_interstitial_type + + use module_radsw_parameters, only: topfsw_type, sfcfsw_type + use module_radlw_parameters, only: topflw_type, sfcflw_type + use funcphys, only: gfuncphys + + implicit none + + private + +!-------------------------------------------------------------------------------- +! GFS_init_type +!-------------------------------------------------------------------------------- +! This container is the minimum set of data required from the dycore/atmosphere +! component to allow proper initialization of the GFS physics +! +! Type is defined in GFS_typedefs.F90 +!-------------------------------------------------------------------------------- +! type GFS_init_type +! public +! integer :: me !< my MPI-rank +! integer :: master !< master MPI-rank +! integer :: isc !< starting i-index for this MPI-domain +! integer :: jsc !< starting j-index for this MPI-domain +! integer :: nx !< number of points in i-dir for this MPI rank +! integer :: ny !< number of points in j-dir for this MPI rank +! integer :: levs !< number of vertical levels +! integer :: cnx !< number of points in i-dir for this cubed-sphere face +! !< equal to gnx for lat-lon grids +! integer :: cny !< number of points in j-dir for this cubed-sphere face +! !< equal to gny for lat-lon grids +! integer :: gnx !< number of global points in x-dir (i) along the equator +! integer :: gny !< number of global points in y-dir (j) along any meridian +! integer :: nlunit !< fortran unit number for file opens +! integer :: logunit !< fortran unit number for writing logfile +! integer :: dt_dycore !< dynamics time step in seconds +! integer :: dt_phys !< physics time step in seconds +! integer :: bdat(8) !< model begin date in GFS format (same as idat) +! integer :: cdat(8) !< model current date in GFS format (same as jdat) +! !--- blocking data +! integer, pointer :: blksz(:) !< for explicit data blocking +! !< default blksz(1)=[nx*ny] +! !--- ak/bk for pressure level calculations +! integer, pointer :: ak(:) !< from surface (k=1) to TOA (k=levs) +! integer, pointer :: bk(:) !< from surface (k=1) to TOA (k=levs) +! !--- grid metrics +! real(kind=kind_phys), pointer :: xlon(:,:) !< column longitude for MPI rank +! real(kind=kind_phys), pointer :: xlat(:,:) !< column latitude for MPI rank +! real(kind=kind_phys), pointer :: area(:,:) !< column area for length scale calculations +! +! character(len=32), pointer :: tracer_names(:) !< tracers names to dereference tracer id +! !< based on name location in array +! character(len=65) :: fn_nml !< namelist filename +! end type GFS_init_type +!-------------------------------------------------------------------------------- + +!------------------ +! Module parameters +!------------------ + +!---------------------------- +! Module variable definitions +!---------------------------- + real(kind=kind_phys), parameter :: con_24 = 24.0_kind_phys + real(kind=kind_phys), parameter :: con_hr = 3600.0_kind_phys + real(kind=kind_phys), parameter :: con_99 = 99.0_kind_phys + real(kind=kind_phys), parameter :: con_100 = 100.0_kind_phys + real(kind=kind_phys), parameter :: qmin = 1.0e-10 + + integer, allocatable :: blksz(:) + +!---------------- +! Public entities +!---------------- + public GFS_ozone_and_h20_setup, GFS_initialize !< GFS initialization routine + + CONTAINS +!******************************************************************************************* + + subroutine GFS_ozone_and_h20_setup(n_columns, n_levels, lats, pres, & + n_ozone_lats, n_ozone_layers, n_ozone_coefficients, n_ozone_times, & + ozone_lat, ozone_pres, ozone_time, ozone_forcing_in) + use ozne_def, only: latsozp, levozp, timeoz, oz_coeff, oz_lat, oz_pres, oz_time, ozplin + integer, intent(in) :: n_columns, n_levels + real(kind_phys), intent(in) :: lats(:), pres(:) + + integer, intent(inout) :: n_ozone_lats, n_ozone_layers, n_ozone_coefficients, n_ozone_times + real(kind_phys), allocatable, intent(inout) :: ozone_lat(:), ozone_pres(:), ozone_time(:), ozone_forcing_in(:,:,:,:) + + !set ozone forcing array dimensions + n_ozone_lats = n_columns + n_ozone_layers = n_levels + n_ozone_coefficients = 4 + n_ozone_times = 2 + + !reallocate ozone forcing latitutes, pressure levels, and times using the array dimensions set here + if(allocated(ozone_lat)) then + deallocate(ozone_lat) + allocate(ozone_lat(n_ozone_lats)) + endif + ozone_lat = lats + + if(allocated(ozone_pres)) then + deallocate(ozone_pres) + allocate(ozone_pres(n_ozone_layers)) + endif + ozone_pres = pres + + if(allocated(ozone_time)) then + deallocate(ozone_time) + allocate(ozone_time(n_ozone_times+1)) + endif + ozone_time = (/12.0, 13.0, 14.0/) + + if(allocated(ozone_forcing_in))then + deallocate(ozone_forcing_in) + allocate(ozone_forcing_in(n_ozone_lats, n_ozone_layers, n_ozone_coefficients, n_ozone_times)) + endif + ozone_forcing_in = 0.0 + + !allocate memory for the variables stored in ozne_def and set them + allocate(oz_lat(n_ozone_lats), oz_pres(n_ozone_layers), oz_time(n_ozone_times+1)) + allocate(ozplin(n_ozone_lats, n_ozone_layers, n_ozone_coefficients, n_ozone_times)) + latsozp = n_ozone_lats + levozp = n_ozone_layers + timeoz = n_ozone_times + oz_coeff = n_ozone_coefficients + oz_lat = ozone_lat + oz_pres = ozone_pres + oz_time = ozone_time + ozplin = ozone_forcing_in + + end subroutine GFS_ozone_and_h20_setup + + +!-------------- +! GFS initialze +!-------------- + subroutine GFS_initialize (Model, Statein, Stateout, Sfcprop, & + Coupling, Grid, Tbd, Cldprop, Radtend, & + Diag, Sfccycle, Interstitial, Init_parm, n_columns) + + use module_microphysics, only: gsmconst + use cldwat2m_micro, only: ini_micro + use aer_cloud, only: aer_cloud_init + use module_ras, only: ras_init +#ifdef OPENMP + use omp_lib +#endif + + + !--- interface variables + type(GFS_control_type), intent(inout) :: Model + type(GFS_statein_type), intent(inout) :: Statein + type(GFS_stateout_type), intent(inout) :: Stateout + type(GFS_sfcprop_type), intent(inout) :: Sfcprop + type(GFS_coupling_type), intent(inout) :: Coupling + type(GFS_grid_type), intent(inout) :: Grid + type(GFS_tbd_type), intent(inout) :: Tbd + type(GFS_cldprop_type), intent(inout) :: Cldprop + type(GFS_radtend_type), intent(inout) :: Radtend + type(GFS_diag_type), intent(inout) :: Diag + type(GFS_sfccycle_type), intent(inout) :: Sfccycle + type(GFS_interstitial_type), intent(inout) :: Interstitial + type(GFS_init_type), intent(in) :: Init_parm + integer, intent(in) :: n_columns +! +! !--- local variables +! integer :: nb +! integer :: nblks +! integer :: blkszmax +! integer :: nt +! integer :: nthreads + integer :: ntrac + real(kind=kind_phys), allocatable :: si(:) + real(kind=kind_phys), parameter :: p_ref = 101325.0d0 +! +! nblks = size(Init_parm%blksz) + ntrac = size(Init_parm%tracer_names) +! allocate (blksz(nblks)) +! blksz(:) = Init_parm%blksz(:) +! +! !--- set control properties (including namelist read) + call Model%init (Init_parm%nlunit, Init_parm%fn_nml, & + Init_parm%me, Init_parm%master, & + Init_parm%logunit, Init_parm%isc, & + Init_parm%jsc, Init_parm%nx, Init_parm%ny, & + Init_parm%levs, Init_parm%cnx, Init_parm%cny, & + Init_parm%gnx, Init_parm%gny, & + Init_parm%dt_dycore, Init_parm%dt_phys, & + Init_parm%bdat, Init_parm%cdat, & + Init_parm%tracer_names, Init_parm%blksz) + + + +! +! call read_o3data (Model%ntoz, Model%me, Model%master) +! call read_h2odata (Model%h2o_phys, Model%me, Model%master) +! +! blkszmax = 0 +! do nb = 1,nblks + call Statein%create(1, Model) + call Stateout%create(1, Model) + call Sfcprop%create(1, Model) + call Coupling%create(1, Model) + call Grid%create(1, Model) + call Tbd%create(1, 1, Model) + call Cldprop%create(1, Model) + call Radtend%create(1, Model) + !--- internal representation of diagnostics + call Diag%create(1, Model) + !--- internal representation of sfccycle + call Sfccycle%create(1, Model) +! !--- maximum blocksize +! blkszmax = max(blkszmax, Init_parm%blksz(nb)) +! enddo +! +! #ifdef CCPP +! #ifdef OPENMP +! nthreads = omp_get_max_threads() +! #else +! nthreads = 1 +! #endif +! do nt=1,nthreads + + + call Interstitial%create(1, Model) +! enddo +! #endif +! +! !--- populate the grid components + call GFS_grid_populate (Grid, Init_parm%xlon, Init_parm%xlat, Init_parm%area) + +! +! !--- read in and initialize ozone and water +! if (Model%ntoz > 0) then +! do nb = 1, nblks +! call setindxoz (Init_parm%blksz(nb), Grid(nb)%xlat_d, Grid(nb)%jindx1_o3, & +! Grid(nb)%jindx2_o3, Grid(nb)%ddy_o3) +! enddo +! endif +! +! if (Model%h2o_phys) then +! do nb = 1, nblks +! call setindxh2o (Init_parm%blksz(nb), Grid(nb)%xlat_d, Grid(nb)%jindx1_h, & +! Grid(nb)%jindx2_h, Grid(nb)%ddy_h) +! enddo +! endif +! +! !--- Call gfuncphys (funcphys.f) to compute all physics function tables. + call gfuncphys () +! + call gsmconst (Model%dtp, Model%me, .TRUE.) +! +! !--- define sigma level for radiation initialization +! !--- The formula converting hybrid sigma pressure coefficients to sigma coefficients follows Eckermann (2009, MWR) +! !--- ps is replaced with p0. The value of p0 uses that in http://www.emc.ncep.noaa.gov/officenotes/newernotes/on461.pdf +! !--- ak/bk have been flipped from their original FV3 orientation and are defined sfc -> toa + allocate(si(Model%levr+1)) + si = (Init_parm%ak + Init_parm%bk * p_ref - Init_parm%ak(Model%levr+1)) & + / (p_ref - Init_parm%ak(Model%levr+1)) + call rad_initialize (si, Model%levr, Model%ictm, Model%isol, & + Model%ico2, Model%iaer, Model%ialb, Model%iems, & + Model%ntcw, Model%num_p3d, Model%npdf3d, Model%ntoz, & + Model%iovr_sw, Model%iovr_lw, Model%isubc_sw, & + Model%isubc_lw, Model%crick_proof, Model%ccnorm, & + Model%norad_precip, Model%idate,Model%iflip, Model%me) + deallocate (si) +! +! !--- initialize Morrison-Gettleman microphysics + if (Model%ncld == 2) then + call ini_micro (Model%mg_dcs, Model%mg_qcvar, Model%mg_ts_auto_ice) + call aer_cloud_init () + endif +! +! !--- initialize ras + if (Model%ras) call ras_init (Model%levs, Model%me) +! +! !--- initialize soil vegetation + call set_soilveg(Model%me, Model%isot, Model%ivegsrc, Model%nlunit) +! +! !--- lsidea initialization + if (Model%lsidea) then + print *,' LSIDEA is active but needs to be reworked for FV3 - shutting down' + stop + !--- NEED TO get the logic from the old phys/gloopb.f initialization area + endif +! +! !--- sncovr may not exist in ICs from chgres. +! !--- FV3GFS handles this as part of the IC ingest +! !--- this not is placed here to alert users to the need to study +! !--- the FV3GFS_io.F90 module +! + end subroutine GFS_initialize +! +! +! #ifndef CCPP +! !------------------------------------------------------------------------- +! ! time_vary_step +! !------------------------------------------------------------------------- +! ! routine called prior to radiation and physics steps to handle: +! ! 1) sets up various time/date variables +! ! 2) sets up various triggers +! ! 3) defines random seed indices for radiation (in a reproducible way) +! ! 5) interpolates coefficients for prognostic ozone calculation +! ! 6) performs surface data cycling via the GFS gcycle routine +! !------------------------------------------------------------------------- +! subroutine GFS_time_vary_step (Model, Statein, Stateout, Sfcprop, Coupling, & +! Grid, Tbd, Cldprop, Radtend, Diag, Sfccycle) +! +! use GFS_phys_time_vary_1, only: GFS_phys_time_vary_1_run +! use GFS_phys_time_vary_2, only: GFS_phys_time_vary_2_run +! use GFS_rad_time_vary, only: GFS_rad_time_vary_run +! implicit none +! +! !--- interface variables +! type(GFS_control_type), intent(inout) :: Model +! type(GFS_statein_type), intent(inout) :: Statein +! type(GFS_stateout_type), intent(inout) :: Stateout +! type(GFS_sfcprop_type), intent(inout) :: Sfcprop +! type(GFS_coupling_type), intent(inout) :: Coupling +! type(GFS_grid_type), intent(inout) :: Grid +! type(GFS_tbd_type), intent(inout) :: Tbd +! type(GFS_cldprop_type), intent(inout) :: Cldprop +! type(GFS_radtend_type), intent(inout) :: Radtend +! type(GFS_diag_type), intent(inout) :: Diag +! type(GFS_sfccycle_type), intent(inout) :: Sfccycle +! +! call GFS_phys_time_vary_1_run (Model, Tbd) +! +! call GFS_rad_time_vary_run (Model, Statein, Tbd) +! +! call GFS_phys_time_vary_2_run (Grid, Model, Tbd, Sfcprop, Cldprop, Diag, Sfccycle) +! +! end subroutine GFS_time_vary_step +! +! +! !------------------------------------------------------------------------- +! ! GFS stochastic_driver +! !------------------------------------------------------------------------- +! ! routine called prior to radiation and physics steps to handle: +! ! 1) sets up various time/date variables +! ! 2) sets up various triggers +! ! 3) defines random seed indices for radiation (in a reproducible way) +! ! 5) interpolates coefficients for prognostic ozone calculation +! ! 6) performs surface data cycling via the GFS gcycle routine +! !------------------------------------------------------------------------- +! subroutine GFS_stochastic_driver (Model, Statein, Stateout, Sfcprop, Coupling, & +! Grid, Tbd, Cldprop, Radtend, Diag) +! +! use GFS_stochastics, only: GFS_stochastics_run +! +! implicit none +! +! !--- interface variables +! type(GFS_control_type), intent(in ) :: Model +! type(GFS_statein_type), intent(in ) :: Statein +! type(GFS_stateout_type), intent(in ) :: Stateout +! type(GFS_sfcprop_type), intent(in ) :: Sfcprop +! type(GFS_coupling_type), intent(inout) :: Coupling +! type(GFS_grid_type), intent(in ) :: Grid +! type(GFS_tbd_type), intent(in ) :: Tbd +! type(GFS_cldprop_type), intent(in ) :: Cldprop +! type(GFS_radtend_type), intent(in ) :: Radtend +! type(GFS_diag_type), intent(inout) :: Diag +! +! call GFS_stochastics_run(Model, Statein, Stateout, Sfcprop, Coupling, & +! Grid, Tbd, Cldprop, Radtend, Diag) +! +! end subroutine GFS_stochastic_driver +! #endif +! +! +!------------------ +! GFS_grid_populate +!------------------ + subroutine GFS_grid_populate (Grid, xlon, xlat, area) + use physcons, only: pi => con_pi + + implicit none + + type(GFS_grid_type) :: Grid + real(kind=kind_phys), intent(in) :: xlon(:,:) + real(kind=kind_phys), intent(in) :: xlat(:,:) + real(kind=kind_phys), intent(in) :: area(:,:) + + !--- local variables + !integer :: nb, ix, blksz, i, j + integer :: n_columns, i + + n_columns = size(Grid%xlon) + + do i=1, n_columns + Grid%xlon = xlon(i,1) + Grid%xlat = xlat(i,1) + Grid%xlat_d(i) = xlat(i,1) * 180.0_kind_phys/pi + Grid%sinlat(i) = sin(Grid%xlat(i)) + Grid%coslat(i) = sqrt(1.0_kind_phys - Grid%sinlat(i)*Grid%sinlat(i)) + Grid%area(i) = area(i,1) + Grid%dx(i) = sqrt(area(i,1)) + end do + + ! blksz = size(Grid(1)%xlon) + + ! nb = 1 + ! ix = 0 + ! do j = 1,size(xlon,2) + ! do i = 1,size(xlon,1) + ! ix=ix+1 + ! if (ix .gt. blksz) then + ! nb = nb + 1 + ! ix = 1 + ! endif + ! Grid(nb)%xlon(ix) = xlon(i,j) + ! Grid(nb)%xlat(ix) = xlat(i,j) + ! Grid(nb)%xlat_d(ix) = xlat(i,j) * 180.0_kind_phys/pi + ! Grid(nb)%sinlat(ix) = sin(Grid(nb)%xlat(ix)) + ! Grid(nb)%coslat(ix) = sqrt(1.0_kind_phys - Grid(nb)%sinlat(ix)*Grid(nb)%sinlat(ix)) + ! Grid(nb)%area(ix) = area(i,j) + ! Grid(nb)%dx(ix) = sqrt(area(i,j)) + ! enddo + ! enddo + + + + end subroutine GFS_grid_populate + +end module GFS_driver_gmtb_scm diff --git a/input.nml b/input.nml new file mode 100644 index 000000000..cb253e69a --- /dev/null +++ b/input.nml @@ -0,0 +1,213 @@ +&amip_interp_nml + interp_oi_sst = .true. + use_ncep_sst = .true. + use_ncep_ice = .false. + no_anom_sst = .false. + data_set = 'reynolds_oi', + date_out_of_range = 'climo', +/ + +&atmos_model_nml + blocksize = 32 + chksum_debug = .false. + dycore_only = .false. + ccpp_suite = "suite_GFS_IPD.xml" +/ + +&diag_manager_nml + prepend_date = .F. +/ + +&fms_io_nml + checksum_required = .false. + max_files_r = 100, + max_files_w = 100, +/ + +&fms_nml + clock_grain = 'ROUTINE', + domains_stack_size = 115200, + print_memory_usage = .false. +/ + +&fv_grid_nml + grid_file = 'INPUT/grid_spec.nc' +/ + +&fv_core_nml + layout = @[INPES],@[JNPES] + io_layout = 1,1 + npx = 97 + npy = 97 + ntiles = 6, + npz = 63 + grid_type = -1 + make_nh = @[MAKE_NH] + fv_debug = .F. + range_warn = .F. + reset_eta = .F. + n_sponge = 24 + nudge_qv = .T. + tau = 5. + rf_cutoff = 7.5e2 + d2_bg_k1 = 0.15 + d2_bg_k2 = 0.02 + kord_tm = -9 + kord_mt = 9 + kord_wz = 9 + kord_tr = 9 + hydrostatic = .F. + phys_hydrostatic = .F. + use_hydro_pressure = .F. + beta = 0. + a_imp = 1. + p_fac = 0.1 + k_split = 2 + n_split = 6 + nwat = 2 + na_init = @[NA_INIT] + d_ext = 0.0 + dnats = 0 + fv_sg_adj = 450 + d2_bg = 0. + nord = 2 + dddmp = 0.1 + d4_bg = 0.12 + vtdm4 = 0.02 + delt_max = 0.002 + ke_bg = 0. + do_vort_damp = .true. + external_ic = @[EXTERNAL_IC] + gfs_phil = .false. + nggps_ic = @[NGGPS_IC] + mountain = @[MOUNTAIN] + ncep_ic = .F. + d_con = 1. + hord_mt = 6 + hord_vt = 6 + hord_tm = 6 + hord_dp = 6 + hord_tr = 8 + adjust_dry_mass = .F. + consv_te = 1. + consv_am = .F. + fill = .T. + dwind_2d = .F. + print_freq = 6 + warm_start = @[WARM_START] + no_dycore = .false. + z_tracer = .T. +/ + +#&coupler_nml +# months = 0 +# days = 1 +# hours = 0 +# dt_atmos = 225 +# dt_ocean = 225 +# current_date = 2016,10,03,00,0,0 +# calendar = 'julian' +# memuse_verbose = .false. +# atmos_nthreads = 1 +# use_hyper_thread = .false. +# ncores_per_node = 24 +#/ + +&external_ic_nml + filtered_terrain = .true. + ncep_plevels = .true. + levp = 64 + gfs_dwinds = .true. + checker_tr = .F. + nt_checker = 0 +/ + +&gfs_physics_nml + fhzero = 6. + ldiag3d = .false. + fhcyc = 0. + nst_anl = .true. + use_ufo = .true. + pre_rad = .false. + ncld = 1 + zhao_mic = .true. + pdfcld = .false. + fhswr = 3600. + fhlwr = 3600. + ialb = 1 + iems = 1 + IAER = 111 + ico2 = 2 + isubc_sw = 2 + isubc_lw = 2 + isol = 2 + lwhtr = .true. + swhtr = .true. + cnvgwd = .true. + shal_cnv = .true. + cal_pre = .true. + redrag = .true. + dspheat = .true. + hybedmf = .true. + random_clds = .true. + trans_trac = .true. + cnvcld = .true. + imfshalcnv = 2 + imfdeepcnv = 2 + cdmbgwd = 3.5,0.25 + prslrd0 = 0. + ivegsrc = 1 + isot = 1 + debug = .true. + nstf_name = 2,0,1,0,5 +/ + +&nggps_diag_nml + fdiag = @[FDIAG] +/ + +&interpolator_nml + interp_method = 'conserve_great_circle' +/ + +&namsfc + FNGLAC = "global_glacier.2x2.grb", + FNMXIC = "global_maxice.2x2.grb", + FNTSFC = "RTGSST.1982.2012.monthly.clim.grb", + FNSNOC = "global_snoclim.1.875.grb", + FNZORC = "igbp", + FNALBC = "global_snowfree_albedo.bosu.t126.384.190.rg.grb", + FNALBC2 = "global_albedo4.1x1.grb", + FNAISC = "CFSR.SEAICE.1982.2012.monthly.clim.grb", + FNTG3C = "global_tg3clim.2.6x1.5.grb", + FNVEGC = "global_vegfrac.0.144.decpercent.grb", + FNVETC = "global_vegtype.igbp.t126.384.190.rg.grb", + FNSOTC = "global_soiltype.statsgo.t126.384.190.rg.grb", + FNSMCC = "global_soilmgldas.t126.384.190.grb", + FNMSKH = "seaice_newland.grb", + FNTSFA = "", + FNACNA = "", + FNSNOA = "", + FNVMNC = "global_shdmin.0.144x0.144.grb", + FNVMXC = "global_shdmax.0.144x0.144.grb", + FNSLPC = "global_slope.1x1.grb", + FNABSC = "global_mxsnoalb.uariz.t126.384.190.rg.grb", + LDEBUG =.false., + FSMCL(2) = 99999 + FSMCL(3) = 99999 + FSMCL(4) = 99999 + FTSFS = 90 + FAISS = 99999 + FSNOL = 99999 + FSICL = 99999 + FTSFL = 99999, + FAISL = 99999, + FVETL = 99999, + FSOTL = 99999, + FvmnL = 99999, + FvmxL = 99999, + FSLPL = 99999, + FABSL = 99999, + FSNOS = 99999, + FSICS = 99999, +/ From 7e2ab99c2a75e85fdebdce069e9c802626f2e570 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Fri, 2 Mar 2018 16:42:01 -0700 Subject: [PATCH 03/16] minor change to GFS_Layer/GFS_type_defs.f90 to initialize npdf3d; added jcap to input.nml (not necessarily needed) --- GFS_layer/GFS_typedefs.F90 | 236 +++++++++++++++++++------------------ input.nml | 3 + 2 files changed, 124 insertions(+), 115 deletions(-) diff --git a/GFS_layer/GFS_typedefs.F90 b/GFS_layer/GFS_typedefs.F90 index 209572508..547b8beca 100644 --- a/GFS_layer/GFS_typedefs.F90 +++ b/GFS_layer/GFS_typedefs.F90 @@ -62,7 +62,7 @@ module GFS_typedefs ! GFS_sfccycle_type !< surface cycling/update fields ! GFS_coupling_type !< fields to/from coupling with other components (e.g. land/ice/ocean/etc.) ! !---GFS specific containers -! GFS_control_type !< model control parameters +! GFS_control_type !< model control parameters ! GFS_grid_type !< grid and interpolation related data ! GFS_tbd_type !< to be determined data that doesn't fit in any one container ! GFS_cldprop_type !< cloud fields needed by radiation from physics @@ -173,7 +173,7 @@ module GFS_typedefs !! type GFS_statein_type - !--- level geopotential and pressures + !--- level geopotential and pressures real (kind=kind_phys), pointer :: phii (:,:) => null() !< interface geopotential height real (kind=kind_phys), pointer :: prsi (:,:) => null() !< model level pressure in Pa real (kind=kind_phys), pointer :: prsik (:,:) => null() !< Exner function at interface @@ -293,11 +293,11 @@ module GFS_typedefs !--- In (radiation and physics) real (kind=kind_phys), pointer :: slmsk (:) => null() !< sea/land mask array (sea:0,land:1,sea-ice:2) - real (kind=kind_phys), pointer :: tsfc (:) => null() !< surface temperature in k + real (kind=kind_phys), pointer :: tsfc (:) => null() !< surface temperature in k !< [tsea in gbphys.f] - real (kind=kind_phys), pointer :: tisfc (:) => null() !< surface temperature over ice fraction + real (kind=kind_phys), pointer :: tisfc (:) => null() !< surface temperature over ice fraction real (kind=kind_phys), pointer :: snowd (:) => null() !< snow depth water equivalent in mm ; same as snwdph - real (kind=kind_phys), pointer :: zorl (:) => null() !< surface roughness in cm + real (kind=kind_phys), pointer :: zorl (:) => null() !< surface roughness in cm real (kind=kind_phys), pointer :: fice (:) => null() !< ice fraction over open water grid real (kind=kind_phys), pointer :: hprim (:) => null() !< topographic standard deviation in m real (kind=kind_phys), pointer :: hprime (:,:) => null() !< orographic metrics @@ -321,7 +321,7 @@ module GFS_typedefs real (kind=kind_phys), pointer :: vtype (:) => null() !< vegetation type real (kind=kind_phys), pointer :: stype (:) => null() !< soil type real (kind=kind_phys), pointer :: uustar (:) => null() !< boundary layer parameter - real (kind=kind_phys), pointer :: oro (:) => null() !< orography + real (kind=kind_phys), pointer :: oro (:) => null() !< orography real (kind=kind_phys), pointer :: oro_uf (:) => null() !< unfiltered orography !-- In/Out @@ -466,7 +466,7 @@ module GFS_typedefs type GFS_coupling_type !--- Out (radiation only) - real (kind=kind_phys), pointer :: nirbmdi(:) => null() !< sfc nir beam sw downward flux (w/m2) + real (kind=kind_phys), pointer :: nirbmdi(:) => null() !< sfc nir beam sw downward flux (w/m2) real (kind=kind_phys), pointer :: nirdfdi(:) => null() !< sfc nir diff sw downward flux (w/m2) real (kind=kind_phys), pointer :: visbmdi(:) => null() !< sfc uv+vis beam sw downward flux (w/m2) real (kind=kind_phys), pointer :: visdfdi(:) => null() !< sfc uv+vis diff sw downward flux (w/m2) @@ -494,17 +494,17 @@ module GFS_typedefs !--- outgoing accumulated quantities real (kind=kind_phys), pointer :: rain_cpl (:) => null() !< total rain precipitation - real (kind=kind_phys), pointer :: snow_cpl (:) => null() !< total snow precipitation + real (kind=kind_phys), pointer :: snow_cpl (:) => null() !< total snow precipitation real (kind=kind_phys), pointer :: dusfc_cpl (:) => null() !< sfc u momentum flux real (kind=kind_phys), pointer :: dvsfc_cpl (:) => null() !< sfc v momentum flux real (kind=kind_phys), pointer :: dtsfc_cpl (:) => null() !< sfc sensible heat flux real (kind=kind_phys), pointer :: dqsfc_cpl (:) => null() !< sfc latent heat flux real (kind=kind_phys), pointer :: dlwsfc_cpl(:) => null() !< sfc downward lw flux (w/m**2) real (kind=kind_phys), pointer :: dswsfc_cpl(:) => null() !< sfc downward sw flux (w/m**2) - real (kind=kind_phys), pointer :: dnirbm_cpl(:) => null() !< sfc nir beam downward sw flux (w/m**2) - real (kind=kind_phys), pointer :: dnirdf_cpl(:) => null() !< sfc nir diff downward sw flux (w/m**2) - real (kind=kind_phys), pointer :: dvisbm_cpl(:) => null() !< sfc uv+vis beam dnwd sw flux (w/m**2) - real (kind=kind_phys), pointer :: dvisdf_cpl(:) => null() !< sfc uv+vis diff dnwd sw flux (w/m**2) + real (kind=kind_phys), pointer :: dnirbm_cpl(:) => null() !< sfc nir beam downward sw flux (w/m**2) + real (kind=kind_phys), pointer :: dnirdf_cpl(:) => null() !< sfc nir diff downward sw flux (w/m**2) + real (kind=kind_phys), pointer :: dvisbm_cpl(:) => null() !< sfc uv+vis beam dnwd sw flux (w/m**2) + real (kind=kind_phys), pointer :: dvisdf_cpl(:) => null() !< sfc uv+vis diff dnwd sw flux (w/m**2) real (kind=kind_phys), pointer :: nlwsfc_cpl(:) => null() !< net downward lw flux (w/m**2) real (kind=kind_phys), pointer :: nswsfc_cpl(:) => null() !< net downward sw flux (w/m**2) real (kind=kind_phys), pointer :: nnirbm_cpl(:) => null() !< net nir beam downward sw flux (w/m**2) @@ -564,7 +564,7 @@ module GFS_typedefs !---------------------------------------------------------------------------------- ! GFS_control_type ! model control parameters input from a namelist and/or derived from others -! list of those that can be modified during the run are at the bottom of the list +! list of those that can be modified during the run are at the bottom of the list !---------------------------------------------------------------------------------- !! \section arg_table_GFS_control_type !! | local var name | longname | description | units | rank | type | kind | intent | optional | @@ -813,7 +813,7 @@ module GFS_typedefs !< available; use latest; do extrapolation. !< ictm=yyyy0 => use yyyy data for the forecast time; !< no extrapolation. - !< ictm=yyyy1 = > use yyyy data for the fcst. If needed, + !< ictm=yyyy1 = > use yyyy data for the fcst. If needed, !< do extrapolation to match the fcst time. !< ictm=-1 => use user provided external data for !< the fcst time; no extrapolation. @@ -825,7 +825,7 @@ module GFS_typedefs !< =2 => sub-grid cloud with randomly generated !< seeds logical :: crick_proof !< CRICK-Proof cloud water - logical :: ccnorm !< Cloud condensate normalized by cloud cover + logical :: ccnorm !< Cloud condensate normalized by cloud cover logical :: norad_precip !< radiation precip flag for Ferrier/Moorthi logical :: lwhtr !< flag to output lw heating rate (Radtend%lwhc) logical :: swhtr !< flag to output sw heating rate (Radtend%swhc) @@ -842,13 +842,13 @@ module GFS_typedefs !--- M-G microphysical parameters integer :: fprcp !< no prognostic rain and snow (MG) real(kind=kind_phys) :: mg_dcs !< Morrison-Gettleman microphysics parameters - real(kind=kind_phys) :: mg_qcvar + real(kind=kind_phys) :: mg_qcvar real(kind=kind_phys) :: mg_ts_auto_ice !< ice auto conversion time scale !--- land/surface model parameters integer :: lsm !< flag for land surface model lsm=1 for noah lsm integer :: lsoil !< number of soil layers - integer :: ivegsrc !< ivegsrc = 0 => USGS, + integer :: ivegsrc !< ivegsrc = 0 => USGS, !< ivegsrc = 1 => IGBP (20 category) !< ivegsrc = 2 => UMD (13 category) integer :: isot !< isot = 0 => Zobler soil type ( 9 category) @@ -878,7 +878,7 @@ module GFS_typedefs logical :: redrag !< flag for reduced drag coeff. over sea logical :: hybedmf !< flag for hybrid edmf pbl scheme logical :: dspheat !< flag for tke dissipative heating - logical :: cnvcld + logical :: cnvcld logical :: random_clds !< flag controls whether clouds are random logical :: shal_cnv !< flag for calling shallow convection integer :: imfshalcnv !< flag for mass-flux shallow convection scheme @@ -902,11 +902,11 @@ module GFS_typedefs !< workfunction for RAS real(kind=kind_phys) :: cdmbgwd(2) !< multiplication factors for cdmb and gwd real(kind=kind_phys) :: sup !< supersaturation in pdf cloud when t is very low - real(kind=kind_phys) :: ctei_rm(2) !< critical cloud top entrainment instability criteria + real(kind=kind_phys) :: ctei_rm(2) !< critical cloud top entrainment instability criteria !< (used if mstrat=.true.) real(kind=kind_phys) :: crtrh(3) !< critical relative humidity at the surface !< PBL top and at the top of the atmosphere - real(kind=kind_phys) :: dlqf(2) !< factor for cloud condensate detrainment + real(kind=kind_phys) :: dlqf(2) !< factor for cloud condensate detrainment !< from cloud edges for RAS integer :: seed0 !< random seed for radiation @@ -916,10 +916,10 @@ module GFS_typedefs !--- near surface temperature model logical :: nst_anl !< flag for NSSTM analysis in gcycle/sfcsub - integer :: lsea - real(kind=kind_phys) :: xkzm_m !< [in] bkgd_vdif_m background vertical diffusion for momentum - real(kind=kind_phys) :: xkzm_h !< [in] bkgd_vdif_h background vertical diffusion for heat q - real(kind=kind_phys) :: xkzm_s !< [in] bkgd_vdif_s sigma threshold for background mom. diffusion + integer :: lsea + real(kind=kind_phys) :: xkzm_m !< [in] bkgd_vdif_m background vertical diffusion for momentum + real(kind=kind_phys) :: xkzm_h !< [in] bkgd_vdif_h background vertical diffusion for heat q + real(kind=kind_phys) :: xkzm_s !< [in] bkgd_vdif_s sigma threshold for background mom. diffusion integer :: nstf_name(5) !< flag 0 for no nst 1 for uncoupled nst and 2 for coupled NST !< nstf_name contains the NSST related parameters !< nstf_name(1) : 0 = NSSTM off, 1 = NSSTM on but uncoupled, 2 = @@ -927,12 +927,12 @@ module GFS_typedefs !< nstf_name(3) : 1 = NSST analysis on, 0 = NSSTM analysis off !< nstf_name(4) : zsea1 in mm !< nstf_name(5) : zsea2 in mm - + !--- stochastic physics control parameters logical :: do_sppt logical :: do_shum logical :: do_skeb - logical :: do_vc + logical :: do_vc real(kind=kind_phys) :: sppt(5) !< stochastic physics tendency amplitude real(kind=kind_phys) :: shum(5) !< stochastic boundary layer spf hum amp real(kind=kind_phys) :: skeb(5) !< stochastic KE backscatter amplitude @@ -955,7 +955,7 @@ module GFS_typedefs integer :: ntke !< tracer index for kinetic energy integer :: nto !< tracer index for oxygen ion integer :: nto2 !< tracer index for oxygen - + !--- derived totals for phy_f*d integer :: ntot2d !< total number of variables for phyf2d integer :: ntot3d !< total number of variables for phyf3d @@ -968,7 +968,7 @@ module GFS_typedefs integer :: nctp !< number of cloud types in Chikira-Sugiyama scheme !--- debug flag - logical :: debug + logical :: debug logical :: pre_rad !< flag for testing purpose !--- variables modified at each time step @@ -981,7 +981,7 @@ module GFS_typedefs real(kind=kind_phys) :: slag !< equation of time ( radian ) [set via radupdate] real(kind=kind_phys) :: sdec !< sin of the solar declination angle [set via radupdate] real(kind=kind_phys) :: cdec !< cos of the solar declination angle [set via radupdate] - real(kind=kind_phys) :: clstp !< index used by cnvc90 (for convective clouds) + real(kind=kind_phys) :: clstp !< index used by cnvc90 (for convective clouds) !< legacy stuff - does not affect forecast real(kind=kind_phys) :: phour !< previous forecast hour real(kind=kind_phys) :: fhour !< curent forecast hour @@ -1019,15 +1019,15 @@ module GFS_typedefs !! | IPD_Data(nb)%Grid%jindx2_h | | interpolation high index for h2o | index | 1 | integer | | none | F | !! type GFS_grid_type - - real (kind=kind_phys), pointer :: xlon (:) => null() !< grid longitude in radians, ok for both 0->2pi - !! or -pi -> +pi ranges - real (kind=kind_phys), pointer :: xlat (:) => null() !< grid latitude in radians, default to pi/2 -> - !! -pi/2 range, otherwise adj in subr called - real (kind=kind_phys), pointer :: xlat_d (:) => null() !< grid latitude in degrees, default to 90 -> - !! -90 range, otherwise adj in subr called - real (kind=kind_phys), pointer :: sinlat (:) => null() !< sine of the grids corresponding latitudes - real (kind=kind_phys), pointer :: coslat (:) => null() !< cosine of the grids corresponding latitudes + + real (kind=kind_phys), pointer :: xlon (:) => null() !< grid longitude in radians, ok for both 0->2pi + !! or -pi -> +pi ranges + real (kind=kind_phys), pointer :: xlat (:) => null() !< grid latitude in radians, default to pi/2 -> + !! -pi/2 range, otherwise adj in subr called + real (kind=kind_phys), pointer :: xlat_d (:) => null() !< grid latitude in degrees, default to 90 -> + !! -90 range, otherwise adj in subr called + real (kind=kind_phys), pointer :: sinlat (:) => null() !< sine of the grids corresponding latitudes + real (kind=kind_phys), pointer :: coslat (:) => null() !< cosine of the grids corresponding latitudes real (kind=kind_phys), pointer :: area (:) => null() !< area of the grid cell real (kind=kind_phys), pointer :: dx (:) => null() !< relative dx for the grid cell @@ -1089,8 +1089,8 @@ module GFS_typedefs !--- radiation random seeds integer, pointer :: icsdsw (:) => null() !< (rad. only) auxiliary cloud control arrays passed to main - integer, pointer :: icsdlw (:) => null() !< (rad. only) radiations. if isubcsw/isubclw (input to init) - !< (rad. only) are set to 2, the arrays contains provided + integer, pointer :: icsdlw (:) => null() !< (rad. only) radiations. if isubcsw/isubclw (input to init) + !< (rad. only) are set to 2, the arrays contains provided !< (rad. only) random seeds for sub-column clouds generators !--- In @@ -1132,7 +1132,7 @@ module GFS_typedefs !------------------------------------------------------------------ ! GFS_cldprop_type -! cloud properties and tendencies needed by radiation from physics +! cloud properties and tendencies needed by radiation from physics !------------------------------------------------------------------ !! \section arg_table_GFS_cldprop_type !! | local var name | longname | description | units | rank | type | kind | intent | optional | @@ -1180,37 +1180,37 @@ module GFS_typedefs type GFS_radtend_type type (sfcfsw_type), pointer :: sfcfsw(:) => null() !< sw radiation fluxes at sfc - !< [dim(im): created in grrad.f], components: - !! (check module_radsw_parameters for definition) - !!\n %upfxc - total sky upward sw flux at sfc (w/m**2) - !!\n %upfx0 - clear sky upward sw flux at sfc (w/m**2) - !!\n %dnfxc - total sky downward sw flux at sfc (w/m**2) - !!\n %dnfx0 - clear sky downward sw flux at sfc (w/m**2) + !< [dim(im): created in grrad.f], components: + !! (check module_radsw_parameters for definition) + !!\n %upfxc - total sky upward sw flux at sfc (w/m**2) + !!\n %upfx0 - clear sky upward sw flux at sfc (w/m**2) + !!\n %dnfxc - total sky downward sw flux at sfc (w/m**2) + !!\n %dnfx0 - clear sky downward sw flux at sfc (w/m**2) type (sfcflw_type), pointer :: sfcflw(:) => null() !< lw radiation fluxes at sfc - !< [dim(im): created in grrad.f], components: - !! (check module_radlw_paramters for definition) - !!\n %upfxc - total sky upward lw flux at sfc (w/m**2) - !!\n %upfx0 - clear sky upward lw flux at sfc (w/m**2) - !!\n %dnfxc - total sky downward lw flux at sfc (w/m**2) - !!\n %dnfx0 - clear sky downward lw flux at sfc (w/m**2) + !< [dim(im): created in grrad.f], components: + !! (check module_radlw_paramters for definition) + !!\n %upfxc - total sky upward lw flux at sfc (w/m**2) + !!\n %upfx0 - clear sky upward lw flux at sfc (w/m**2) + !!\n %dnfxc - total sky downward lw flux at sfc (w/m**2) + !!\n %dnfx0 - clear sky downward lw flux at sfc (w/m**2) !--- Out (radiation only) - real (kind=kind_phys), pointer :: htrsw (:,:) => null() !< swh total sky sw heating rate in k/sec + real (kind=kind_phys), pointer :: htrsw (:,:) => null() !< swh total sky sw heating rate in k/sec real (kind=kind_phys), pointer :: htrlw (:,:) => null() !< hlw total sky lw heating rate in k/sec - real (kind=kind_phys), pointer :: sfalb (:) => null() !< mean surface diffused sw albedo + real (kind=kind_phys), pointer :: sfalb (:) => null() !< mean surface diffused sw albedo - real (kind=kind_phys), pointer :: coszen(:) => null() !< mean cos of zenith angle over rad call period - real (kind=kind_phys), pointer :: tsflw (:) => null() !< surface air temp during lw calculation in k + real (kind=kind_phys), pointer :: coszen(:) => null() !< mean cos of zenith angle over rad call period + real (kind=kind_phys), pointer :: tsflw (:) => null() !< surface air temp during lw calculation in k real (kind=kind_phys), pointer :: semis (:) => null() !< surface lw emissivity in fraction !--- In/Out (???) (radiaition only) real (kind=kind_phys), pointer :: coszdg(:) => null() !< daytime mean cosz over rad call period !--- In/Out (???) (physics only) - real (kind=kind_phys), pointer :: swhc (:,:) => null() !< clear sky sw heating rates ( k/s ) - real (kind=kind_phys), pointer :: lwhc (:,:) => null() !< clear sky lw heating rates ( k/s ) - real (kind=kind_phys), pointer :: lwhd (:,:,:) => null() !< idea sky lw heating rates ( k/s ) + real (kind=kind_phys), pointer :: swhc (:,:) => null() !< clear sky sw heating rates ( k/s ) + real (kind=kind_phys), pointer :: lwhc (:,:) => null() !< clear sky lw heating rates ( k/s ) + real (kind=kind_phys), pointer :: lwhd (:,:,:) => null() !< idea sky lw heating rates ( k/s ) contains procedure :: create => radtend_create !< allocate array data @@ -1218,7 +1218,7 @@ module GFS_typedefs !---------------------------------------------------------------- ! GFS_diag_type -! internal diagnostic type used as arguments to gbphys and grrad +! internal diagnostic type used as arguments to gbphys and grrad !---------------------------------------------------------------- !! \section arg_table_GFS_diag_type !! | local var name | longname | description | units | rank | type | kind | intent | optional | @@ -1309,10 +1309,10 @@ module GFS_typedefs !! Input/Output only in radiation real (kind=kind_phys), pointer :: fluxr (:,:) => null() !< to save time accumulated 2-d fields defined as:! !< hardcoded field indices, opt. includes aerosols! - type (topfsw_type), pointer :: topfsw(:) => null() !< sw radiation fluxes at toa, components: - ! %upfxc - total sky upward sw flux at toa (w/m**2) - ! %dnfxc - total sky downward sw flux at toa (w/m**2) - ! %upfx0 - clear sky upward sw flux at toa (w/m**2) + type (topfsw_type), pointer :: topfsw(:) => null() !< sw radiation fluxes at toa, components: + ! %upfxc - total sky upward sw flux at toa (w/m**2) + ! %dnfxc - total sky downward sw flux at toa (w/m**2) + ! %upfx0 - clear sky upward sw flux at toa (w/m**2) type (topflw_type), pointer :: topflw(:) => null() !< lw radiation fluxes at top, component: ! %upfxc - total sky upward lw flux at toa (w/m**2) ! %upfx0 - clear sky upward lw flux at toa (w/m**2) @@ -1395,7 +1395,7 @@ module GFS_typedefs real (kind=kind_phys), pointer :: dv3dt (:,:,:) => null() !< v momentum change due to physics real (kind=kind_phys), pointer :: dt3dt (:,:,:) => null() !< temperature change due to physics real (kind=kind_phys), pointer :: dq3dt (:,:,:) => null() !< moisture change due to physics - + !--- accumulated quantities for 3D diagnostics real (kind=kind_phys), pointer :: upd_mf (:,:) => null() !< instantaneous convective updraft mass flux real (kind=kind_phys), pointer :: dwn_mf (:,:) => null() !< instantaneous convective downdraft mass flux @@ -1445,7 +1445,7 @@ module GFS_typedefs !! | IPD_Interstitial(nt)%clouds(:,:,5) | mean_effective_radius_for_ice_cloud | mean effective radius for ice cloud | micron | 2 | real | kind_phys | none | F | !! | IPD_Interstitial(nt)%clouds(:,:,6) | cloud_rain_water_path | cloud rain water path | g m-2 | 2 | real | kind_phys | none | F | !! | IPD_Interstitial(nt)%clouds(:,:,7) | mean_effective_radius_for_rain_drop | mean effective radius for rain drop | micron | 2 | real | kind_phys | none | F | -!! | IPD_Interstitial(nt)%clouds(:,:,8) | cloud_snow_water_path | cloud snow water path | g m-2 | 2 | real | kind_phys | none | F | +!! | IPD_Interstitial(nt)%clouds(:,:,8) | cloud_snow_water_path | cloud snow water path | g m-2 | 2 | real | kind_phys | none | F | !! | IPD_Interstitial(nt)%clouds(:,:,9) | mean_effective_radius_for_snow_flake | mean effective radius for snow flake | micron | 2 | real | kind_phys | none | F | !! | IPD_Interstitial(nt)%clw | convective_transportable_tracers | array to contain cloud water and other convective trans. tracers | kg kg-1 | 3 | real | kind_phys | none | F | !! | IPD_Interstitial(nt)%clw(:,:,1) | cloud_ice_specific_humidity | cloud ice specific humidity | kg kg-1 | 2 | real | kind_phys | none | F | @@ -1604,7 +1604,7 @@ module GFS_typedefs !! | IPD_Interstitial(nt)%work3 | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | none | F | !! | IPD_Interstitial(nt)%xcosz | instantaneous_cosine_of_zenith_angle | cosine of zenith angle at current time | none | 1 | real | kind_phys | none | F | !! | IPD_Interstitial(nt)%xmu | zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes | zenith angle temporal adjustment factor for shortwave | none | 1 | real | kind_phys | none | F | -!! | IPD_Interstitial(nt)%zice | sea_ice_thickness_for_physics | sea-ice thickness | m | 1 | real | kind_phys | none | F | +!! | IPD_Interstitial(nt)%zice | sea_ice_thickness_for_physics | sea-ice thickness | m | 1 | real | kind_phys | none | F | !! #endif type GFS_interstitial_type @@ -1788,7 +1788,7 @@ module GFS_typedefs !------------------------ ! GFS_statein_type%create !------------------------ - subroutine statein_create (Statein, IM, Model) + subroutine statein_create (Statein, IM, Model) implicit none class(GFS_statein_type) :: Statein @@ -1862,7 +1862,7 @@ end subroutine stateout_create ! GFS_sfcprop_type%create !------------------------ subroutine sfcprop_create (Sfcprop, IM, Model) - + implicit none class(GFS_sfcprop_type) :: Sfcprop @@ -2051,12 +2051,12 @@ subroutine coupling_create (Coupling, IM, Model) !--- physics in allocate (Coupling%nirbmdi (IM)) allocate (Coupling%nirdfdi (IM)) - allocate (Coupling%visbmdi (IM)) - allocate (Coupling%visdfdi (IM)) - allocate (Coupling%nirbmui (IM)) - allocate (Coupling%nirdfui (IM)) - allocate (Coupling%visbmui (IM)) - allocate (Coupling%visdfui (IM)) + allocate (Coupling%visbmdi (IM)) + allocate (Coupling%visdfdi (IM)) + allocate (Coupling%nirbmui (IM)) + allocate (Coupling%nirdfui (IM)) + allocate (Coupling%visbmui (IM)) + allocate (Coupling%visdfui (IM)) Coupling%nirbmdi = clear_val Coupling%nirdfdi = clear_val @@ -2314,8 +2314,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & real(kind=kind_phys) :: fhswr = 3600. !< frequency for shortwave radiation (secs) real(kind=kind_phys) :: fhlwr = 3600. !< frequency for longwave radiation (secs) integer :: levr = -99 !< number of vertical levels for radiation calculations - integer :: nfxr = 39 !< second dimension of input/output array fluxr - logical :: aero_in = .false. !< flag for initializing aero data + integer :: nfxr = 39 !< second dimension of input/output array fluxr + logical :: aero_in = .false. !< flag for initializing aero data integer :: iflip = 1 !< iflip - is not the same as flipv integer :: isol = 0 !< use prescribed solar constant integer :: ico2 = 0 !< prescribed global mean value (old opernl) @@ -2331,7 +2331,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !< available; use latest; do extrapolation. !< ictm=yyyy0 => use yyyy data for the forecast time; !< no extrapolation. - !< ictm=yyyy1 = > use yyyy data for the fcst. If needed, + !< ictm=yyyy1 = > use yyyy data for the fcst. If needed, !< do extrapolation to match the fcst time. !< ictm=-1 => use user provided external data for !< the fcst time; no extrapolation. @@ -2343,7 +2343,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !< =2 => sub-grid cloud with randomly generated !< seeds logical :: crick_proof = .false. !< CRICK-Proof cloud water - logical :: ccnorm = .false. !< Cloud condensate normalized by cloud cover + logical :: ccnorm = .false. !< Cloud condensate normalized by cloud cover logical :: norad_precip = .false. !< radiation precip flag for Ferrier/Moorthi logical :: lwhtr = .true. !< flag to output lw heating rate (Radtend%lwhc) logical :: swhtr = .true. !< flag to output sw heating rate (Radtend%swhc) @@ -2417,11 +2417,11 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !< workfunction for RAS real(kind=kind_phys) :: cdmbgwd(2) = (/2.0d0,0.25d0/) !< multiplication factors for cdmb and gwd real(kind=kind_phys) :: sup = 1.1 !< supersaturation in pdf cloud when t is very low - real(kind=kind_phys) :: ctei_rm(2) = (/10.0d0,10.0d0/) !< critical cloud top entrainment instability criteria + real(kind=kind_phys) :: ctei_rm(2) = (/10.0d0,10.0d0/) !< critical cloud top entrainment instability criteria !< (used if mstrat=.true.) real(kind=kind_phys) :: crtrh(3) = (/0.90d0,0.90d0,0.90d0/) !< critical relative humidity at the surface !< PBL top and at the top of the atmosphere - real(kind=kind_phys) :: dlqf(2) = (/0.0d0,0.0d0/) !< factor for cloud condensate detrainment + real(kind=kind_phys) :: dlqf(2) = (/0.0d0,0.0d0/) !< factor for cloud condensate detrainment !< from cloud edges for RAS !--- Rayleigh friction @@ -2430,10 +2430,10 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !--- near surface temperature model logical :: nst_anl = .false. !< flag for NSSTM analysis in gcycle/sfcsub - integer :: lsea = 0 - real(kind=kind_phys) :: xkzm_m = 1.0d0 !< [in] bkgd_vdif_m background vertical diffusion for momentum - real(kind=kind_phys) :: xkzm_h = 1.0d0 !< [in] bkgd_vdif_h background vertical diffusion for heat q - real(kind=kind_phys) :: xkzm_s = 1.0d0 !< [in] bkgd_vdif_s sigma threshold for background mom. diffusion + integer :: lsea = 0 + real(kind=kind_phys) :: xkzm_m = 1.0d0 !< [in] bkgd_vdif_m background vertical diffusion for momentum + real(kind=kind_phys) :: xkzm_h = 1.0d0 !< [in] bkgd_vdif_h background vertical diffusion for heat q + real(kind=kind_phys) :: xkzm_s = 1.0d0 !< [in] bkgd_vdif_s sigma threshold for background mom. diffusion integer :: nstf_name(5) = (/0,0,1,0,5/) !< flag 0 for no nst 1 for uncoupled nst and 2 for coupled NST !< nstf_name contains the NSSTM related parameters !< nstf_name(1) : 0 = NSSTM off, 1 = NSSTM on but uncoupled @@ -2442,7 +2442,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !< nstf_name(3) : 1 = NSSTM analysis on, 0 = NSSTM analysis off !< nstf_name(4) : zsea1 in mm !< nstf_name(5) : zsea2 in mm - + !--- stochastic physics options real(kind=kind_phys) :: sppt(5) = -999. !< stochastic physics tendency amplitude real(kind=kind_phys) :: shum(5) = -999. !< stochastic boundary layer spf hum amp @@ -2486,7 +2486,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !--- debug options debug, pre_rad - !--- other parameters + !--- other parameters integer :: nctp = 0 !< number of cloud types in CS scheme logical :: gen_coord_hybrid = .false. !< for Henry's gen coord @@ -2695,6 +2695,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%nshoc_2d = nshoc_2d Model%nshoc_3d = nshoc_3d Model%ncnvcld3d = ncnvcld3d + Model%npdf3d = 0 Model%nctp = nctp !--- debug flag @@ -2712,7 +2713,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%sdec = -9999. Model%cdec = -9999. Model%clstp = -9999 - rinc(1:5) = 0 + rinc(1:5) = 0 call w3difdat(jdat,idat,4,rinc) Model%phour = rinc(4)/con_hr Model%fhour = (rinc(4) + Model%dtp)/con_hr @@ -2735,7 +2736,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & dxinv = 1.0d0 / (dxmax-dxmin) if (Model%me == Model%master) write(0,*)' dxmax=',dxmax,' dxmin=',dxmin,' dxinv=',dxinv - !--- set nrcm + !--- set nrcm if (Model%ras) then Model%nrcm = min(nrcmax, Model%levs-1) * (Model%dtp/1200.d0) + 0.10001d0 else @@ -2784,7 +2785,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & stop endif print *,' nst_anl=',Model%nst_anl,' use_ufo=',Model%use_ufo - if (Model%nstf_name(1) > 0 ) then + if (Model%nstf_name(1) > 0 ) then print *,' NSSTM is active ' print *,' nstf_name(1)=',Model%nstf_name(1) print *,' nstf_name(2)=',Model%nstf_name(2) @@ -2891,7 +2892,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & if(Model%ras .or. Model%cscnv) Model%cnvcld = .false. if(Model%do_shoc .or. Model%pdfcld) Model%cnvcld = .false. if(Model%cnvcld) Model%ncnvcld3d = 1 - + !--- derived totals for phy_f*d Model%ntot2d = Model%num_p2d + Model%nshoc_2d Model%ntot3d = Model%num_p3d + Model%nshoc_3d + Model%npdf3d + Model%ncnvcld3d @@ -2900,7 +2901,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & ' pdfcld=',Model%pdfcld,' shcnvcw=',Model%shcnvcw, & ' cnvcld=',Model%cnvcld,' ncnvcld3d=',Model%ncnvcld3d, & ' do_shoc=',Model%do_shoc,' nshoc3d=',Model%nshoc_3d, & - ' nshoc_2d=',Model%nshoc_2d,' shoc_cld=',Model%shoc_cld,& + ' nshoc_2d=',Model%nshoc_2d,' shoc_cld=',Model%shoc_cld,& ' ntot3d=',Model%ntot3d,' ntot2d=',Model%ntot2d, & ' shocaftcnv=',Model%shocaftcnv @@ -2947,7 +2948,7 @@ subroutine control_print(Model) !--- interface variables class(GFS_control_type) :: Model - + if (Model%me == Model%master) then print *, ' ' print *, 'basic control parameters' @@ -3134,7 +3135,7 @@ subroutine control_print(Model) print *, ' nctp : ', Model%nctp print *, ' ' print *, 'debug flags' - print *, ' debug : ', Model%debug + print *, ' debug : ', Model%debug print *, ' pre_rad : ', Model%pre_rad print *, ' ' print *, 'variables modified at each time step' @@ -3288,13 +3289,13 @@ subroutine cldprop_create (Cldprop, IM, Model) type(GFS_control_type), intent(in) :: Model allocate (Cldprop%cv (IM)) - allocate (Cldprop%cvt (IM)) + allocate (Cldprop%cvt (IM)) allocate (Cldprop%cvb (IM)) - + Cldprop%cv = clear_val Cldprop%cvt = clear_val Cldprop%cvb = clear_val - + end subroutine cldprop_create @@ -3302,14 +3303,14 @@ end subroutine cldprop_create ! GFS_radtend_type%create !****************************************** subroutine radtend_create (Radtend, IM, Model) - + implicit none - + class(GFS_radtend_type) :: Radtend integer, intent(in) :: IM type(GFS_control_type), intent(in) :: Model - !--- Out (radiation only) + !--- Out (radiation only) allocate (Radtend%sfcfsw (IM)) allocate (Radtend%sfcflw (IM)) @@ -3321,7 +3322,7 @@ subroutine radtend_create (Radtend, IM, Model) Radtend%sfcflw%upfx0 = clear_val Radtend%sfcflw%dnfxc = clear_val Radtend%sfcflw%dnfx0 = clear_val - + allocate (Radtend%htrsw (IM,Model%levs)) allocate (Radtend%htrlw (IM,Model%levs)) allocate (Radtend%sfalb (IM)) @@ -3335,12 +3336,12 @@ subroutine radtend_create (Radtend, IM, Model) Radtend%coszen = clear_val Radtend%tsflw = clear_val Radtend%semis = clear_val - + !--- In/Out (???) (radiation only) allocate (Radtend%coszdg (IM)) Radtend%coszdg = clear_val - + !--- In/Out (???) (physics only) allocate (Radtend%swhc (IM,Model%levs)) allocate (Radtend%lwhc (IM,Model%levs)) @@ -3575,11 +3576,13 @@ subroutine interstitial_create (Interstitial, IM, Model) class(GFS_interstitial_type) :: Interstitial integer, intent(in) :: IM type(GFS_control_type), intent(in) :: Model + ! ! Set up numbers of tracers for water etc - previously interstitial code: sets ! Interstitial%{tracers_water,tracers_total,tracers_start_index,ntk} call interstitial_setup_tracers(Interstitial, Model) ! Allocate arrays + allocate (Interstitial%adjnirbmd (IM)) allocate (Interstitial%adjnirbmu (IM)) allocate (Interstitial%adjnirdfd (IM)) @@ -3710,6 +3713,7 @@ subroutine interstitial_create (Interstitial, IM, Model) allocate (Interstitial%xmu (IM)) allocate (Interstitial%zice (IM)) ! Set components that do not change + Interstitial%im = IM Interstitial%ipr = min(IM,10) Interstitial%ix = IM @@ -3722,7 +3726,9 @@ subroutine interstitial_create (Interstitial, IM, Model) Interstitial%nvdiff = Model%ntrac Interstitial%oz_coeff = oz_coeff Interstitial%oz_pres = oz_pres + Interstitial%skip_macro = .false. + ! Reset all other variables call Interstitial%rad_reset () call Interstitial%phys_reset () @@ -3938,18 +3944,18 @@ subroutine interstitial_print(Interstitial, mpirank, omprank, blkno) ! Print static variables write (0,'(a,3i6)') 'Interstitial_print for mpirank, omprank, blkno: ', mpirank, omprank, blkno write (0,*) 'Interstitial_print: values that do not change' - write (0,*) 'Interstitial%im = ', Interstitial%im - write (0,*) 'Interstitial%ipr = ', Interstitial%ipr - write (0,*) 'Interstitial%ix = ', Interstitial%ix + write (0,*) 'Interstitial%im = ', Interstitial%im + write (0,*) 'Interstitial%ipr = ', Interstitial%ipr + write (0,*) 'Interstitial%ix = ', Interstitial%ix write (0,*) 'Interstitial%latidxprnt = ', Interstitial%latidxprnt - write (0,*) 'Interstitial%levi = ', Interstitial%levi - write (0,*) 'Interstitial%levozp = ', Interstitial%levozp - write (0,*) 'Interstitial%lm = ', Interstitial%lm - write (0,*) 'Interstitial%lmk = ', Interstitial%lmk - write (0,*) 'Interstitial%lmp = ', Interstitial%lmp - write (0,*) 'Interstitial%nvdiff = ', Interstitial%nvdiff - write (0,*) 'Interstitial%oz_coeff = ', Interstitial%oz_coeff - write (0,*) 'Interstitial%oz_pres = ', Interstitial%oz_pres + write (0,*) 'Interstitial%levi = ', Interstitial%levi + write (0,*) 'Interstitial%levozp = ', Interstitial%levozp + write (0,*) 'Interstitial%lm = ', Interstitial%lm + write (0,*) 'Interstitial%lmk = ', Interstitial%lmk + write (0,*) 'Interstitial%lmp = ', Interstitial%lmp + write (0,*) 'Interstitial%nvdiff = ', Interstitial%nvdiff + write (0,*) 'Interstitial%oz_coeff = ', Interstitial%oz_coeff + write (0,*) 'Interstitial%oz_pres = ', Interstitial%oz_pres write (0,*) 'Interstitial%skip_macro = ', Interstitial%skip_macro ! Print all other variables write (0,*) 'Interstitial_print: values that change' diff --git a/input.nml b/input.nml index cb253e69a..ddbee87e6 100644 --- a/input.nml +++ b/input.nml @@ -160,6 +160,9 @@ isot = 1 debug = .true. nstf_name = 2,0,1,0,5 + + jcap = 574 + / &nggps_diag_nml From 08565cf2615c5dd25daf6b33eadf26dd47adc935 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Thu, 15 Mar 2018 10:28:56 -0600 Subject: [PATCH 04/16] changed GFS_driver_gmtb_scm.f90 to GFS_initialize_scm.F90, which is now a CCPP-compliant scheme used for initialization of the GFS suite in the GMTB SCM --- CCPP_CAPS.mk | 69 +++++- CMakeLists.txt | 7 +- GFS_layer/GFS_initialize_scm.F90 | 369 +++++++++++++++++++++++++++++++ 3 files changed, 441 insertions(+), 4 deletions(-) create mode 100644 GFS_layer/GFS_initialize_scm.F90 diff --git a/CCPP_CAPS.mk b/CCPP_CAPS.mk index facd1d0a8..ed360bb46 100644 --- a/CCPP_CAPS.mk +++ b/CCPP_CAPS.mk @@ -1,6 +1,73 @@ + # All CCPP caps are defined here. # # This file is auto-generated using ccpp_prebuild.py # at compile time, do not edit manually. # -CAPS_F90 = +CAPS_F90 = + ./physics/radsw_cap.F90 + ./physics/GFS_DCNV_generic_post_cap.F90 + ./physics/GFS_RRTMG_post_cap.F90 + ./physics/ozphys_cap.F90 + ./physics/GFS_suite_interstitial_rad_reset_cap.F90 + ./physics/GFS_MP_generic_pre_cap.F90 + ./physics/GFS_MP_generic_post_cap.F90 + ./physics/gscond_cap.F90 + ./physics/GFS_SCNV_generic_pre_cap.F90 + ./physics/dcyc2t3_post_cap.F90 + ./physics/cnvc90_cap.F90 + ./physics/gwdc_cap.F90 + ./physics/GFS_RRTMG_pre_cap.F90 + ./physics/GFS_zhao_carr_pre_cap.F90 + ./physics/GFS_PBL_generic_pre_cap.F90 + ./physics/radlw_cap.F90 + ./physics/GFS_suite_interstitial_1_cap.F90 + ./physics/gwdps_pre_cap.F90 + ./physics/GFS_suite_interstitial_3_cap.F90 + ./physics/GFS_suite_interstitial_2_cap.F90 + ./physics/dcyc2t3_pre_cap.F90 + ./physics/lsm_noah_pre_cap.F90 + ./physics/sasasshal_post_cap.F90 + ./physics/precpd_cap.F90 + ./physics/sfc_ex_coef_cap.F90 + ./physics/GFS_radsw_post_cap.F90 + ./physics/GFS_PBL_generic_post_cap.F90 + ./physics/sasasshal_cap.F90 + ./physics/GFS_surface_loop_control_part0_cap.F90 + ./physics/GFS_phys_time_vary_2_cap.F90 + ./physics/GFS_phys_time_vary_1_cap.F90 + ./physics/dcyc2t3_cap.F90 + ./physics/GFS_surface_loop_control_part1_cap.F90 + ./physics/sfc_sice_cap.F90 + ./physics/sfc_nst_post_cap.F90 + ./physics/GFS_surface_generic_post_cap.F90 + ./physics/sfc_nst_cap.F90 + ./physics/edmf_cap.F90 + ./physics/GFS_surface_loop_control_part2_cap.F90 + ./physics/GFS_radlw_pre_cap.F90 + ./physics/sfc_sice_pre_cap.F90 + ./physics/ozphys_pre_cap.F90 + ./physics/GFS_radsw_pre_cap.F90 + ./physics/lsm_noah_cap.F90 + ./physics/GFS_suite_interstitial_phys_reset_cap.F90 + ./physics/gwdps_cap.F90 + ./physics/sfc_nst_pre_cap.F90 + ./physics/GFS_SCNV_generic_post_cap.F90 + ./physics/GFS_rad_time_vary_cap.F90 + ./physics/lsm_noah_post_cap.F90 + ./physics/sasasdeep_cap.F90 + ./physics/GFS_initialize_scm_cap.F90 + ./physics/GFS_DCNV_generic_pre_cap.F90 + ./physics/gwdc_pre_cap.F90 + ./physics/sfc_diag_cap.F90 + ./physics/rayleigh_damp_cap.F90 + ./physics/GFS_radlw_post_cap.F90 + ./physics/sfc_sice_post_cap.F90 + ./physics/gwdc_post_cap.F90 + ./physics/GFS_suite_update_stateout_cap.F90 + ./physics/get_prs_fv3_cap.F90 + ./physics/GFS_surface_generic_pre_cap.F90 + ./physics/ozphys_post_cap.F90 + ./physics/GFS_calpreciptype_cap.F90 + ./physics/get_phi_fv3_cap.F90 + ./physics/gwdps_post_cap.F90 \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index a23ed2bd4..cb3978034 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,7 +115,7 @@ set(SOURCES ./physics/wam_f107_kp_mod.f90 ./physics/num_parthds.F ./physics/gocart_tracer_config_stub.f - ./GFS_layer/GFS_driver_gmtb_scm.F90 + ./GFS_layer/GFS_initialize_scm.F90 ./physics/cldwat2m_micro.F ./physics/wv_saturation.F ./physics/aer_cloud.F @@ -207,7 +207,7 @@ set(SOURCES ./physics/GFS_surface_loop_control_part0_cap.F90 ./physics/GFS_phys_time_vary_2_cap.F90 ./physics/GFS_phys_time_vary_1_cap.F90 - ./physics/gwdc_pre_cap.F90 + ./physics/dcyc2t3_cap.F90 ./physics/GFS_surface_loop_control_part1_cap.F90 ./physics/sfc_sice_cap.F90 ./physics/sfc_nst_post_cap.F90 @@ -227,8 +227,9 @@ set(SOURCES ./physics/GFS_rad_time_vary_cap.F90 ./physics/lsm_noah_post_cap.F90 ./physics/sasasdeep_cap.F90 - ./physics/dcyc2t3_cap.F90 + ./physics/GFS_initialize_scm_cap.F90 ./physics/GFS_DCNV_generic_pre_cap.F90 + ./physics/gwdc_pre_cap.F90 ./physics/sfc_diag_cap.F90 ./physics/rayleigh_damp_cap.F90 ./physics/GFS_radlw_post_cap.F90 diff --git a/GFS_layer/GFS_initialize_scm.F90 b/GFS_layer/GFS_initialize_scm.F90 new file mode 100644 index 000000000..1556e5fb3 --- /dev/null +++ b/GFS_layer/GFS_initialize_scm.F90 @@ -0,0 +1,369 @@ +module GFS_initialize_scm + use machine, only: kind_phys + use GFS_typedefs, only: GFS_init_type, & + GFS_statein_type, GFS_stateout_type, & + GFS_sfcprop_type, GFS_coupling_type, & + GFS_control_type, GFS_grid_type, & + GFS_tbd_type, GFS_cldprop_type, & + GFS_radtend_type, GFS_diag_type, & + GFS_sfccycle_type, GFS_interstitial_type + + use funcphys, only: gfuncphys + + implicit none + + private + +!------------------ +! Module parameters +!------------------ + +!---------------------------- +! Module variable definitions +!---------------------------- + +!---------------- +! Public entities +!---------------- + public GFS_initialize_scm_init, GFS_initialize_scm_run, GFS_initialize_scm_finalize + + CONTAINS +!******************************************************************************************* + +!-------------- +! GFS initialze +!-------------- + + subroutine GFS_initialize_scm_init() + end subroutine GFS_initialize_scm_init + + subroutine GFS_initialize_scm_finalize() + end subroutine GFS_initialize_scm_finalize + +!> \section arg_table_GFS_initialize_scm_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_control_type | | inout | F | +!! | Statein | FV3-GFS_Statein_type | Fortran DDT containing FV3-GFS prognostic state data in from dycore | DDT | 0 | GFS_statein_type | | inout | F | +!! | Stateout | FV3-GFS_Stateout_type | Fortran DDT containing FV3-GFS prognostic state to return to dycore | DDT | 0 | GFS_stateout_type | | inout | F | +!! | Sfcprop | FV3-GFS_Sfcprop_type | Fortran DDT containing FV3-GFS surface fields | DDT | 0 | GFS_sfcprop_type | | inout | F | +!! | Coupling | FV3-GFS_Coupling_type | derived type GFS_coupling_type in FV3 | DDT | 0 | GFS_coupling_type | | inout | F | +!! | Grid | FV3-GFS_Grid_type | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_grid_type | | inout | F | +!! | Tbd | FV3-GFS_Tbd_type | derived type GFS_tbd_type in FV3 | DDT | 0 | GFS_tbd_type | | inout | F | +!! | Cldprop | FV3-GFS_Cldprop_type | derived type GFS_cldprop_type in FV3 | DDT | 0 | GFS_cldprop_type | | inout | F | +!! | Radtend | FV3-GFS_Radtend_type | derived type GFS_radtend_type in FV3 | DDT | 0 | GFS_radtend_type | | inout | F | +!! | Diag | FV3-GFS_Diag_type | Fortran DDT containing FV3-GFS fields targeted for diagnostic output | DDT | 0 | GFS_diag_type | | inout | F | +!! | Sfccycle | FV3-GFS_Sfccycle_type | derived type GFS_sfccycle_type in FV3 | DDT | 0 | GFS_sfccycle_type | | inout | F | +!! | Interstitial | FV3-GFS_Interstitial_type | derived type GFS_interstitial_type in FV3 | DDT | 0 | GFS_interstitial_type | | inout | F | +!! | Init_parm | FV3-GFS_Init_type | dervied type GFS_init_type in FV3 | DDT | 0 | GFS_init_type | | in | F | +!! | n_ozone_layers | vertical_dimension_of_ozone_forcing_data_from_host | number of vertical layers in ozone forcing data coming from host | count | 0 | integer | | in | F | +!! | n_ozone_lats | number_of_latitutde_points_in_ozone_forcing_data_from_host | number of latitude points in ozone forcing data coming from host | count | 0 | integer | | in | F | +!! | n_ozone_times | number_of_time_levels_in_ozone_forcing_data_from_host | number of time levels in ozone forcing data coming from host | count | 0 | integer | | in | F | +!! | n_ozone_coefficients | number_of_coefficients_in_ozone_forcing_data_from_host | number of coeffcients in ozone forcing data coming from host | count | 0 | integer | | in | F | +!! | ozone_lat | latitude_of_ozone_forcing_data_from_host | latitude value of the ozone forcing data coming from host | degree | 1 | real | kind_phys | in | F | +!! | ozone_pres | natural_log_of_ozone_forcing_data_pressure_levels_from_host | natural logarithm of the pressure levels of the ozone forcing data | Pa | 1 | real | kind_phys | in | F | +!! | ozone_time | time_levels_in_ozone_forcing_data_from_host | time values of the ozone forcing data coming from host | day | 1 | real | kind_phys | in | F | +!! | ozone_forcing_in | ozone_forcing_from_host | ozone forcing data from host | various | 4 | real | kind_phys | in | F | +!! + subroutine GFS_initialize_scm_run (Model, Statein, Stateout, Sfcprop, & + Coupling, Grid, Tbd, Cldprop, Radtend, & + Diag, Sfccycle, Interstitial, Init_parm, n_ozone_lats, & + n_ozone_layers, n_ozone_times, n_ozone_coefficients, & + ozone_lat, ozone_pres, ozone_time, ozone_forcing_in) + + use module_microphysics, only: gsmconst + use cldwat2m_micro, only: ini_micro + use aer_cloud, only: aer_cloud_init + use module_ras, only: ras_init + use ozne_def, only: latsozp, levozp, timeoz, oz_coeff, oz_lat, oz_pres, oz_time, ozplin +#ifdef OPENMP + use omp_lib +#endif + + + !--- interface variables + type(GFS_control_type), intent(inout) :: Model + type(GFS_statein_type), intent(inout) :: Statein + type(GFS_stateout_type), intent(inout) :: Stateout + type(GFS_sfcprop_type), intent(inout) :: Sfcprop + type(GFS_coupling_type), intent(inout) :: Coupling + type(GFS_grid_type), intent(inout) :: Grid + type(GFS_tbd_type), intent(inout) :: Tbd + type(GFS_cldprop_type), intent(inout) :: Cldprop + type(GFS_radtend_type), intent(inout) :: Radtend + type(GFS_diag_type), intent(inout) :: Diag + type(GFS_sfccycle_type), intent(inout) :: Sfccycle + type(GFS_interstitial_type), intent(inout) :: Interstitial + type(GFS_init_type), intent(in) :: Init_parm + + integer, intent(in) :: n_ozone_lats, n_ozone_layers, n_ozone_coefficients, n_ozone_times + real(kind=kind_phys), intent(in) :: ozone_lat(:), ozone_pres(:), ozone_time(:), ozone_forcing_in(:,:,:,:) +! +! !--- local variables + real(kind=kind_phys), allocatable :: si(:) + real(kind=kind_phys), parameter :: p_ref = 101325.0d0 + +! !--- set control properties (including namelist read) + call Model%init (Init_parm%nlunit, Init_parm%fn_nml, & + Init_parm%me, Init_parm%master, & + Init_parm%logunit, Init_parm%isc, & + Init_parm%jsc, Init_parm%nx, Init_parm%ny, & + Init_parm%levs, Init_parm%cnx, Init_parm%cny, & + Init_parm%gnx, Init_parm%gny, & + Init_parm%dt_dycore, Init_parm%dt_phys, & + Init_parm%bdat, Init_parm%cdat, & + Init_parm%tracer_names, Init_parm%blksz) + + !allocate memory for the variables stored in ozne_def and set them + allocate(oz_lat(n_ozone_lats), oz_pres(n_ozone_layers), oz_time(n_ozone_times+1)) + allocate(ozplin(n_ozone_lats, n_ozone_layers, n_ozone_coefficients, n_ozone_times)) + latsozp = n_ozone_lats + levozp = n_ozone_layers + timeoz = n_ozone_times + oz_coeff = n_ozone_coefficients + oz_lat = ozone_lat + oz_pres = ozone_pres + oz_time = ozone_time + ozplin = ozone_forcing_in + + call Statein%create(1, Model) + call Stateout%create(1, Model) + call Sfcprop%create(1, Model) + call Coupling%create(1, Model) + call Grid%create(1, Model) + call Tbd%create(1, 1, Model) + call Cldprop%create(1, Model) + call Radtend%create(1, Model) + !--- internal representation of diagnostics + call Diag%create(1, Model) + !--- internal representation of sfccycle + call Sfccycle%create(1, Model) +! +! #ifdef CCPP +! #ifdef OPENMP +! nthreads = omp_get_max_threads() +! #else +! nthreads = 1 +! #endif + + call Interstitial%create(1, Model) + + +! #endif +! +! !--- populate the grid components + call GFS_grid_populate (Grid, Init_parm%xlon, Init_parm%xlat, Init_parm%area) + + + +! !--- Call gfuncphys (funcphys.f) to compute all physics function tables. + call gfuncphys () +! + call gsmconst (Model%dtp, Model%me, .TRUE.) +! +! !--- define sigma level for radiation initialization +! !--- The formula converting hybrid sigma pressure coefficients to sigma coefficients follows Eckermann (2009, MWR) +! !--- ps is replaced with p0. The value of p0 uses that in http://www.emc.ncep.noaa.gov/officenotes/newernotes/on461.pdf +! !--- ak/bk have been flipped from their original FV3 orientation and are defined sfc -> toa + allocate(si(Model%levr+1)) + si = (Init_parm%ak + Init_parm%bk * p_ref - Init_parm%ak(Model%levr+1)) & + / (p_ref - Init_parm%ak(Model%levr+1)) + call rad_initialize (si, Model%levr, Model%ictm, Model%isol, & + Model%ico2, Model%iaer, Model%ialb, Model%iems, & + Model%ntcw, Model%num_p3d, Model%npdf3d, Model%ntoz, & + Model%iovr_sw, Model%iovr_lw, Model%isubc_sw, & + Model%isubc_lw, Model%crick_proof, Model%ccnorm, & + Model%norad_precip, Model%idate,Model%iflip, Model%me) + deallocate (si) +! +! !--- initialize Morrison-Gettleman microphysics + if (Model%ncld == 2) then + call ini_micro (Model%mg_dcs, Model%mg_qcvar, Model%mg_ts_auto_ice) + call aer_cloud_init () + endif +! +! !--- initialize ras + if (Model%ras) call ras_init (Model%levs, Model%me) +! +! !--- initialize soil vegetation + call set_soilveg(Model%me, Model%isot, Model%ivegsrc, Model%nlunit) +! +! !--- lsidea initialization + if (Model%lsidea) then + print *,' LSIDEA is active but needs to be reworked for FV3 - shutting down' + stop + !--- NEED TO get the logic from the old phys/gloopb.f initialization area + endif +! +! !--- sncovr may not exist in ICs from chgres. +! !--- FV3GFS handles this as part of the IC ingest +! !--- this not is placed here to alert users to the need to study +! !--- the FV3GFS_io.F90 module + + end subroutine GFS_initialize_scm_run + + !------------------ + ! GFS_grid_populate + !------------------ + subroutine GFS_grid_populate (Grid, xlon, xlat, area) + use physcons, only: pi => con_pi + + implicit none + + type(GFS_grid_type) :: Grid + real(kind=kind_phys), intent(in) :: xlon(:,:) + real(kind=kind_phys), intent(in) :: xlat(:,:) + real(kind=kind_phys), intent(in) :: area(:,:) + + !--- local variables + integer :: n_columns, i + + n_columns = size(Grid%xlon) + + do i=1, n_columns + Grid%xlon = xlon(i,1) + Grid%xlat = xlat(i,1) + Grid%xlat_d(i) = xlat(i,1) * 180.0_kind_phys/pi + Grid%sinlat(i) = sin(Grid%xlat(i)) + Grid%coslat(i) = sqrt(1.0_kind_phys - Grid%sinlat(i)*Grid%sinlat(i)) + Grid%area(i) = area(i,1) + Grid%dx(i) = sqrt(area(i,1)) + end do + + end subroutine GFS_grid_populate + +end module GFS_initialize_scm +! +! +! #ifndef CCPP +! !------------------------------------------------------------------------- +! ! time_vary_step +! !------------------------------------------------------------------------- +! ! routine called prior to radiation and physics steps to handle: +! ! 1) sets up various time/date variables +! ! 2) sets up various triggers +! ! 3) defines random seed indices for radiation (in a reproducible way) +! ! 5) interpolates coefficients for prognostic ozone calculation +! ! 6) performs surface data cycling via the GFS gcycle routine +! !------------------------------------------------------------------------- +! subroutine GFS_time_vary_step (Model, Statein, Stateout, Sfcprop, Coupling, & +! Grid, Tbd, Cldprop, Radtend, Diag, Sfccycle) +! +! use GFS_phys_time_vary_1, only: GFS_phys_time_vary_1_run +! use GFS_phys_time_vary_2, only: GFS_phys_time_vary_2_run +! use GFS_rad_time_vary, only: GFS_rad_time_vary_run +! implicit none +! +! !--- interface variables +! type(GFS_control_type), intent(inout) :: Model +! type(GFS_statein_type), intent(inout) :: Statein +! type(GFS_stateout_type), intent(inout) :: Stateout +! type(GFS_sfcprop_type), intent(inout) :: Sfcprop +! type(GFS_coupling_type), intent(inout) :: Coupling +! type(GFS_grid_type), intent(inout) :: Grid +! type(GFS_tbd_type), intent(inout) :: Tbd +! type(GFS_cldprop_type), intent(inout) :: Cldprop +! type(GFS_radtend_type), intent(inout) :: Radtend +! type(GFS_diag_type), intent(inout) :: Diag +! type(GFS_sfccycle_type), intent(inout) :: Sfccycle +! +! call GFS_phys_time_vary_1_run (Model, Tbd) +! +! call GFS_rad_time_vary_run (Model, Statein, Tbd) +! +! call GFS_phys_time_vary_2_run (Grid, Model, Tbd, Sfcprop, Cldprop, Diag, Sfccycle) +! +! end subroutine GFS_time_vary_step +! +! +! !------------------------------------------------------------------------- +! ! GFS stochastic_driver +! !------------------------------------------------------------------------- +! ! routine called prior to radiation and physics steps to handle: +! ! 1) sets up various time/date variables +! ! 2) sets up various triggers +! ! 3) defines random seed indices for radiation (in a reproducible way) +! ! 5) interpolates coefficients for prognostic ozone calculation +! ! 6) performs surface data cycling via the GFS gcycle routine +! !------------------------------------------------------------------------- +! subroutine GFS_stochastic_driver (Model, Statein, Stateout, Sfcprop, Coupling, & +! Grid, Tbd, Cldprop, Radtend, Diag) +! +! use GFS_stochastics, only: GFS_stochastics_run +! +! implicit none +! +! !--- interface variables +! type(GFS_control_type), intent(in ) :: Model +! type(GFS_statein_type), intent(in ) :: Statein +! type(GFS_stateout_type), intent(in ) :: Stateout +! type(GFS_sfcprop_type), intent(in ) :: Sfcprop +! type(GFS_coupling_type), intent(inout) :: Coupling +! type(GFS_grid_type), intent(in ) :: Grid +! type(GFS_tbd_type), intent(in ) :: Tbd +! type(GFS_cldprop_type), intent(in ) :: Cldprop +! type(GFS_radtend_type), intent(in ) :: Radtend +! type(GFS_diag_type), intent(inout) :: Diag +! +! call GFS_stochastics_run(Model, Statein, Stateout, Sfcprop, Coupling, & +! Grid, Tbd, Cldprop, Radtend, Diag) +! +! end subroutine GFS_stochastic_driver +! #endif +! +! + + ! subroutine GFS_initialize_scm_ozone_and_h20_setup(n_columns, n_levels, lats, pres, & + ! n_ozone_lats, n_ozone_layers, n_ozone_coefficients, n_ozone_times, & + ! ozone_lat, ozone_pres, ozone_time, ozone_forcing_in) + ! use ozne_def, only: latsozp, levozp, timeoz, oz_coeff, oz_lat, oz_pres, oz_time, ozplin + ! integer, intent(in) :: n_columns, n_levels + ! real(kind_phys), intent(in) :: lats(:), pres(:) + ! + ! integer, intent(inout) :: n_ozone_lats, n_ozone_layers, n_ozone_coefficients, n_ozone_times + ! real(kind_phys), allocatable, intent(inout) :: ozone_lat(:), ozone_pres(:), ozone_time(:), ozone_forcing_in(:,:,:,:) + ! + ! !set ozone forcing array dimensions + ! n_ozone_lats = n_columns + ! n_ozone_layers = n_levels + ! n_ozone_coefficients = 4 + ! n_ozone_times = 2 + ! + ! !reallocate ozone forcing latitutes, pressure levels, and times using the array dimensions set here + ! if(allocated(ozone_lat)) then + ! deallocate(ozone_lat) + ! allocate(ozone_lat(n_ozone_lats)) + ! endif + ! ozone_lat = lats + ! + ! if(allocated(ozone_pres)) then + ! deallocate(ozone_pres) + ! allocate(ozone_pres(n_ozone_layers)) + ! endif + ! ozone_pres = pres + ! + ! if(allocated(ozone_time)) then + ! deallocate(ozone_time) + ! allocate(ozone_time(n_ozone_times+1)) + ! endif + ! ozone_time = (/12.0, 13.0, 14.0/) + ! + ! if(allocated(ozone_forcing_in))then + ! deallocate(ozone_forcing_in) + ! allocate(ozone_forcing_in(n_ozone_lats, n_ozone_layers, n_ozone_coefficients, n_ozone_times)) + ! endif + ! ozone_forcing_in = 0.0 + ! + ! !allocate memory for the variables stored in ozne_def and set them + ! allocate(oz_lat(n_ozone_lats), oz_pres(n_ozone_layers), oz_time(n_ozone_times+1)) + ! allocate(ozplin(n_ozone_lats, n_ozone_layers, n_ozone_coefficients, n_ozone_times)) + ! latsozp = n_ozone_lats + ! levozp = n_ozone_layers + ! timeoz = n_ozone_times + ! oz_coeff = n_ozone_coefficients + ! oz_lat = ozone_lat + ! oz_pres = ozone_pres + ! oz_time = ozone_time + ! ozplin = ozone_forcing_in + ! + ! end subroutine GFS_initialize_scm_ozone_and_h20_setup From fdbe1be3ef5ddb4ea4dc36aba443ce631faf9ee8 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Thu, 15 Mar 2018 11:55:14 -0600 Subject: [PATCH 05/16] removed GFS_layer/GFS_driver_gmtb_scm.F90 --- GFS_layer/GFS_driver_gmtb_scm.F90 | 436 ------------------------------ 1 file changed, 436 deletions(-) delete mode 100644 GFS_layer/GFS_driver_gmtb_scm.F90 diff --git a/GFS_layer/GFS_driver_gmtb_scm.F90 b/GFS_layer/GFS_driver_gmtb_scm.F90 deleted file mode 100644 index cd76111af..000000000 --- a/GFS_layer/GFS_driver_gmtb_scm.F90 +++ /dev/null @@ -1,436 +0,0 @@ -module GFS_driver_gmtb_scm - use machine, only: kind_phys - use GFS_typedefs, only: GFS_init_type, & - GFS_statein_type, GFS_stateout_type, & - GFS_sfcprop_type, GFS_coupling_type, & - GFS_control_type, GFS_grid_type, & - GFS_tbd_type, GFS_cldprop_type, & - GFS_radtend_type, GFS_diag_type, & - GFS_sfccycle_type, GFS_interstitial_type - - use module_radsw_parameters, only: topfsw_type, sfcfsw_type - use module_radlw_parameters, only: topflw_type, sfcflw_type - use funcphys, only: gfuncphys - - implicit none - - private - -!-------------------------------------------------------------------------------- -! GFS_init_type -!-------------------------------------------------------------------------------- -! This container is the minimum set of data required from the dycore/atmosphere -! component to allow proper initialization of the GFS physics -! -! Type is defined in GFS_typedefs.F90 -!-------------------------------------------------------------------------------- -! type GFS_init_type -! public -! integer :: me !< my MPI-rank -! integer :: master !< master MPI-rank -! integer :: isc !< starting i-index for this MPI-domain -! integer :: jsc !< starting j-index for this MPI-domain -! integer :: nx !< number of points in i-dir for this MPI rank -! integer :: ny !< number of points in j-dir for this MPI rank -! integer :: levs !< number of vertical levels -! integer :: cnx !< number of points in i-dir for this cubed-sphere face -! !< equal to gnx for lat-lon grids -! integer :: cny !< number of points in j-dir for this cubed-sphere face -! !< equal to gny for lat-lon grids -! integer :: gnx !< number of global points in x-dir (i) along the equator -! integer :: gny !< number of global points in y-dir (j) along any meridian -! integer :: nlunit !< fortran unit number for file opens -! integer :: logunit !< fortran unit number for writing logfile -! integer :: dt_dycore !< dynamics time step in seconds -! integer :: dt_phys !< physics time step in seconds -! integer :: bdat(8) !< model begin date in GFS format (same as idat) -! integer :: cdat(8) !< model current date in GFS format (same as jdat) -! !--- blocking data -! integer, pointer :: blksz(:) !< for explicit data blocking -! !< default blksz(1)=[nx*ny] -! !--- ak/bk for pressure level calculations -! integer, pointer :: ak(:) !< from surface (k=1) to TOA (k=levs) -! integer, pointer :: bk(:) !< from surface (k=1) to TOA (k=levs) -! !--- grid metrics -! real(kind=kind_phys), pointer :: xlon(:,:) !< column longitude for MPI rank -! real(kind=kind_phys), pointer :: xlat(:,:) !< column latitude for MPI rank -! real(kind=kind_phys), pointer :: area(:,:) !< column area for length scale calculations -! -! character(len=32), pointer :: tracer_names(:) !< tracers names to dereference tracer id -! !< based on name location in array -! character(len=65) :: fn_nml !< namelist filename -! end type GFS_init_type -!-------------------------------------------------------------------------------- - -!------------------ -! Module parameters -!------------------ - -!---------------------------- -! Module variable definitions -!---------------------------- - real(kind=kind_phys), parameter :: con_24 = 24.0_kind_phys - real(kind=kind_phys), parameter :: con_hr = 3600.0_kind_phys - real(kind=kind_phys), parameter :: con_99 = 99.0_kind_phys - real(kind=kind_phys), parameter :: con_100 = 100.0_kind_phys - real(kind=kind_phys), parameter :: qmin = 1.0e-10 - - integer, allocatable :: blksz(:) - -!---------------- -! Public entities -!---------------- - public GFS_ozone_and_h20_setup, GFS_initialize !< GFS initialization routine - - CONTAINS -!******************************************************************************************* - - subroutine GFS_ozone_and_h20_setup(n_columns, n_levels, lats, pres, & - n_ozone_lats, n_ozone_layers, n_ozone_coefficients, n_ozone_times, & - ozone_lat, ozone_pres, ozone_time, ozone_forcing_in) - use ozne_def, only: latsozp, levozp, timeoz, oz_coeff, oz_lat, oz_pres, oz_time, ozplin - integer, intent(in) :: n_columns, n_levels - real(kind_phys), intent(in) :: lats(:), pres(:) - - integer, intent(inout) :: n_ozone_lats, n_ozone_layers, n_ozone_coefficients, n_ozone_times - real(kind_phys), allocatable, intent(inout) :: ozone_lat(:), ozone_pres(:), ozone_time(:), ozone_forcing_in(:,:,:,:) - - !set ozone forcing array dimensions - n_ozone_lats = n_columns - n_ozone_layers = n_levels - n_ozone_coefficients = 4 - n_ozone_times = 2 - - !reallocate ozone forcing latitutes, pressure levels, and times using the array dimensions set here - if(allocated(ozone_lat)) then - deallocate(ozone_lat) - allocate(ozone_lat(n_ozone_lats)) - endif - ozone_lat = lats - - if(allocated(ozone_pres)) then - deallocate(ozone_pres) - allocate(ozone_pres(n_ozone_layers)) - endif - ozone_pres = pres - - if(allocated(ozone_time)) then - deallocate(ozone_time) - allocate(ozone_time(n_ozone_times+1)) - endif - ozone_time = (/12.0, 13.0, 14.0/) - - if(allocated(ozone_forcing_in))then - deallocate(ozone_forcing_in) - allocate(ozone_forcing_in(n_ozone_lats, n_ozone_layers, n_ozone_coefficients, n_ozone_times)) - endif - ozone_forcing_in = 0.0 - - !allocate memory for the variables stored in ozne_def and set them - allocate(oz_lat(n_ozone_lats), oz_pres(n_ozone_layers), oz_time(n_ozone_times+1)) - allocate(ozplin(n_ozone_lats, n_ozone_layers, n_ozone_coefficients, n_ozone_times)) - latsozp = n_ozone_lats - levozp = n_ozone_layers - timeoz = n_ozone_times - oz_coeff = n_ozone_coefficients - oz_lat = ozone_lat - oz_pres = ozone_pres - oz_time = ozone_time - ozplin = ozone_forcing_in - - end subroutine GFS_ozone_and_h20_setup - - -!-------------- -! GFS initialze -!-------------- - subroutine GFS_initialize (Model, Statein, Stateout, Sfcprop, & - Coupling, Grid, Tbd, Cldprop, Radtend, & - Diag, Sfccycle, Interstitial, Init_parm, n_columns) - - use module_microphysics, only: gsmconst - use cldwat2m_micro, only: ini_micro - use aer_cloud, only: aer_cloud_init - use module_ras, only: ras_init -#ifdef OPENMP - use omp_lib -#endif - - - !--- interface variables - type(GFS_control_type), intent(inout) :: Model - type(GFS_statein_type), intent(inout) :: Statein - type(GFS_stateout_type), intent(inout) :: Stateout - type(GFS_sfcprop_type), intent(inout) :: Sfcprop - type(GFS_coupling_type), intent(inout) :: Coupling - type(GFS_grid_type), intent(inout) :: Grid - type(GFS_tbd_type), intent(inout) :: Tbd - type(GFS_cldprop_type), intent(inout) :: Cldprop - type(GFS_radtend_type), intent(inout) :: Radtend - type(GFS_diag_type), intent(inout) :: Diag - type(GFS_sfccycle_type), intent(inout) :: Sfccycle - type(GFS_interstitial_type), intent(inout) :: Interstitial - type(GFS_init_type), intent(in) :: Init_parm - integer, intent(in) :: n_columns -! -! !--- local variables -! integer :: nb -! integer :: nblks -! integer :: blkszmax -! integer :: nt -! integer :: nthreads - integer :: ntrac - real(kind=kind_phys), allocatable :: si(:) - real(kind=kind_phys), parameter :: p_ref = 101325.0d0 -! -! nblks = size(Init_parm%blksz) - ntrac = size(Init_parm%tracer_names) -! allocate (blksz(nblks)) -! blksz(:) = Init_parm%blksz(:) -! -! !--- set control properties (including namelist read) - call Model%init (Init_parm%nlunit, Init_parm%fn_nml, & - Init_parm%me, Init_parm%master, & - Init_parm%logunit, Init_parm%isc, & - Init_parm%jsc, Init_parm%nx, Init_parm%ny, & - Init_parm%levs, Init_parm%cnx, Init_parm%cny, & - Init_parm%gnx, Init_parm%gny, & - Init_parm%dt_dycore, Init_parm%dt_phys, & - Init_parm%bdat, Init_parm%cdat, & - Init_parm%tracer_names, Init_parm%blksz) - - - -! -! call read_o3data (Model%ntoz, Model%me, Model%master) -! call read_h2odata (Model%h2o_phys, Model%me, Model%master) -! -! blkszmax = 0 -! do nb = 1,nblks - call Statein%create(1, Model) - call Stateout%create(1, Model) - call Sfcprop%create(1, Model) - call Coupling%create(1, Model) - call Grid%create(1, Model) - call Tbd%create(1, 1, Model) - call Cldprop%create(1, Model) - call Radtend%create(1, Model) - !--- internal representation of diagnostics - call Diag%create(1, Model) - !--- internal representation of sfccycle - call Sfccycle%create(1, Model) -! !--- maximum blocksize -! blkszmax = max(blkszmax, Init_parm%blksz(nb)) -! enddo -! -! #ifdef CCPP -! #ifdef OPENMP -! nthreads = omp_get_max_threads() -! #else -! nthreads = 1 -! #endif -! do nt=1,nthreads - - - call Interstitial%create(1, Model) -! enddo -! #endif -! -! !--- populate the grid components - call GFS_grid_populate (Grid, Init_parm%xlon, Init_parm%xlat, Init_parm%area) - -! -! !--- read in and initialize ozone and water -! if (Model%ntoz > 0) then -! do nb = 1, nblks -! call setindxoz (Init_parm%blksz(nb), Grid(nb)%xlat_d, Grid(nb)%jindx1_o3, & -! Grid(nb)%jindx2_o3, Grid(nb)%ddy_o3) -! enddo -! endif -! -! if (Model%h2o_phys) then -! do nb = 1, nblks -! call setindxh2o (Init_parm%blksz(nb), Grid(nb)%xlat_d, Grid(nb)%jindx1_h, & -! Grid(nb)%jindx2_h, Grid(nb)%ddy_h) -! enddo -! endif -! -! !--- Call gfuncphys (funcphys.f) to compute all physics function tables. - call gfuncphys () -! - call gsmconst (Model%dtp, Model%me, .TRUE.) -! -! !--- define sigma level for radiation initialization -! !--- The formula converting hybrid sigma pressure coefficients to sigma coefficients follows Eckermann (2009, MWR) -! !--- ps is replaced with p0. The value of p0 uses that in http://www.emc.ncep.noaa.gov/officenotes/newernotes/on461.pdf -! !--- ak/bk have been flipped from their original FV3 orientation and are defined sfc -> toa - allocate(si(Model%levr+1)) - si = (Init_parm%ak + Init_parm%bk * p_ref - Init_parm%ak(Model%levr+1)) & - / (p_ref - Init_parm%ak(Model%levr+1)) - call rad_initialize (si, Model%levr, Model%ictm, Model%isol, & - Model%ico2, Model%iaer, Model%ialb, Model%iems, & - Model%ntcw, Model%num_p3d, Model%npdf3d, Model%ntoz, & - Model%iovr_sw, Model%iovr_lw, Model%isubc_sw, & - Model%isubc_lw, Model%crick_proof, Model%ccnorm, & - Model%norad_precip, Model%idate,Model%iflip, Model%me) - deallocate (si) -! -! !--- initialize Morrison-Gettleman microphysics - if (Model%ncld == 2) then - call ini_micro (Model%mg_dcs, Model%mg_qcvar, Model%mg_ts_auto_ice) - call aer_cloud_init () - endif -! -! !--- initialize ras - if (Model%ras) call ras_init (Model%levs, Model%me) -! -! !--- initialize soil vegetation - call set_soilveg(Model%me, Model%isot, Model%ivegsrc, Model%nlunit) -! -! !--- lsidea initialization - if (Model%lsidea) then - print *,' LSIDEA is active but needs to be reworked for FV3 - shutting down' - stop - !--- NEED TO get the logic from the old phys/gloopb.f initialization area - endif -! -! !--- sncovr may not exist in ICs from chgres. -! !--- FV3GFS handles this as part of the IC ingest -! !--- this not is placed here to alert users to the need to study -! !--- the FV3GFS_io.F90 module -! - end subroutine GFS_initialize -! -! -! #ifndef CCPP -! !------------------------------------------------------------------------- -! ! time_vary_step -! !------------------------------------------------------------------------- -! ! routine called prior to radiation and physics steps to handle: -! ! 1) sets up various time/date variables -! ! 2) sets up various triggers -! ! 3) defines random seed indices for radiation (in a reproducible way) -! ! 5) interpolates coefficients for prognostic ozone calculation -! ! 6) performs surface data cycling via the GFS gcycle routine -! !------------------------------------------------------------------------- -! subroutine GFS_time_vary_step (Model, Statein, Stateout, Sfcprop, Coupling, & -! Grid, Tbd, Cldprop, Radtend, Diag, Sfccycle) -! -! use GFS_phys_time_vary_1, only: GFS_phys_time_vary_1_run -! use GFS_phys_time_vary_2, only: GFS_phys_time_vary_2_run -! use GFS_rad_time_vary, only: GFS_rad_time_vary_run -! implicit none -! -! !--- interface variables -! type(GFS_control_type), intent(inout) :: Model -! type(GFS_statein_type), intent(inout) :: Statein -! type(GFS_stateout_type), intent(inout) :: Stateout -! type(GFS_sfcprop_type), intent(inout) :: Sfcprop -! type(GFS_coupling_type), intent(inout) :: Coupling -! type(GFS_grid_type), intent(inout) :: Grid -! type(GFS_tbd_type), intent(inout) :: Tbd -! type(GFS_cldprop_type), intent(inout) :: Cldprop -! type(GFS_radtend_type), intent(inout) :: Radtend -! type(GFS_diag_type), intent(inout) :: Diag -! type(GFS_sfccycle_type), intent(inout) :: Sfccycle -! -! call GFS_phys_time_vary_1_run (Model, Tbd) -! -! call GFS_rad_time_vary_run (Model, Statein, Tbd) -! -! call GFS_phys_time_vary_2_run (Grid, Model, Tbd, Sfcprop, Cldprop, Diag, Sfccycle) -! -! end subroutine GFS_time_vary_step -! -! -! !------------------------------------------------------------------------- -! ! GFS stochastic_driver -! !------------------------------------------------------------------------- -! ! routine called prior to radiation and physics steps to handle: -! ! 1) sets up various time/date variables -! ! 2) sets up various triggers -! ! 3) defines random seed indices for radiation (in a reproducible way) -! ! 5) interpolates coefficients for prognostic ozone calculation -! ! 6) performs surface data cycling via the GFS gcycle routine -! !------------------------------------------------------------------------- -! subroutine GFS_stochastic_driver (Model, Statein, Stateout, Sfcprop, Coupling, & -! Grid, Tbd, Cldprop, Radtend, Diag) -! -! use GFS_stochastics, only: GFS_stochastics_run -! -! implicit none -! -! !--- interface variables -! type(GFS_control_type), intent(in ) :: Model -! type(GFS_statein_type), intent(in ) :: Statein -! type(GFS_stateout_type), intent(in ) :: Stateout -! type(GFS_sfcprop_type), intent(in ) :: Sfcprop -! type(GFS_coupling_type), intent(inout) :: Coupling -! type(GFS_grid_type), intent(in ) :: Grid -! type(GFS_tbd_type), intent(in ) :: Tbd -! type(GFS_cldprop_type), intent(in ) :: Cldprop -! type(GFS_radtend_type), intent(in ) :: Radtend -! type(GFS_diag_type), intent(inout) :: Diag -! -! call GFS_stochastics_run(Model, Statein, Stateout, Sfcprop, Coupling, & -! Grid, Tbd, Cldprop, Radtend, Diag) -! -! end subroutine GFS_stochastic_driver -! #endif -! -! -!------------------ -! GFS_grid_populate -!------------------ - subroutine GFS_grid_populate (Grid, xlon, xlat, area) - use physcons, only: pi => con_pi - - implicit none - - type(GFS_grid_type) :: Grid - real(kind=kind_phys), intent(in) :: xlon(:,:) - real(kind=kind_phys), intent(in) :: xlat(:,:) - real(kind=kind_phys), intent(in) :: area(:,:) - - !--- local variables - !integer :: nb, ix, blksz, i, j - integer :: n_columns, i - - n_columns = size(Grid%xlon) - - do i=1, n_columns - Grid%xlon = xlon(i,1) - Grid%xlat = xlat(i,1) - Grid%xlat_d(i) = xlat(i,1) * 180.0_kind_phys/pi - Grid%sinlat(i) = sin(Grid%xlat(i)) - Grid%coslat(i) = sqrt(1.0_kind_phys - Grid%sinlat(i)*Grid%sinlat(i)) - Grid%area(i) = area(i,1) - Grid%dx(i) = sqrt(area(i,1)) - end do - - ! blksz = size(Grid(1)%xlon) - - ! nb = 1 - ! ix = 0 - ! do j = 1,size(xlon,2) - ! do i = 1,size(xlon,1) - ! ix=ix+1 - ! if (ix .gt. blksz) then - ! nb = nb + 1 - ! ix = 1 - ! endif - ! Grid(nb)%xlon(ix) = xlon(i,j) - ! Grid(nb)%xlat(ix) = xlat(i,j) - ! Grid(nb)%xlat_d(ix) = xlat(i,j) * 180.0_kind_phys/pi - ! Grid(nb)%sinlat(ix) = sin(Grid(nb)%xlat(ix)) - ! Grid(nb)%coslat(ix) = sqrt(1.0_kind_phys - Grid(nb)%sinlat(ix)*Grid(nb)%sinlat(ix)) - ! Grid(nb)%area(ix) = area(i,j) - ! Grid(nb)%dx(ix) = sqrt(area(i,j)) - ! enddo - ! enddo - - - - end subroutine GFS_grid_populate - -end module GFS_driver_gmtb_scm From d8b1ff550c0f3c6960a2e0d61f4b546c1be5d91a Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Thu, 15 Mar 2018 13:35:37 -0600 Subject: [PATCH 06/16] updated CMakeLists.txt to reflect changes in dir structure --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cb3978034..b34558341 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ enable_language(Fortran) #------------------------------------------------------------------------------ # CMake Modules # Set the CMake module path -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../cmake") +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../gmtb-ccpp/cmake") #------------------------------------------------------------------------------ # Find OpenMP for C/C++ From 9137afc84f4829e3c7d24522e4f9c7843298b056 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Thu, 15 Mar 2018 16:59:15 -0600 Subject: [PATCH 07/16] Generally, changes to work with updated gmtb-ccpp and gmtb-gfsphysics; added errmsg and errflg to GFS_initialize_scm.F90; updated CMakeLists.txt to use latest physics filenames/caps; deleted redundant initialization of npdf3d in GFS_typedefs.F90; added kind_phys to dtf in sfc_drv.f --- CMakeLists.txt | 85 ++++++++++++++++---------------- GFS_layer/GFS_initialize_scm.F90 | 16 ++++-- GFS_layer/GFS_typedefs.F90 | 1 - physics/sfc_drv.f | 2 +- 4 files changed, 56 insertions(+), 48 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b34558341..0e87a019c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,12 +125,12 @@ set(SOURCES ./physics/radiation_astronomy.f ./physics/radsw_main.f ./physics/radsw_datatb.f - ./physics/GFS_RRTMG_pre.F90 - ./physics/GFS_RRTMG_post.F90 - ./physics/GFS_radsw_pre.F90 - ./physics/GFS_radsw_post.F90 - ./physics/GFS_radlw_pre.F90 - ./physics/GFS_radlw_post.F90 + ./physics/GFS_rrtmg_pre.F90 + ./physics/GFS_rrtmg_post.F90 + ./physics/rrtmg_sw_pre.F90 + ./physics/rrtmg_sw_post.F90 + ./physics/rrtmg_lw_pre.F90 + ./physics/rrtmg_lw_post.F90 ./physics/radlw_main.f ./physics/radlw_datatb.f ./physics/set_soilveg.f @@ -142,7 +142,6 @@ set(SOURCES ./physics/GFS_rad_time_vary.f90 ./physics/GFS_radupdate.f90 ./physics/GFS_suite_interstitial.ccpp.f90 - ./physics/GFS_RRTMG_pre.F90 ./physics/get_prs_fv3.f90 ./physics/sfc_sice.f ./physics/dcyc2.f @@ -176,72 +175,72 @@ set(SOURCES ./physics/precpd.f ./physics/GFS_calpreciptype.f90 ./physics/GFS_MP_generic_post.f90 - ./physics/radsw_cap.F90 + ./physics/cnvc90_cap.F90 + ./physics/lsm_noah_pre_cap.F90 ./physics/GFS_DCNV_generic_post_cap.F90 - ./physics/GFS_RRTMG_post_cap.F90 + ./physics/ozphys_pre_cap.F90 + ./physics/gwdps_pre_cap.F90 ./physics/ozphys_cap.F90 ./physics/GFS_suite_interstitial_rad_reset_cap.F90 - ./physics/GFS_MP_generic_pre_cap.F90 ./physics/GFS_MP_generic_post_cap.F90 - ./physics/gscond_cap.F90 - ./physics/GFS_SCNV_generic_pre_cap.F90 + ./physics/rrtmg_sw_cap.F90 ./physics/dcyc2t3_post_cap.F90 - ./physics/cnvc90_cap.F90 - ./physics/gwdc_cap.F90 - ./physics/GFS_RRTMG_pre_cap.F90 + ./physics/sfc_nst_cap.F90 + ./physics/rrtmg_lw_cap.F90 ./physics/GFS_zhao_carr_pre_cap.F90 ./physics/GFS_PBL_generic_pre_cap.F90 - ./physics/radlw_cap.F90 + ./physics/gwdps_post_cap.F90 ./physics/GFS_suite_interstitial_1_cap.F90 - ./physics/gwdps_pre_cap.F90 - ./physics/GFS_suite_interstitial_3_cap.F90 + ./physics/sfc_sice_pre_cap.F90 ./physics/GFS_suite_interstitial_2_cap.F90 ./physics/dcyc2t3_pre_cap.F90 - ./physics/lsm_noah_pre_cap.F90 - ./physics/sasasshal_post_cap.F90 - ./physics/precpd_cap.F90 - ./physics/sfc_ex_coef_cap.F90 - ./physics/GFS_radsw_post_cap.F90 + ./physics/rrtmg_lw_pre_cap.F90 + ./physics/GFS_rad_time_vary_cap.F90 + ./physics/sasas_shal_post_cap.F90 + ./physics/sfc_sice_cap.F90 + ./physics/GFS_SCNV_generic_pre_cap.F90 ./physics/GFS_PBL_generic_post_cap.F90 - ./physics/sasasshal_cap.F90 - ./physics/GFS_surface_loop_control_part0_cap.F90 + ./physics/sasas_shal_cap.F90 + ./physics/GFS_surface_loop_control_part2_cap.F90 + ./physics/GFS_rrtmg_pre_cap.F90 ./physics/GFS_phys_time_vary_2_cap.F90 ./physics/GFS_phys_time_vary_1_cap.F90 ./physics/dcyc2t3_cap.F90 - ./physics/GFS_surface_loop_control_part1_cap.F90 - ./physics/sfc_sice_cap.F90 - ./physics/sfc_nst_post_cap.F90 + ./physics/gwdc_cap.F90 + ./physics/get_prs_fv3_cap.F90 ./physics/GFS_surface_generic_post_cap.F90 - ./physics/sfc_nst_cap.F90 + ./physics/rrtmg_sw_post_cap.F90 ./physics/edmf_cap.F90 - ./physics/GFS_surface_loop_control_part2_cap.F90 - ./physics/GFS_radlw_pre_cap.F90 - ./physics/sfc_sice_pre_cap.F90 - ./physics/ozphys_pre_cap.F90 - ./physics/GFS_radsw_pre_cap.F90 + ./physics/sfc_ex_coef_cap.F90 + ./physics/GFS_surface_loop_control_part1_cap.F90 + ./physics/GFS_surface_loop_control_part0_cap.F90 + ./physics/rrtmg_lw_post_cap.F90 + ./physics/rayleigh_damp_cap.F90 + ./physics/lsm_noah_post_cap.F90 ./physics/lsm_noah_cap.F90 ./physics/GFS_suite_interstitial_phys_reset_cap.F90 ./physics/gwdps_cap.F90 ./physics/sfc_nst_pre_cap.F90 ./physics/GFS_SCNV_generic_post_cap.F90 - ./physics/GFS_rad_time_vary_cap.F90 - ./physics/lsm_noah_post_cap.F90 - ./physics/sasasdeep_cap.F90 + ./physics/sfc_diag_cap.F90 + ./physics/zhaocarr_precpd_cap.F90 + ./physics/sasas_deep_cap.F90 ./physics/GFS_initialize_scm_cap.F90 ./physics/GFS_DCNV_generic_pre_cap.F90 ./physics/gwdc_pre_cap.F90 - ./physics/sfc_diag_cap.F90 - ./physics/rayleigh_damp_cap.F90 - ./physics/GFS_radlw_post_cap.F90 + ./physics/zhaocarr_gscond_cap.F90 + ./physics/GFS_suite_interstitial_3_cap.F90 + ./physics/GFS_calpreciptype_cap.F90 + ./physics/GFS_MP_generic_pre_cap.F90 ./physics/sfc_sice_post_cap.F90 ./physics/gwdc_post_cap.F90 ./physics/GFS_suite_update_stateout_cap.F90 - ./physics/get_prs_fv3_cap.F90 + ./physics/sfc_nst_post_cap.F90 ./physics/GFS_surface_generic_pre_cap.F90 ./physics/ozphys_post_cap.F90 - ./physics/GFS_calpreciptype_cap.F90 + ./physics/GFS_rrtmg_post_cap.F90 ./physics/get_phi_fv3_cap.F90 - ./physics/gwdps_post_cap.F90 + ./physics/rrtmg_sw_pre_cap.F90 ) set(f_flags -ffree-line-length-none) diff --git a/GFS_layer/GFS_initialize_scm.F90 b/GFS_layer/GFS_initialize_scm.F90 index 1556e5fb3..3bddf052e 100644 --- a/GFS_layer/GFS_initialize_scm.F90 +++ b/GFS_layer/GFS_initialize_scm.F90 @@ -41,7 +41,7 @@ subroutine GFS_initialize_scm_finalize() end subroutine GFS_initialize_scm_finalize !> \section arg_table_GFS_initialize_scm_run Argument Table -!! | local var name | longname | description | units | rank | type | kind | intent | optional | +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | !! |----------------------|-------------------------------------------------------------|-------------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| !! | Model | FV3-GFS_Control_type | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | inout | F | !! | Statein | FV3-GFS_Statein_type | Fortran DDT containing FV3-GFS prognostic state data in from dycore | DDT | 0 | GFS_statein_type | | inout | F | @@ -64,12 +64,15 @@ end subroutine GFS_initialize_scm_finalize !! | ozone_pres | natural_log_of_ozone_forcing_data_pressure_levels_from_host | natural logarithm of the pressure levels of the ozone forcing data | Pa | 1 | real | kind_phys | in | F | !! | ozone_time | time_levels_in_ozone_forcing_data_from_host | time values of the ozone forcing data coming from host | day | 1 | real | kind_phys | in | F | !! | ozone_forcing_in | ozone_forcing_from_host | ozone forcing data from host | various | 4 | real | kind_phys | in | F | +!! | errmsg | error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! subroutine GFS_initialize_scm_run (Model, Statein, Stateout, Sfcprop, & Coupling, Grid, Tbd, Cldprop, Radtend, & Diag, Sfccycle, Interstitial, Init_parm, n_ozone_lats, & n_ozone_layers, n_ozone_times, n_ozone_coefficients, & - ozone_lat, ozone_pres, ozone_time, ozone_forcing_in) + ozone_lat, ozone_pres, ozone_time, ozone_forcing_in, & + errmsg, errflg) use module_microphysics, only: gsmconst use cldwat2m_micro, only: ini_micro @@ -98,11 +101,18 @@ subroutine GFS_initialize_scm_run (Model, Statein, Stateout, Sfcprop, & integer, intent(in) :: n_ozone_lats, n_ozone_layers, n_ozone_coefficients, n_ozone_times real(kind=kind_phys), intent(in) :: ozone_lat(:), ozone_pres(:), ozone_time(:), ozone_forcing_in(:,:,:,:) + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg ! ! !--- local variables real(kind=kind_phys), allocatable :: si(:) real(kind=kind_phys), parameter :: p_ref = 101325.0d0 + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + ! !--- set control properties (including namelist read) call Model%init (Init_parm%nlunit, Init_parm%fn_nml, & Init_parm%me, Init_parm%master, & @@ -113,7 +123,7 @@ subroutine GFS_initialize_scm_run (Model, Statein, Stateout, Sfcprop, & Init_parm%dt_dycore, Init_parm%dt_phys, & Init_parm%bdat, Init_parm%cdat, & Init_parm%tracer_names, Init_parm%blksz) - + !allocate memory for the variables stored in ozne_def and set them allocate(oz_lat(n_ozone_lats), oz_pres(n_ozone_layers), oz_time(n_ozone_times+1)) allocate(ozplin(n_ozone_lats, n_ozone_layers, n_ozone_coefficients, n_ozone_times)) diff --git a/GFS_layer/GFS_typedefs.F90 b/GFS_layer/GFS_typedefs.F90 index b61ad5188..331756258 100644 --- a/GFS_layer/GFS_typedefs.F90 +++ b/GFS_layer/GFS_typedefs.F90 @@ -2699,7 +2699,6 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%nshoc_2d = nshoc_2d Model%nshoc_3d = nshoc_3d Model%ncnvcld3d = ncnvcld3d - Model%npdf3d = 0 Model%nctp = nctp !--- debug flag diff --git a/physics/sfc_drv.f b/physics/sfc_drv.f index 1038c6c80..8dfc73ff6 100644 --- a/physics/sfc_drv.f +++ b/physics/sfc_drv.f @@ -124,7 +124,7 @@ subroutine lsm_noah_post_run & integer, intent(in) :: im, km logical, intent(in) :: flag_lssav - real, intent (in) :: dtf + real(kind=kind_phys), intent (in) :: dtf real(kind=kind_phys), dimension(im), intent(in ) :: & & drain, runof From 002b6b6b29513a5cff05a0fcf83cb5322fcb2067 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Fri, 16 Mar 2018 13:36:01 -0600 Subject: [PATCH 08/16] added compilation options for ifort for Theia --- CMakeLists.txt | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e87a019c..d41bdf0d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -243,13 +243,27 @@ set(SOURCES ./physics/rrtmg_sw_pre_cap.F90 ) -set(f_flags -ffree-line-length-none) +if (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU") + set(f_flags -ffree-line-length-none) -SET_SOURCE_FILES_PROPERTIES(./physics/module_bfmicrophysics.f ./physics/rascnvv2.f ./physics/sflx.f ./physics/sfc_diff.f ./physics/sfc_diag.f PROPERTIES COMPILE_FLAGS -fdefault-real-8) -SET_SOURCE_FILES_PROPERTIES(./physics/module_nst_model.f90 ./physics/GFS_calpreciptype.f90 PROPERTIES COMPILE_FLAGS "-fdefault-real-8 -ffree-form") -SET_SOURCE_FILES_PROPERTIES(./physics/mersenne_twister.f PROPERTIES COMPILE_FLAGS "-fdefault-real-8 -fno-range-check") -SET_SOURCE_FILES_PROPERTIES(./physics/module_nst_water_prop.f90 PROPERTIES COMPILE_FLAGS "-ffree-line-length-none -fdefault-real-8 -ffree-form") -SET_SOURCE_FILES_PROPERTIES(./physics/aer_cloud.F ./physics/wv_saturation.F ./physics/cldwat2m_micro.F PROPERTIES COMPILE_FLAGS "-DNEMS_GSM -fdefault-real-8 -fdefault-double-8") + SET_SOURCE_FILES_PROPERTIES(./physics/module_bfmicrophysics.f ./physics/rascnvv2.f ./physics/sflx.f ./physics/sfc_diff.f ./physics/sfc_diag.f PROPERTIES COMPILE_FLAGS -fdefault-real-8) + SET_SOURCE_FILES_PROPERTIES(./physics/module_nst_model.f90 ./physics/GFS_calpreciptype.f90 PROPERTIES COMPILE_FLAGS "-fdefault-real-8 -ffree-form") + SET_SOURCE_FILES_PROPERTIES(./physics/mersenne_twister.f PROPERTIES COMPILE_FLAGS "-fdefault-real-8 -fno-range-check") + SET_SOURCE_FILES_PROPERTIES(./physics/module_nst_water_prop.f90 PROPERTIES COMPILE_FLAGS "-ffree-line-length-none -fdefault-real-8 -ffree-form") + SET_SOURCE_FILES_PROPERTIES(./physics/aer_cloud.F ./physics/wv_saturation.F ./physics/cldwat2m_micro.F PROPERTIES COMPILE_FLAGS "-DNEMS_GSM -fdefault-real-8 -fdefault-double-8") +elseif (${CMAKE_Fortran_COMPILER_ID} MATCHES "Intel") + set(f_flags -extend-source 132) + + SET_SOURCE_FILES_PROPERTIES(./physics/module_bfmicrophysics.f ./physics/rascnvv2.f ./physics/sflx.f ./physics/sfc_diff.f ./physics/sfc_diag.f PROPERTIES COMPILE_FLAGS -r8) + SET_SOURCE_FILES_PROPERTIES(./physics/module_nst_model.f90 ./physics/GFS_calpreciptype.f90 PROPERTIES COMPILE_FLAGS "-r8 -free") + SET_SOURCE_FILES_PROPERTIES(./physics/mersenne_twister.f PROPERTIES COMPILE_FLAGS "-r8 -ftz") + SET_SOURCE_FILES_PROPERTIES(./physics/module_nst_water_prop.f90 PROPERTIES COMPILE_FLAGS "-extend-source 132 -r8 -free") + SET_SOURCE_FILES_PROPERTIES(./physics/aer_cloud.F ./physics/wv_saturation.F ./physics/cldwat2m_micro.F PROPERTIES COMPILE_FLAGS "-DNEMS_GSM -r8") +else (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU") + message ("CMAKE_Fortran_COMPILER full path: " ${CMAKE_Fortran_COMPILER}) + message ("Fortran compiler: " ${CMAKE_Fortran_COMPILER_ID}) + message ("This program has only been compiled with gfortran and ifort. If another compiler is needed, the appropriate flags must be added in ${GFS_PHYS_SRC}/CMakeLists.txt") +endif #apply general fortran tags to all fortran source files if(${CMAKE_VERSION} LESS 3.3) From d1c8aa6a98c4549b2272873d25773e512159d55b Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Fri, 16 Mar 2018 13:40:12 -0600 Subject: [PATCH 09/16] fixed error in CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d41bdf0d8..7bd04b9b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -263,7 +263,7 @@ else (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU") message ("CMAKE_Fortran_COMPILER full path: " ${CMAKE_Fortran_COMPILER}) message ("Fortran compiler: " ${CMAKE_Fortran_COMPILER_ID}) message ("This program has only been compiled with gfortran and ifort. If another compiler is needed, the appropriate flags must be added in ${GFS_PHYS_SRC}/CMakeLists.txt") -endif +endif (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU") #apply general fortran tags to all fortran source files if(${CMAKE_VERSION} LESS 3.3) From 398320bd5a4035418cbadd7b3cd36fb38b72ab3c Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Fri, 16 Mar 2018 14:32:56 -0600 Subject: [PATCH 10/16] added back ozone and h20 forcing index initialization routines to fix seg fault on Theia --- GFS_layer/GFS_initialize_scm.F90 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/GFS_layer/GFS_initialize_scm.F90 b/GFS_layer/GFS_initialize_scm.F90 index 3bddf052e..ef3d411bf 100644 --- a/GFS_layer/GFS_initialize_scm.F90 +++ b/GFS_layer/GFS_initialize_scm.F90 @@ -164,7 +164,16 @@ subroutine GFS_initialize_scm_run (Model, Statein, Stateout, Sfcprop, & ! !--- populate the grid components call GFS_grid_populate (Grid, Init_parm%xlon, Init_parm%xlat, Init_parm%area) + !--- read in and initialize ozone and water + if (Model%ntoz > 0) then + call setindxoz (Init_parm%blksz, Grid%xlat_d, Grid%jindx1_o3, & + Grid%jindx2_o3, Grid%ddy_o3) + endif + if (Model%h2o_phys) then + call setindxh2o (Init_parm%blksz, Grid%xlat_d, Grid%jindx1_h, & + Grid%jindx2_h, Grid%ddy_h) + endif ! !--- Call gfuncphys (funcphys.f) to compute all physics function tables. call gfuncphys () From 1420427c98e26543a0c9f7c221f460a175679c6b Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Tue, 20 Mar 2018 12:34:49 -0600 Subject: [PATCH 11/16] clean up of features/ccpp_scm branch before merge into features/ccpp --- CCPP_CAPS.mk | 66 ------- CCPP_SCHEMES.mk | 45 ++++- GFS_layer/GFS_initialize_scm.F90 | 287 +++++++---------------------- GFS_layer/GFS_radiation_driver.F90 | 2 +- 4 files changed, 109 insertions(+), 291 deletions(-) diff --git a/CCPP_CAPS.mk b/CCPP_CAPS.mk index ed360bb46..f3686dd2f 100644 --- a/CCPP_CAPS.mk +++ b/CCPP_CAPS.mk @@ -5,69 +5,3 @@ # at compile time, do not edit manually. # CAPS_F90 = - ./physics/radsw_cap.F90 - ./physics/GFS_DCNV_generic_post_cap.F90 - ./physics/GFS_RRTMG_post_cap.F90 - ./physics/ozphys_cap.F90 - ./physics/GFS_suite_interstitial_rad_reset_cap.F90 - ./physics/GFS_MP_generic_pre_cap.F90 - ./physics/GFS_MP_generic_post_cap.F90 - ./physics/gscond_cap.F90 - ./physics/GFS_SCNV_generic_pre_cap.F90 - ./physics/dcyc2t3_post_cap.F90 - ./physics/cnvc90_cap.F90 - ./physics/gwdc_cap.F90 - ./physics/GFS_RRTMG_pre_cap.F90 - ./physics/GFS_zhao_carr_pre_cap.F90 - ./physics/GFS_PBL_generic_pre_cap.F90 - ./physics/radlw_cap.F90 - ./physics/GFS_suite_interstitial_1_cap.F90 - ./physics/gwdps_pre_cap.F90 - ./physics/GFS_suite_interstitial_3_cap.F90 - ./physics/GFS_suite_interstitial_2_cap.F90 - ./physics/dcyc2t3_pre_cap.F90 - ./physics/lsm_noah_pre_cap.F90 - ./physics/sasasshal_post_cap.F90 - ./physics/precpd_cap.F90 - ./physics/sfc_ex_coef_cap.F90 - ./physics/GFS_radsw_post_cap.F90 - ./physics/GFS_PBL_generic_post_cap.F90 - ./physics/sasasshal_cap.F90 - ./physics/GFS_surface_loop_control_part0_cap.F90 - ./physics/GFS_phys_time_vary_2_cap.F90 - ./physics/GFS_phys_time_vary_1_cap.F90 - ./physics/dcyc2t3_cap.F90 - ./physics/GFS_surface_loop_control_part1_cap.F90 - ./physics/sfc_sice_cap.F90 - ./physics/sfc_nst_post_cap.F90 - ./physics/GFS_surface_generic_post_cap.F90 - ./physics/sfc_nst_cap.F90 - ./physics/edmf_cap.F90 - ./physics/GFS_surface_loop_control_part2_cap.F90 - ./physics/GFS_radlw_pre_cap.F90 - ./physics/sfc_sice_pre_cap.F90 - ./physics/ozphys_pre_cap.F90 - ./physics/GFS_radsw_pre_cap.F90 - ./physics/lsm_noah_cap.F90 - ./physics/GFS_suite_interstitial_phys_reset_cap.F90 - ./physics/gwdps_cap.F90 - ./physics/sfc_nst_pre_cap.F90 - ./physics/GFS_SCNV_generic_post_cap.F90 - ./physics/GFS_rad_time_vary_cap.F90 - ./physics/lsm_noah_post_cap.F90 - ./physics/sasasdeep_cap.F90 - ./physics/GFS_initialize_scm_cap.F90 - ./physics/GFS_DCNV_generic_pre_cap.F90 - ./physics/gwdc_pre_cap.F90 - ./physics/sfc_diag_cap.F90 - ./physics/rayleigh_damp_cap.F90 - ./physics/GFS_radlw_post_cap.F90 - ./physics/sfc_sice_post_cap.F90 - ./physics/gwdc_post_cap.F90 - ./physics/GFS_suite_update_stateout_cap.F90 - ./physics/get_prs_fv3_cap.F90 - ./physics/GFS_surface_generic_pre_cap.F90 - ./physics/ozphys_post_cap.F90 - ./physics/GFS_calpreciptype_cap.F90 - ./physics/get_phi_fv3_cap.F90 - ./physics/gwdps_post_cap.F90 \ No newline at end of file diff --git a/CCPP_SCHEMES.mk b/CCPP_SCHEMES.mk index 21cfc7645..d767748fe 100644 --- a/CCPP_SCHEMES.mk +++ b/CCPP_SCHEMES.mk @@ -1,3 +1,4 @@ + # All CCPP schemes are defined here. # # This file is auto-generated using ccpp_prebuild.py @@ -5,8 +6,46 @@ # SCHEMES_F = -SCHEMES_F90 = +SCHEMES_F90 = \ + ./GFS_layer/GFS_initialize_scm.F90 \ + ./physics/GFS_rrtmg_pre.F90 \ + ./physics/rrtmg_sw_pre.F90 \ + ./physics/rrtmg_sw_post.F90 \ + ./physics/rrtmg_lw_pre.F90 \ + ./physics/rrtmg_lw_post.F90 \ + ./physics/GFS_rrtmg_post.F90 -SCHEMES_f = +SCHEMES_f = \ + ./physics/radsw_main.f \ + ./physics/radlw_main.f \ + ./physics/sfc_sice.f \ + ./physics/dcyc2.f \ + ./physics/sfc_drv.f \ + ./physics/sfc_diff.f \ + ./physics/GFS_surface_loop_control.f \ + ./physics/sfc_nst.f \ + ./physics/sfc_diag.f \ + ./physics/moninedmf.f \ + ./physics/gwdps.f \ + ./physics/rayleigh_damp.f \ + ./physics/ozphys.f \ + ./physics/mfdeepcnv.f \ + ./physics/gwdc.f \ + ./physics/mfshalcnv.f \ + ./physics/cnvc90.f \ + ./physics/gscond.f \ + ./physics/precpd.f -SCHEMES_f90 = +SCHEMES_f90 = \ + ./physics/GFS_phys_time_vary.f90 \ + ./physics/GFS_rad_time_vary.f90 \ + ./physics/GFS_suite_interstitial.ccpp.f90 \ + ./physics/get_prs_fv3.f90 \ + ./physics/GFS_surface_generic.f90 \ + ./physics/GFS_PBL_generic.f90 \ + ./physics/GFS_DCNV_generic.f90 \ + ./physics/GFS_zhao_carr_pre.f90 \ + ./physics/GFS_SCNV_generic.f90 \ + ./physics/GFS_MP_generic_pre.f90 \ + ./physics/GFS_calpreciptype.f90 \ + ./physics/GFS_MP_generic_post.f90 \ No newline at end of file diff --git a/GFS_layer/GFS_initialize_scm.F90 b/GFS_layer/GFS_initialize_scm.F90 index ef3d411bf..959dcfa95 100644 --- a/GFS_layer/GFS_initialize_scm.F90 +++ b/GFS_layer/GFS_initialize_scm.F90 @@ -1,27 +1,9 @@ module GFS_initialize_scm - use machine, only: kind_phys - use GFS_typedefs, only: GFS_init_type, & - GFS_statein_type, GFS_stateout_type, & - GFS_sfcprop_type, GFS_coupling_type, & - GFS_control_type, GFS_grid_type, & - GFS_tbd_type, GFS_cldprop_type, & - GFS_radtend_type, GFS_diag_type, & - GFS_sfccycle_type, GFS_interstitial_type - - use funcphys, only: gfuncphys implicit none private -!------------------ -! Module parameters -!------------------ - -!---------------------------- -! Module variable definitions -!---------------------------- - !---------------- ! Public entities !---------------- @@ -74,6 +56,15 @@ subroutine GFS_initialize_scm_run (Model, Statein, Stateout, Sfcprop, & ozone_lat, ozone_pres, ozone_time, ozone_forcing_in, & errmsg, errflg) + use machine, only: kind_phys + use GFS_typedefs, only: GFS_init_type, & + GFS_statein_type, GFS_stateout_type, & + GFS_sfcprop_type, GFS_coupling_type, & + GFS_control_type, GFS_grid_type, & + GFS_tbd_type, GFS_cldprop_type, & + GFS_radtend_type, GFS_diag_type, & + GFS_sfccycle_type, GFS_interstitial_type + use funcphys, only: gfuncphys use module_microphysics, only: gsmconst use cldwat2m_micro, only: ini_micro use aer_cloud, only: aer_cloud_init @@ -83,7 +74,6 @@ subroutine GFS_initialize_scm_run (Model, Statein, Stateout, Sfcprop, & use omp_lib #endif - !--- interface variables type(GFS_control_type), intent(inout) :: Model type(GFS_statein_type), intent(inout) :: Statein @@ -104,14 +94,14 @@ subroutine GFS_initialize_scm_run (Model, Statein, Stateout, Sfcprop, & character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg -! -! !--- local variables - real(kind=kind_phys), allocatable :: si(:) - real(kind=kind_phys), parameter :: p_ref = 101325.0d0 + ! + ! !--- local variables + real(kind=kind_phys), allocatable :: si(:) + real(kind=kind_phys), parameter :: p_ref = 101325.0d0 - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 ! !--- set control properties (including namelist read) call Model%init (Init_parm%nlunit, Init_parm%fn_nml, & @@ -124,43 +114,32 @@ subroutine GFS_initialize_scm_run (Model, Statein, Stateout, Sfcprop, & Init_parm%bdat, Init_parm%cdat, & Init_parm%tracer_names, Init_parm%blksz) - !allocate memory for the variables stored in ozne_def and set them - allocate(oz_lat(n_ozone_lats), oz_pres(n_ozone_layers), oz_time(n_ozone_times+1)) - allocate(ozplin(n_ozone_lats, n_ozone_layers, n_ozone_coefficients, n_ozone_times)) - latsozp = n_ozone_lats - levozp = n_ozone_layers - timeoz = n_ozone_times - oz_coeff = n_ozone_coefficients - oz_lat = ozone_lat - oz_pres = ozone_pres - oz_time = ozone_time - ozplin = ozone_forcing_in - - call Statein%create(1, Model) - call Stateout%create(1, Model) - call Sfcprop%create(1, Model) - call Coupling%create(1, Model) - call Grid%create(1, Model) - call Tbd%create(1, 1, Model) - call Cldprop%create(1, Model) - call Radtend%create(1, Model) - !--- internal representation of diagnostics - call Diag%create(1, Model) - !--- internal representation of sfccycle - call Sfccycle%create(1, Model) -! -! #ifdef CCPP -! #ifdef OPENMP -! nthreads = omp_get_max_threads() -! #else -! nthreads = 1 -! #endif - - call Interstitial%create(1, Model) - + !allocate memory for the variables stored in ozne_def and set them + allocate(oz_lat(n_ozone_lats), oz_pres(n_ozone_layers), oz_time(n_ozone_times+1)) + allocate(ozplin(n_ozone_lats, n_ozone_layers, n_ozone_coefficients, n_ozone_times)) + latsozp = n_ozone_lats + levozp = n_ozone_layers + timeoz = n_ozone_times + oz_coeff = n_ozone_coefficients + oz_lat = ozone_lat + oz_pres = ozone_pres + oz_time = ozone_time + ozplin = ozone_forcing_in + + call Statein%create(1, Model) + call Stateout%create(1, Model) + call Sfcprop%create(1, Model) + call Coupling%create(1, Model) + call Grid%create(1, Model) + call Tbd%create(1, 1, Model) + call Cldprop%create(1, Model) + call Radtend%create(1, Model) + !--- internal representation of diagnostics + call Diag%create(1, Model) + !--- internal representation of sfccycle + call Sfccycle%create(1, Model) + call Interstitial%create(1, Model) -! #endif -! ! !--- populate the grid components call GFS_grid_populate (Grid, Init_parm%xlon, Init_parm%xlat, Init_parm%area) @@ -176,9 +155,9 @@ subroutine GFS_initialize_scm_run (Model, Statein, Stateout, Sfcprop, & endif ! !--- Call gfuncphys (funcphys.f) to compute all physics function tables. - call gfuncphys () + call gfuncphys () ! - call gsmconst (Model%dtp, Model%me, .TRUE.) + call gsmconst (Model%dtp, Model%me, .TRUE.) ! ! !--- define sigma level for radiation initialization ! !--- The formula converting hybrid sigma pressure coefficients to sigma coefficients follows Eckermann (2009, MWR) @@ -202,10 +181,10 @@ subroutine GFS_initialize_scm_run (Model, Statein, Stateout, Sfcprop, & endif ! ! !--- initialize ras - if (Model%ras) call ras_init (Model%levs, Model%me) + if (Model%ras) call ras_init (Model%levs, Model%me) ! ! !--- initialize soil vegetation - call set_soilveg(Model%me, Model%isot, Model%ivegsrc, Model%nlunit) + call set_soilveg(Model%me, Model%isot, Model%ivegsrc, Model%nlunit) ! ! !--- lsidea initialization if (Model%lsidea) then @@ -219,170 +198,36 @@ subroutine GFS_initialize_scm_run (Model, Statein, Stateout, Sfcprop, & ! !--- this not is placed here to alert users to the need to study ! !--- the FV3GFS_io.F90 module - end subroutine GFS_initialize_scm_run + end subroutine GFS_initialize_scm_run !------------------ ! GFS_grid_populate !------------------ - subroutine GFS_grid_populate (Grid, xlon, xlat, area) - use physcons, only: pi => con_pi + subroutine GFS_grid_populate (Grid, xlon, xlat, area) + use physcons, only: pi => con_pi - implicit none + implicit none - type(GFS_grid_type) :: Grid - real(kind=kind_phys), intent(in) :: xlon(:,:) - real(kind=kind_phys), intent(in) :: xlat(:,:) - real(kind=kind_phys), intent(in) :: area(:,:) + type(GFS_grid_type) :: Grid + real(kind=kind_phys), intent(in) :: xlon(:,:) + real(kind=kind_phys), intent(in) :: xlat(:,:) + real(kind=kind_phys), intent(in) :: area(:,:) - !--- local variables - integer :: n_columns, i + !--- local variables + integer :: n_columns, i - n_columns = size(Grid%xlon) + n_columns = size(Grid%xlon) - do i=1, n_columns - Grid%xlon = xlon(i,1) - Grid%xlat = xlat(i,1) - Grid%xlat_d(i) = xlat(i,1) * 180.0_kind_phys/pi - Grid%sinlat(i) = sin(Grid%xlat(i)) - Grid%coslat(i) = sqrt(1.0_kind_phys - Grid%sinlat(i)*Grid%sinlat(i)) - Grid%area(i) = area(i,1) - Grid%dx(i) = sqrt(area(i,1)) - end do + do i=1, n_columns + Grid%xlon = xlon(i,1) + Grid%xlat = xlat(i,1) + Grid%xlat_d(i) = xlat(i,1) * 180.0_kind_phys/pi + Grid%sinlat(i) = sin(Grid%xlat(i)) + Grid%coslat(i) = sqrt(1.0_kind_phys - Grid%sinlat(i)*Grid%sinlat(i)) + Grid%area(i) = area(i,1) + Grid%dx(i) = sqrt(area(i,1)) + end do - end subroutine GFS_grid_populate + end subroutine GFS_grid_populate end module GFS_initialize_scm -! -! -! #ifndef CCPP -! !------------------------------------------------------------------------- -! ! time_vary_step -! !------------------------------------------------------------------------- -! ! routine called prior to radiation and physics steps to handle: -! ! 1) sets up various time/date variables -! ! 2) sets up various triggers -! ! 3) defines random seed indices for radiation (in a reproducible way) -! ! 5) interpolates coefficients for prognostic ozone calculation -! ! 6) performs surface data cycling via the GFS gcycle routine -! !------------------------------------------------------------------------- -! subroutine GFS_time_vary_step (Model, Statein, Stateout, Sfcprop, Coupling, & -! Grid, Tbd, Cldprop, Radtend, Diag, Sfccycle) -! -! use GFS_phys_time_vary_1, only: GFS_phys_time_vary_1_run -! use GFS_phys_time_vary_2, only: GFS_phys_time_vary_2_run -! use GFS_rad_time_vary, only: GFS_rad_time_vary_run -! implicit none -! -! !--- interface variables -! type(GFS_control_type), intent(inout) :: Model -! type(GFS_statein_type), intent(inout) :: Statein -! type(GFS_stateout_type), intent(inout) :: Stateout -! type(GFS_sfcprop_type), intent(inout) :: Sfcprop -! type(GFS_coupling_type), intent(inout) :: Coupling -! type(GFS_grid_type), intent(inout) :: Grid -! type(GFS_tbd_type), intent(inout) :: Tbd -! type(GFS_cldprop_type), intent(inout) :: Cldprop -! type(GFS_radtend_type), intent(inout) :: Radtend -! type(GFS_diag_type), intent(inout) :: Diag -! type(GFS_sfccycle_type), intent(inout) :: Sfccycle -! -! call GFS_phys_time_vary_1_run (Model, Tbd) -! -! call GFS_rad_time_vary_run (Model, Statein, Tbd) -! -! call GFS_phys_time_vary_2_run (Grid, Model, Tbd, Sfcprop, Cldprop, Diag, Sfccycle) -! -! end subroutine GFS_time_vary_step -! -! -! !------------------------------------------------------------------------- -! ! GFS stochastic_driver -! !------------------------------------------------------------------------- -! ! routine called prior to radiation and physics steps to handle: -! ! 1) sets up various time/date variables -! ! 2) sets up various triggers -! ! 3) defines random seed indices for radiation (in a reproducible way) -! ! 5) interpolates coefficients for prognostic ozone calculation -! ! 6) performs surface data cycling via the GFS gcycle routine -! !------------------------------------------------------------------------- -! subroutine GFS_stochastic_driver (Model, Statein, Stateout, Sfcprop, Coupling, & -! Grid, Tbd, Cldprop, Radtend, Diag) -! -! use GFS_stochastics, only: GFS_stochastics_run -! -! implicit none -! -! !--- interface variables -! type(GFS_control_type), intent(in ) :: Model -! type(GFS_statein_type), intent(in ) :: Statein -! type(GFS_stateout_type), intent(in ) :: Stateout -! type(GFS_sfcprop_type), intent(in ) :: Sfcprop -! type(GFS_coupling_type), intent(inout) :: Coupling -! type(GFS_grid_type), intent(in ) :: Grid -! type(GFS_tbd_type), intent(in ) :: Tbd -! type(GFS_cldprop_type), intent(in ) :: Cldprop -! type(GFS_radtend_type), intent(in ) :: Radtend -! type(GFS_diag_type), intent(inout) :: Diag -! -! call GFS_stochastics_run(Model, Statein, Stateout, Sfcprop, Coupling, & -! Grid, Tbd, Cldprop, Radtend, Diag) -! -! end subroutine GFS_stochastic_driver -! #endif -! -! - - ! subroutine GFS_initialize_scm_ozone_and_h20_setup(n_columns, n_levels, lats, pres, & - ! n_ozone_lats, n_ozone_layers, n_ozone_coefficients, n_ozone_times, & - ! ozone_lat, ozone_pres, ozone_time, ozone_forcing_in) - ! use ozne_def, only: latsozp, levozp, timeoz, oz_coeff, oz_lat, oz_pres, oz_time, ozplin - ! integer, intent(in) :: n_columns, n_levels - ! real(kind_phys), intent(in) :: lats(:), pres(:) - ! - ! integer, intent(inout) :: n_ozone_lats, n_ozone_layers, n_ozone_coefficients, n_ozone_times - ! real(kind_phys), allocatable, intent(inout) :: ozone_lat(:), ozone_pres(:), ozone_time(:), ozone_forcing_in(:,:,:,:) - ! - ! !set ozone forcing array dimensions - ! n_ozone_lats = n_columns - ! n_ozone_layers = n_levels - ! n_ozone_coefficients = 4 - ! n_ozone_times = 2 - ! - ! !reallocate ozone forcing latitutes, pressure levels, and times using the array dimensions set here - ! if(allocated(ozone_lat)) then - ! deallocate(ozone_lat) - ! allocate(ozone_lat(n_ozone_lats)) - ! endif - ! ozone_lat = lats - ! - ! if(allocated(ozone_pres)) then - ! deallocate(ozone_pres) - ! allocate(ozone_pres(n_ozone_layers)) - ! endif - ! ozone_pres = pres - ! - ! if(allocated(ozone_time)) then - ! deallocate(ozone_time) - ! allocate(ozone_time(n_ozone_times+1)) - ! endif - ! ozone_time = (/12.0, 13.0, 14.0/) - ! - ! if(allocated(ozone_forcing_in))then - ! deallocate(ozone_forcing_in) - ! allocate(ozone_forcing_in(n_ozone_lats, n_ozone_layers, n_ozone_coefficients, n_ozone_times)) - ! endif - ! ozone_forcing_in = 0.0 - ! - ! !allocate memory for the variables stored in ozne_def and set them - ! allocate(oz_lat(n_ozone_lats), oz_pres(n_ozone_layers), oz_time(n_ozone_times+1)) - ! allocate(ozplin(n_ozone_lats, n_ozone_layers, n_ozone_coefficients, n_ozone_times)) - ! latsozp = n_ozone_lats - ! levozp = n_ozone_layers - ! timeoz = n_ozone_times - ! oz_coeff = n_ozone_coefficients - ! oz_lat = ozone_lat - ! oz_pres = ozone_pres - ! oz_time = ozone_time - ! ozplin = ozone_forcing_in - ! - ! end subroutine GFS_initialize_scm_ozone_and_h20_setup diff --git a/GFS_layer/GFS_radiation_driver.F90 b/GFS_layer/GFS_radiation_driver.F90 index 10f9f9c01..88df4d838 100644 --- a/GFS_layer/GFS_radiation_driver.F90 +++ b/GFS_layer/GFS_radiation_driver.F90 @@ -1,7 +1,7 @@ !> \file grrad.f This file is the radiation driver module. It prepares !! the atmospheric profiles and invokes the main radiation calculation. -!> \defgroup RRTMG RRTMG Shortwave/Longwave Radiation +!> \defgroup rad RRTMG Shortwave/Longwave Radiation Scheme !> @{ !! \brief The GFS radiation scheme !! \details Radiative processes are among the most complex and From 3094f6bfd9aad4a77388b52927fa96fb3c363515 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Tue, 20 Mar 2018 13:23:54 -0600 Subject: [PATCH 12/16] emptied CCPP_SCHEMES.mk --- CCPP_SCHEMES.mk | 44 +++----------------------------------------- 1 file changed, 3 insertions(+), 41 deletions(-) diff --git a/CCPP_SCHEMES.mk b/CCPP_SCHEMES.mk index d767748fe..507962d67 100644 --- a/CCPP_SCHEMES.mk +++ b/CCPP_SCHEMES.mk @@ -6,46 +6,8 @@ # SCHEMES_F = -SCHEMES_F90 = \ - ./GFS_layer/GFS_initialize_scm.F90 \ - ./physics/GFS_rrtmg_pre.F90 \ - ./physics/rrtmg_sw_pre.F90 \ - ./physics/rrtmg_sw_post.F90 \ - ./physics/rrtmg_lw_pre.F90 \ - ./physics/rrtmg_lw_post.F90 \ - ./physics/GFS_rrtmg_post.F90 +SCHEMES_F90 = -SCHEMES_f = \ - ./physics/radsw_main.f \ - ./physics/radlw_main.f \ - ./physics/sfc_sice.f \ - ./physics/dcyc2.f \ - ./physics/sfc_drv.f \ - ./physics/sfc_diff.f \ - ./physics/GFS_surface_loop_control.f \ - ./physics/sfc_nst.f \ - ./physics/sfc_diag.f \ - ./physics/moninedmf.f \ - ./physics/gwdps.f \ - ./physics/rayleigh_damp.f \ - ./physics/ozphys.f \ - ./physics/mfdeepcnv.f \ - ./physics/gwdc.f \ - ./physics/mfshalcnv.f \ - ./physics/cnvc90.f \ - ./physics/gscond.f \ - ./physics/precpd.f +SCHEMES_f = -SCHEMES_f90 = \ - ./physics/GFS_phys_time_vary.f90 \ - ./physics/GFS_rad_time_vary.f90 \ - ./physics/GFS_suite_interstitial.ccpp.f90 \ - ./physics/get_prs_fv3.f90 \ - ./physics/GFS_surface_generic.f90 \ - ./physics/GFS_PBL_generic.f90 \ - ./physics/GFS_DCNV_generic.f90 \ - ./physics/GFS_zhao_carr_pre.f90 \ - ./physics/GFS_SCNV_generic.f90 \ - ./physics/GFS_MP_generic_pre.f90 \ - ./physics/GFS_calpreciptype.f90 \ - ./physics/GFS_MP_generic_post.f90 \ No newline at end of file +SCHEMES_f90 = From 8f9b07113eed623f22ac0c71bf8eb48816e8980f Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Tue, 20 Mar 2018 13:29:32 -0600 Subject: [PATCH 13/16] reverting GFS_typedefs.F90 to previous version (cleanup whitespace changes) --- GFS_layer/GFS_typedefs.F90 | 235 ++++++++++++++++++------------------- 1 file changed, 115 insertions(+), 120 deletions(-) diff --git a/GFS_layer/GFS_typedefs.F90 b/GFS_layer/GFS_typedefs.F90 index 331756258..3c4250e99 100644 --- a/GFS_layer/GFS_typedefs.F90 +++ b/GFS_layer/GFS_typedefs.F90 @@ -62,7 +62,7 @@ module GFS_typedefs ! GFS_sfccycle_type !< surface cycling/update fields ! GFS_coupling_type !< fields to/from coupling with other components (e.g. land/ice/ocean/etc.) ! !---GFS specific containers -! GFS_control_type !< model control parameters +! GFS_control_type !< model control parameters ! GFS_grid_type !< grid and interpolation related data ! GFS_tbd_type !< to be determined data that doesn't fit in any one container ! GFS_cldprop_type !< cloud fields needed by radiation from physics @@ -173,7 +173,7 @@ module GFS_typedefs !! type GFS_statein_type - !--- level geopotential and pressures + !--- level geopotential and pressures real (kind=kind_phys), pointer :: phii (:,:) => null() !< interface geopotential height real (kind=kind_phys), pointer :: prsi (:,:) => null() !< model level pressure in Pa real (kind=kind_phys), pointer :: prsik (:,:) => null() !< Exner function at interface @@ -293,11 +293,11 @@ module GFS_typedefs !--- In (radiation and physics) real (kind=kind_phys), pointer :: slmsk (:) => null() !< sea/land mask array (sea:0,land:1,sea-ice:2) - real (kind=kind_phys), pointer :: tsfc (:) => null() !< surface temperature in k + real (kind=kind_phys), pointer :: tsfc (:) => null() !< surface temperature in k !< [tsea in gbphys.f] - real (kind=kind_phys), pointer :: tisfc (:) => null() !< surface temperature over ice fraction + real (kind=kind_phys), pointer :: tisfc (:) => null() !< surface temperature over ice fraction real (kind=kind_phys), pointer :: snowd (:) => null() !< snow depth water equivalent in mm ; same as snwdph - real (kind=kind_phys), pointer :: zorl (:) => null() !< surface roughness in cm + real (kind=kind_phys), pointer :: zorl (:) => null() !< surface roughness in cm real (kind=kind_phys), pointer :: fice (:) => null() !< ice fraction over open water grid real (kind=kind_phys), pointer :: hprim (:) => null() !< topographic standard deviation in m real (kind=kind_phys), pointer :: hprime (:,:) => null() !< orographic metrics @@ -321,7 +321,7 @@ module GFS_typedefs real (kind=kind_phys), pointer :: vtype (:) => null() !< vegetation type real (kind=kind_phys), pointer :: stype (:) => null() !< soil type real (kind=kind_phys), pointer :: uustar (:) => null() !< boundary layer parameter - real (kind=kind_phys), pointer :: oro (:) => null() !< orography + real (kind=kind_phys), pointer :: oro (:) => null() !< orography real (kind=kind_phys), pointer :: oro_uf (:) => null() !< unfiltered orography !-- In/Out @@ -466,7 +466,7 @@ module GFS_typedefs type GFS_coupling_type !--- Out (radiation only) - real (kind=kind_phys), pointer :: nirbmdi(:) => null() !< sfc nir beam sw downward flux (w/m2) + real (kind=kind_phys), pointer :: nirbmdi(:) => null() !< sfc nir beam sw downward flux (w/m2) real (kind=kind_phys), pointer :: nirdfdi(:) => null() !< sfc nir diff sw downward flux (w/m2) real (kind=kind_phys), pointer :: visbmdi(:) => null() !< sfc uv+vis beam sw downward flux (w/m2) real (kind=kind_phys), pointer :: visdfdi(:) => null() !< sfc uv+vis diff sw downward flux (w/m2) @@ -494,17 +494,17 @@ module GFS_typedefs !--- outgoing accumulated quantities real (kind=kind_phys), pointer :: rain_cpl (:) => null() !< total rain precipitation - real (kind=kind_phys), pointer :: snow_cpl (:) => null() !< total snow precipitation + real (kind=kind_phys), pointer :: snow_cpl (:) => null() !< total snow precipitation real (kind=kind_phys), pointer :: dusfc_cpl (:) => null() !< sfc u momentum flux real (kind=kind_phys), pointer :: dvsfc_cpl (:) => null() !< sfc v momentum flux real (kind=kind_phys), pointer :: dtsfc_cpl (:) => null() !< sfc sensible heat flux real (kind=kind_phys), pointer :: dqsfc_cpl (:) => null() !< sfc latent heat flux real (kind=kind_phys), pointer :: dlwsfc_cpl(:) => null() !< sfc downward lw flux (w/m**2) real (kind=kind_phys), pointer :: dswsfc_cpl(:) => null() !< sfc downward sw flux (w/m**2) - real (kind=kind_phys), pointer :: dnirbm_cpl(:) => null() !< sfc nir beam downward sw flux (w/m**2) - real (kind=kind_phys), pointer :: dnirdf_cpl(:) => null() !< sfc nir diff downward sw flux (w/m**2) - real (kind=kind_phys), pointer :: dvisbm_cpl(:) => null() !< sfc uv+vis beam dnwd sw flux (w/m**2) - real (kind=kind_phys), pointer :: dvisdf_cpl(:) => null() !< sfc uv+vis diff dnwd sw flux (w/m**2) + real (kind=kind_phys), pointer :: dnirbm_cpl(:) => null() !< sfc nir beam downward sw flux (w/m**2) + real (kind=kind_phys), pointer :: dnirdf_cpl(:) => null() !< sfc nir diff downward sw flux (w/m**2) + real (kind=kind_phys), pointer :: dvisbm_cpl(:) => null() !< sfc uv+vis beam dnwd sw flux (w/m**2) + real (kind=kind_phys), pointer :: dvisdf_cpl(:) => null() !< sfc uv+vis diff dnwd sw flux (w/m**2) real (kind=kind_phys), pointer :: nlwsfc_cpl(:) => null() !< net downward lw flux (w/m**2) real (kind=kind_phys), pointer :: nswsfc_cpl(:) => null() !< net downward sw flux (w/m**2) real (kind=kind_phys), pointer :: nnirbm_cpl(:) => null() !< net nir beam downward sw flux (w/m**2) @@ -564,7 +564,7 @@ module GFS_typedefs !---------------------------------------------------------------------------------- ! GFS_control_type ! model control parameters input from a namelist and/or derived from others -! list of those that can be modified during the run are at the bottom of the list +! list of those that can be modified during the run are at the bottom of the list !---------------------------------------------------------------------------------- !! \section arg_table_GFS_control_type !! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | @@ -813,7 +813,7 @@ module GFS_typedefs !< available; use latest; do extrapolation. !< ictm=yyyy0 => use yyyy data for the forecast time; !< no extrapolation. - !< ictm=yyyy1 = > use yyyy data for the fcst. If needed, + !< ictm=yyyy1 = > use yyyy data for the fcst. If needed, !< do extrapolation to match the fcst time. !< ictm=-1 => use user provided external data for !< the fcst time; no extrapolation. @@ -825,7 +825,7 @@ module GFS_typedefs !< =2 => sub-grid cloud with randomly generated !< seeds logical :: crick_proof !< CRICK-Proof cloud water - logical :: ccnorm !< Cloud condensate normalized by cloud cover + logical :: ccnorm !< Cloud condensate normalized by cloud cover logical :: norad_precip !< radiation precip flag for Ferrier/Moorthi logical :: lwhtr !< flag to output lw heating rate (Radtend%lwhc) logical :: swhtr !< flag to output sw heating rate (Radtend%swhc) @@ -842,13 +842,13 @@ module GFS_typedefs !--- M-G microphysical parameters integer :: fprcp !< no prognostic rain and snow (MG) real(kind=kind_phys) :: mg_dcs !< Morrison-Gettleman microphysics parameters - real(kind=kind_phys) :: mg_qcvar + real(kind=kind_phys) :: mg_qcvar real(kind=kind_phys) :: mg_ts_auto_ice !< ice auto conversion time scale !--- land/surface model parameters integer :: lsm !< flag for land surface model lsm=1 for noah lsm integer :: lsoil !< number of soil layers - integer :: ivegsrc !< ivegsrc = 0 => USGS, + integer :: ivegsrc !< ivegsrc = 0 => USGS, !< ivegsrc = 1 => IGBP (20 category) !< ivegsrc = 2 => UMD (13 category) integer :: isot !< isot = 0 => Zobler soil type ( 9 category) @@ -878,7 +878,7 @@ module GFS_typedefs logical :: redrag !< flag for reduced drag coeff. over sea logical :: hybedmf !< flag for hybrid edmf pbl scheme logical :: dspheat !< flag for tke dissipative heating - logical :: cnvcld + logical :: cnvcld logical :: random_clds !< flag controls whether clouds are random logical :: shal_cnv !< flag for calling shallow convection integer :: imfshalcnv !< flag for mass-flux shallow convection scheme @@ -902,11 +902,11 @@ module GFS_typedefs !< workfunction for RAS real(kind=kind_phys) :: cdmbgwd(2) !< multiplication factors for cdmb and gwd real(kind=kind_phys) :: sup !< supersaturation in pdf cloud when t is very low - real(kind=kind_phys) :: ctei_rm(2) !< critical cloud top entrainment instability criteria + real(kind=kind_phys) :: ctei_rm(2) !< critical cloud top entrainment instability criteria !< (used if mstrat=.true.) real(kind=kind_phys) :: crtrh(3) !< critical relative humidity at the surface !< PBL top and at the top of the atmosphere - real(kind=kind_phys) :: dlqf(2) !< factor for cloud condensate detrainment + real(kind=kind_phys) :: dlqf(2) !< factor for cloud condensate detrainment !< from cloud edges for RAS integer :: seed0 !< random seed for radiation @@ -916,10 +916,10 @@ module GFS_typedefs !--- near surface temperature model logical :: nst_anl !< flag for NSSTM analysis in gcycle/sfcsub - integer :: lsea - real(kind=kind_phys) :: xkzm_m !< [in] bkgd_vdif_m background vertical diffusion for momentum - real(kind=kind_phys) :: xkzm_h !< [in] bkgd_vdif_h background vertical diffusion for heat q - real(kind=kind_phys) :: xkzm_s !< [in] bkgd_vdif_s sigma threshold for background mom. diffusion + integer :: lsea + real(kind=kind_phys) :: xkzm_m !< [in] bkgd_vdif_m background vertical diffusion for momentum + real(kind=kind_phys) :: xkzm_h !< [in] bkgd_vdif_h background vertical diffusion for heat q + real(kind=kind_phys) :: xkzm_s !< [in] bkgd_vdif_s sigma threshold for background mom. diffusion integer :: nstf_name(5) !< flag 0 for no nst 1 for uncoupled nst and 2 for coupled NST !< nstf_name contains the NSST related parameters !< nstf_name(1) : 0 = NSSTM off, 1 = NSSTM on but uncoupled, 2 = @@ -927,12 +927,12 @@ module GFS_typedefs !< nstf_name(3) : 1 = NSST analysis on, 0 = NSSTM analysis off !< nstf_name(4) : zsea1 in mm !< nstf_name(5) : zsea2 in mm - + !--- stochastic physics control parameters logical :: do_sppt logical :: do_shum logical :: do_skeb - logical :: do_vc + logical :: do_vc real(kind=kind_phys) :: sppt(5) !< stochastic physics tendency amplitude real(kind=kind_phys) :: shum(5) !< stochastic boundary layer spf hum amp real(kind=kind_phys) :: skeb(5) !< stochastic KE backscatter amplitude @@ -955,7 +955,7 @@ module GFS_typedefs integer :: ntke !< tracer index for kinetic energy integer :: nto !< tracer index for oxygen ion integer :: nto2 !< tracer index for oxygen - + !--- derived totals for phy_f*d integer :: ntot2d !< total number of variables for phyf2d integer :: ntot3d !< total number of variables for phyf3d @@ -968,7 +968,7 @@ module GFS_typedefs integer :: nctp !< number of cloud types in Chikira-Sugiyama scheme !--- debug flag - logical :: debug + logical :: debug logical :: pre_rad !< flag for testing purpose !--- variables modified at each time step @@ -981,7 +981,7 @@ module GFS_typedefs real(kind=kind_phys) :: slag !< equation of time ( radian ) [set via radupdate] real(kind=kind_phys) :: sdec !< sin of the solar declination angle [set via radupdate] real(kind=kind_phys) :: cdec !< cos of the solar declination angle [set via radupdate] - real(kind=kind_phys) :: clstp !< index used by cnvc90 (for convective clouds) + real(kind=kind_phys) :: clstp !< index used by cnvc90 (for convective clouds) !< legacy stuff - does not affect forecast real(kind=kind_phys) :: phour !< previous forecast hour real(kind=kind_phys) :: fhour !< curent forecast hour @@ -1019,15 +1019,15 @@ module GFS_typedefs !! | IPD_Data(nb)%Grid%jindx2_h | | interpolation high index for h2o | index | 1 | integer | | none | F | !! type GFS_grid_type - - real (kind=kind_phys), pointer :: xlon (:) => null() !< grid longitude in radians, ok for both 0->2pi - !! or -pi -> +pi ranges - real (kind=kind_phys), pointer :: xlat (:) => null() !< grid latitude in radians, default to pi/2 -> - !! -pi/2 range, otherwise adj in subr called - real (kind=kind_phys), pointer :: xlat_d (:) => null() !< grid latitude in degrees, default to 90 -> - !! -90 range, otherwise adj in subr called - real (kind=kind_phys), pointer :: sinlat (:) => null() !< sine of the grids corresponding latitudes - real (kind=kind_phys), pointer :: coslat (:) => null() !< cosine of the grids corresponding latitudes + + real (kind=kind_phys), pointer :: xlon (:) => null() !< grid longitude in radians, ok for both 0->2pi + !! or -pi -> +pi ranges + real (kind=kind_phys), pointer :: xlat (:) => null() !< grid latitude in radians, default to pi/2 -> + !! -pi/2 range, otherwise adj in subr called + real (kind=kind_phys), pointer :: xlat_d (:) => null() !< grid latitude in degrees, default to 90 -> + !! -90 range, otherwise adj in subr called + real (kind=kind_phys), pointer :: sinlat (:) => null() !< sine of the grids corresponding latitudes + real (kind=kind_phys), pointer :: coslat (:) => null() !< cosine of the grids corresponding latitudes real (kind=kind_phys), pointer :: area (:) => null() !< area of the grid cell real (kind=kind_phys), pointer :: dx (:) => null() !< relative dx for the grid cell @@ -1089,8 +1089,8 @@ module GFS_typedefs !--- radiation random seeds integer, pointer :: icsdsw (:) => null() !< (rad. only) auxiliary cloud control arrays passed to main - integer, pointer :: icsdlw (:) => null() !< (rad. only) radiations. if isubcsw/isubclw (input to init) - !< (rad. only) are set to 2, the arrays contains provided + integer, pointer :: icsdlw (:) => null() !< (rad. only) radiations. if isubcsw/isubclw (input to init) + !< (rad. only) are set to 2, the arrays contains provided !< (rad. only) random seeds for sub-column clouds generators !--- In @@ -1132,7 +1132,7 @@ module GFS_typedefs !------------------------------------------------------------------ ! GFS_cldprop_type -! cloud properties and tendencies needed by radiation from physics +! cloud properties and tendencies needed by radiation from physics !------------------------------------------------------------------ !! \section arg_table_GFS_cldprop_type !! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | @@ -1180,37 +1180,37 @@ module GFS_typedefs type GFS_radtend_type type (sfcfsw_type), pointer :: sfcfsw(:) => null() !< sw radiation fluxes at sfc - !< [dim(im): created in grrad.f], components: - !! (check module_radsw_parameters for definition) - !!\n %upfxc - total sky upward sw flux at sfc (w/m**2) - !!\n %upfx0 - clear sky upward sw flux at sfc (w/m**2) - !!\n %dnfxc - total sky downward sw flux at sfc (w/m**2) - !!\n %dnfx0 - clear sky downward sw flux at sfc (w/m**2) + !< [dim(im): created in grrad.f], components: + !! (check module_radsw_parameters for definition) + !!\n %upfxc - total sky upward sw flux at sfc (w/m**2) + !!\n %upfx0 - clear sky upward sw flux at sfc (w/m**2) + !!\n %dnfxc - total sky downward sw flux at sfc (w/m**2) + !!\n %dnfx0 - clear sky downward sw flux at sfc (w/m**2) type (sfcflw_type), pointer :: sfcflw(:) => null() !< lw radiation fluxes at sfc - !< [dim(im): created in grrad.f], components: - !! (check module_radlw_paramters for definition) - !!\n %upfxc - total sky upward lw flux at sfc (w/m**2) - !!\n %upfx0 - clear sky upward lw flux at sfc (w/m**2) - !!\n %dnfxc - total sky downward lw flux at sfc (w/m**2) - !!\n %dnfx0 - clear sky downward lw flux at sfc (w/m**2) + !< [dim(im): created in grrad.f], components: + !! (check module_radlw_paramters for definition) + !!\n %upfxc - total sky upward lw flux at sfc (w/m**2) + !!\n %upfx0 - clear sky upward lw flux at sfc (w/m**2) + !!\n %dnfxc - total sky downward lw flux at sfc (w/m**2) + !!\n %dnfx0 - clear sky downward lw flux at sfc (w/m**2) !--- Out (radiation only) - real (kind=kind_phys), pointer :: htrsw (:,:) => null() !< swh total sky sw heating rate in k/sec + real (kind=kind_phys), pointer :: htrsw (:,:) => null() !< swh total sky sw heating rate in k/sec real (kind=kind_phys), pointer :: htrlw (:,:) => null() !< hlw total sky lw heating rate in k/sec - real (kind=kind_phys), pointer :: sfalb (:) => null() !< mean surface diffused sw albedo + real (kind=kind_phys), pointer :: sfalb (:) => null() !< mean surface diffused sw albedo - real (kind=kind_phys), pointer :: coszen(:) => null() !< mean cos of zenith angle over rad call period - real (kind=kind_phys), pointer :: tsflw (:) => null() !< surface air temp during lw calculation in k + real (kind=kind_phys), pointer :: coszen(:) => null() !< mean cos of zenith angle over rad call period + real (kind=kind_phys), pointer :: tsflw (:) => null() !< surface air temp during lw calculation in k real (kind=kind_phys), pointer :: semis (:) => null() !< surface lw emissivity in fraction !--- In/Out (???) (radiaition only) real (kind=kind_phys), pointer :: coszdg(:) => null() !< daytime mean cosz over rad call period !--- In/Out (???) (physics only) - real (kind=kind_phys), pointer :: swhc (:,:) => null() !< clear sky sw heating rates ( k/s ) - real (kind=kind_phys), pointer :: lwhc (:,:) => null() !< clear sky lw heating rates ( k/s ) - real (kind=kind_phys), pointer :: lwhd (:,:,:) => null() !< idea sky lw heating rates ( k/s ) + real (kind=kind_phys), pointer :: swhc (:,:) => null() !< clear sky sw heating rates ( k/s ) + real (kind=kind_phys), pointer :: lwhc (:,:) => null() !< clear sky lw heating rates ( k/s ) + real (kind=kind_phys), pointer :: lwhd (:,:,:) => null() !< idea sky lw heating rates ( k/s ) contains procedure :: create => radtend_create !< allocate array data @@ -1218,7 +1218,7 @@ module GFS_typedefs !---------------------------------------------------------------- ! GFS_diag_type -! internal diagnostic type used as arguments to gbphys and grrad +! internal diagnostic type used as arguments to gbphys and grrad !---------------------------------------------------------------- !! \section arg_table_GFS_diag_type !! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | @@ -1309,10 +1309,10 @@ module GFS_typedefs !! Input/Output only in radiation real (kind=kind_phys), pointer :: fluxr (:,:) => null() !< to save time accumulated 2-d fields defined as:! !< hardcoded field indices, opt. includes aerosols! - type (topfsw_type), pointer :: topfsw(:) => null() !< sw radiation fluxes at toa, components: - ! %upfxc - total sky upward sw flux at toa (w/m**2) - ! %dnfxc - total sky downward sw flux at toa (w/m**2) - ! %upfx0 - clear sky upward sw flux at toa (w/m**2) + type (topfsw_type), pointer :: topfsw(:) => null() !< sw radiation fluxes at toa, components: + ! %upfxc - total sky upward sw flux at toa (w/m**2) + ! %dnfxc - total sky downward sw flux at toa (w/m**2) + ! %upfx0 - clear sky upward sw flux at toa (w/m**2) type (topflw_type), pointer :: topflw(:) => null() !< lw radiation fluxes at top, component: ! %upfxc - total sky upward lw flux at toa (w/m**2) ! %upfx0 - clear sky upward lw flux at toa (w/m**2) @@ -1395,7 +1395,7 @@ module GFS_typedefs real (kind=kind_phys), pointer :: dv3dt (:,:,:) => null() !< v momentum change due to physics real (kind=kind_phys), pointer :: dt3dt (:,:,:) => null() !< temperature change due to physics real (kind=kind_phys), pointer :: dq3dt (:,:,:) => null() !< moisture change due to physics - + !--- accumulated quantities for 3D diagnostics real (kind=kind_phys), pointer :: upd_mf (:,:) => null() !< instantaneous convective updraft mass flux real (kind=kind_phys), pointer :: dwn_mf (:,:) => null() !< instantaneous convective downdraft mass flux @@ -1445,7 +1445,7 @@ module GFS_typedefs !! | IPD_Interstitial(nt)%clouds(:,:,5) | mean_effective_radius_for_ice_cloud | mean effective radius for ice cloud | micron | 2 | real | kind_phys | none | F | !! | IPD_Interstitial(nt)%clouds(:,:,6) | cloud_rain_water_path | cloud rain water path | g m-2 | 2 | real | kind_phys | none | F | !! | IPD_Interstitial(nt)%clouds(:,:,7) | mean_effective_radius_for_rain_drop | mean effective radius for rain drop | micron | 2 | real | kind_phys | none | F | -!! | IPD_Interstitial(nt)%clouds(:,:,8) | cloud_snow_water_path | cloud snow water path | g m-2 | 2 | real | kind_phys | none | F | +!! | IPD_Interstitial(nt)%clouds(:,:,8) | cloud_snow_water_path | cloud snow water path | g m-2 | 2 | real | kind_phys | none | F | !! | IPD_Interstitial(nt)%clouds(:,:,9) | mean_effective_radius_for_snow_flake | mean effective radius for snow flake | micron | 2 | real | kind_phys | none | F | !! | IPD_Interstitial(nt)%clw | convective_transportable_tracers | array to contain cloud water and other convective trans. tracers | kg kg-1 | 3 | real | kind_phys | none | F | !! | IPD_Interstitial(nt)%clw(:,:,1) | cloud_ice_specific_humidity | cloud ice specific humidity | kg kg-1 | 2 | real | kind_phys | none | F | @@ -1606,7 +1606,7 @@ module GFS_typedefs !! | IPD_Interstitial(nt)%work3 | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | none | F | !! | IPD_Interstitial(nt)%xcosz | instantaneous_cosine_of_zenith_angle | cosine of zenith angle at current time | none | 1 | real | kind_phys | none | F | !! | IPD_Interstitial(nt)%xmu | zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes | zenith angle temporal adjustment factor for shortwave | none | 1 | real | kind_phys | none | F | -!! | IPD_Interstitial(nt)%zice | sea_ice_thickness_for_physics | sea-ice thickness | m | 1 | real | kind_phys | none | F | +!! | IPD_Interstitial(nt)%zice | sea_ice_thickness_for_physics | sea-ice thickness | m | 1 | real | kind_phys | none | F | !! #endif type GFS_interstitial_type @@ -1792,7 +1792,7 @@ module GFS_typedefs !------------------------ ! GFS_statein_type%create !------------------------ - subroutine statein_create (Statein, IM, Model) + subroutine statein_create (Statein, IM, Model) implicit none class(GFS_statein_type) :: Statein @@ -1866,7 +1866,7 @@ end subroutine stateout_create ! GFS_sfcprop_type%create !------------------------ subroutine sfcprop_create (Sfcprop, IM, Model) - + implicit none class(GFS_sfcprop_type) :: Sfcprop @@ -2055,12 +2055,12 @@ subroutine coupling_create (Coupling, IM, Model) !--- physics in allocate (Coupling%nirbmdi (IM)) allocate (Coupling%nirdfdi (IM)) - allocate (Coupling%visbmdi (IM)) - allocate (Coupling%visdfdi (IM)) - allocate (Coupling%nirbmui (IM)) - allocate (Coupling%nirdfui (IM)) - allocate (Coupling%visbmui (IM)) - allocate (Coupling%visdfui (IM)) + allocate (Coupling%visbmdi (IM)) + allocate (Coupling%visdfdi (IM)) + allocate (Coupling%nirbmui (IM)) + allocate (Coupling%nirdfui (IM)) + allocate (Coupling%visbmui (IM)) + allocate (Coupling%visdfui (IM)) Coupling%nirbmdi = clear_val Coupling%nirdfdi = clear_val @@ -2318,8 +2318,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & real(kind=kind_phys) :: fhswr = 3600. !< frequency for shortwave radiation (secs) real(kind=kind_phys) :: fhlwr = 3600. !< frequency for longwave radiation (secs) integer :: levr = -99 !< number of vertical levels for radiation calculations - integer :: nfxr = 39 !< second dimension of input/output array fluxr - logical :: aero_in = .false. !< flag for initializing aero data + integer :: nfxr = 39 !< second dimension of input/output array fluxr + logical :: aero_in = .false. !< flag for initializing aero data integer :: iflip = 1 !< iflip - is not the same as flipv integer :: isol = 0 !< use prescribed solar constant integer :: ico2 = 0 !< prescribed global mean value (old opernl) @@ -2335,7 +2335,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !< available; use latest; do extrapolation. !< ictm=yyyy0 => use yyyy data for the forecast time; !< no extrapolation. - !< ictm=yyyy1 = > use yyyy data for the fcst. If needed, + !< ictm=yyyy1 = > use yyyy data for the fcst. If needed, !< do extrapolation to match the fcst time. !< ictm=-1 => use user provided external data for !< the fcst time; no extrapolation. @@ -2347,7 +2347,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !< =2 => sub-grid cloud with randomly generated !< seeds logical :: crick_proof = .false. !< CRICK-Proof cloud water - logical :: ccnorm = .false. !< Cloud condensate normalized by cloud cover + logical :: ccnorm = .false. !< Cloud condensate normalized by cloud cover logical :: norad_precip = .false. !< radiation precip flag for Ferrier/Moorthi logical :: lwhtr = .true. !< flag to output lw heating rate (Radtend%lwhc) logical :: swhtr = .true. !< flag to output sw heating rate (Radtend%swhc) @@ -2421,11 +2421,11 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !< workfunction for RAS real(kind=kind_phys) :: cdmbgwd(2) = (/2.0d0,0.25d0/) !< multiplication factors for cdmb and gwd real(kind=kind_phys) :: sup = 1.1 !< supersaturation in pdf cloud when t is very low - real(kind=kind_phys) :: ctei_rm(2) = (/10.0d0,10.0d0/) !< critical cloud top entrainment instability criteria + real(kind=kind_phys) :: ctei_rm(2) = (/10.0d0,10.0d0/) !< critical cloud top entrainment instability criteria !< (used if mstrat=.true.) real(kind=kind_phys) :: crtrh(3) = (/0.90d0,0.90d0,0.90d0/) !< critical relative humidity at the surface !< PBL top and at the top of the atmosphere - real(kind=kind_phys) :: dlqf(2) = (/0.0d0,0.0d0/) !< factor for cloud condensate detrainment + real(kind=kind_phys) :: dlqf(2) = (/0.0d0,0.0d0/) !< factor for cloud condensate detrainment !< from cloud edges for RAS !--- Rayleigh friction @@ -2434,10 +2434,10 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !--- near surface temperature model logical :: nst_anl = .false. !< flag for NSSTM analysis in gcycle/sfcsub - integer :: lsea = 0 - real(kind=kind_phys) :: xkzm_m = 1.0d0 !< [in] bkgd_vdif_m background vertical diffusion for momentum - real(kind=kind_phys) :: xkzm_h = 1.0d0 !< [in] bkgd_vdif_h background vertical diffusion for heat q - real(kind=kind_phys) :: xkzm_s = 1.0d0 !< [in] bkgd_vdif_s sigma threshold for background mom. diffusion + integer :: lsea = 0 + real(kind=kind_phys) :: xkzm_m = 1.0d0 !< [in] bkgd_vdif_m background vertical diffusion for momentum + real(kind=kind_phys) :: xkzm_h = 1.0d0 !< [in] bkgd_vdif_h background vertical diffusion for heat q + real(kind=kind_phys) :: xkzm_s = 1.0d0 !< [in] bkgd_vdif_s sigma threshold for background mom. diffusion integer :: nstf_name(5) = (/0,0,1,0,5/) !< flag 0 for no nst 1 for uncoupled nst and 2 for coupled NST !< nstf_name contains the NSSTM related parameters !< nstf_name(1) : 0 = NSSTM off, 1 = NSSTM on but uncoupled @@ -2446,7 +2446,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !< nstf_name(3) : 1 = NSSTM analysis on, 0 = NSSTM analysis off !< nstf_name(4) : zsea1 in mm !< nstf_name(5) : zsea2 in mm - + !--- stochastic physics options real(kind=kind_phys) :: sppt(5) = -999. !< stochastic physics tendency amplitude real(kind=kind_phys) :: shum(5) = -999. !< stochastic boundary layer spf hum amp @@ -2490,7 +2490,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !--- debug options debug, pre_rad - !--- other parameters + !--- other parameters integer :: nctp = 0 !< number of cloud types in CS scheme logical :: gen_coord_hybrid = .false. !< for Henry's gen coord @@ -2716,7 +2716,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%sdec = -9999. Model%cdec = -9999. Model%clstp = -9999 - rinc(1:5) = 0 + rinc(1:5) = 0 call w3difdat(jdat,idat,4,rinc) Model%phour = rinc(4)/con_hr Model%fhour = (rinc(4) + Model%dtp)/con_hr @@ -2739,7 +2739,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & dxinv = 1.0d0 / (dxmax-dxmin) if (Model%me == Model%master) write(0,*)' dxmax=',dxmax,' dxmin=',dxmin,' dxinv=',dxinv - !--- set nrcm + !--- set nrcm if (Model%ras) then Model%nrcm = min(nrcmax, Model%levs-1) * (Model%dtp/1200.d0) + 0.10001d0 else @@ -2788,7 +2788,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & stop endif print *,' nst_anl=',Model%nst_anl,' use_ufo=',Model%use_ufo - if (Model%nstf_name(1) > 0 ) then + if (Model%nstf_name(1) > 0 ) then print *,' NSSTM is active ' print *,' nstf_name(1)=',Model%nstf_name(1) print *,' nstf_name(2)=',Model%nstf_name(2) @@ -2896,7 +2896,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & if(Model%ras .or. Model%cscnv) Model%cnvcld = .false. if(Model%do_shoc .or. Model%pdfcld) Model%cnvcld = .false. if(Model%cnvcld) Model%ncnvcld3d = 1 - + !--- derived totals for phy_f*d Model%ntot2d = Model%num_p2d + Model%nshoc_2d Model%ntot3d = Model%num_p3d + Model%nshoc_3d + Model%npdf3d + Model%ncnvcld3d @@ -2905,7 +2905,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & ' pdfcld=',Model%pdfcld,' shcnvcw=',Model%shcnvcw, & ' cnvcld=',Model%cnvcld,' ncnvcld3d=',Model%ncnvcld3d, & ' do_shoc=',Model%do_shoc,' nshoc3d=',Model%nshoc_3d, & - ' nshoc_2d=',Model%nshoc_2d,' shoc_cld=',Model%shoc_cld,& + ' nshoc_2d=',Model%nshoc_2d,' shoc_cld=',Model%shoc_cld,& ' ntot3d=',Model%ntot3d,' ntot2d=',Model%ntot2d, & ' shocaftcnv=',Model%shocaftcnv @@ -2952,7 +2952,7 @@ subroutine control_print(Model) !--- interface variables class(GFS_control_type) :: Model - + if (Model%me == Model%master) then print *, ' ' print *, 'basic control parameters' @@ -3139,7 +3139,7 @@ subroutine control_print(Model) print *, ' nctp : ', Model%nctp print *, ' ' print *, 'debug flags' - print *, ' debug : ', Model%debug + print *, ' debug : ', Model%debug print *, ' pre_rad : ', Model%pre_rad print *, ' ' print *, 'variables modified at each time step' @@ -3293,13 +3293,13 @@ subroutine cldprop_create (Cldprop, IM, Model) type(GFS_control_type), intent(in) :: Model allocate (Cldprop%cv (IM)) - allocate (Cldprop%cvt (IM)) + allocate (Cldprop%cvt (IM)) allocate (Cldprop%cvb (IM)) - + Cldprop%cv = clear_val Cldprop%cvt = clear_val Cldprop%cvb = clear_val - + end subroutine cldprop_create @@ -3307,14 +3307,14 @@ end subroutine cldprop_create ! GFS_radtend_type%create !****************************************** subroutine radtend_create (Radtend, IM, Model) - + implicit none - + class(GFS_radtend_type) :: Radtend integer, intent(in) :: IM type(GFS_control_type), intent(in) :: Model - !--- Out (radiation only) + !--- Out (radiation only) allocate (Radtend%sfcfsw (IM)) allocate (Radtend%sfcflw (IM)) @@ -3326,7 +3326,7 @@ subroutine radtend_create (Radtend, IM, Model) Radtend%sfcflw%upfx0 = clear_val Radtend%sfcflw%dnfxc = clear_val Radtend%sfcflw%dnfx0 = clear_val - + allocate (Radtend%htrsw (IM,Model%levs)) allocate (Radtend%htrlw (IM,Model%levs)) allocate (Radtend%sfalb (IM)) @@ -3340,12 +3340,12 @@ subroutine radtend_create (Radtend, IM, Model) Radtend%coszen = clear_val Radtend%tsflw = clear_val Radtend%semis = clear_val - + !--- In/Out (???) (radiation only) allocate (Radtend%coszdg (IM)) Radtend%coszdg = clear_val - + !--- In/Out (???) (physics only) allocate (Radtend%swhc (IM,Model%levs)) allocate (Radtend%lwhc (IM,Model%levs)) @@ -3580,13 +3580,11 @@ subroutine interstitial_create (Interstitial, IM, Model) class(GFS_interstitial_type) :: Interstitial integer, intent(in) :: IM type(GFS_control_type), intent(in) :: Model - ! ! Set up numbers of tracers for water etc - previously interstitial code: sets ! Interstitial%{tracers_water,tracers_total,tracers_start_index,ntk} call interstitial_setup_tracers(Interstitial, Model) ! Allocate arrays - allocate (Interstitial%adjnirbmd (IM)) allocate (Interstitial%adjnirbmu (IM)) allocate (Interstitial%adjnirdfd (IM)) @@ -3717,7 +3715,6 @@ subroutine interstitial_create (Interstitial, IM, Model) allocate (Interstitial%xmu (IM)) allocate (Interstitial%zice (IM)) ! Set components that do not change - Interstitial%im = IM Interstitial%ipr = min(IM,10) Interstitial%ix = IM @@ -3730,9 +3727,7 @@ subroutine interstitial_create (Interstitial, IM, Model) Interstitial%nvdiff = Model%ntrac Interstitial%oz_coeff = oz_coeff Interstitial%oz_pres = oz_pres - Interstitial%skip_macro = .false. - ! Reset all other variables call Interstitial%rad_reset () call Interstitial%phys_reset () @@ -3952,18 +3947,18 @@ subroutine interstitial_print(Interstitial, mpirank, omprank, blkno) ! Print static variables write (0,'(a,3i6)') 'Interstitial_print for mpirank, omprank, blkno: ', mpirank, omprank, blkno write (0,*) 'Interstitial_print: values that do not change' - write (0,*) 'Interstitial%im = ', Interstitial%im - write (0,*) 'Interstitial%ipr = ', Interstitial%ipr - write (0,*) 'Interstitial%ix = ', Interstitial%ix + write (0,*) 'Interstitial%im = ', Interstitial%im + write (0,*) 'Interstitial%ipr = ', Interstitial%ipr + write (0,*) 'Interstitial%ix = ', Interstitial%ix write (0,*) 'Interstitial%latidxprnt = ', Interstitial%latidxprnt - write (0,*) 'Interstitial%levi = ', Interstitial%levi - write (0,*) 'Interstitial%levozp = ', Interstitial%levozp - write (0,*) 'Interstitial%lm = ', Interstitial%lm - write (0,*) 'Interstitial%lmk = ', Interstitial%lmk - write (0,*) 'Interstitial%lmp = ', Interstitial%lmp - write (0,*) 'Interstitial%nvdiff = ', Interstitial%nvdiff - write (0,*) 'Interstitial%oz_coeff = ', Interstitial%oz_coeff - write (0,*) 'Interstitial%oz_pres = ', Interstitial%oz_pres + write (0,*) 'Interstitial%levi = ', Interstitial%levi + write (0,*) 'Interstitial%levozp = ', Interstitial%levozp + write (0,*) 'Interstitial%lm = ', Interstitial%lm + write (0,*) 'Interstitial%lmk = ', Interstitial%lmk + write (0,*) 'Interstitial%lmp = ', Interstitial%lmp + write (0,*) 'Interstitial%nvdiff = ', Interstitial%nvdiff + write (0,*) 'Interstitial%oz_coeff = ', Interstitial%oz_coeff + write (0,*) 'Interstitial%oz_pres = ', Interstitial%oz_pres write (0,*) 'Interstitial%skip_macro = ', Interstitial%skip_macro ! Print all other variables write (0,*) 'Interstitial_print: values that change' From 712b4bf7c0bbe2f46be0d3855975f3edf37137f3 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Tue, 20 Mar 2018 13:32:59 -0600 Subject: [PATCH 14/16] reverted several files to fix whitespace changes --- CCPP_CAPS.mk | 3 +-- CCPP_SCHEMES.mk | 3 +-- GFS_layer/GFS_radiation_driver.F90 | 2 +- physics/gscond.f | 1 + physics/gwdc.f | 1 - physics/gwdps.f | 1 - physics/mfdeepcnv.f | 1 + physics/mfshalcnv.f | 2 -- physics/moninedmf.f | 1 - physics/ozphys.f | 1 + 10 files changed, 6 insertions(+), 10 deletions(-) diff --git a/CCPP_CAPS.mk b/CCPP_CAPS.mk index f3686dd2f..facd1d0a8 100644 --- a/CCPP_CAPS.mk +++ b/CCPP_CAPS.mk @@ -1,7 +1,6 @@ - # All CCPP caps are defined here. # # This file is auto-generated using ccpp_prebuild.py # at compile time, do not edit manually. # -CAPS_F90 = +CAPS_F90 = diff --git a/CCPP_SCHEMES.mk b/CCPP_SCHEMES.mk index 507962d67..21cfc7645 100644 --- a/CCPP_SCHEMES.mk +++ b/CCPP_SCHEMES.mk @@ -1,4 +1,3 @@ - # All CCPP schemes are defined here. # # This file is auto-generated using ccpp_prebuild.py @@ -10,4 +9,4 @@ SCHEMES_F90 = SCHEMES_f = -SCHEMES_f90 = +SCHEMES_f90 = diff --git a/GFS_layer/GFS_radiation_driver.F90 b/GFS_layer/GFS_radiation_driver.F90 index 88df4d838..f57bda244 100644 --- a/GFS_layer/GFS_radiation_driver.F90 +++ b/GFS_layer/GFS_radiation_driver.F90 @@ -1214,7 +1214,7 @@ subroutine GFS_radiation_driver & ! CCPP: L1211-1577 call GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input - Tbd, Cldprop, Radtend, & + Tbd, Cldprop, Radtend, & lm, im, lmk, lmp, kd, kt, kb, raddt, plvl, plyr, & ! output tlvl, tlyr, tsfg, tsfa, qlyr, olyr, & gasvmr(:,:,1), gasvmr(:,:,2), gasvmr(:,:,3), & diff --git a/physics/gscond.f b/physics/gscond.f index 104dcd26c..74b88233c 100644 --- a/physics/gscond.f +++ b/physics/gscond.f @@ -5,6 +5,7 @@ module zhaocarr_gscond contains + !> \defgroup Zhao-Carr Zhao-Carr Microphysics !! @{ !! \brief The GFS scheme for large-scale condensation and precipitation diff --git a/physics/gwdc.f b/physics/gwdc.f index 8b35d42f6..f54cb9798 100644 --- a/physics/gwdc.f +++ b/physics/gwdc.f @@ -209,7 +209,6 @@ end subroutine gwdc_init !! hypothesis in order to find wave breaking levels in terms of the !! Richardon number criterion using the nonlinearity factor of !! thermally induced waves. - !> \param[in] IM horizontal number of used pts !> \param[in] IX horizontal dimension !> \param[in] KM vertical layer dimension diff --git a/physics/gwdps.f b/physics/gwdps.f index 1ab306ce9..fe3f5b0de 100644 --- a/physics/gwdps.f +++ b/physics/gwdps.f @@ -56,7 +56,6 @@ !! seen as a source of gravity waves to the atmosphere above and !! nonlinear subgrid low-level mountain drag effect below. !! - !> \section provenance Provenance !! - Gravity-wave drag is simulated as described by Alpert et al. !! (1988) \cite alpert_et_al_1988. The parameterization includes diff --git a/physics/mfdeepcnv.f b/physics/mfdeepcnv.f index 9a83bdc98..71c05b147 100644 --- a/physics/mfdeepcnv.f +++ b/physics/mfdeepcnv.f @@ -384,6 +384,7 @@ subroutine sasas_deep_run(im,ix,km,delt,delp,prslp,psp,phil,ql1, & !> hydrostatic height assume zero terr and initially assume !! updraft entrainment rate as an inverse function of height + do k = 1, km do i=1,im zo(i,k) = phil(i,k) / g diff --git a/physics/mfshalcnv.f b/physics/mfshalcnv.f index 85d1a4525..8e240f04f 100644 --- a/physics/mfshalcnv.f +++ b/physics/mfshalcnv.f @@ -1511,9 +1511,7 @@ subroutine sasas_shal_run (im,ix,km,delt,delp,prslp,psp,phil,ql1, & enddo !! return - end subroutine sasas_shal_run - !> @} !> \brief Brief description of the subroutine diff --git a/physics/moninedmf.f b/physics/moninedmf.f index a107d6dec..310eddb0f 100644 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -1270,7 +1270,6 @@ end subroutine edmf_run 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. !! diff --git a/physics/ozphys.f b/physics/ozphys.f index bc8beb2de..107d4701e 100644 --- a/physics/ozphys.f +++ b/physics/ozphys.f @@ -304,3 +304,4 @@ end subroutine ozphys_post_finalize end module ozphys_post + From 5830e1e5f334103d26000d41217d5a543f0485fc Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Tue, 20 Mar 2018 14:00:10 -0600 Subject: [PATCH 15/16] bugfix - added module use statements to GFS_grid_populate in GFS_initialize_scm.F90 to fix compilation errors --- GFS_layer/GFS_initialize_scm.F90 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GFS_layer/GFS_initialize_scm.F90 b/GFS_layer/GFS_initialize_scm.F90 index 959dcfa95..730e060be 100644 --- a/GFS_layer/GFS_initialize_scm.F90 +++ b/GFS_layer/GFS_initialize_scm.F90 @@ -204,7 +204,9 @@ end subroutine GFS_initialize_scm_run ! GFS_grid_populate !------------------ subroutine GFS_grid_populate (Grid, xlon, xlat, area) - use physcons, only: pi => con_pi + use machine, only: kind_phys + use physcons, only: pi => con_pi + use GFS_typedefs, only: GFS_grid_type implicit none From 3baef1608b152f11b6e09dae6956139d32218e13 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 21 Mar 2018 11:56:44 -0600 Subject: [PATCH 16/16] Formatting changes and removal of unused OPENMP CPP directives --- GFS_layer/GFS_initialize_scm.F90 | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/GFS_layer/GFS_initialize_scm.F90 b/GFS_layer/GFS_initialize_scm.F90 index 730e060be..ca33f3477 100644 --- a/GFS_layer/GFS_initialize_scm.F90 +++ b/GFS_layer/GFS_initialize_scm.F90 @@ -23,7 +23,7 @@ subroutine GFS_initialize_scm_finalize() end subroutine GFS_initialize_scm_finalize !> \section arg_table_GFS_initialize_scm_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | !! |----------------------|-------------------------------------------------------------|-------------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| !! | Model | FV3-GFS_Control_type | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | inout | F | !! | Statein | FV3-GFS_Statein_type | Fortran DDT containing FV3-GFS prognostic state data in from dycore | DDT | 0 | GFS_statein_type | | inout | F | @@ -42,16 +42,16 @@ end subroutine GFS_initialize_scm_finalize !! | n_ozone_lats | number_of_latitutde_points_in_ozone_forcing_data_from_host | number of latitude points in ozone forcing data coming from host | count | 0 | integer | | in | F | !! | n_ozone_times | number_of_time_levels_in_ozone_forcing_data_from_host | number of time levels in ozone forcing data coming from host | count | 0 | integer | | in | F | !! | n_ozone_coefficients | number_of_coefficients_in_ozone_forcing_data_from_host | number of coeffcients in ozone forcing data coming from host | count | 0 | integer | | in | F | -!! | ozone_lat | latitude_of_ozone_forcing_data_from_host | latitude value of the ozone forcing data coming from host | degree | 1 | real | kind_phys | in | F | +!! | ozone_lat | latitude_of_ozone_forcing_data_from_host | latitude value of the ozone forcing data coming from host | degree | 1 | real | kind_phys | in | F | !! | ozone_pres | natural_log_of_ozone_forcing_data_pressure_levels_from_host | natural logarithm of the pressure levels of the ozone forcing data | Pa | 1 | real | kind_phys | in | F | !! | ozone_time | time_levels_in_ozone_forcing_data_from_host | time values of the ozone forcing data coming from host | day | 1 | real | kind_phys | in | F | !! | ozone_forcing_in | ozone_forcing_from_host | ozone forcing data from host | various | 4 | real | kind_phys | in | F | -!! | errmsg | error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! | errmsg | error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! - subroutine GFS_initialize_scm_run (Model, Statein, Stateout, Sfcprop, & - Coupling, Grid, Tbd, Cldprop, Radtend, & - Diag, Sfccycle, Interstitial, Init_parm, n_ozone_lats, & + subroutine GFS_initialize_scm_run (Model, Statein, Stateout, Sfcprop, & + Coupling, Grid, Tbd, Cldprop, Radtend, Diag, & + Sfccycle, Interstitial, Init_parm, n_ozone_lats, & n_ozone_layers, n_ozone_times, n_ozone_coefficients, & ozone_lat, ozone_pres, ozone_time, ozone_forcing_in, & errmsg, errflg) @@ -70,9 +70,6 @@ subroutine GFS_initialize_scm_run (Model, Statein, Stateout, Sfcprop, & use aer_cloud, only: aer_cloud_init use module_ras, only: ras_init use ozne_def, only: latsozp, levozp, timeoz, oz_coeff, oz_lat, oz_pres, oz_time, ozplin -#ifdef OPENMP - use omp_lib -#endif !--- interface variables type(GFS_control_type), intent(inout) :: Model