4.2  Subdir: MAIN


This subdirectory contains the CANDIE ocean model dynamics codes. It is the subdirectory where the model simulations are run. It consists of a subdirectory SUBS and several ASCII files discussed below:

AN_ID.h
File contains the name of the test case being run, as in the file PREP/ AN_ID.h.

Define.h
File contains list of features of the CANDIE model to be included or omitted using #define and #undefine statements.

main.F
File contains the MAIN program and subroutine FS (for Free Stream) of the DieCAST model.

Makefile
File contains the makefile commands to compile and link the CANDIE model to form the executable file main.

Runtime_parm.tag
File contains information to set a model run (time step, momentum and heat diffusion coefficients, restart information, length of run). File is read by main.F at execution time. The name tag is the same name supplied to main.F at execution time to identify the model run.

SUBS
This subdirectory contains files with subroutines required by main.F. The appropriate files are included in main.F with preprocessor #include statements.

/MAIN/SUBS/ bbl2_stepA.h

/MAIN/SUBS/ bc_radiation.h
File contains subroutines BC_PHASESPEED and BC_RADIATION for radiation boundary conditions at northern and southern boundaries, if they are opened with the options OPEN_SOUTH or OPEN_NORTH.

/MAIN/SUBS/ biharm.F
File contains subroutines BFLT, BFLTUP, and BFLTV, for the biharmonic filter of T and S (normal gradients zero at boundaries).

/MAIN/SUBS/ biharm0.F

/MAIN/SUBS/ biharm1.F,

/MAIN/SUBS/ bt_radiation.F
File contains subroutines VTIDE_BDRY, BT_RADIATION, and VBT_RESIDUAL. The subroutine VTIDE_BDRY specifies the incoming tide at the open boundary.

/MAIN/SUBS/ convect.F
File contains SUBROUTINE CONVECT to check for static instability and mix the water column. This subroutine is called if the parameter ICONV=1 is set in the file /MAIN/Runtime_parm.tag. The number of times this proceedure is iterated is the value of the parameter ISWEEP, set in file /MAIN/Runtime_parm.tag. This file also contains SUBROUTINE SHUFFLE0, and SUBROUTINE SHUFFLE1.

/MAIN/SUBS/ free_surf.F
File contains the subroutines necessary for free surface calculations, INT_FREE_SURF, UVDIV_WT, GRAD_ETA, PRE, and MATINV.

/MAIN/SUBS/ gsl_tide_bdry.F
File contains subroutines READ_TIDE, UTIDE_BNDR, and GRID2IN2.

/MAIN/SUBS/ gsl_tsinit.h

/MAIN/SUBS/ HB_TEST_CASE.h

/MAIN/SUBS/ Hmix.F
File contains code for horizontal Smagorinsky mixing.

/MAIN/SUBS/ initfs.F
File contains SUBROUTINE INITFS that initializes the controlling arrays and derived scalars used for the SUBROUTINE FS, the Free Stream model calculations. This file reads in several data initialziation files, including /MAIN/Runtime_parm.tag. The surface T and S restoring time scale OT_RESTORE is specified in this file in #ifdef blocks for the options T_RESTORE and S_RESTORE. The time step acceleration parameter ALPHA_ACC is set in this file if the option UV_ACCEL is used.

/MAIN/SUBS/ interp.h
File contains code to interpolate values to the longitudinal and latitudinal faces of grid cells.

/MAIN/SUBS/ Local_Arrays.h
File contains the model array dimension specifications used in main.F. If you need new arrays in the program they can be dimensioned in this file in an #ifdef block for your case. These could be put in a COMMON block and passed to the various suboutines called by main.F.

/MAIN/SUBS/ movie_dd.F
File contains SUBROUTINE COMXY to save movie data. This was written by David Dietrich.

/MAIN/SUBS/ open_flow.h
File contains code for velocities at open boundaries.

/MAIN/SUBS/ open_flux.h
File contains code for horizontal fluxes through open boundaries.

