Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:37:38 UTC

view on githubraw file Latest commit 672ec4d5 on 2016-12-01 17:05:48 UTC
672ec4d5cf Jean*0001 <HTML>
                0002 <TITLE>module vert_diff_mod</TITLE>
                0003 <BODY BGCOLOR="#AABBCC" TEXT="#332211" >
                0004 
                0005 <DIV ALIGN="CENTER"> <FONT SIZE=1>
                0006 <A HREF="#INTERFACE">PUBLIC INTERFACE</A> / 
                0007 <A HREF="#DATA_TYPES">DATA</A> / 
                0008 <A HREF="#ROUTINES">ROUTINES</A> / 
                0009 <A HREF="#NAMELIST">NAMELIST</A> / 
                0010 <A HREF="#DIAGNOSTICS">DIAGNOSTICS</A> / 
                0011 <A HREF="#CHANGES">CHANGES</A> / 
                0012 <A HREF="#ERRORS">ERRORS</A> / 
                0013 <A HREF="#REFERENCES">REFERENCES</A> / 
                0014 <A HREF="#NOTES">NOTES</A> 
                0015 </FONT>
                0016 <BR><BR></DIV><HR>
                0017 
                0018 
                0019 <H2>Vert_diff_mod</H2>
                0020 <A NAME="HEADER">
                0021 <PRE>
                0022      <B>Contact:</B>   Isaac Held
                0023      <B>Reviewers:</B>
                0024 
                0025 </PRE>
                0026 </A><!-- END HEADER -->
                0027 <!--------------------------------------------------------------------->
                0028 <A NAME="OVERVIEW">
                0029 <HR>
                0030 <H4>OVERVIEW</H4>
                0031 <!-- BEGIN OVERVIEW -->
                0032 <PRE>
                0033 
                0034      Adds the tendencies due to vertical diffusion to the tendencies
                0035      of model prognostic variables  
                0036      
                0037 
                0038 </PRE>
                0039 </A><!-- END OVERVIEW -->
                0040 <!--------------------------------------------------------------------->
                0041 <A NAME="DESCRIPTION">
                0042 <!-- BEGIN DESCRIPTION -->
                0043 <PRE>
                0044 
                0045      All three dimensional fields are assumed to be (lon, lat, level)
                0046       with the third index starting at the top of the model and
                0047       ending at the bottom
                0048 
                0049      For tracers, it is the tendency of the mixing ratio (parts
                0050         per unit mass) that is computed, not of the density (parts
                0051         per unit volume) and analogously for all other fields
                0052 
                0053      If the dependence of the surface heat flux and evaporation
                0054        on surface temperature is treated explicitly, then a single
                0055        subroutine updates the tendencies of all fields
                0056 
                0057      If the dependence of the surface heat flux and evaporation
                0058        on surface temperature is treated implicitly, then interfaces 
                0059        are provided for dividing the up and down sweeps of the 
                0060        standard tridiagonal elimination into two parts.  One can 
                0061        visualize this procedure as starting with a downward 
                0062        sweep through the atmosphere, which continue through the 
                0063        surface, then re-emerges and continues up the atmosphere.
                0064        A sample program is included below to help the user undertand
                0065        the approriate calling sequence
                0066 
                0067      Diffusion of heat takes the form of mixing of the "dry static
                0068        energy temperature", T + g*z/cp.
                0069 
                0070      Details are provided in <A HREF="vert_diff.tech.ps">vert_diff.tech.ps</A>
                0071 
                0072      
                0073 </PRE>
                0074 </A><!-- END DESCRIPTION -->
                0075 <!--------------------------------------------------------------------->
                0076 <A NAME="MODULES_USED">
                0077 <HR>
                0078 <H4>OTHER MODULES USED</H4>
                0079 <!-- BEGIN MODULES_USED -->
                0080 <PRE>
                0081 
                0082      constants_mod
                0083      fms_mod
                0084      field_manager_mod
                0085      tracer_manager_mod
                0086 
                0087 </PRE>
                0088 </A><!-- END MODULES_USED -->
                0089 <!--------------------------------------------------------------------->
                0090 <A NAME="INTERFACE">
                0091 <HR>
                0092 <H4>PUBLIC INTERFACE</H4>
                0093 <!-- BEGIN INTERFACE -->
                0094 <PRE>
                0095 
                0096   use vert_diff_mod [,only: gcm_vert_diff_init       , &
                0097                             gcm_vert_diff_end        , &
                0098                             vert_diff                , &
                0099                             gcm_vert_diff            , &
                0100                             gcm_vert_diff_down       , &
                0101                             gcm_vert_diff_up         , &
                0102                             surf_diff_type           
                0103 
                0104 
                0105   gcm_vert_diff_init : initializes module
                0106 
                0107   gcm_vert_diff_end : clears memory
                0108 
                0109   vert_diff : adds tendency (derivative with respect to time)
                0110               due to vertical diffusion to tendencies of a single field -- 
                0111               to be used only if surface flux is not implicitly 
                0112               dependent on surface parameters (it can be implicit
                0113               function of the value within the lowest atmospheric
                0114               layer of the field being diffused)
                0115 
                0116   gcm_vert_diff  : 
                0117               adds tendency due to vertical diffusion to tendencies
                0118               of temperature, specific humidity, two components of 
                0119               momentum, and mixing ratios of any # of other tracers,
                0120               to be used only if surface fluxes are not implicitly 
                0121               dependent on surface parameters (the surface heat flux and
                0122               evaporation can be implicit functions of atmospheric
                0123               temperature and specific humidity, respectively, in the 
                0124               lowest atmospheric layer).  Diffusivities for 
                0125               specific humidity, heat, and all tracers are assumed to be 
                0126               equal.
                0127 
                0128   gcm_vert_diff_down :  Downward sweep of tridiagonal solver
                0129 
                0130   gcm_vert_diff_up   :  Upward sweep of tridiagonal solver
                0131 
                0132   surf_diff_type : type defined to hold fields required outside of this
                0133                    module when the dependence of surface fluxes on surface 
                0134                    temperature is treated implicitly
                0135 
                0136  
                0137 notes:
                0138  1) there is no namelist
                0139  2) no data files or restart files are required
                0140  3) a line is appended to the file logfile.out if it already exists
                0141     containing the version number of the module -- if it does not
                0142     exist the file is created in the working directory
                0143 
                0144 
                0145 </PRE>
                0146 </A><!-- END INTERFACE -->
                0147 <!--------------------------------------------------------------------->
                0148 <A NAME="ROUTINES">
                0149 <HR>
                0150 <H4>PUBLIC ROUTINES</H4>
                0151 <!-- BEGIN ROUTINES -->
                0152 <PRE>
                0153 
                0154 ==========================================================================
                0155 
                0156  subroutine gcm_vert_diff_init(Tri_surf, idim, jdim, kdim, &
                0157                                conserve_energy, 
                0158                    use_virtual_temp_vert_diff,
                0159                    do_mcm_plev)
                0160  
                0161     integer, intent(in)  :: idim, jdim, kdim 
                0162         the three "global" dimensions of the fields to be diffused,
                0163         with kdim being the number of vertical levels;
                0164         "global" refers to the entire field residing on a processor
                0165 
                0166     type(surf_diff_type), intent(inout) :: Tri_surf
                0167         where data needed outside of module is stored
                0168     
                0169     logical, intent(in) :: conserve_energy
                0170          .true. => kinetic energy that is lost due to vertical diffusion
                0171      is returned as heat in the temperature tendency so as to 
                0172      conserve energy
                0173 
                0174     logical, intent(in) :: use_virtual_temp_vert_diff
                0175 
                0176     logical, intent(in) :: do_mcm_plev
                0177 
                0178 ==========================================================================
                0179 
                0180  subroutine gcm_vert_diff_end()
                0181  
                0182         no arguments
                0183 
                0184 ==========================================================================
                0185 
                0186  subroutine vert_diff(delt, xi, t, q, diff, p_half, z_full, &
                0187                 flux, dflux_datmos, factor, dt_xi, kbot)
                0188  
                0189     input: 
                0190 
                0191          delt -- real
                0192            time step , seconds
                0193            if using leapfrog step, set equal to 2*dt = time(i+1) - time(i-1)
                0194 
                0195          xi -- real, dimension(:,:,:)
                0196             field to be diffused, 
                0197                   at time step i   for   two-time level schemes
                0198                   at time step i-1 for three-time level (leapfrog) schemes
                0199                units up to user
                0200            
                0201          t -- real, dimension(:,:,:)
                0202             temperature ( degrees K)
                0203               used only for computation of density 
                0204               shape must conform to that of xi
                0205 
                0206          q -- real, dimension(:,:,:)
                0207             specific humidity (dimensionless)
                0208               used only for computation of density 
                0209               shape must conform to that of xi
                0210               (set = 0 to ignore effects of vapor on density)
                0211 
                0212          diff -- real, dimension(:,:,:) 
                0213              kinematic diffusivity (m*2/s)
                0214              shape must conform to that of xi
                0215              diff(:,:,k) is the diffusivity evaluated at the interface
                0216                  between the k-1 and k levels
                0217              the value diff(:,:,1) is not used
                0218 
                0219          p_half -- real, dimension(:,:,:)
                0220              pressure at interface between model levels
                0221              size(p_half,3) must = 1 + size(xi,3)
                0222              units = Pascals
                0223 
                0224          z_full -- real, dimension(:,:,:)
                0225              height of the level where xi is defined
                0226              shape must conform to that of xi
                0227              units = meters
                0228 
                0229          factor -- real
                0230              used if one wants to modify the units of the flux input 
                0231              The units for flux are [factor]*[xi]*kg/(m**2 s)
                0232                 where [xi} is the unit for the field xi
                0233              Thus, if xi = temperature in K, and if you want to input the 
                0234                flux in W/(m**2) set factor = heat capacity per unit mass
                0235                in (J/(kg K))
                0236 
                0237          dflux_datmos -- real, dimension(:,:)
                0238              shape must conform to first two dimensions of xi.
                0239              Set = 0.0 if the surface flux is treated explicitly.
                0240              If dependence of flux on lowest level of atmosphere is
                0241              treated implicitly, set equal to derivative of flux 
                0242              with respect to value of xi in lowest model layer.
                0243              Units = [factor]*kg/(m**2 s)
                0244 
                0245     
                0246     input/output:
                0247 
                0248          flux -- real, dimension(:,:)
                0249              Surface flux (positive upwards) 
                0250              shape must conform to first two dimensions of xi
                0251              Units = [factor]*[xi]*kg/(m**2 s)
                0252              Flux should be evaluated with atmospheric fields 
                0253                      from time i   for two-time level schemes
                0254                      from time i-1 for leapgrog
                0255              If dflux_datmos is non-zero, input flux is modified by 
                0256              the implicit correction 
                0257                  flux(i+1) = flux(i or i-1) + delt*dflux_datmos*dt_xi(:,:,N)
                0258                  where dt_xi is the final (output) tendency and 
                0259                  N = size(dt_xi,3) is the lowest model level
                0260 
                0261          dt_xi -- real, dimension(:,:,:)
                0262              Tendency of xi
                0263              shape must conform to that of xi
                0264              input is the tendency due to all other processes
                0265                  that have been added prior to this call
                0266              output will be the tendency modified by the effects of diffusion
                0267              Because the algorithm is implicit, the final tendency
                0268                 depends on which other processes contribute to 
                0269                 the tendency before, and which after, this call
                0270 
                0271      optional input:
                0272 
                0273           kbot -- integer,dimension(:,:)
                0274              shape must conform to first two dimensions of xi
                0275 
                0276              For use with models in which different columns
                0277              have different number of levels above the surface.
                0278              The levels k &lt;= kbot are assumed to be above the surface.
                0279 
                0280              If kbot is present, the module will function properly
                0281              if  diff = 0 for levels below the surface. Also, to avoid
                0282              division by zero, be sure that the underground 
                0283              input temperatures are non-zero and that the pressure 
                0284              thicknesses of the underground layers are non-zero as well.  
                0285                
                0286 ==========================================================================
                0287 
                0288  subroutine  gcm_vert_diff(delt, u, v, t, q, tr, diff_m, diff_t,     &
                0289                     p_half, z_full,                                  &
                0290                     dtau_datmos, dsens_datmos, devap_datmos,         &
                0291                     sens, evap, tau_u, tau_v, flux_tr,               &
                0292                     dt_u, dt_v, dt_t, dt_q, dt_tr, dissipative_heat, &
                0293             kbot)
                0294  
                0295     input: 
                0296 
                0297          delt -- real
                0298            time step , seconds
                0299            if using leapfrog step, set equal to 2*dt = time(i+1) - time(i-1)
                0300 
                0301          u -- real, dimension(:,:,:)   zonal wind (m/sec)
                0302          v -- real, dimension(:,:,:)   meridional wind (m/sec)
                0303          T -- real, dimension(:,:,:)   temperature  (K)
                0304          q -- real, dimension(:,:,:)   specific humidity 
                0305                                          (non-dimensional -- Kg water/Kg air)
                0306          tr -- real, dimension(:,:,:,:) tracers
                0307                                           (units arbitrary)
                0308                                         size(tr,4) = number of tracers
                0309          
                0310               fields to be diffused, 
                0311                   at time step i   for   two-time level schemes
                0312                   at time step i-1 for three-time level (leapfrog) schemes
                0313               (t and q also used to compute density)
                0314 
                0315          diff_m -- real, dimension(:,:,:) 
                0316              kinematic diffusivity for momentum (m*2/s)
                0317          diff_t -- real, dimension(:,:,:) 
                0318              kinematic diffusivity for heat, water vapor, tracers (m*2/s)
                0319 
                0320              shape must conform to those of u, v, t, q
                0321              diff_m(:,:,k) and dsiff_t(:,:,k) are the diffusivities
                0322                  evaluated at the interface between the k-1 and k levels
                0323              the values diff_m(:,:,1) and diff_m(:,:,1) are not used
                0324 
                0325          p_half -- real, dimension(:,:,:)
                0326              pressure at interface between model levels
                0327              size(p_half,3) must = 1 + size(t,3)
                0328              units = Pascals
                0329 
                0330          z_full -- real, dimension(:,:,:)
                0331              height of the levels where t, q, u, v, tr are defined
                0332              shape must conform to that of xi
                0333              units = meters
                0334 
                0335 
                0336          dtau_datmos  -- real, dimension(:,:)
                0337          dsens_datmos -- real, dimension(:,:)
                0338          devap_datmos -- real, dimension(:,:)
                0339              shape must conform to first two dimensions of input fields
                0340              Set = 0.0 if the surface flux is treated explicitly
                0341              If dependence of flux on lowest level of atmosphere is
                0342              treated implicitly, set 
                0343 
                0344                 dtau_datmos = derivative of surface stress with respect to 
                0345                      wind component in lowest model layer.
                0346                      Units = kg/(m**2 s)
                0347 
                0348                 dsens_datmos = derivative of surface sensible heat flux 
                0349                      with respect to temperature in lowest model layer.
                0350                      Units = W/(m**2 K)
                0351 
                0352                 devap_datmos = derivative of surface flux of water vapor 
                0353                      with respect to specific humidity in lowest model layer.
                0354                      Units = kg/(m**2 s)
                0355 
                0356     
                0357     input/output:
                0358 
                0359          sens, evap, tau_u, tau_v -- real, dimension(:,:)
                0360              Surface fluxes (positive upwards) 
                0361              shape must conform to first two dimensions of input fields
                0362 
                0363              Units:  sens   : W/(m**2) = J /(m**2 s)
                0364                      evap   : Kg/(m**2 s)
                0365                      tau_u  : Kg/(m s**2) = (Kg m/s)/(m**2 s) 
                0366                                = (Kg/(m**3))((m/s)**2) = Pascals
                0367                      tau_v  : as above
                0368 
                0369              Flux should be evaluated with atmospheric fields 
                0370                      from time i   for two-time level schemes
                0371                      from time i-1 for leapgrog
                0372 
                0373              If dflux_datmos is non-zero, input flux is modified by 
                0374              the implicit correction to be 
                0375                  flux(i+1) = flux(i or i-1) + delt*dflux_datmos*dt_xi(:,:,N)
                0376                  where dt_xi is the final (output) tendency and 
                0377                  N is the lowest model level
                0378 
                0379          flux_tr -- real, dimension(:,:,:) 
                0380                    with size(flux,tr_3) = number of tracers
                0381                    (although listed as inout, the implicit treatment of 
                0382                     tracer fluxes is not implemented here, so the 
                0383                     ouput tracer flux will be identical to the input flux
                0384                                   
                0385 
                0386          dt_u, dt_v, dt_t, dt_q -- real, dimension(:,:,:)
                0387              Tendency of u, v, t, q
                0388              shape must conform to that of u, v etc
                0389              input is the tendency due to all other processes
                0390                  that have been added prior to this call
                0391              output will be the tendency modified by the effects of diffusion
                0392              Because the algorithm is implicit, the final tendency
                0393                 depends on which other processes have contributed to 
                0394                 the tendency before, and which after, this call
                0395 
                0396              Units of dt_xi are [xi]/s where [xi] are units of xi
                0397 
                0398          dt_tr -- real, dimension(:,:,:,:)
                0399              Tracer tendency (see above)  size(dt_tr,4) = number of tracers
                0400          
                0401      output: 
                0402          dissipative_heat -- real, dimension(:,:,:)
                0403              shape must conform to that of u, v, t, etc
                0404          units: deg_K/s 
                0405          
                0406          (computed when do_conserve_energy = .true.
                0407           and added to dt_t before temperature is diffused)
                0408 
                0409      optional input:
                0410 
                0411           kbot -- integer,dimension(:,:)
                0412              shape must conform to first two dimensions of xi
                0413 
                0414              For use with models in which different columns
                0415              have different number of levels above the surface.
                0416              The levels k &lt;= kbot are assumed to be above the surface.
                0417 
                0418              If kbot is present, the interface will function properly
                0419              if  diff = 0 for levels below the surface. Also, to avoid
                0420              division by zero, be sure that the underground 
                0421              input temperatures are non-zero and that the pressure 
                0422              thicknesses of the underground layers are non-zero as well.  
                0423                
                0424 ==========================================================================
                0425 
                0426  type surf_diff_type
                0427 
                0428    a public type used to store data needed by the 
                0429        multi-step version of the diffusion algorithm
                0430 
                0431 
                0432   real, pointer, dimension(:,:) :: dtmass,    &
                0433                                    dflux_t,   & 
                0434                                    dflux_q,   & 
                0435                                    delta_t,   &
                0436                                    delta_q
                0437  
                0438 
                0439 
                0440         for full description of these fields, and the rationale for 
                0441               saving these particular fields, 
                0442                  see  <A HREF="vert_diff.tech.ps">vert_diff.tech.ps</A>
                0443 
                0444      dtmass = dt/mass, where dt = atmospheric time step (sec)
                0445               ((i+1)-(i-1), not (i+1)-i, if atmos model is leapfrog)
                0446               mass = mass of lowest atmospheric layer (Kg/m2)
                0447               (defined in gcm_vert_diff_down -- not used elsewhere)
                0448 
                0449      dflux_t = derivative of the temperature flux at the top of the lowest
                0450                atmospheric layer with respect to the temperature
                0451                of that layer  (J/(m2 K))
                0452                (defined in gcm_vert_diff_down -- not used elsewhere)
                0453 
                0454      dflux_q = derivative of the flux of specific humidity 
                0455                at the top of the lowest atmospheric layer with respect to 
                0456                the specific humidity of that layer  (--/(m2 K))
                0457                (defined in gcm_vert_diff_down -- not used elsewhere)
                0458 
                0459      delta_t = the increment in temperature in the lowest atmospheric
                0460                layer (((i+1)-(i-1) if atmos model is leapfrog) (K)
                0461                (defined in  gcm_vert_diff_down as the increment computed up
                0462                to this point in model, including effect of vertical 
                0463                diffusive flux at top of lowest model level, presumed
                0464                to be modified to include effects of surface fluxes 
                0465                outside of this module, then used to start upward
                0466                tridiagonal sweep,
                0467                see  <A HREF="vert_diff.tech.ps">vert_diff.tech.ps</A>
                0468 
                0469      delta_q = similarly for the increment in specific humidity 
                0470                 (non-dimensional  = Kg/Kg)
                0471 
                0472  
                0473 ==========================================================================
                0474 
                0475  subroutine gcm_vert_diff_down (is, js, delt,                              &
                0476                           u, v, t, q, tr,                                  &
                0477                           diff_m, diff_t, p_half, p_full, z_full,          &
                0478                           tau_u, tau_v, dtau_datmos,                       &
                0479                           flux_tr,                                         &
                0480                           dt_u, dt_v, dt_t, dt_q, dt_tr,                   &
                0481                           dissipative_heat, Tri_surf,                      &
                0482                           kbot)
                0483 
                0484     input: 
                0485 
                0486          is, js -- integers
                0487              the location in the global lon-lat grid of the rectangular
                0488              domain on which diffusion is to be performed
                0489              the size of the domain is determined by the size ofthe input
                0490              i.e, longitude index ranges from is to is + size(t,1) -1
                0491                    latitude index ranges from js to js + size(t,2) -1
                0492 
                0493          delt -- real
                0494            time step , seconds
                0495            if using leapfrog step, set equal to 2*dt = time(i+1) - time(i-1)
                0496 
                0497          u -- real, dimension(:,:,:)   zonal wind (m/sec)
                0498          v -- real, dimension(:,:,:)   meridional wind (m/sec)
                0499          T -- real, dimension(:,:,:)   temperature  (K)
                0500          q -- real, dimension(:,:,:)   specific humidity 
                0501                                          (non-dimensional -- Kg water/Kg air)
                0502          tr -- real, dimension(:,:,:,:) tracers
                0503                                           (units arbitrary)
                0504                                         size(tr,4) = number of tracers
                0505          
                0506               input fields to be diffused, 
                0507                   values at time step i   for   two-time level schemes
                0508                   at time step i-1 for three-time level (leapfrog) schemes
                0509               (t and q also used to compute density)
                0510 
                0511          diff_m -- real, dimension(:,:,:) 
                0512              kinematic diffusivity for momentum (m*2/s)
                0513          diff_t -- real, dimension(:,:,:) 
                0514              kinematic diffusivity for heat, water vapor, tracers (m*2/s)
                0515 
                0516              shape must conform to those of u, v, t, q
                0517              diff_m(:,:,k) and dsiff_t(:,:,k) are the diffusivities
                0518                  evaluated at the interface between the k-1 and k levels
                0519              the values diff_m(:,:,1) and diff_m(:,:,1) are not used
                0520 
                0521          p_half -- real, dimension(:,:,:)
                0522              pressure at interface between model levels
                0523              size(p_half,3) must = 1 + size(t,3)
                0524              units = Pascals
                0525 
                0526          p_full -- real, dimension(:,:,:)
                0527              pressure at full model levels
                0528              size(p_half,3) must = size(t,3)
                0529              units = Pascals
                0530 
                0531          z_full -- real, dimension(:,:,:)
                0532              height of the levels where t, q, u, v, tr are defined
                0533              shape must conform to that of xi
                0534              units = meters
                0535 
                0536      dtau_datmos  -- real, dimension(:,:)
                0537          shape must conform to first two dimensions of input fields
                0538          Set = 0.0 if the surface flux is treated explicitly. If
                0539          dependence of flux on lowest level of atmosphere is
                0540          treated implicitly, set = derivative of surface stress
                0541          with respect to wind component in lowest model layer.  
                0542              Units = kg/(m**2 s)
                0543 
                0544         dt_t, dt_q -- real, dimension(:,:,:)
                0545              Tendency of t, q  up to this point
                0546              (The final value of dt_t and dt_q are output by 
                0547               gcm_vert_diff_up)
                0548              Units are [xi]/s where [xi] = [T], [q]
                0549 
                0550 
                0551     input/output:
                0552 
                0553          tau_u, tau_v -- real, dimension(:,:)
                0554              Surface stresses (positive upwards) 
                0555              shape must conform to first two dimensions of input fields
                0556 
                0557              Units:  Kg/(m s**2) = (Kg m/s)/(m**2 s) 
                0558                                = (Kg/(m**3))((m/s)**2) = Pascals
                0559 
                0560 
                0561              Flux should be evaluated at time i   for two-time level schemes
                0562                                    and at time i-1 for leapgrog
                0563              If dtau_datmos is non-zero, input stress is modified by 
                0564              the implicit correction 
                0565                  tau_u(i+1) = tau_u(i or i-1) + delt*dtau_datmos*dt_u(:,:,N)
                0566                  where dt_u is the final (output) tendency and 
                0567                  N is the lowest model level; similarly for tau_v
                0568 
                0569          flux_tr -- real, dimension(:,:,:) 
                0570                    with size(flux,tr_3) = number of tracers
                0571                    (although listed as inout, the implicit treatment of 
                0572                     tracer fluxes is not implemented here, so the 
                0573                     ouput tracer flux will be identical to the input flux
                0574                                   
                0575 
                0576          dt_u, dt_v,  -- real, dimension(:,:,:)
                0577              Tendency of u and v
                0578              shape must conform to that of u, v etc
                0579              input is the tendency due to all other processes
                0580                  that have been added prior to this call
                0581              output will be the tendency modified by the 
                0582                  effects of diffusion 
                0583              Units are [xi]/s where [xi] = [u], [v] etc
                0584 
                0585         dt_tr -- real, dimension(:,:,:,:)
                0586              Tracer tendency (see above)  size(dt_tr,4) = number of tracer
                0587 
                0588         Tri_surf -- type(surf_diff_type)
                0589              information needed to pass 
                0590                => surface modules => gcm_vert_diff_up
                0591            
                0592      output: 
                0593      
                0594         dissipative_heat -- real, dimension(:,:,:)
                0595              shape must conform to that of u, v, t, etc
                0596          units: deg_K/s 
                0597          
                0598          (computed when do_conserve_energy = .true.
                0599           and added to dt_t before temperature is diffused)
                0600 
                0601      optional input:
                0602 
                0603           kbot -- integer,dimension(:,:)
                0604              shape must conform to first two dimensions of xi
                0605 
                0606              For use with models in which different columns
                0607              have different number of levels above the surface.
                0608              The levels k &lt;= kbot are assumed to be above the surface.
                0609 
                0610              If kbot is present, the interface will function properly
                0611              if  diff = 0 for levels below the surface. Also, to avoid
                0612              division by zero, be sure that the underground 
                0613              input temperatures are non-zero and that the pressure 
                0614              thicknesses of the underground layers are non-zero as well.  
                0615               
                0616 ==========================================================================
                0617 
                0618 subroutine gcm_vert_diff_up (is, js, delt, Tri_surf, dt_t, dt_q, kbot)
                0619 
                0620    input:
                0621 
                0622          is, js -- integers
                0623              the location in the global lon-lat grid of the rectangular
                0624              domain on which diffusion is to be performed
                0625              the size of the domain is determined by the size ofthe input
                0626              i.e, longitude index ranges from is to is + size(dt_t,1) -1
                0627                    latitude index ranges from js to js + size(dt_t,2) -1
                0628 
                0629          delt -- real
                0630            time step , seconds
                0631            if using leapfrog step, set equal to 2*dt = time(i+1) - time(i-1)
                0632 
                0633          Tri_surf -- type(surf_diff_type)
                0634              information passed from  information 
                0635                surface modules and gcm_vert_diff_down 
                0636 
                0637 
                0638          dt_t, dt_q -- real, dimension(:,:,:)
                0639 
                0640              The tendencies modified by the effects of diffusion
                0641              Because the algorithm is implicit, the final tendency
                0642                 depends on which other processes have contributed to 
                0643                 the tendency before, and which after, this call
                0644 
                0645              Units of dt_xi are [xi]/s where [xi] are units of xi
                0646 
                0647      optional input:
                0648 
                0649           kbot -- integer,dimension(:,:)
                0650              shape must conform to first two dimensions of xi
                0651 
                0652              For use with models in which different columns
                0653              have different number of levels above the surface.
                0654              The levels k &lt;= kbot are assumed to be above the surface.
                0655 
                0656              If kbot is present, the interface will function properly
                0657              if  diff = 0 for levels below the surface. Also, to avoid
                0658              division by zero, be sure that the underground 
                0659              input temperatures are non-zero and that the pressure 
                0660              thicknesses of the underground layers are non-zero as well. 
                0661 
                0662 ==========================================================================
                0663 
                0664 subroutine gcm_vert_diff_end
                0665 
                0666 </PRE>
                0667 </A><!-- END ROUTINES -->
                0668 <!--------------------------------------------------------------------->
                0669 <A NAME="CHANGES">
                0670 <HR>
                0671 <H4>CHANGE HISTORY</H4>
                0672 <!-- BEGIN CHANGES -->
                0673 <PRE>
                0674 
                0675 
                0676 <b>Changes prior to the CVS revision history</b>
                0677 
                0678      v1.1 incorporates parts of v1.0 of tq_surf_flux_mod so as
                0679             to centralize all parts of the code that are related to 
                0680             the implicit vertical diffusion
                0681 
                0682      The code has been reorganized substantially from v1.0 but
                0683             the algorithm has not changed
                0684 
                0685 
                0686 </PRE>
                0687 </A><!-- END CHANGES -->
                0688 <!--------------------------------------------------------------------->
                0689 <A NAME="NOTES">
                0690 <HR>
                0691 <H4>NOTES</H4>
                0692 <!-- BEGIN NOTES -->
                0693 <PRE>
                0694 
                0695      A pseudo-program using the multistep algorithm:
                0696 
                0697          do atmospheric loop
                0698              call gcm_vert_diff_down  
                0699          end do
                0700 
                0701          call surface modules
                0702 
                0703          do atmospheric loop
                0704              call gcm_vert_diff_up
                0705          end do
                0706 
                0707 </PRE>
                0708 </A><!-- END NOTES -->
                0709 <!--------------------------------------------------------------------->
                0710 <A NAME="PLANS">
                0711 <HR>
                0712 <H4>FUTURE PLANS</H4>
                0713 <!-- BEGIN PLANS -->
                0714 <PRE>
                0715 
                0716      (??)
                0717 
                0718 </PRE>
                0719 </A><!-- END PLANS -->
                0720 <!--------------------------------------------------------------------->
                0721 
                0722 <HR>
                0723 </BODY>
                0724 </HTML>