This code allows the user to easily add tracers to the FMS framework.
use radon_mod, only : radon_sourcesink, radon_init, radon_endAn integer parameter, which will be used as an identifier for the tracer, should be assigned.
integer :: nradonWithin tracer_driver_init a call to the tracer manager is needed in order to identify which tracer it has set the tracer as.
nradon = get_tracer_index(MODEL_ATMOS,'radon')Here MODEL_ATMOS is a parameter defined in field_manager. 'radon' is the name of the tracer within the field_table.
if (nradon > 0) then call radon_init(Argument list) endifWithin tracer_driver the user can also use the identifier to surround calls to the source-sink routines for the tracer of interest.
if (nradon > 0 .and. nradon <= nt) then call radon_sourcesink (Argument list) rdt(:,:,:,nradon)=rdt(:,:,:,nradon)+rtnd(:,:,:) endifIt is the users responsibility to add the tendency generated by the sourcesink routine.
call radon_endThis may simply be a deallocation statement or a routine to send output to the logfile stating that the termination routine has been called.
time_manager_mod
coupler_types_mod
call atmos_tracer_driver (is, ie, js, je, Time, lon, lat, land, phalf, pfull, r, & u, v, t, q, u_star, rdt, rm, rdiag, kbot)
is, ie, js, je | Local domain boundaries. [integer] |
Time | Model time. [type(time_type)] |
lon | Longitude of the centre of the model gridcells [real, dimension(:,:)] |
lat | Latitude of the centre of the model gridcells [real, dimension(:,:)] |
land | Land/sea mask. [logical, dimension(:,:)] |
phalf | Pressures on the model half levels. [real, dimension(:,:,:)] |
pfull | Pressures on the model full levels. [real, dimension(:,:,:)] |
r | The tracer array in the component model. [real, dimension(:,:,:,:)] |
u | Zonal wind speed. [real, dimension(:,:,:)] |
v | Meridonal wind speed. [real, dimension(:,:,:)] |
t | Temperature. [real, dimension(:,:,:)] |
q | Specific humidity. This may also be accessible as a
portion of the tracer array. [real, dimension(:,:,:)] |
u_star | Friction velocity ::
The magnitude of the wind stress is density*(ustar**2)
The drag coefficient for momentum is u_star**2/(u**2+v**2) [real, dimension(:,:)] |
rm | The tracer array in the component model for the previous timestep. [real, dimension(:,:,:,:)] |
kbot | Integer array describing which model layer intercepts the surface. [integer, optional, dimension(:,:)] |
rdt | The tendency of the tracer array in the compenent
model. The tendency due to sources and sinks computed
in the individual tracer routines should be added to
this array before exiting tracer_driver. [real, dimension(:,:,:,:)] |
rdiag | The array of diagnostic tracers. As these may be changed within the
tracer routines for diagnostic purposes, they need to be writable. [real, dimension(:,:,:,:)] |
call atmos_tracer_driver_init (lonb,latb, r, mask, axes, Time)
lonb | The longitudes for the local domain. [real, dimension(:)] |
latb | The latitudes for the local domain. [real, dimension(:)] |
mask | optional mask (0. or 1.) that designates which grid points
are above (=1.) or below (=0.) the ground dimensioned as
(nlon,nlat,nlev). [real, optional, dimension(:,:,:)] |
Time | Model time. [type(time_type)] |
axes | The axes relating to the tracer array dimensioned as
(nlon, nlat, nlev, ntime) [integer, dimension(4)] |
r | Tracer fields dimensioned as (nlon,nlat,nlev,ntrace). [real, dimension(:,:,:,:)] |
call atmos_tracer_driver_end
call atmos_tracer_driver_gather_data