/MAIN/SUBS/ open_init.h
File contains code to initialize sections at open boundaries.

/MAIN/SUBS/ output.F
File contains subroutines OUTPUTGRIDS, SGRIDOUT, SGID2OUT, SGRID3OUT. The SUBROUTINE OUTPUTGRIDS calls other subroutines to make plots of surface elevation, stream function, and cross section plots of variables.

/MAIN/SUBS/ output_dd.h
File contains code written by David Dietrich to produce a computer generated movie. Data are written at time step intervals MVI. This is done by calling SUBROUTINE COMXY.

/MAIN/SUBS/ output_gri.h
File contains code to write output for plotting with the GRI plotting package.

/MAIN/SUBS/ pc_flux.h
File contains code to correct the longitudinal and latitudinal fluxes.

/MAIN/SUBS/ pc_gradp.h
File contains code to calculate the pressure gradient.

/MAIN/SUBS/ pc_interp.h
File contains code to interpolate to longitudinal and latitudinal faces of grid cells.

/MAIN/SUBS/ pc_interpolator.F
File contains the two interpolation functions R_INTERP and D_INTERP.

/MAIN/SUBS/ pg_velocity.h

/MAIN/SUBS/ pr_solver.F
File contains SUBROUTINE REP for the elliptic solver.

/MAIN/SUBS/ pv_mix.F
File contains SUBROUTINE COMPUTE_PVMIX. This subroutine deals with eddy parameterisations. It implements the Greatbatch (1997) potential vorticity parameterisation. The coefficient K is determined using Visbeck (1997). Upper limit for K can be introduced by commenting out one line (see below). The value of K(kb(i,j)) at the bottom is fixed to 100e4 as in Greatbatch (1997). Minimum slope is 1e-8.

/MAIN/SUBS/ rc_init.h
File contains code to input the gridded climate data files.

/MAIN/SUBS/ rc_restart.h
This file contains special routines to allow for restart given what's been output and input from previous run(s). Want to allow for time-dependent restart (ie SEASONAL defined) and a restart that continues with the forcing fixed at the last month integrated (ie SEASONAL _not_defined) NB: have the variable DAYS NB: re REAL_CLM restart: At this time (98/01/20) no RC variables have been added to the RESTART output. This means that the frequency of updating the forcing (currently 1/day) is not recorded. Therefore, if RESTART info is NOT written coincident with an update time it is not possible to exactly re-initialize the climate forcing to what it was at stop-time. This is NOT a problem with 1/day updating if writing RESTARTs when mod(ITF,DAODT)==0, and should not in general be a big problem as the forcing does not change much over a even few days.

/MAIN/SUBS/ rho.F
File contains DOUBLE PRECISION FUNCTION R(T,S,P) that calculates the density. It is calculated according to Wright (1997) as the default, but options are available to calculate it according to other methods.

/MAIN/SUBS/ tridi.F
File contains SUBROUTINE TRIDIT which solves for implicit vertical diffusion and advection of temperature, and SUBROUTINE TRIDIV which solves for implicit vertical diffusion and advection of momentum. File also contains SUBROUTINE TRIDAG.

/MAIN/SUBS/ TS_restore.h
File contains segments of code that will restore the surface temperature or salinity to a climatological or prescribed value over a prescribed time scale. Code in this file is included for the C-preprocessor options # if defined REAL_CLM && defined SEASONAL, T_RESTORE, S_RESTORE, NORTH_SPONGE, SOUTH_SPONGE, MED_SPONGE.

/MAIN/SUBS/ TS_restore0.h

/MAIN/SUBS/ Vmix.F
File contains SUBROUTINE Vmix for vertical mixing based on a Richarson number parameterization. The bulk Richardson number is determined at each interface, and the additional mixing is determined by the Richardson number formulation. This subroutine is called if the C-preprocessor options #if defined VMix_RICH || defined KVXYZ in Define.h are used.



CANDIE Home User Guide Contents Previous Section Top of Page Next Section