GEOS-5 Quick Start: Difference between revisions

No edit summary
No edit summary
Line 3: Line 3:
== Checking Out and Compiling GEOS-5 ==
== Checking Out and Compiling GEOS-5 ==


The following assumes that you know your way around Unix, have successfully logged into your NCCS account (presumably on the '''discover''' cluster) and have an account on '''sourcemotel'''.  The commands below assume that your shell is ''csh''.  Since the scripts to build and run GEOS-5  tend to be written in the same, you shouldn't bother trying to import too much into an alternative shell.  If you prefer a different shell, it is easiest just to open a ''csh'' process to build the model and your experiment.
The following assumes that you know your way around Unix, have successfully logged into your NCCS account (presumably on the '''discover''' cluster) and have an account on '''sourcemotel'''.  The commands below assume that your shell is <code>csh</code>.  Since the scripts to build and run GEOS-5  tend to be written in the same, you shouldn't bother trying to import too much into an alternative shell.  If you prefer a different shell, it is easiest just to open a <code>csh</code> process to build the model and your experiment.


Set the following three environment variables:
Set the following three environment variables:
Line 15: Line 15:
  cvs co -r  Fortuna-1_4  Fortuna
  cvs co -r  Fortuna-1_4  Fortuna


This should check out the latest stable version of the model from '''sourcemotel''' and create a directory called <code>GEOSagcm</code>.  ''cd'' into ''GEOSagcm/src'' and ''source'' the file called ''g5_modules'':
This should check out the latest stable version of the model from '''sourcemotel''' and create a directory called <code>GEOSagcm</code>.  <code>cd</code> into <code>GEOSagcm/src</code> and <code>source</code> the file called <code>g5_modules</code>:


  source g5_modules
  source g5_modules
Line 38: Line 38:
Setting up to run:
Setting up to run:


From the  ''GEOSagcm/src/Applications/GEOSgcm_App'' directory, we run:
From the  <code>GEOSagcm/src/Applications/GEOSgcm_App</code> directory, we run:


  gcm_setup
  gcm_setup


The ''gcm_setup'' script asks you a few questions such as an experiment name (with no spaces, called EXPID) and description (spaces ok).  It will also ask you for the model resolution, expecting the lat-lon domain size, the dimensions separated by a space.  For you first time out you will probably want to enter <code>144 91</code>.
The <code>gcm_setup</code> script asks you a few questions such as an experiment name (with no spaces, called EXPID) and description (spaces ok).  It will also ask you for the model resolution, expecting the lat-lon domain size, the dimensions separated by a space.  For you first time out you will probably want to enter <code>144 91</code>.


The rest of the questions provide defaults which will be suitable for now, so just press enter for these.  The script produces an experiment directory (EXPDIR) in your space as ''/discover/nobackup/USERID/EXPID'', which contains, among other things, the sub-directories:
The rest of the questions provide defaults which will be suitable for now, so just press enter for these.  The script produces an experiment directory (EXPDIR) in your space as <code>/discover/nobackup/USERID/EXPID</code>, which contains, among other things, the sub-directories:


*''post''  (containing the post-processing job script)
*''post''  (containing the post-processing job script)
Line 50: Line 50:
*''plot''  (containing an incomplete plotting job script)
*''plot''  (containing an incomplete plotting job script)


The post-processing script will complete (i.e., add necessary commands to) the archiving and plotting scripts as it runs.  The setup script that you ran also creates an experiment home directory (HOMEDIR) as ''~USERID/geos5/EXPID'' containing the run scripts and GEOS resource (''.rc'') files.
The post-processing script will complete (i.e., add necessary commands to) the archiving and plotting scripts as it runs.  The setup script that you ran also creates an experiment home directory (HOMEDIR) as <code>~USERID/geos5/EXPID</code> containing the run scripts and GEOS resource (<code>.rc</code>) files.




The run scripts need some more environment variables -- here are the minimum contents of a ''.cshrc'':
The run scripts need some more environment variables -- here are the minimum contents of a <code>.cshrc</code>:


  umask 022
  umask 022
Line 62: Line 62:
  setenv LD_LIBRARY_PATH ${LIBRARY_PATH}:${BASEDIR}/${arch}/lib
  setenv LD_LIBRARY_PATH ${LIBRARY_PATH}:${BASEDIR}/${arch}/lib


where ''.g5_modules'' is simply a copy of the ''g5_modules'' that you ran earlier before compiling.   
where <code>.g5_modules</code> is simply a copy of the <code>g5_modules</code> that you ran earlier before compiling.   


Copy the restart (initial condition) and ''cap_restart'' (t=t0) files into EXPDIR.  Keep the "originals" handy since if the model crashes early in the run it might have renamed them.  The model expects restarts to end in "rst" but produces them with the date at time appended to the filename, so you may have to rename them.  The ''cap_restart'' file is simply one line of text with the format "YYYYMMDD HHMMSS".  The boundary conditions/forcings are provided by symbolic links created by the run script.
Copy the restart (initial condition) and <code>cap_restart</code> (t=t0) files into EXPDIR.  Keep the "originals" handy since if the model crashes early in the run it might have renamed them.  The model expects restarts to end in "rst" but produces them with the date at time appended to the filename, so you may have to rename them.  The <code>cap_restart</code> file is simply one line of text with the format "YYYYMMDD HHMMSS".  The boundary conditions/forcings are provided by symbolic links created by the run script.


