Pre- and post-processing scripts
Usually one can use the scripts from the environment. This is
always the official (closed) version.
But you might also want to ask either Bernard Dugas
(Bernard.Dugas@ec.gc.ca) or Katja Winger (Katja.Winger@ec.gc.ca) if
there is a newer updated version of the scripts.
There are two types of scripts:
- version-dependent, that change with model versions (found in
${gemclim}/scripts/*) and
- version-invariant, that do not change (found in
${ARMNLIB}/scripts/Climat_*)
In case you want to modify and use some of these scripts you must
put your (modified) copies
of any version-dependent scripts into your
'~/modeles/GEMCLIM/v_3.3.0/scripts' directory and
any version-invariant scripts into the '~/ovbin' directory.
After having created the directory '~/modeles/GEMCLIM/v_3.3.0/scripts'
you need to reset the model environment again so that this directory gets
added to your 'PATH'!
In climate mode, the pre- and post-processing
are going to use several extra scripts which will never be used in non-
climate mode GEM. The names for all of these scripts start with
'Climat_...'.
Furthermore, some of the "normal" non-climate scripts may work
differently in
climate mode.
You can find here
Calling sequences for the
GEM/GEMCLIM models, scripts and jobs
Given is the script name, if it gets called or submitted and on which
machine it runs. Note that in the following, ${launch_mach} is where
the model was started, ${mach}
is where the model was
run, ${arch_mach}
is
where the archives are to be stored and ${dest_mach}
is the main
post-processing machine. Finally, ${lehost} stands for the main
front-end that is used here to handle most of the actual job
submissions and file transfers (defaults to pollux at CMC/RPN).
Pre processing and model run
Post processing in non-climate mode
Post processing in climate mode
Pre processing and model run
List of scripts in alphabetical
order
Scripts starting with
"Climat_" are only used when the
model
is
running in climate mode. All other scripts are used in both climate and
non-climate modes, unless
noted otherwise.
Climat_archive_pilot
Is put in the delayed_jobs directory and submitted by pilot_job.
Runs on ${arch_mach}.
- Archives pilot information files. Usually one file per
month; if
the
total volume is greater than 2GByte, a second, third, ... file will be
created.
Position
in flowchart
Climat_beta
Is called from Climat_lancer_diag.
Runs on ${dest_mach}.
- Calculates GJB's beta field.
Position
in flowchart
Climat_check_rdiag
Is called from Climat_strip_phy. Runs
on ${dest_mach}.
- Checks the r.diag
version number (as defined by the ${RDIAG} environment variable) and
compares it to
${minimal_rdiag_version}
(the r.diag version that is needed to do specific calculations, i.e. rotate,
during the post processing).
Position
in flowchart
Climat_diag
Is called from Climat_lancer_diag
and
Climat_diag_phy. Runs on ${dest_mach}.
1. Position
in flowchart 2. Position
in flowchart 3. Position
in flowchart
Climat_diag_phy
Is called from Climat_lancer_diag.
Runs on ${dest_mach}.
- Takes care of the creation of means and variances of
2-D variables
from
the physics.
- It sorts the variables in accumulators, non accumulators
and
multi
level variables.
- To create the means and variances of the accumulators it
calls 'Climat_surfacc_mean'.
- For the creation of the means and variances of the non
accumulators
and multi level variables it calls 'Climat_diag'.
- At the end it calls 'Climat_mv2cfs'
to
transfer the files in an archive.
Position
in flowchart
Climat_eta2preshyb
Is called from Climat_prepare_job
and Climat_strip_phy.
Runs on launching machine and ${dest_mach}, respectively.
- Sets all variables depending on the ${etaname} vertical
configuration name.
1. Position
in flowchart 2. Position
in flowchart
Climat_get_grtyp
Is called from Climat_diag, Climat_make_zonaux and Climat_surfacc_mean. Runs on
${dest_mach}.
- Determines the grid type of a standard file.
1. Position
in flowchart
2. Position
in flowchart
Climat_lancer_diag
Is called from diag-job.
Runs on ${dest_mach}.
- Produces a full set of diagnostics,
following WCRP and AMIP2 guidelines including:
- Monthly means
- Monthly zonal means
- Time variances
- Time covariances
- zonal rms of monthly means and variances
- 0-D (global averages) and 2-D time series
Position
in flowchart
Climat_launch_next_interval.sh
Is called from the model job which got created by Um_launch.
Runs on ${mach}.
Position
in flowchart
Climat_make_covar
Is called from Climat_diag.
Runs on ${dest_mach}.
- Calculates covariances over time supposing the time mean
already
exist.
Position
in flowchart
Climat_make_gaussien
Is called from Climat_strip_phy.
Runs on ${dest_mach}.
Runs on ${dest_mach}.
- Converts GEM-native Z-type grids into gaussian grids
when ${gaussout}
is set
Position
in flowchart
Climat_make_mean
Is called from Climat_diag.
Runs on ${dest_mach}.
- Calculates means and variances over time.
Position
in flowchart
Climat_make_zonaux
Is called from Climat_diag.
Runs on ${dest_mach}.
- Calculates zonal means and variances.
- If requires it also creates zonal plots as metacod-files.
Position
in flowchart
Climat_mdpr_clean
Is called from Climat_lancer_diag
after the diagnostics
have been done 1) if archiving
is requested and 2) if the interval between time samples is less than and is a subset of
12 hours.
Each call 'removes' every second md- and pr-file, correctly accounting
for
variables that are accumulations, averages, minima or maxima. More than
one
call to this script may be required to reduce the final sampling
interval
to 12 hours in the archives. Runs on ${dest_mach}.
A more detailed description of the way
this
procedure actually works can be found here.
Position
in flowchart
Climat_multi_diag
This script is not part of the automatic pre or post processing.
It can be called after the diagnostics
have been done.
- Creates inter- and intra-annual statistics from the relevant
monthly means.
Climat_mv2cfs
Is called from Climat_diag,
Climat_diag_phy and Climat_lancer_diag.
Runs on ${dest_mach}.
- Archives files (using cmcarc) with the same prefix and
transfers
them
to another machine.
1. Position
in flowchart
2. Position
in flowchart 3. Position
in flowchart 4. Position
in flowchart
Climat_post_processing
Is called from the post_job.
Runs on ${dest_mach}
Position
in flowchart
Climat_prepare_job
Is called from 'Um_launch'.
Runs on ${launch_mach}, the machine on which the experiment was
launched.
Prepares
the configuration files for Climate mode processing.
- Calls Climat_var_test
- Creates 'outcfg.out' for first job
- Checks if ${startdate}, ${enddate}, and ${interval}
are correct
- Calculates climatic date objective for first job
- Updates 'configexp.dot.cfg', 'gemclim_settings.nml', and
'outcfg.out'.
- In 'configexp.dot.cfg': exp, step_total, lam_nest_exp
- In 'gemclim_settings.nml': Mod_runstrt_S, Pil_jobstrt_S,
Pil_jobend_S, Step_total,
Step_rsti,
Step_cleanup
- In 'outcfg.out': steps
- Updates 'gemclim_settings.nml' according to ${etaname}
- Creates hybrid levels: hyb
- Sets pressure at model top: Pres_ptop
- Creates radiation levels: RADNIVL
- Updates fularch
- Sets variables for next job
- Calculates 'anal_step' from 'save_anal' to save an analysis
file
- Sets/Updates all 'Pil_' variables needed for LAM
Position
in flowchart
Climat_rotate_vectors
Is called from Climat_strip_phy. Runs
on ${dest_mach}.
- Rotates vectors fields in a file. Other fields are not
touched.
I.e.
it transforms the wind in a rotated grid from x-,y-components into
lat-,lon-components.
Position
in flowchart
Climat_save_analysis
Is called from back_job.
Runs on ${mach}.
- Separates records needed for creation of an analysis file.
- Converts the variable name "GY" to "LG" and every IP1 level
descriptors to
the old
style
(1989) format.
- creates and submits anal_job.
Position
in flowchart
Climat_save_listings
Is called by the post-processing job that finishes last. This can be
the
last post_job
or, if no diagnostics are required, the last diag_job.
Runs on ${dest_mach}.
Position
in flowchart
Climat_save_pilot
Is called from pilot_job.
Runs on ${dest_mach}.
- Extracts nesting informations from the model output.
- Converts names and units.
Position
in flowchart
Climat_save_restarts
Is called at the end of a model job interval
either from Climat_post_processing
or from Climat_launch_next_interval.sh (when a continuing job is
submitted).
Runs on ${mach}and ${launch_mach}, respectively
Position #1
in flowchart Position
#2 in flowchart
Climat_series_temporelles
Is called from Climat_lancer_diag.
Runs on ${dest_mach}.
- Extracts some of the time series required by the AMIP2 protocol.
At this time, this means
the following fields:
P0, PN, T5 (1 sg), T9 (1 sg), AR, PR,
UU (200+850 hPa, 1 sg),
VV (200+850 hPa, 1 sg), GZ (500 hPa),
TT (1 sg),
HU (1 sg)
Position
in flowchart
Climat_strip_phy
Is called from rassemble_job.
Runs on ${dest_mach}.
- Re-organizes the GEMDM dynamic (dm- and dp-) and physic
(pm-)
output
files. At every sample time, multi-level physic variables on model
levels are
interpolated
to the same pressure levels as are used for the dynamic output and
written
to a pr- file, along with the content of the dp- file. All other pm-
and
dm- (single-) model-level variables are written to a md- file. Note
that all multi-level variables defined on ARBITRARY levels (eg.
accounting for different surface types or soil levels) such as the
surface albedo AL and the soil temperatures I0 are also written to
the md- file.
Position
in flowchart
Climat_surfacc_mean
Is called from Climat_diag_phy. Runs on
${dest_mach}.
- Creates temporal means and variances of 2D fields of
accumulators.
- If required it also creates plots as metacod-files.
Position
in flowchart
Climat_var_test
Is called from Climat_prepare_job.
Runs on ${launch_mach}, the machine on which the experiment was
launched.
Verifies that
several variables are set correctly.
Position
in flowchart
Climat_xfer
Is called from Um_xfer.sh.
Runs on ${mach}.
- Creates up to three jobs as needed:
- back_job:
- Saves analysis file from output
- Saves files for nesting information
- xfer_job:
- Does transfer of dm-, dp-, pm-files when
post-processing
is
not done on ${mach}
- post_job:
- Moves dm-, dp-, pm-files when post-processing is
done on
${mach}
- Launches Climat_post_processing
- Then these jobs get submitted, the first one directly, the
others
at
the end of the previous job.
i.e.: back_job gets submitted directly. When it finishes, back_job
submits
xfer_job, which itself submits post_job when it ends. Alternatively, if
back_job
is not needed, xfer_job gets submitted directly; or if xfer_job is not
needed, back_job and post_job get concatenated and submitted directly...
Position
in flowchart
Climat_xfer_pilot
Is called from Climat_post_processing.
Runs on ${dest_mach}
- Creates and submits a job which transfers pilot information files
from ${mach} to
${pil_mach} to ${lehost}.
- This created and submitted job then creates and submits a job
which calls Climat_archive_pilot
to
${pil_mach}.
Position
in flowchart
Um_delam
Is called from Um_xfer.sh resp. Climat_xfer. Runs on ${mach}.
This script is only needed for model versions 3.1.2 and older.
- Takes care of the conversion from slab-files into standard
files
by
calling delam.
Position
in flowchart
Um_launch
Main script to launch the model. Runs on ${mach} resp. ${launch_mach}
- Takes care of the preparation of the environment by calling Um_preprep, Um_loadbin
and Um_shipstuff.
- Creates the jobs to launch the entry
and the model and then
launches
the entry job.
- In climate mode it also takes care of the preparation and
checking
of the "climate environment" by calling Climat_prepare_job.
Position in flowchart
Um_loadbin
Is called from Um_launch. Runs on ${mach}
resp. ${launch_mach}
- Compiles and loads the absolutes if necessary.
- Copies/Links them into $EXECDIR.
Position
in flowchart
Um_maindriver.sh
Is called from the entry and the model job created in Um_launch. Runs on ${mach} resp. ${launch_mach}.
- Launches the entry by calling Um_runent.sh
resp. the model by calling Um_runent.sh.
- After the model has finished it also does some clean up
in
$REPRUN.
1. Position in
flowchart 2. Position
in flowchart
Um_preprep
Is called from Um_launch. Runs on ${mach}
resp. ${launch_mach}.
Position
in flowchart
Um_runent.sh
Is called from Um_maindriver.sh.
This script is the main entry script.
It usually runs on ${mach},
except in LAM-Climate mode when it runs on ${launch_mach}, the
launching machine.
- It copies all files needed to run the model in the
appropriate
directory.
These files are 'gemclim_settings.nml', the analysis file, the file
with
the geophysical
fields, the climatology file and the model job created by Um_launch.
- It checks if the analysis file contains the right fields at
the
right
time step.
- Then it launches the model entry absolute,
main${MODEL}ntr_${ARCH}_${MODEL_VERSION}.Abs.
- When the model is run in LAM mode this absolute
also
creates
the bm-files, the bitmap-files containing the nesting informations.
- In LAM climate mode it also:
- Copies files needed by the entry from ${mach}
to launching machine
- Unpacks pilot information for the whole interval
- Transfers the fully or partially interpolaterd pilot
files to
${mach}
Position
in flowchart
Um_runmod.sh
Is called from Um_maindriver.sh. Runs
on ${mach}.
This script is the main model script.
- It links a few files like model_settings, output_settings,
imclima
and imanclima.
- It creates the directory $REPRUN and if the model is not
run in
restart
mode a subdirectory for each MPI processes.
- It then links other need files into the 00-00 process directory.
- Finally it launches the main model absolute,
main${MODEL}dm_${ARCH}_${MODEL_VERSION}.Abs.
- After this absolute has finished the script cleans up the
environment
and
moves
the output files into $EXECDIR/output.
Position
in flowchart
Um_shipstuff
Is called from Um_launch. Runs on ${mach}
resp. ${launch_mach}.
This script updates the content of ${EXECDIR} on ${MACH}.
- First it cleans up $EXECDIR of old, no longer needed files.
- Then it copies (ships) certain files for the actual job into
$EXECDIR, eg. the
configuration files, '${MODEL}_settings.nml' and 'outcfg.out'
as
well as *.sh, constantes, ozoclim* and irtab5_*.
- If the model is run in restart mode it retreives the restart
files
from
the previous job. In climate mode it will also removes the
previous job's bm-files (possibly carried on by the retreival process).
Position
in flowchart
Um_xfer
Is called from Um_xfer_prep.sh. Runs on
${mach}. It is only
used
in non-climate mode.
- Tranfers the model output using Um_xfer_rsync
to ${dest_mach} and if required the model listing.
- Submits a tailjob if required.
Position
in flowchart
Um_xfer.sh
Is called either at the end of a model clone subjob from Um_launch
or from the model at run-time to do a "cleanup". Runs on ${mach}.
- In climate mode it moves the output-files from the
process-directory
into the output-directory
- It moves the output-files (again) in the directory
'last_step${endstep}'
- In non-climate mode it
then
creates and submits a job which does delamineur by calling Um_delam and starts the transfer of the ouput
files
by calling Um_xfer_prep.sh.
- In climate mode it
calls Climat_xfer
to start the climate post processing.
Position
in flowchart
Um_xfer_cpac
This script is not called anymore. It was last called in version 3.1.0.
There
it was called by Um_xfer resp. Climat_xfer.
Um_xfer_mach
Is called from Um_xfer. Runs on ${mach}. It is
only used in non-climate mode.
- Checks if the two remote systems src_mach and dest_mach are
available.
Position
in flowchart
Um_xfer_mvf
This script is not called anymore. It was last called in version 3.1.0.
There
it was called by Um_xfer
resp. Climat_xfer.
Um_xfer_prep.sh
Is called from from a job created and submitted by Um_xfer.sh
but only in non-climate mode.
Runs on ${mach}.
- This script takes care of the reassemblage of the output
files
from
the different processors by calling d2z.
- It takes care of the time series files 'time_series.bin'.
- It assembles dynamics and physics output if required.
- It creates and submits a job to do the actual transfer.
This last job calls Um_xfer.
Position
in flowchart
Um_xfer_rsync
Is called from Climat_post_processing,
Climat_save_listings, Climat_save_pilot, Climat_xfer
and Um_xfer.
- Transfers directory contents from one machine to another using
rsync.
1. Position
in flowchart
2. Position in flowchart
3.
Position in flowchart
4.+5. Position in flowchart
d2z
Is called from Um_xfer_prep.sh resp. Climat_post_processing. Runs on
${mach}.
- This script reassembles the output files from the different
processors
into one file.
1. Position
in flowchart
2. Position
in flowchart
delam
Is called from Um_delam. Runs on ${mach}. Is
only used for version 3.1.2 and older.
- This script converts files that were written slab-wise to
ones that contain regular 2- and 3-D records.
List of jobs in alphabetical order
The following jobs are created by the scripts, although most of the
jobs are only created and used in climate
mode,
they are indicated with *.
Jobs only created and used in non-climate
mode are indicated with *.
For each
pre- and post-processing, new jobs get created. In climate mode, at the
end of each model job interval,
when the
diagnostics get saved, the code of these "post-processing jobs" is
packed in a zip-file called 'jobs_${exp}.zip' and this archive is
saved in the same directory as the diagnostics, namely ${arch_mach}:${arch_dir}
anal_job *
Is created and submitted from Climat_save_analysis.
Runs on ${lehost}.
- Transfers analysis file from ${mach} to ${arch_mach}
Position
in flowchart
archfer_job *
Is created and submitted from diag_job.
Runs
on ${lehost}.
- Transfers the diagnostics to ${arch_mach}
Position
in flowchart
back_job *
Is created and submitted from Climat_xfer.
Runs on ${mach}.
===>
See flux
diagram
for calling sequence of
back_job, xfer_job, and post_job! <===
Position
in flowchart
continue_with_next_job *
Is created and submitted from Climat_launch_next_interval.sh.
Runs on ${launch_mach}, the machine on which the first model job got
launched.
- Launches the next job of the model by calling typically Um_launch
- Calls Climat_save_restarts
to start the archiving of the restart file, if required
Position
in flowchart
d2z_job *
Is created from Climat_post_processing
and called from the post_processing_job.
Runs on 1, 2, 4 or 8 cpu's. Runs on ${dest_mach}.
- Does 'd2z' (converting partial-domain tile-specific #-type grids
to full-domain
Z-type grids)
Position
in flowchart
diag_job *
Is created from Climat_post_processing
and submitted from the rassemble_job.
Runs on 1, 2, 4 or 8 cpu's. Runs
on ${dest_mach}.
Position
in flowchart
entry-job: ${_job}_${exp}_E
Is created and submitted from Um_launch. Runs
on ${mach} except for LAM-Climate mode where it runs on
${launch_mach}, the machine from which the model was launched.
- Exports several variables
- Creates ${EXECDIR} resp. the working directory for LAM-Climate
mode
- Calls Um_maindriver.sh which
than executes the entry model
- Calls soumet_la_job which than
submits the model
Position
in flowchart
file-transfer job: ${_job}_${exp}_FT_${endstep}
Is created and submitted from Um_xfer_prep.sh.
Runs
on ${lehost}.
- Calls Um_xfer to start the file transfer
Position
in flowchart
model-job: ${_job}_${exp}_M
Is created from Um_launch
and submitted from soumet_la_job. Runs on
${mach}.
Position
in flowchart
pil_job *
Is created and submitted from Climat_xfer_pilot.
Runs
on ${lehost}.
- Transfers pilot files to ${pil_mach}
- Creates and submits job which calls Climat_archive_pilot
Position
in flowchart
pilot_job *
Is created from Climat_post_processing
and called from the post_processing_job.
Runs on 1, 2, 4 or 8 cpu's. Runs
on ${dest_mach}.
Position
in flowchart
post_job *
Is created from Climat_xfer
and submitted or called (depending if it will be a long job or not)
from xfer_job
or directly from Climat_xfer.
Runs on ${dest_mach}.
===>
See flux
diagram
for calling sequence of
back_job, xfer_job, and post_job! <===
Position
in flowchart
post_processing_job *
Is created and submitted from Climat_post_processing.
Runs on 1,2 ,4 or 8 cpu's. Runs on ${dest_mach}.
Position
in flowchart
preclimdiagpr_job *
Is created and called from Climat_lancer_diag.
Runs on 1, 2, 4 or 8 cpu's.
Runs on ${dest_mach}.
- Re-organizes the multiple-variable individual-sample pr-files
into a much smaller set of variable-specific files, each containing a
large fraction of all samples. These variable-specific files are
then used by the latter diagnostic steps called by the parent script.
Each cpu used here will produce one file per variable. The number
of cpus this step will use is partly determined by the number of total
model samples.
Position
in flowchart
prepare-file-transfer job: ${_job}_${exp}_PREPFT_${endstep}
*
Is created and submitted from Um_xfer.sh.
Runs on ${mach}.
Position
in flowchart
rassemble_job *
Is created from Climat_post_processing
and called from the post_processing_job.
Runs on 1, 2, 4 or 8 cpu's. Runs on ${dest_mach}.
- Creates high- and coarse-resolution versions of output
files if
required
- calls Climat_strip_phy
Position
in flowchart
save_listings_job *
Is created and submitted from Climat_save_listings.
Runs on ${lehost}.
- Transfers and archives all listings to ${list_mach}
save_job *
Is created and submitted from Climat_save_restarts.
Runs on ${lehost}.
- Archives most of the content of ${EXECDIR}on ${mach} as a
restart
backup
- Transfers archived restart to ${arch_mach}
1. Position
in flowchart 2. Position
in flowchart
soumet_la_job
Is created from Um_launch and called from the
entry job. Runs on ${mach}.
Position
in flowchart
xfer_job *
Is created from Climat_xfer
and submitted
from back_job
or directly from Climat_xfer.
Runs on ${lehost}.
- Does transfer of dm-, dp-, pm-files if post-processing is
not
done on ${mach}
- Submits post_job
===>
See flux
diagram
for calling sequence of
back_job, xfer_job, and post_job! <===
Position
in flowchart
* Jobs only created and
used in climate mode
* Jobs only created and
used in non-climate mode
Author: Katja Winger
Last update: June 2006