[2432] | 1 | This directory contains source codes of utilities (programs) that can be |
---|
[137] | 2 | used to process the LMD Mars GCM output files (like "diagfi" or |
---|
[2432] | 3 | "stats"). |
---|
| 4 | In addition most output file from one of these program can then be |
---|
| 5 | processed by another. |
---|
[137] | 6 | |
---|
[2432] | 7 | See script "compile" for instructions and recommendations to compile |
---|
| 8 | the utilities. Once adequately modified, that script can be used to |
---|
| 9 | compile each utility; e.g. to build the zrecast.e utility program: |
---|
| 10 | > compile zrecast |
---|
[137] | 11 | |
---|
[2432] | 12 | Note that inputs can be provided by (1) replying to questions on screen or |
---|
| 13 | (2) filling the corresponding *.def and redirecting the input of these *.def |
---|
[137] | 14 | files instead. For example : |
---|
| 15 | > concatnc.e < concatnc.def |
---|
| 16 | > zrecast.e < zrecast.def |
---|
| 17 | |
---|
| 18 | -------------------------------------------------------------------- |
---|
[2432] | 19 | 1) concatnc.e : concatenate successive GCM output files |
---|
[137] | 20 | -------------------------------------------------------------------- |
---|
| 21 | |
---|
| 22 | This program is used to concatenate consecutive |
---|
| 23 | output files ("diagfi", and even "stats") for a selection of |
---|
[2435] | 24 | variable, in order to obtain one single big file. The time dimension can |
---|
[137] | 25 | be "sols" or "Ls" (in that last case, Ls will not be linear, and |
---|
| 26 | software like Grads may not be able to use it. To have a linear "Ls" |
---|
| 27 | timescale, you can use "Ls_Linear.e" (see below). |
---|
[2432] | 28 | You can also add a "Ls" variable corresponding solar longitude for each |
---|
| 29 | timestep by using the "adls" option. |
---|
[137] | 30 | |
---|
| 31 | Output file is : concat.nc |
---|
| 32 | |
---|
| 33 | -------------------------------------------------------------------- |
---|
[2432] | 34 | 2) zrecast.e : put GCM data in physical vertical coordinate |
---|
[137] | 35 | -------------------------------------------------------------------- |
---|
| 36 | |
---|
[2432] | 37 | GCM outputs are in GCM hybrid coordinate which do not correspond to any |
---|
| 38 | physical vertical coordinate ! zrecast is NECESSARY to make any publishable |
---|
| 39 | scientific figure. |
---|
[137] | 40 | |
---|
| 41 | This program reads 4D (lon-lat-alt-time) fields from GCM output files |
---|
| 42 | (ie: diagfi.nc time series or concat.nc or stats.nc files) and, by |
---|
| 43 | integrating the hydrostatic equation, recasts data along the vertical |
---|
| 44 | direction. |
---|
[281] | 45 | The vertical coordinate can be either 1) pressure, 2) above areoid |
---|
| 46 | altitudes, 3) above local surface altitudes or 4) distance to center of |
---|
| 47 | the planet. Some interpolation along the vertical direction is also |
---|
| 48 | done, following instructions given by user (levels may be specified |
---|
| 49 | or given as minimu,maximum and number of levels). |
---|
[137] | 50 | For "above areoid altitudes" output, Atmospheric pressure is added to |
---|
| 51 | output dataset; for "pressure coordinate" outputs, the above areoid |
---|
| 52 | altitude of pressure is added to output dataset. |
---|
| 53 | |
---|
| 54 | Minimal requirements and dependencies: |
---|
| 55 | The dataset must include the following data: |
---|
| 56 | - surface pressure |
---|
| 57 | - atmospheric temperature |
---|
[2432] | 58 | - hybrid coordinates aps() and bps(), or sigma levels() |
---|
[137] | 59 | - ground geopotential (in input file; if not found, it is sought |
---|
| 60 | in a 'diagfi.nc' file. If not found there, it is then sought in |
---|
| 61 | a 'phisinit.nc' file (see section 1.3.3 of program) |
---|
| 62 | |
---|
| 63 | - When integration the hydrostatic equation, we assume that R, the |
---|
| 64 | molecular Gas Constant, may not be constant, so it is computed as |
---|
| 65 | R=P/(rho*T) (P=Pressure, rho=density, T=temperature) |
---|
| 66 | If 'rho' is not available, then we use a constant R (see section |
---|
| 67 | 2.2 in source file) |
---|
| 68 | |
---|
[2432] | 69 | - Vertical interpolation : note that density (kg.m-3) and species density |
---|
| 70 | (e.g. in molecules.cm-3) must be vertically interpolated in log-space. For |
---|
| 71 | that purpose, these variables names must start with "rho" (exemple : rho for |
---|
| 72 | density, rho_co2, rho_o2, etc....) |
---|
| 73 | |
---|
[137] | 74 | output file is : |
---|
| 75 | name_of_input_file_P.nc with pressure coordinate |
---|
[281] | 76 | name_of_input_file_A.nc with altitude above areoid coordinate |
---|
| 77 | name_of_input_file_S.nc with altitude above local surface coordinate |
---|
| 78 | name_of_input_file_R.nc with altitude as distance to center of planet |
---|
[137] | 79 | |
---|
[2432] | 80 | -------------------------------------------------------------------- |
---|
| 81 | 3) localtime.e : put GCM data in local time coordinate |
---|
| 82 | -------------------------------------------------------------------- |
---|
[137] | 83 | |
---|
[2432] | 84 | Program to redistribute and interpolate the variable a the same |
---|
| 85 | local times everywhere (useful to mimic satellite observations, or |
---|
| 86 | analyse day to day variations at a given local time). |
---|
| 87 | input : diagfi.nc / concat.nc / stats.nc kind of files |
---|
| 88 | |
---|
| 89 | output file is : name_of_input_file_LT.nc |
---|
| 90 | |
---|
[137] | 91 | -------------------------------------------------------------------- |
---|
[2450] | 92 | 4) lslin.e : redistribute and average gcm output in Ls coordinate. |
---|
[137] | 93 | -------------------------------------------------------------------- |
---|
| 94 | |
---|
[2450] | 95 | This program has been designed to interpolate data in Solar Longitude (Ls) |
---|
[137] | 96 | linear time coordinate (usable with grads) from Netcdf diagfi or concatnc |
---|
[2450] | 97 | files, and to average the instantaneous data in periodic Ls intervals |
---|
| 98 | (for comparison with binned dataset, for instance). |
---|
[2432] | 99 | |
---|
| 100 | lslin also creates a lslin.ctl file that can be read |
---|
[137] | 101 | directly by grads (>xdfopen lsllin.ctl) to plot in Ls coordinate to |
---|
| 102 | avoid some problem with grads when grads think that "the time interval |
---|
| 103 | is too small"... |
---|
| 104 | |
---|
[2450] | 105 | Output file is : name_of_input_file_Ls.nc |
---|
[137] | 106 | |
---|
| 107 | -------------------------------------------------------------------- |
---|
[2432] | 108 | 5) solzenangle.e : select GCM data at a given solar zenith angle |
---|
[137] | 109 | -------------------------------------------------------------------- |
---|
| 110 | |
---|
[2432] | 111 | Program to redistribute and interpolate the variable a the same |
---|
| 112 | solar zenith angle (notably useful to mimic satellite observations and in particular |
---|
| 113 | SOLAR OCCULTATIONS by choosing solar zenith angle = 90°) |
---|
| 114 | The user choose between Morning and Evening side. |
---|
[137] | 115 | |
---|
[2432] | 116 | input : diagfi.nc / concat.nc / stats.nc kind of files |
---|
| 117 | |
---|
| 118 | On the morning side output file (1 output per sol per grid point) is : |
---|
| 119 | name_of_input_file_MO.nc |
---|
| 120 | |
---|
| 121 | On the evening side output file is (1 output per sol per grid point): |
---|
| 122 | name_of_input_file_EV.nc |
---|
| 123 | |
---|
| 124 | -------------------------------------------------------------------- |
---|
| 125 | 6) hrecast.e : interpolate data at another horizontal grid resolution. |
---|
| 126 | -------------------------------------------------------------------- |
---|
| 127 | |
---|
| 128 | This program can interpolate GCM output on any horizontal grid (regular |
---|
| 129 | lat - lon) as long as it cover all the planet. |
---|
| 130 | The grid can be given points by points. The best way is to use the |
---|
| 131 | redirected input hrecast.def |
---|
| 132 | |
---|
[137] | 133 | hrecast.e < hrecast.def |
---|
| 134 | |
---|
| 135 | |
---|
[275] | 136 | -------------------------------------------------------------------- |
---|
[2432] | 137 | 7) expandstartfi.e : to plot data in a startfi.nc file |
---|
[275] | 138 | -------------------------------------------------------------------- |
---|
[137] | 139 | |
---|
[2432] | 140 | In startfi.nc file, data are not plotable because the horizontal coordinate |
---|
| 141 | in only a 1D list of all atmospheric columns on the planets. |
---|
[275] | 142 | This program takes a physics start file ("startfi.nc") and recasts it |
---|
| 143 | on the corresponding lonxlat grid (so it contents may easily be displayed |
---|
[2432] | 144 | using Python, Grads, Ferret, etc.) |
---|
[137] | 145 | |
---|
[275] | 146 | Simply run expandstartfi.e as a command line with arguments: |
---|
| 147 | |
---|
| 148 | expandstartfi.e [infile.nc] [outfile.nc] |
---|
| 149 | |
---|
| 150 | (if infile is not specified, "startfi.nc" is used as default) |
---|
| 151 | (if outfile is not specified, it is built as "infile_ex.nc") |
---|
[282] | 152 | |
---|
| 153 | -------------------------------------------------------------------- |
---|
[2432] | 154 | 8) extract.e : get data at specific coordinates for comparison with observations |
---|
[282] | 155 | -------------------------------------------------------------------- |
---|
| 156 | |
---|
| 157 | This program extracts (ie: interpolates) pointwise values of an atmospheric |
---|
| 158 | variable from a 'zrecast'ed diagfi file (works if altitude is geometrical |
---|
| 159 | height or a pressure vertical coordinates) |
---|
| 160 | user has to specify: |
---|
| 161 | - name of input file |
---|
| 162 | - date (in sols) offset wrt the input file (e.g. if the input file "begins" |
---|
[2571] | 163 | at Ls=0, then the offset is 0; if the input file begins at Ls=90, the |
---|
[282] | 164 | offset date corresponding to the first 3 months is 61+66+66=193 sols, etc.) |
---|
[2571] | 165 | NB: that means the input file must have its "Time" coordinate in sols |
---|
[282] | 166 | - the "extraction mode": |
---|
| 167 | 1: extract individual values; user will specify values of |
---|
| 168 | lon lat alt Ls LT (all on a same line) |
---|
| 169 | on as many lines as there are sought values |
---|
| 170 | 2: extract a profile: user will specify on a first line the values of |
---|
| 171 | lon lat Ls LT (all on a same line) |
---|
| 172 | and then only specify values of altitudes (m or Pa depending on the |
---|
| 173 | coordinate in the input file), one per line, at which values are |
---|
| 174 | sought |
---|
[293] | 175 | - output values are sent to (ASCII) output file 'infile_var_.dat', where |
---|
| 176 | 'infile' is the input file name (without trailing '.nc') and |
---|
| 177 | 'var' is the sought variable, for extraction mode 1 as |
---|
| 178 | lines of "lon lat alt Ls LT value" and for a profile (extraction mode 2) |
---|
| 179 | as lines of "alt value" |
---|
| 180 | |
---|
[282] | 181 | NB: If there is no data to do an appropriate interpolation to extract |
---|
| 182 | the sought value, then a "missing_value" (taken from the variable's |
---|
| 183 | attribute in the input file, most likely -9.99E33) is returned. |
---|
| 184 | |
---|
| 185 | See files "extract.points.def" and "extract.profile.def" for examples of |
---|
| 186 | input format that would simply need to be redirected to extract.e, e.g.: |
---|
| 187 | |
---|
| 188 | extract.e < extract.points.def |
---|
| 189 | |
---|
[2435] | 190 | -------------------------------------------------------------------- |
---|
| 191 | 9) aeroptical.e : compute aerosol opacities at a given wavelength |
---|
| 192 | -------------------------------------------------------------------- |
---|
| 193 | |
---|
[2830] | 194 | Program to compute opacity profiles opa_[aer] (1/km) of aerosols |
---|
| 195 | at a wavelength given by the user. |
---|
[2435] | 196 | Computation is made from the aerosol mass mixing ratios and effective radius, |
---|
| 197 | associated with air density (rho) and files containing the aerosol |
---|
| 198 | optical properties (generally present in the GCM datadir/ directory). |
---|
[2443] | 199 | The user have to precise the type of opacity : extinction or absorption. |
---|
[2830] | 200 | The user can also ask to compute the column-integrated optical depth tau_[aer]. |
---|
[2435] | 201 | |
---|
[2817] | 202 | NB : this program requires to compile the module aeropt_mod.F90 |
---|
| 203 | at the same time |
---|
[2435] | 204 | |
---|
| 205 | input : diagfi.nc / concat.nc / stats.nc kind of files |
---|
| 206 | |
---|
[2443] | 207 | output file is : |
---|
| 208 | name_of_input_file_OPAext.nc for extinction opacities |
---|
| 209 | name_of_input_file_OPAabs.nc for absorption opacities |
---|
| 210 | |
---|
[2435] | 211 | aeroptical.e < aeroptical.def |
---|