Professional Documents
Culture Documents
' $
Patrick Luyten
Patrick.Luyten@mumm.ac.be
' $
& %
MUMM - BMM - UGMM [3]
' $
& %
MUMM - BMM - UGMM [4]
' $
& %
MUMM - BMM - UGMM [5]
' $
& %
MUMM - BMM - UGMM [6]
' $
& %
MUMM - BMM - UGMM [7]
' $
' $
model grid
' $
density
iopt dens Evaluation of density and expansion coefficients (0).
0 : uniform density, zero expansion coefficients
1 : density from linear equation of state, uniform expansion coefficients
2 : from general equation of state (McDougall et al., 2006) without pressure effects
3 : from general equation of state with pressure effects
iopt dens grad Selects numerical algorithm for discretisation of baroclinic pressure gradient (see User
Documentation) (1).
0 : gradient set to zero
1 : traditional σ-coordinate (second order) method
2 : z-level method
3 : method of Shchepetkin and McWilliams [2003]
iopt sal Salinity update (0).
0 : uniform (space and time) salinity field
1 : salinity field initialised but not updated in time
2 : salinity field initialised and updated in time
iopt sal sbc Type of surface boundary condition for salinity (0).
0 : zero surface flux
1 : surface flux proportional to evaporation minus precipitation rate
& %
MUMM - BMM - UGMM [10]
' $
& %
MUMM - BMM - UGMM [11]
' $
& %
MUMM - BMM - UGMM [12]
' $
advection
iopt adv scal Type of advection of scheme for advection of scalar quantities (3).
0 : advection disabled
1 : upwind scheme
2 : Lax-Wendroff (explicit) in the horizontal, central (semi-implicit) in the vertical (not
recommended!)
3 : TVD scheme
iopt adv 2D Type of advection of scheme for advection of 2-D transports (1).
0 : advection disabled
1 : upwind scheme
2 : Lax-Wendroff (explicit) in the horizontal, central (semi-implicit) in the vertical (not
recommended!)
3 : TVD scheme
iopt adv 3D Type of advection of scheme for advection of 3-D currents (1).
0 : advection disabled
1 : upwind scheme
2 : Lax-Wendroff (explicit) in the horizontal, central (semi-implicit) in the vertical (not
recommended!)
3 : TVD scheme
& %
MUMM - BMM - UGMM [13]
' $
diffusion coefficients
iopt hdif coef Type of scheme for horizontal diffusion coefficients (0).
0: not used
1: spatially uniform
2: Smagorinsky formulation
iopt hdif scal Disables/enables (0/1) horizontal diffusion in scalar transport equations (0).
iopt hdif 2D Disables/enables (0/1) horizontal diffusion in 2-D transport equations (0).
iopt hdif 3D Disables/enables (0/1) horizontal diffusion in 3-D current transport equations (0).
iopt hdif turb Disables/enables (0/1) horizontal diffusion in turbulence transport equations (0).
iopt vdif coef Selects (general) type of vertical diffusion scheme (3).
0: vertical diffusion disabled
1: uniform diffusion coefficient
2: algebraic formulation
3: second order turbulence closure
& %
MUMM - BMM - UGMM [14]
' $
turbulence schemes
iopt turb alg Type of algebraic scheme if iopt vdif coef =2 (1).
1 : Pacanowski-Philander
2 : Munk-Anderson
3–5: Flow dependent formulations
iopt turb lmix Mixing length formulation (4).
1 : parabolic law
2 : “modified” parabolic law
3 : “Xing” formulation
4 : “Blackadar” asymptotic formulation
iopt turb ntrans Number of transport equations (1).
0 : equilibrium method (“Mellor-Yamada level 2”)
1 : turbulence energy equation + mixing length selected by iopt turb lmix
2 : k-ε of k-kl equation
iopt turb param Selects type of second turbulent variable (2).
1 : mixing length l (k-l scheme)
2 : dissipation rate ε (k-ε scheme)
& %
MUMM - BMM - UGMM [15]
' $
iopt turb stab mod Selects type of closure (RANS) model (4).
1 : Mellor and Yamada [Mellor and Yamada, 1974; Galperin et al., 1988]
2 : Kantha and Clayson [1994]
3 : Burchard and Baumert [1995]
4 : Hossain and Rodi [1982]
5 : Canuto A-scheme [Canuto, 2001]
6 : Canuto B-scheme [Canuto, 2001]
drying/wetting scheme
& %
MUMM - BMM - UGMM [16]
' $
tides
iopt astro tide Disables/enables (0/1) inclusion of astronomical tidal force in momentum equations (0).
iopt astro pars Selects evaluation of tidal parameters (0).
0 : astronomical argument set to zero, nodal factors set to 1
1 : evaluate astronomical phases at a given time and reference longitude, nodal factors are set to 1
& %
2 : evaluate astronomical phases and nodal factors at a given time and reference longitude
MUMM - BMM - UGMM [17]
' $
meteorological forcing
' $
iopt sflux cds Formulation for neutral surface drag coefficient CDs (0).
0 : constant value
1 : Large and Pond [1981]
2 : Smith and Banke [1975]
3 : Geernaert et al. [1986]
4 : Kondo [1975]
5 : Blanc [1985]
6 : Charnock’s relation
iopt sflux cehs Formulation for neutral surface (heat) exchange coefficients CE , CH (0).
0 : constant value
1 : Large and Pond [1982]
2 : Anderson and Smith [1981]
3 : Kondo [1975]
4 : Blanc [1985]
& %
MUMM - BMM - UGMM [19]
' $
iopt sflux strat Selects dependence of surface drag and exchange coefficients on atmospheric
stratification effects (0).
0 : no dependence
1 : using Kondo’s [1975] parameterisation
2 : using Monin-Obukhov similarity theory
nesting
& %
MUMM - BMM - UGMM [20]
' $
MPI mode
The non-blocking options need to be re-programmed and should not be used in the present version !
iopt MPI partit Selects method for domain decomposition (1).
1: “simple” partition based on the values of nprocsx and nprocsy
2: decomposition obtained from an external data file
user output
& %
MUMM - BMM - UGMM [21]
' $
& %
MUMM - BMM - UGMM [22]
' $
Model constants
nc Number of grid cells in the X-direction (including an extra column along the eastern
edge) (*)
nr Number of grid cells in the Y-direction (including an extra column along the northern
edge) (*)
nz Number of grid cells in the vertical direction (*)
nosbu Number of open sea boundaries at U-nodes (West/East) (0)
nosbv Number of open sea boundaries at V-nodes (South/North) (0)
nrvbu Number of river boundaries at U-nodes (West/East) (0)
nrvbv Number of river boundaries at V-nodes (South/North) (0)
nconobc Number of constituents for open boundary tidal forcing (0).
nonestsets Number of nested sub-grids used when iopt nests = 1 (0).
norestarts Number of restart times (1).
ntrestart(1:norestarts) Restart time indices for writing of initial conditions. If a value equals int fill, it
will be replaced by the total number of 2-D time steps (int fill).
dlat ref Reference latitude to be used for the Coriolis frequency in case of a Cartesian grid
[decimal degrees] (0.0).
dlon ref Reference longitude to be used for solar irradiance in case of a Cartesian grid [decimal
degrees] (0.0).
& %
MUMM - BMM - UGMM [23]
' $
dlon ref obc If iopt astro pars > 0, phases at open boundaries are assumed to be taken with respect
to astronomical argument at this reference value [decimal degrees]. If zero, the reference
longitude is taken at Greenwich (0.0).
gacc ref If different from real fill, spatially uniform acceleration of gravity. Otherwise, g is
evaluated as function of latitude [m/s2 ] (real fill).
sal ref Reference salinity used if iopt sal=0 or iopt dens ≤ 1 [PSU] (33.0).
temp min Minimum temperature. If set to real fill, the minimum is taken as the freezing point of
sea water which is a function of salinity [deg C] (0.0).
temp ref Reference temperature used if iopt temp=0 or iopt dens ≤1 [deg C] (12.0).
dcrit fld Critical water depth used in drying/wetting algorithm [m] (0.1).
dmin fld Minimum water depth used in drying/wetting algorithm [m] (0.02).
hdifmom cst Constant coefficient for horizontal momentum diffusion when iopt hdif coef=1 [m2 /s]
(0.0).
hdifscal cst Constant coefficient for horizontal scalar diffusion when iopt hdif coef=1 [m2 /s] (0.0).
vdifmom cst Constant coefficient for vertical diffusion of momentum used if iopt vdif coef=1 or as
bacground value if iopt turb iwlim=0 [m2 /s] (10−6 ).
vdifscal cst Constant coefficient for vertical diffusion of scalars used if iopt vdif coef=1 or as
bacground value if iopt turb iwlim=0 [m2 /s] (10−6 ).
bdragcoef cst Constant bottom drag coefficient CDb when iopt bstres drag=1 [-] (0.0).
zrough cst Constant bottom roughness length z0b when iopt bstres drag=3 [m] (0.0).
& %
MUMM - BMM - UGMM [24]
' $
cds cst Constant surface drag coefficient CDs when iopt sflux cds=0 [-] (0.0013).
ces cst Constant surface exchange coefficient CE when iopt sflux cehs=0 [-] (0.0013).
chs cst Constant surface exchange coefficient CH when iopt sflux cehs=0 [-] (0.0013).
optattcoef1 cst Inverse optical attenuation depth for the absorption of long-wave solar radiation [m−1 ]
(10.0).
optattcoef2 cst Inverse optical attenuation depth for the absorption of short-wave solar radiation [m−1 ]
(2.06).
opt frac Long-wave fraction R of surface solar radiance [-] (0.54).
index obc(1:nconobc) Key ids of the tidal constituents used for the tidal forcing at open boundaries (0).
Turbulence constants
& %
MUMM - BMM - UGMM [25]
' $
Parameters characterising a surface grid are stored into the Fortran 90 DERIVED TYPE 2-D array
surfacegrids.
TYPE :: GridParams
INTEGER :: nhtype, n1dat, n2dat
REAL :: delxdat, delydat, x0dat, y0dat
END TYPE GridParams
TYPE (GridParams), DIMENSION(MaxGridTypes,2) :: surfacegrids
An element of the array surfacegrids can be generically represented as surfacegrids(igrd,ifil) where igrd is
the “grid descriptor” and ifil the “file number” (which in the present version always equals 1).
file descriptors
& %
MUMM - BMM - UGMM [26]
' $
grid parameters
nhtype Type of surface grid.
0: single grid point
1: uniform rectangular grid
2: non-uniform rectangular grid
3: non-rectangular (curvilinear or non-structured)
4: same as model grid
n1dat X-dimension of surface grid.
n2dat Y-dimension of surface grid.
delxdat grid spacings in X-direction (m or fractional degrees longitude) when nhtype=1
delydat grid spacings in Y-direction (m or fractional degrees latitude) when nhtype=1
x0dat X-coordinate (Cartesian or longitude) of lower left corner when nhtype=1
y0dat Y-coordinate (Cartesian or latitude) of lower left corner when nhtype=1
• Note that if nhtype=4, then n1dat=nc and n2dat=nr.
• If nhtype=1, all parameters need to be defined.
• If nhtype=2,3, only n1dat and n2dat need to be defined.
• If nhtype=4, no further definitions need to be made.
• Parameters for the model grid need to be set according to the value of iopt grid htype which equals
nhtype. If nhtype=1, the (horizontal) model grid is defined by delxdat, delydat, x0dat, y0dat. The
latter 2 parameters are defined at the Soutwest corner of the domain.
& %
MUMM - BMM - UGMM [27]
' $
The file parameters related to model forcing (either input or output) are stored into the Fortran 90
DERIVED TYPE 3-D array modfiles.
TYPE :: FileParams
LOGICAL :: defined, info, opened, time regular
CHARACTER (LEN=1) :: form, status
CHARACTER (LEN=leniofile) :: filename, pathname
CHARACTER (LEN=lendesc) :: filedesc
INTEGER :: endfile, header type, iostat, iunit, &
& lenrec, maxrecs, nocoords, nodim, novars, timeid, &
& timerec, tskips, varid, zetaid
INTEGER, DIMENSION(3) :: tlims
END TYPE FileParams
TYPE (FileParams), DIMENSION(MaxIOTypes,MaxIOFiles,2) :: modfiles
Only the underlined parameters can be defined by the user, the others are used internally in the
program (e.g. iunit giving the FORTRAN file unit number).
& %
MUMM - BMM - UGMM [28]
' $
An element of the array modfiles can be generically represented as modfiles(idesc,ifil,iotype) where idesc
is the “file descriptor”, ifil the “file number” and iotype represents input (output) data if 1 (2).
Almost all forcing data (except nesting) are input data, i.e. represented by an element of modfiles with
iotype=1. By defining a corresponding output element with iotype=2 the input data will re-written in a
COHERENS standard format. In case of nested output, iotype=2. The method also allows to define
multiple files for a given descriptor.
file descriptors
' $
io tmpobc specifiers for temperature open boundary forcing if ifil=1, open boundary data if ifil>1
io rlxobc definitions of relaxation zones (ifil=1)
io nstspc specifiers for sub-grid nesting (ifil=1)
io 2uvnst 2-D open boundary data for nested sub-grids (one file per sub-grid)
io 3uvnst 3-D (baroclinic current) open boundary data for nested sub-grids (one file per sub-grid)
io salnst salinity open boundary data for nested sub-grids (one file per sub-grid)
io tmpnst temperature open boundary data for nested sub-grids (one file per sub-grid)
io metsur meteorological data (ifil=1)
io sstsur SST data (ifil=1)
& %
MUMM - BMM - UGMM [30]
' $
' $
' $
User output
nosetstsr Number of time series file sets if iopt out tsers=1 (0).
nostatstsr Number of time series output stations if iopt out tsers=1 (0).
novarstsr Number of time series variables if iopt out tsers=1 (0).
nosetsavr Number of time averaged file sets if iopt out avrgd=1 (0).
nostatsavr Number of time averaged output stations if iopt out avrgd=1 (0).
novarsavr Number of time averaged variables if iopt out avrgd=1 (0).
nosetsanal Number of harmonic file sets if iopt out anal=1 (0).
nofreqsanal Number of harmonic frequencies if iopt out anal=1 (0).
nostatsanal Number of harmonic output stations if iopt out anal=1 (0).
novarsanal Number of harmonic variables if iopt out anal=1 (0).
intitle Title used to create names of model forcing files.
outtitle Title used to create names of user output files.
& %
MUMM - BMM - UGMM [33]
' $
usrdef grid
• Define model grid and bathymetry if modfiles(io modgrd,1,1)%status=‘N’.
• Generic code can be found in examples/Usrdef Model.f90.
• Definitions of coordinate arrays depend on values of the switches iopt grid htype and iopt grid vtype.
• nobu=nosbu+nrvbu and nobv=nosbv+nrvbv are the total number of open boundary points at U-
and V-nodes.
All arrays are global and have the following meaning
gxcoordglb(1:nc,1:nr) X-coordinates (Cartesian or spherical) of model grid corner points (only
when iopt grid htype>1).
gycoordglb(1:nc,1:nr) Y-coordinates (Cartesian or spherical) of model grid corner points (only
when iopt grid htype>1).
gsigcoord(nz+1) σ-coordinates in case of a σ-grid with vertical spacings which are non-uniform
in the vertical but uniform in the horizontal (only when iopt grid vtype=2)
gscoordglb(1:nc-1,1:nr-1,nz+1) general σ-coordinates (only when iopt grid vtype=3)
depmeanglb(1:nc-1,1:nr-1) mean water depths [m] (bathymetry)
iobu grid indices in X-direction of open boundary points at U-nodes
jobu grid indices in Y-direction of open boundary points at U-nodes
iobv grid indices in X-direction of open boundary points at V-nodes
jobv grid indices in Y-direction of open boundary points at V-nodes
& %
MUMM - BMM - UGMM [34]
' $
usrdef partition
Define domain decomposition if iopt MPI partit=2 and modfiles(io mppmod,1,1)%status=‘N’.
& %
MUMM - BMM - UGMM [35]
' $
usrdef phsics
• Define initial conditions if modfiles(io inicon,1,1)%status=‘N’.
• Initialisation of some variables depends on the values of switches (see examples/Usrdef Model.f90).
• Arrays defined on the model grid need to be initialised “locally”. If they are obtained from a global
data file, distribution calls need to be made in the parallel case to extract the local values from the
global data.
• In parallel mode, arrays on the model grid are defined including their halos. The halo size of most
arrays equals nhalo=2.
• ncloc and nrloc are the X- and Y-dimensions of the local grid.
• Example procedures are given in examples/Usrdef Model.f90.
2-D mode
udvel(1-nhalo:ncloc+nhalo,1-nhalo:nrloc+nhalo) depth-integrated current in the X-direction [m2 /s]
vdvel(1-nhalo:ncloc+nhalo,1-nhalo:nrloc+nhalo) depth-integrated current in the Y-direction [m2 /s]
zeta(0:ncloc+1,0:nrloc+1) surface elevation [m]
3-D currents
uvel(1-nhalo:ncloc+nhalo,1-nhalo:nrloc+nhalo,nz) current in X-direction [m/s]
& %
MUMM - BMM - UGMM [36]
' $
density arrays
temp(1-nhalo:ncloc+nhalo,1-nhalo:nrloc+nhalo,nz) temperature [deg C]
sal(1-nhalo:ncloc+nhalo,1-nhalo:nrloc+nhalo,nz) salinity [PSU]
turbulence arrays
tke(1-nhalo:ncloc+nhalo,nrloc,nz+1) turbulent kinetic energy [J/kg]
zlmix(1-nhalo:ncloc+nhalo,1-nhalo:nrloc+nhalo,nz+1) mixing length [m]
dissip(1-nhalo:ncloc+nhalo,1-nhalo:nrloc+nhalo,nz+1) dissipation of turbulent energy [W/kg]
' $
& %
MUMM - BMM - UGMM [38]
' $
general specifiers
ityp2dobu(nobu) type of open boundary condition at U-nodes (between 0-13)
ityp2dobv(nobv) type of open boundary condition at V-nodes (between 0-13)
iloczobu(nobu) position of elevation data at U-nodes
0: not specified
1: at U-node
2: at first C-node outside the domain
iloczobv(nobv) position of elevation data at V-nodes (0/1/2)
no2dobc(2:nofiles) number of data locations within each data file
iobc2dtype(2:nofiles) type of the 2-D data
1: depth-integrated currents and elevations
2: elevations only
3: depth-integrated currents only
& %
MUMM - BMM - UGMM [39]
' $
index2dobc(nobu+nobv,2:nofiles) Each data file contains a sub-set of open boundary data points. The
element index2dobc(idat,ifil) maps, for file ifil, the local data point idat into a
corresponding global open boundary index (between 1:nobu for U- and
nobu+1:nobu+nobv for V-open boundaries). The physical size of the first
dimension for file ifil equals no2dobc(ifil).
amplitudes
ud2obu amp(nobu,nconobc) amplitudes of depth-integrated X-current at U-open boundaries [m2 /s]
vd2obv amp(nobv,nconobc) amplitudes of depth-integrated Y-current at V-open boundaries [m2 /s]
zetobu amp(nobu,nconobc) amplitudes of surface elevation at U-open boundaries [m]
zetobv amp(nobv,nconobc) amplitudes of surface elevation at V-open boundaries [m]
phases
ud2obu pha(nobu,nconobc) phases of depth-integrated X-current at U-open boundaries [rad]
vd2obv pha(nobv,nconobc) phases of depth-integrated Y-current at V-open boundaries [rad]
zetobu pha(nobu,nconobc) phases of surface elevation at U-open boundaries [rad]
zetobv pha(nobv,nconobc) phases of surface elevation at V-open boundaries [rad]
& %
MUMM - BMM - UGMM [40]
' $
(2) 8
(2) 6 (3) 11
• second number is open boundary index (nobu is
added at V-node points)
(2) 5 (3) 10
ifil=2: data at (U-)o.b. points 1 to 8
(2) 4 (3) 9
ifil=3: data at (U-)o.b. points 9 to 11
(2) 3 ifil=4: data at (V-)o.b. points 12 to 14
(6) 19
ifil=5: data at (V-)o.b. points 15 to 18
(2) 2
ifil=6: data at (V-)o.b. point 19
(2) 1
' $
' $
& %
MUMM - BMM - UGMM [43]
' $
& %
MUMM - BMM - UGMM [44]
' $
' $
& %
MUMM - BMM - UGMM [46]
' $
& %
MUMM - BMM - UGMM [47]
' $
' $
& %
MUMM - BMM - UGMM [49]
' $
& %
MUMM - BMM - UGMM [50]
' $
& %
3: transport
MUMM - BMM - UGMM [51]
' $
& %
MUMM - BMM - UGMM [52]
' $
& %
MUMM - BMM - UGMM [53]
' $
& %
MUMM - BMM - UGMM [54]
' $
& %
MUMM - BMM - UGMM [55]
' $
& %
MUMM - BMM - UGMM [56]
' $
' $
definition of variables
TYPE :: VariableAtts
INTEGER :: ivarid, klev, nrank, oopt
REAL :: dep
END TYPE VariableAtts
TYPE (VariableAtts), DIMENSION(novarstsr) :: tsrvars
INTEGER, DIMENSION(nosetstsr,novarstsr) :: ivarstsr
ivarid Variable key id of the output variable (as defined in modids.f90). The syntax is iarr * where * is
the variables’s FORTRAN name (e.g. iarr temp). Variables need to be defined in the following
order: 0-D (if any), 2-D (if any), 3-D (if any). A zero means that the variable is user-defined.
nrank variable rank (0,2 or 3)
oopt (optional) operator applied to the variable. Following values are allowed
oopt null no operator is applied (default)
oopt min minimum value over whole domain
oopt max maximum value over whole domain
oopt mean domain average
oopt klev value at the vertical grid level given by the klev attribute
oopt dep value at a depth given by by the dep attribute
klev vertical grid level applied when oopt=oopt klev
& %
MUMM - BMM - UGMM [58]
' $
dep depth (distance from the surface) applied when oopt=oopt dep. Output value is obtained by
vertical interpolation
ivarstsr Each file set contains a sub-set of the variables defined in tsrvars. The element ivarstsr(iset,ivar)
maps, for set iset, the local variable ivar into the corresponding array index in tsrvars. The
variables must be defined in the following order: first 0-D (if any), next 2-D (if any) and finally
the 3-D variables (if any).
& %
MUMM - BMM - UGMM [59]
' $
file attributes
TYPE :: FileParams
LOGICAL :: defined, info
CHARACTER (LEN=1) :: form
CHARACTER (LEN=leniofile) :: filename
INTEGER :: header type
END TYPE FileParams
TYPE (FileParams), DIMENSION(nosetstsr) :: tsr0d, tsr2d, tsr3d
The following file attributes can be defined:
defined Output file will be written (only) if this parameter is set to .TRUE. Default is .FALSE.
form Output format
‘A’: ASCII
‘U’: unformatted binary
‘N’: netCDF
filename File name. If not defined, a default will be constructed by the program.
info An “info” file (ending with ‘I’) will be created if .TRUE. (default value).
header type No heading information will be written if set to 0. Default is 2. This option is not available
for netCDF output.
& %
MUMM - BMM - UGMM [60]
' $
TYPE :: OutGridParams
LOGICAL :: gridded, grid file, land mask, time grid
CHARACTER (LEN=1) :: status
CHARACTER (LEN=lentime) :: enddate, refdate, startdate
INTEGER :: nodim, nostats, time format
INTEGER, DIMENSION(3) :: tlims, xlims, ylims, zlims
END TYPE OutGridParams
TYPE (OutGridParams), DIMENSION(nosetstsr) :: tsrgpars
gridded If .TRUE. (default), output data are defined on a sub-grid of the model grid (or the whole
model grid). If .FALSE., the data are taken at a series of locations (“station” data) defined
below.
grid file If .TRUE., output grid data will be written on a separate output file (defined by tsrgrd).
Otherwise, they are written within the data file itself (default).
land mask A land mask will be applied if .TRUE. and gridded=.TRUE.. This means that the gridded
data will be stored as a vector excluding land points. Advantage may be a significant
reduction in disk space. Default is .FALSE..
time grid If .TRUE., the data grid is time-dependent (vertical positions in a σ- or s-grid are
time-dependent). Surface elevations will be written at each time step. Default if .FALSE..
& %
MUMM - BMM - UGMM [61]
' $
& %
MUMM - BMM - UGMM [62]
' $
station attributes
TYPE :: StationLocs
INTEGER :: ipos, jpos
CHARACTER (LEN=lenname) :: name
END TYPE StationLocs
TYPE (StationLocs), DIMENSION(nostatstsr) :: tsrstatlocs
INTEGER, DIMENSION(nosetstsr,nostatstsr) :: lstatstsr
ipos X-index on (global) model grid of output stations
jpos Y-index on (global) model grid of output stations
name descriptive names of the stations
lstatstsr Station labels. Each file set may contain a sub-set of stations. The element lstatstsr(iset,istat)
maps, for set iset, the local station index istat into the corresponding global array index in
tsrstatlocs.
& %
MUMM - BMM - UGMM [63]
' $
& %
MUMM - BMM - UGMM [64]
' $
& %
MUMM - BMM - UGMM [65]
' $
& %
MUMM - BMM - UGMM [66]
' $
& %
MUMM - BMM - UGMM [67]
' $
Final remarks
• The user must insert the proper USE statements in the usrdef-routines.
• To open or close a file, do not use the standard OPEN and CLOSE statements. There are two
alternatives:
1. Use open filepars to open and close filepars to close files. The first argument of these routines is a
derived type variable of TYPE FileParams. Besides opening and closing the routines set or reset
a number of file attributes.
2. Use open file and close file. The routines are similar to the classical OPEN and CLOSE and are
defined in inout routines.f90.
• A special procedure need to be followed within a usrdef routine which reads time series data (i.e.
the routines which have ciodatetime as argument.
1. On first call, the file is opened and the %iostat number is reset from 0 to 1. No data are read.
2. A second call is made, immediately after the first one (i.e. at the same model time step) to read
the date/time and first series of data. This is repeated until the date/time of the last input is
later than the actual model time.
3. When during program execution, the model date equals or becomes later than the one obtained
from last read, the usrdef-routine is called again, until the date/time in the file becomes later
than the actual model time.
4. If an end of file condition occurs or the user knows that this will occur on a next read, the user
must set the iostat number to 2. The program will no longer call the routine. Further action
(decided by the program) now depends on the value of the endfile parameter.
& %