Home Contact Us Site Map  
 
       
    next up previous contents
Next: 7.1.5 Dos and Donts Up: 7.1 Diagnostics-A Flexible Infrastructure Previous: 7.1.3 Key Subroutines and   Contents

Subsections


7.1.4 Usage Notes

To use the diagnostics package, other than enabling it in packages.conf and turning the usediagnostics flag in data.pkg to .TRUE., there are two further steps the user must take to enable the diagnostics package for output of quantities that are already defined in the GCM under an experiment's configuration of packages. A namelist must be supplied in the run directory called data.diagnostics, and the file DIAGNOSTICS_SIZE.h must be included in the code directory. The steps for defining a new (permanent or experiment-specific temporary) diagnostic quantity will be outlined later.

The namelist will activate a user-defined list of diagnostics quantities to be computed, specify the frequency and type of output, the number of levels, and the name of all the separate output files. A sample data.diagnostics namelist file:

# Diagnostic Package Choices
 &diagnostics\_list
  frequency(1) = 86400., 
   levels(1,1) = 1., 
   fields(1,1) = 'RSURF   ', 
   filename(1) = 'surface', 
  frequency(2) = 86400., 
   levels(1,2) = 1.,2.,3.,4.,5., 
   fields(1,2) = 'UVEL    ','VVEL    ', 
   filename(2) = 'diagout1', 
  frequency(3) = 3600., 
   fields(1,3) = 'UVEL    ','VVEL    ','PRESSURE', 
   filename(3) = 'diagout2', 
  fileflags(3) = ' P1     ', 
 &end

In this example, there are two output files that will be generated for each tile and for each output time. The first set of output files has the prefix diagout1, does time averaging every 86400. seconds, (frequency is 86400.), and will write fields which are multiple-level fields at output levels 1-5. The names of diagnostics quantities are UVEL and VVEL. The second set of output files has the prefix diagout2, does time averaging every 3600. seconds, includes fields which are multiple-level fields, levels output are 1-5, and the names of diagnostics quantities are THETA and SALT.

The user must assure that enough computer memory is allocated for the diagnostics and the output streams selected for a particular experiment. This is acomplished by modifying the file DIAGNOSTICS_SIZE.h and including it in the experiment code directory. The parameters that should be checked are called numdiags, numlists, numperlist, and diagSt_size.

numdiags (and diagSt_size):
All GCM diagnostic quantities are stored in the single diagnostic array QDIAG which is located in the file
pkg/diagnostics/DIAGNOSTICS.h.
and has the form:

      common /diagnostics/
     &     qdiag(1-Olx,sNx+Olx,1-Olx,sNx+Olx,numdiags,Nsx,Nsy)
The first two-dimensions of qdiag correspond to the horizontal dimension of a given diagnostic, and the third dimension of qdiag is used to identify diagnostic fields and levels combined. In order to minimize the memory requirement of the model for diagnostics, the default GCM executable is compiled with room for only one horizontal diagnostic array, or with numdiags set to Nr. In order for the User to enable more than 1 three-dimensional diagnostic, the size of the diagnostics common must be expanded to accomodate the desired diagnostics. This can be accomplished by manually changing the parameter numdiags in the file pkg/diagnostics/DIAGNOSTICS_SIZE.h. numdiags should be set greater than or equal to the sum of all the diagnostics activated for output each multiplied by the number of levels defined for that diagnostic quantity. For the above example, there are 4 multiple level fields, which the diagnostics menu (see below) indicates are defined at the GCM vertical resolution, Nr. The value of numdiag in DIAGNOSTICS_SIZE.h would therefore be equal to 4*Nr, or, say 40 if $ Nr=10$ .

numlists and numperlist:
The parameter numlists must be set greater than or equal to the number of separate output streams that the user specifies in the namelist file data.diagnostics. The parameter numperlist corresponds to the number of diagnostics requested in each output stream.

