C C Invocation from WRAPPER level... C C | C |-THE_MODEL_MAIN :: Primary driver for the MITgcm algorithm C | :: Called from WRAPPER level numerical C | :: code invocation routine. On entry C | :: to THE_MODEL_MAIN separate thread and C | :: separate processes will have been established. C | :: Each thread and process will have a unique ID C | :: but as yet it will not be associated with a C | :: specific region in decomposed discrete space. C | C |-INITIALISE_FIXED :: Set fixed model arrays such as topography, C | | :: grid, solver matrices etc.. C | | C | |-INI_PARMS :: Routine to set kernel model parameters. C | | :: Kernel parameters are read from file "data" C | | :: in directory in which code executes. C | | C | |-PACKAGES_BOOT :: Start up the optional package environment. C | | :: Runtime selection of active packages. C | |-PACKAGES_READPARMS :: read all packages input parameter file C | | |- ${PKG}_READPARMS C | | C | |-SET_PARMS :: Finalise model parameter setting (if fct of pkg usage) C | | C | |-INI_MODEL_IO :: Initialise Input/Ouput setting C | | |-MNC_INIT C | | |-MNC_CW_INIT C | | | C | | |-MON_INIT :: Initialises monitor pacakge ( see pkg/monitor ) C | | C | |-INI_GRID :: Control grid array (vert. and hori.) initialisation. C | | | :: Grid arrays are held and described in GRID.h. C | | |-LOAD_GRID_SPACING :: Load grid spacing (vector) from files C | | |-INI_VERTICAL_GRID :: Set up vertical grid and coordinate C | | |-INI_CARTESIAN_GRID :: Cartesian horiz. grid initialisation C | | | :: (calculate grid from kernel parameters). C | | |-INI_SPHERICAL_POLAR_GRID :: Spherical polar horiz. grid setting C | | | :: (calculate grid from kernel parameters). C | | |-INI_CURVILINEAR_GRID :: General orthogonal, structured horiz. C | | | :: grid initialisations. ( input from raw C | | | :: grid files, LONC.bin, DXF.bin etc... ) C | | |-INI_CYLINDER_GRID :: Cylindrical horiz. grid setting C | | C | |-LOAD_REF_FILES :: C | |-INI_EOS :: C | |-SET_REF_STATE :: C | |-SET_GRID_FACTORS :: C | | C | |-INI_DEPTHS :: Read (from "bathyFile") or set bathymetry/orography. C | |-INI_MASKS_ETC :: Derive horizontal and vertical cell fractions and C | | :: land masking for solid-fluid boundaries. C | | C | |-PACKAGES_INIT_FIXED :: do all packages fixed-initialisation setting C | | |- ${PKG}_INIT_FIXED C | | C | |-INI_GLOBAL_DOMAIN C | |-INI_LINEAR_PHSURF :: Set ref. surface Bo_surf C | | C | |-INI_CORI :: Set coriolis term. zero, f-plane, beta-plane, C | | :: sphere optins are coded. C | |-INI_CG2D :: 2d con. grad solver initialisation. C | |-INI_CG3D :: 3d con. grad solver initialisation. C | | C | |-CONFIG_SUMMARY :: Provide synopsis of kernel setup. Includes C | | :: annotated table of kernel parameter settings. C | | C | |-PACKAGES_CHECK :: call each package configuration checking S/R C | | |- ${PKG}_CHECK C | | C | |-CONFIG_CHECK :: Check config and parameter consistency. C | | C | |-WRITE_GRID C | |-CPL_EXCH_CONFIGS C | C |-CTRL_UNPACK :: Control vector support package. see pkg/ctrl C |-COST_DEPENDENT_INIT :: C | C |-ADTHE_MAIN_LOOP :: Derivative evaluating form of main time stepping loop C ! :: Automatically generated by TAMC/TAF. C | C |-THE_MAIN_LOOP :: Main timestepping loop routine. C | | C | |-INITIALISE_VARIA :: Set the initial conditions for time evolving C | | | C #ifdef ALLOW_AUTODIFF C | | |-INI_DEPTHS \ C | | |-CTRL_DEPTH_INI \ C | | |-UPDATE_MASKS_ETC } ALLOW_DEPTH_CONTROL case C | | |-UPDATE_CG2D / C #endif C | | |-INI_NLFS_VARS :: Initialise all Non-Lin Free-Surf arrays (SURFACE.h) C | | |-INI_DYNVARS :: Initialise to zero all DYNVARS.h arrays C | | |-INI_NH_VARS :: Initialise to zero all NH_VARS.h arrays C | | | C | | |-INI_FIELDS :: Control initialising model fields to non-zero C | | | |-INI_VEL :: Initialize 3D flow field. C | | | |-INI_THETA :: Set model initial temperature field. C | | | |-INI_SALT :: Set model initial salinity field. C | | | |-INI_PSURF :: Set model initial free-surface height/pressure. C | | | |-READ_PICKUP C | | | C | | |-INI_MIXING :: Initialise diapycnal diffusivity. C | | |-TAUEDDY_INIT_VARIA C | | | C | | |-INI_FORCING :: initialise forcing fields C | | |-INI_FORCING :: Set model initial forcing fields. C | | | | :: Either set in-line or from file as shown. C | | | |-READ_FLD_XY_RS(zonalWindFile) C | | | |-READ_FLD_XY_RS(meridWindFile) C | | | |-READ_FLD_XY_RS(surfQnetFile) C | | | |-READ_FLD_XY_RS(EmPmRfile) C | | | |-READ_FLD_XY_RS(thetaClimFile) C | | | |-READ_FLD_XY_RS(saltClimFile) C | | | |-READ_FLD_XY_RS(surfQswFile) C | | | C | | |-AUTODIFF_INIT_VARIA C | | | C | | |-PACKAGES_INIT_VARIABLES :: Does initialisation of time evolving C | | | | ${PKG}_INIT_VARIA :: package data. C | | | C | | |-COST_INIT_VARIA C | | |-CONVECTIVE_ADJUSTMENT_INI C | | | C | | |-CALC_R_STAR :: Calculate the new level thickness factor (r* coord) C | | |-UPDATE_R_STAR :: Update the level thickness fraction (r* coord). C | | |-UPDATE_SIGMA :: Update the level thickness fraction (sigma-coord). C | | |-CALC_SURF_DR :: Calculate the new surface level thickness. C | | |-UPDATE_SURF_DR :: Update the surface-level thickness fraction. C | | | C | | |-UPDATE_CG2D :: Update 2d conjugate grad. for Free-Surf. C | | | C | | |-INTEGR_CONTINUITY :: Integrate the continuity Eqiuation C | | | |-INTEGRATE_FOR_W :: Integrate for vertical velocity C | | | |-OBCS_APPLY_W :: Open boundary package (see pkg/obcs). C | | | |-UPDATE_ETAH :: Update Surface height/pressure C | | | C | | |-CALC_R_STAR :: Calculate the new level thickness factor (r* coord) C | | |-CALC_SURF_DR :: Calculate the new surface level thickness. C | | | C | | |-STATE_SUMMARY :: Summarise model prognostic variables. C | | | C | | |-MONITOR :: Monitor state (see pkg/monitor) C | | | C | | |-DO_STATEVARS_TAVE :: Time averaging package ( see pkg/timeave ). C | | | |-TIMEAVE_STATVARS :: C | | | |-PTRACERS_TIMEAVE :: C | | | C | | |-DO_THE_MODEL_IO :: Controlling routine for IO C | | | |-WRITE_STATE :: Write model state variables. C | | | |-TIMEAVE_STATV_WRITE :: Write Time averaged output (see pkg/timeave) C | | | |-FIZHI_WRITE_STATE C | | | |-AIM_WRITE_TAVE C | | | |-LAND_OUTPUT C | | | |-OBCS_OUTPUT C | | | |-GMREDI_OUTPUT C | | | |-KPP_OUTPUT C | | | |-PP81_OUTPUT C | | | |-KL10_OUTPUT C | | | |-MY82_OUTPUT C | | | |-OPPS_OUTPUT C | | | |-GGL90_OUTPUT C | | | |-SBO_CALC C | | | |-SBO_OUTPUT C | | | |-SEAICE_OUTPUT C | | | |-SHELFICE_OUTPUT C | | | |-BULKF_OUTPUT C | | | |-THSICE_OUTPUT C | | | |-PTRACERS_OUTPUT C | | | |-MATRIX_OUTPUT C | | | |-GCHEM_OUTPUT C | | | |-CPL_OUTPUT C | | | |-LAYERS_CALC C | | | |-LAYERS_OUTPUT C | | | |-DIAGNOSTICS_WRITE :: Write pkg/diagnostics output C | | | C====|>| **************************** C====|>| BEGIN MAIN TIMESTEPPING LOOP C====|>| **************************** C | |-COST_AVERAGESFIELDS :: time-averaged Cost function terms (see pkg/cost) C | |-PROFILES_INLOOP :: C | / C | |-MAIN_DO_LOOP :: Open-AD case: Main timestepping loop routine C | \ otherwise: just call FORWARD_STEP C | | C/\ | |-FORWARD_STEP :: Step forward a time-step ( AT LAST !!! ) C/\ | | | C/\ | | |-LOAD_FIELDS_DRIVER :: control loading of input fields from files C/\ | | | C/\ | | |-CTRL_MAP_FORCING :: Control vector support package. (see pkg/ctrl) C/\ | | | C/\ | | |-CPL_EXPORT_MY_DATA :: Send coupling fields to coupler C/\ | | |-CPL_IMPORT_EXTERNAL_DATA :: Receive coupling fields from coupler C/\ | | | C/\ | | |-DO_ATMOSPHERIC_PHYS :: Atmospheric physics computation C/\ | | | C/\ | | |-DO_OCEANIC_PHYS :: Oceanic (& seaice) physics computation C/\ | | | |-OBCS_CALC :: Open boundary. package (see pkg/obcs). C/\ | | | |-EXTERNAL_FORCING_SURF:: Accumulates appropriately dimensioned C/\ | | | | :: forcing terms. C/\ | | | C/\ | | |-GCHEM_CALC_TENDENCY :: geochemistry driver routine (see pkg/gchem) C/\ | | | C/\ | | |-THERMODYNAMICS :: (synchronous time-stepping) C/\ | | | theta, salt + tracer equations driver. C/\ | | | |-GMREDI_RESIDUAL_FLOW :: Get the flow field used to advect tracer C/\ | | | | C/\ | | | |-TEMP_INTEGRATE :: Step forward Prognostic Eq for Temperature. C/\ | | | | |-GAD_ADVECTION :: Generalised advection driver (multi-dim C/\ | | | | | advection case) (see pkg/gad). C/\ | | | | |-GAD_CALC_RHS :: Calculate Advection-Diffusion tendency terms C/\ | | | | |-TIMESTEP_TRACER :: Step tracer field forward in time C/\ | | | | |-IMPLDIFF :: Solve vertical implicit diffusion equation. C/\ | | | | |-CYCLE_AB_TRACER :: Cycle time-stepping arrays for tracer field C/\ | | | | C/\ | | | |-SALT_INTEGRATE :: Step forward Prognostic Eq for Salinity. C/\ | | | | | same sequence of calls as in TEMP_INTEGRATE C/\ | | | | C/\ | | | |-PTRACERS_INTEGRATE :: Integrate other tracer(s) (see pkg/ptracers). C/\ | | | | | same sequence of calls as in TEMP_INTEGRATE C/\ | | | | |-OBCS_APPLY_PTRACER :: Open boundary package for pTracers C/\ | | | | C/\ | | | |-OBCS_APPLY_TS :: Open boundary package (see pkg/obcs ). C/\ | | | C/\ | | |-DYNAMICS :: Momentum equations driver. C/\ | | | | C/\ | | | |-CALC_GRAD_PHI_SURF :: Calculate the gradient of the surface C/\ | | | | Potential anomaly. C/\ | | | |-CALC_VISCOSITY :: Calculate net vertical viscosity C/\ | | | |-CALC_PHI_HYD :: Integrate the hydrostatic relation. C/\ | | | |-MOM_FLUXFORM :: Flux form mom eqn. package (pkg/mom_fluxform) C/\ | | | |-MOM_VECINV :: Vector invariant form mom eqn (pkg/mom_vecinv) C/\ | | | |-TIMESTEP :: Step momentum fields forward in time C/\ | | | |-OBCS_APPLY_UV :: Open boundary package (see pkg/obcs). C/\ | | | |-IMPLDIFF :: Solve vertical implicit diffusion equation. C/\ | | | |-CALC_GW :: vert. momentum tendency terms (Non-Hydrostatic) C/\ | | | C/\ | | |-UPDATE_SURF_DR :: Update the surface-level thickness fraction. C/\ | | |-UPDATE_R_STAR :: Update the level thickness fraction. C/\ | | |-UPDATE_CG2D :: Update 2d conjugate grad. for Free-Surf. C/\ | | | C/\ | | |-SOLVE_FOR_PRESSURE :: Find surface pressure. C/\ | | | |-CG2D :: Two-dim pre-con. conjugate-gradient. C/\ | | | |-CG3D :: Three-dim pre-con. conjugate-gradient solver. C/\ | | | C/\ | | |-MOMENTUM_CORRECTION_STEP :: Finalise momentum stepping C/\ | | | |-CALC_GRAD_PHI_SURF :: Return DDx and DDy of surface pressure C/\ | | | |-CORRECTION_STEP :: Pressure correction to momentum C/\ | | | |-OBCS_APPLY_UV :: Open boundary package (see pkg/obcs). C/\ | | | C/\ | | |-INTEGR_CONTINUITY :: Integrate continuity equation C/\ | | | C/\ | | |-THERMODYNAMICS :: (staggered time-stepping) C/\ | | | theta, salt + tracer equations driver. C/\ | | | C/\ | | |-TRACERS_CORRECTION_STEP :: Finalise tracer steppin: C/\ | | | apply filter, conv.adjustment C/\ | | | C/\ | | |-GCHEM_FORCING_SEP :: tracer forcing for gchem pkg (if tracer C/\ | | | dependent tendencies calculated separately) C/\ | | | C/\ | | |-DO_FIELDS_BLOCKING_EXCHANGES :: Sync up overlap regions. C/\ | | | C/\ | | |-MONITOR :: Monitor package (pkg/monitor). C/\ | | |-DO_THE_MODEL_IO :: Standard diagnostic I/O. C/\ | | | C/\ | | |-DO_WRITE_PICKUP :: Write restart files. C | | C<===|=| ************************** C<===|=| END MAIN TIMESTEPPING LOOP C<===|=| ************************** C | | C | |-COST_AVERAGESFIELDS :: time-averaged Cost function terms (see pkg/cost) C | |-PROFILES_INLOOP :: C | |-COST_FINAL :: Cost function package. (see pkg/cost) C | C |-CTRL_PACK :: Control vector support package. see pkg/ctrl C | C |-GRDCHK_MAIN :: Gradient check package. see pkg/grdchk C | C |-TIMER_PRINTALL :: Computational timing summary C | C |-COMM_STATS :: Summarise inter-proc and inter-thread communication C :: events.