The script you submit, ''gcm_run.j'', is in HOMEDIR.  It should be ready to go as is, though you may eventually want to tune JOB_SGMT (the number of days between saving restarts, called segments) and NUM_SGMT (the number of segments attempted in a job) to maximize your run time.  END_DATE can be changed to your end date, or just left as is.  Commenting out the ''qsub gcm_run.j'' at the end of the script will stop it, too.  Those and the PBS (batch system) parameters at the beginning are all that you will usually want to change in the script.
The script you submit, <code>gcm_run.j</code>, is in HOMEDIR.  It should be ready to go as is, though you may eventually want to tune JOB_SGMT (the number of days between saving restarts, called segments) and NUM_SGMT (the number of segments attempted in a job) to maximize your run time.  END_DATE can be changed to your end date, or just left as is.  Commenting out the <code>qsub gcm_run.j</code> at the end of the script will stop it, too.  Those and the PBS (batch system) parameters at the beginning are all that you will usually want to change in the script.


Submit the job with ''qsub gcm_run.j''.  You can keep track of it with qstat or ''qstat | grep USERNAME'', or stdout with ''tail -f /discovery/pbs_spool/JOBID.OU'', JOBID being returned by qsub and displayed with qstat.  Jobs can be killed with ''qdel JOBID''.  The stdout and stderr will be delivered as files to HOMEDIR at the end of a job.
Submit the job with <code>qsub gcm_run.j</code>.  You can keep track of it with qstat or <code>qstat | grep USERNAME</code>, or stdout with <code>tail -f /discovery/pbs_spool/JOBID.OU</code>, JOBID being returned by qsub and displayed with qstat.  Jobs can be killed with <code>qdel JOBID</code>.  The stdout and stderr will be delivered as files to HOMEDIR at the end of a job.


== Output and Plots ==
== Output and Plots ==


During a normal run, the ''gcm_run.j'' script will run the model for the segment length (current default is 8 days).  The model creates output files (with an ''nc4'' extension), also called collections (of output variables), in the ''EXPDIR/scratch'' directory.  After each segment, the script moves the output to the ''EXPDIR/holding'' and spawns a post-processing batch job which partitions and moves the output files  within the ''holding'' directory to their own distinct collection directory, which is again partitioned into the appropriate year and month.  The  post processing script then checks to
During a normal run, the <code>gcm_run.j</code> script will run the model for the segment length (current default is 8 days).  The model creates output files (with an <code>nc4</code> extension), also called collections (of output variables), in the <code>EXPDIR/scratch</code> directory.  After each segment, the script moves the output to the <code>EXPDIR/holding</code> and spawns a post-processing batch job which partitions and moves the output files  within the <code>holding</code> directory to their own distinct collection directory, which is again partitioned into the appropriate year and month.  The  post processing script then checks to
see if  a full month of data is present.  If not, the post-processing job ends.  If there is a full month, the script will then run the time-averaging executable to produce a monthly mean file in ''EXPDIR/geos_gcm_*''.  The post-processing script then spawns a new batch job which will archive the data onto the mass-storage drives (''/archive/u/USERID/GEOS5.0/EXPID'').
see if  a full month of data is present.  If not, the post-processing job ends.  If there is a full month, the script will then run the time-averaging executable to produce a monthly mean file in <code>EXPDIR/geos_gcm_*</code>.  The post-processing script then spawns a new batch job which will archive the data onto the mass-storage drives (<code>/archive/u/USERID/GEOS5.0/EXPID</code>).


If a monthly average file was made, the post-processing script will also
If a monthly average file was made, the post-processing script will also
Line 79: Line 79:
plotting is:  1) if the month created was February or August,  AND
plotting is:  1) if the month created was February or August,  AND
2) there are at least 3 monthly average files, then a plotting job for
2) there are at least 3 monthly average files, then a plotting job for
the seasons DJF or JJA will be issued.  The plots are created as gifs in ''EXPDIR/plots''.
the seasons DJF or JJA will be issued.  The plots are created as gifs in <code>EXPDIR/plots</code>.


The post-processing script can be found in:
The post-processing script can be found in:
''GEOSagcm/src/GMAO_Shared/GEOS_Util/post/gcmpost.script''.  The ''nc4'' output files can be opened and plotted with ''gradsnc4'' -- see http://www.iges.org/grads/gadoc/tutorial.html for a tutorial, but use ''sdfopen'' instead of ''open''.
<code>GEOSagcm/src/GMAO_Shared/GEOS_Util/post/gcmpost.script</code>.  The <code>nc4</code> output files can be opened and plotted with <code>gradsnc4</code> -- see http://www.iges.org/grads/gadoc/tutorial.html for a tutorial, but use <code>sdfopen</code> instead of <code>open</code>.