In order to define and include as part of the diagnostic output any field that is desired for a particular experiment, two steps must be taken. The first is to enable the ``User Diagnostic'' in data.diagnostics. This is accomplished by adding one of the ``User Diagnostic'' field names (UDIAG1 through UDIAG10, for multi-level fields, or SDIAG1 through SDIAG10 for single level fields) to the data.diagnostics namelist in one of the output streams. These fields are listed in the diagnostics menu. The second step is to add a call to diagnostics_fill from the subroutine in which the quantity desired for diagnostic output is computed.

In order to add a new diagnostic to the permanent set of diagnostics that the main model or any package contains as part of its diagnostics menu, the subroutine diagnostics_add2list should be called during the initialization phase of the main model or package. For the main model, the call should be made from subroutine diagnostics_main_init, and for a package, the call should probably be made from somewhere in the packages_init_fixed sequence (probaby from inside the particular package's init_fixed routine). A typical code sequence to set the input arguments to diagnostics_add2list would look like:

      diagName  = 'THETA   '
      diagTitle = 'Potential Temperature (degC,K)'
      diagUnits = 'Degrees K       '
      diagCode  = 'SM      MR      '
      CALL DIAGNOSTICS\_ADD2LIST( diagNum,
     I          diagName, diagCode, diagUnits, diagTitle, myThid )

If the new diagnostic quantity is associated with either a vector pair or a diagnostic counter, the diagCode argument must be filled with the proper index for the ``mate''. The output argument from diagnostics_add2list that is called diagNum here contains a running total of the number of diagnostics defined in the code up to any point during the run. The sequence number for the next two diagnostics defined (the two components of the vector pair, for instance) will be diagNum+1 and diagNum+2. The definition of the first component of the vector pair must fill the ``mate'' segment of the diagCode as diagnostic number diagNum+2. Since the subroutine increments diagNum, the definition of the second component of the vector fills the ``mate'' part of diagCode with diagNum. A code sequence for this case would look like:

      diagName  = 'UVEL    ' 
      diagTitle = 'Zonal Velocity                ' 
      diagUnits = 'm / sec         ' 
      diagCode  = 'SM      MR      ' 
      write(diagCode,'(A,I3.3,A)') 'VV   ', diagNum+2 ,'MR      ' 
      call diagnostics\_add2list( diagNum, 
     I          diagName, diagCode, diagUnits, diagTitle, myThid ) 
      diagName  = 'VVEL    ' 
      diagTitle = 'Meridional Velocity           ' 
      diagUnits = 'm / sec         ' 
      diagCode  = 'SM      MR      ' 
      write(diagCode,'(A,I3.3,A)') 'VV   ', diagNum ,'MR      ' 
      call diagnostics\_add2list( diagNum, 
     I          diagName, diagCode, diagUnits, diagTitle, myThid )

7.1.4.0.1 MITgcm Kernel Diagnostic Menu:


NAME UNITS LEVELS DESCRIPTION
       
UVEL $ m/sec$ Nr
U-Velocity
VVEL $ m/sec$ Nr
V-Velocity
UVEL_k2 $ m/sec$ 1
U-Velocity
VVEL_k2 $ m/sec$ 1
V-Velocity
WVEL $ m/sec$ Nr
Vertical-Velocity
THETASQ $ deg^2$ Nr
Square of Potential Temperature
SALTSQ $ g^2/{kg}^2$ Nr
Square of Salt (or Water Vapor Mixing Ratio)
SALTSQan $ g^2/{kg}^2$ Nr
Square of Salt anomaly (=SALT-35)
UVELSQ $ m^2/sec^2$ Nr
Square of U-Velocity
VVELSQ $ m^2/sec^2$ Nr
Square of V-Velocity
WVELSQ $ m^2/sec^2$ Nr
Square of Vertical-Velocity
UV_VEL_C $ m^2/sec^2$ Nr
Meridional Transport of Zonal Momentum (cell center)
UV_VEL_Z $ m^2/sec^2$ Nr
Meridional Transport of Zonal Momentum (corner)
WU_VEL $ m^2/sec^2$ Nr
Vertical Transport of Zonal Momentum (cell center)
WV_VEL $ m^2/sec^2$ Nr
Vertical Transport of Meridional Momentum (cell center)
UVELMASS $ m/sec$ Nr
Zonal Mass-Weighted Component of Velocity
VVELMASS $ m/sec$ Nr
Meridional Mass-Weighted Component of Velocity
WVELMASS $ m/sec$ Nr
Vertical Mass-Weighted Component of Velocity
UTHMASS $ m-deg/sec$ Nr
Zonal Mass-Weight Transp of Pot Temp
VTHMASS $ m-deg/sec$ Nr
Meridional Mass-Weight Transp of Pot Temp
WTHMASS $ m-deg/sec$ Nr
Vertical Mass-Weight Transp of Pot Temp
ETAN $ (hPa,m)$ 1
Perturbation of Surface (pressure, height)
ETANSQ $ (hPa^2,m^2)$ 1
Square of Perturbation of Surface (pressure, height)
DETADT2 $ {r-unit}^2/s^2$ 1
Square of Eta (Surf.P,SSH) Tendency
THETA $ deg K$ Nr
Potential Temperature
SST $ deg K$ 1
Sea Surface Temperature
SALT $ g/kg$ Nr
Salt (or Water Vapor Mixing Ratio)
SSS $ g/kg$ 1
Sea Surface Salinity
SALTanom $ g/kg$ Nr
Salt anomaly (=SALT-35)













NAME UNITS LEVELS DESCRIPTION
       
USLTMASS $ m-kg/sec-kg$ Nr
Zonal Mass-Weight Transp of Salt (or W.Vap Mix Rat.)
VSLTMASS $ m-kg/sec-kg$ Nr
Meridional Mass-Weight Transp of Salt (or W.Vap Mix Rat.)
WSLTMASS $ m-kg/sec-kg$ Nr
Vertical Mass-Weight Transp of Salt (or W.Vap Mix Rat.)
UVELTH $ m-deg/sec$ Nr
Zonal Transp of Pot Temp
VVELTH $ m-deg/sec$ Nr
Meridional Transp of Pot Temp
WVELTH $ m-deg/sec$ Nr
Vertical Transp of Pot Temp
UVELSLT $ m-kg/sec-kg$ Nr
Zonal Transp of Salt (or W.Vap Mix Rat.)
VVELSLT $ m-kg/sec-kg$ Nr
Meridional Transp of Salt (or W.Vap Mix Rat.)
WVELSLT $ m-kg/sec-kg$ Nr
Vertical Transp of Salt (or W.Vap Mix Rat.)
RHOAnoma $ kg/m^3$ Nr
Density Anomaly (=Rho-rhoConst)
RHOANOSQ $ kg^2/m^6$ Nr
Square of Density Anomaly (=(Rho-rhoConst))
URHOMASS $ kg/m^2/s$ Nr
Zonal Transport of Density
VRHOMASS $ kg/m^2/s$ Nr
Meridional Transport of Density
WRHOMASS $ kg/m^2/s$ Nr
Vertical Transport of Potential Density
PHIHYD $ m^2/s^2 $ Nr
Hydrostatic (ocean) pressure / (atmos) geo-Potential
PHIHYDSQ $ m^4/s^4 $ Nr
Square of Hyd. (ocean) press / (atmos) geoPotential
PHIBOT $ m^2/s^2 $ Nr
ocean bottom pressure / top. atmos geo-Potential
PHIBOTSQ $ m^4/s^4 $ Nr
Square of ocean bottom pressure / top. geo-Potential
DRHODR $ kg/m^3/{r-unit}$ Nr
Stratification: d.Sigma/dr
VISCA4 $ m^4/sec$ 1
Biharmonic Viscosity Coefficient
VISCAH $ m^2/sec$ 1
Harmonic Viscosity Coefficient
TAUX $ N/m^2$ 1
zonal surface wind stress, >0 increases uVel
TAUY $ N/m^2$ 1
meridional surf. wind stress, >0 increases vVel
TFLUX $ W/m^2$ 1
net surface heat flux, >0 increases theta
TRELAX $ W/m^2$ 1
surface temperature relaxation, >0 increases theta
TICE $ W/m^2$ 1
heat from melt/freeze of sea-ice, >0 increases theta
SFLUX $ g/m^2/s $ 1
net surface salt flux, >0 increases salt
SRELAX $ g/m^2/s $ 1
surface salinity relaxation, >0 increases salt
PRESSURE $ Pa $ Nr
Atmospheric Pressure (Pa)













NAME UNITS LEVELS DESCRIPTION
       
ADVr_TH $ K.Pa.m^2/s $ Nr
Vertical Advective Flux of Pot.Temperature
ADVx_TH $ K.Pa.m^2/s $ Nr
Zonal Advective Flux of Pot.Temperature
ADVy_TH $ K.Pa.m^2/s $ Nr
Meridional Advective Flux of Pot.Temperature
DFrE_TH $ K.Pa.m^2/s $ Nr
Vertical Diffusive Flux of Pot.Temperature (Explicit part)
DIFx_TH $ K.Pa.m^2/s $ Nr
Zonal Diffusive Flux of Pot.Temperature
DIFy_TH $ K.Pa.m^2/s $ Nr
Meridional Diffusive Flux of Pot.Temperature
DFrI_TH $ K.Pa.m^2/s $ Nr
Vertical Diffusive Flux of Pot.Temperature (Implicit part)
ADVr_SLT $ g/kg.Pa.m^2/s$ Nr
Vertical Advective Flux of Water-Vapor
ADVx_SLT $ g/kg.Pa.m^2/s$ Nr
Zonal Advective Flux of Water-Vapor
ADVy_SLT $ g/kg.Pa.m^2/s$ Nr
Meridional Advective Flux of Water-Vapor
DFrE_SLT $ g/kg.Pa.m^2/s$ Nr
Vertical Diffusive Flux of Water-Vapor (Explicit part)
DIFx_SLT $ g/kg.Pa.m^2/s$ Nr
Zonal Diffusive Flux of Water-Vapor
DIFy_SLT $ g/kg.Pa.m^2/s$ Nr
Meridional Diffusive Flux of Water-Vapor
DFrI_SLT $ g/kg.Pa.m^2/s$ Nr
Vertical Diffusive Flux of Water-Vapor (Implicit part)













NAME UNITS LEVELS DESCRIPTION
       
SDIAG1   1
User-Defined Surface Diagnostic-1
SDIAG2   1
User-Defined Surface Diagnostic-2
SDIAG3   1
User-Defined Surface Diagnostic-3
SDIAG4   1
User-Defined Surface Diagnostic-4
SDIAG5   1
User-Defined Surface Diagnostic-5
SDIAG6   1
User-Defined Surface Diagnostic-6
SDIAG7   1
User-Defined Surface Diagnostic-7
SDIAG8   1
User-Defined Surface Diagnostic-8
SDIAG9   1
User-Defined Surface Diagnostic-9
SDIAG10   1
User-Defined Surface Diagnostic-1-
SDIAGC   1
User-Defined Counted Surface Diagnostic
SDIAGCC   1
User-Defined Counted Surface Diagnostic Counter
UDIAG1   Nrphys
User-Defined Upper-Air Diagnostic-1
UDIAG2   Nrphys
User-Defined Upper-Air Diagnostic-2
UDIAG3   Nrphys
User-Defined Multi-Level Diagnostic-3
UDIAG4   Nrphys
User-Defined Multi-Level Diagnostic-4
UDIAG5   Nrphys
User-Defined Multi-Level Diagnostic-5
UDIAG6   Nrphys
User-Defined Multi-Level Diagnostic-6
UDIAG7   Nrphys
User-Defined Multi-Level Diagnostic-7
UDIAG8   Nrphys
User-Defined Multi-Level Diagnostic-8
UDIAG9   Nrphys
User-Defined Multi-Level Diagnostic-9
UDIAG10   Nrphys
User-Defined Multi-Level Diagnostic-10











For a list of the diagnostic fields available in the different MITgcm packages, follow the link to the diagnostics menu in the manual section describing the package:


next up previous contents
Next: 7.1.5 Dos and Donts Up: 7.1 Diagnostics-A Flexible Infrastructure Previous: 7.1.3 Key Subroutines and   Contents
mitgcm-support@mitgcm.org
Copyright © 2006 Massachusetts Institute of Technology Last update 2011-01-09