Code Changes

The code is subject to frequent change. To use new features and possible corrections, regularly update your code by invoking
    ./Update
in your ~/INVERSION/RUN/ directory.
(The ./Update script is replacing the files in your ~/INVERSION/RUN/src/ directory by those from ~m212046/INVERSION/RUN/src/version/ with version denoting the most recent stable code version. In case you did changes to your copy of the code in ~/INVERSION/RUN/src/, there is no risk of loosing them, because ./Update is backing up all your existing files.)

Most changes are just adding optional features, and should not affect existing applications, but:


14.019 (in progress)

14.018

14.017

14.016

14.015

14.014

14.013

14.012

14.011

14.010

14.009

14.008

14.007

14.006

14.005

14.004

14.003

14.002

14.001

13.049

13.048

13.047

13.046

13.045

13.044

13.043

13.042

13.041

13.040

13.039

13.038

13.037

13.036

13.035

13.034

13.033

13.032

13.031

13.030

13.029

13.028

13.027

13.026

13.025

13.024

13.023

13.022

13.021

13.020

13.019

13.018

13.017

13.016

13.015

13.014

13.013

13.012

13.011

13.010

13.009

13.008

13.007

13.006

13.005

13.004

13.003

13.002a

13.002

12.120

12.119

12.118

12.117

12.116

12.115

12.114

12.113

12.112

12.111

12.110

12.109

12.108

12.107

12.106

12.105

12.104

12.103

12.102

12.101

12.100

12.099

12.098

12.097

12.096

12.095

12.094

12.093

12.092

12.091

12.090

12.089

12.088

12.087

12.086

12.085

12.084

12.083

12.082

12.081

12.080

12.079

12.078

12.077

12.076

12.075

12.074

12.073

12.072

12.071

12.070 and before

12.070 * omit mu in output file name if mu==0.

12.069 * depending on species, mixing ratio unit (both in the external and internal files) can be different from "ppm"
         (as defined in "parameters..f")
       * "tm3io_mix3D.f": Convert all variables to be output (c0, mix, gph) into real (in case kc/=k4)
       * "tm3io_flux_buffer.f": Correct bug in effect if tm3 runs in double precision
       * added parameters for further species (ch4, n2o, cos) [partially preliminary]
       * generic file "parameters.xxx.FwdFile.F" provided for doing forward runs

12.068 * "aux.f90": read_prior: Add option to filter (by `tsfilter2D') after direct input
                                by starting filter string by "~"
                                --> this allows all filter types (incl. linear fit) to be applied to input
         (had to change order of modules in "include.f90", and to move function `weight' to module 'mask')
       * "monthly_data.f": No error generated if missing input .ts file - essential if `msite' is set

12.067 * init_rhs: Redefine the meaning of negative values for RHSgroup:
                   If RHSgroup<0 for a component, use each parameter belonging to that component
                   as a separate RHS.
       * correct CPU time check for IBM (replacement of `tremain')
       * add option "Define" to "Run_inv": cpp #DEFINE's to manipulate parameter file
       * provide integration script for PRI just after fluxmodel is ready
       * integrate: Parameter values are written into separate file rather than logfile

12.066 * Add compiler option '-qsmallstack=dynlenonheap' to solve problems with segmentation faults on IBM
       * "aux.f90": read_prior: Ignore non-equidistantness of files with lower than daily frequency
                                because it seems that this can happen w/o being a problem
       * "aux.f90": `unix': Correct way of calling `system' on IBM

12.065 * "aux.f90": load_flux_1: Bug correction:
         - Do not read behind flux(:,:,ntimef) any more
         - Stop loop if more than ntimef records

12.064 * "io.f90": Bug correction in output of time-filtered gridded files
       *
       * "sigmas.f90": add possibility to change the test time (add "+" to the filter;
                       "+I" means the starting time of the run)

12.063 * user-defined subroutines in "priors.f90":
         - rename 'get_apriflux_special' into 'setpriors_special',
         - call it before `get_apriflux' (ie., before any built-in subroutines of `setpriors')
       * "integrate.f90":
         - new subroutine `integrate_special' for diagnostic output calculations in `integrate'
         - declare `apostflux' (formerly `apoflux') as global variable (suh that available in `integrate_special')
         - prepare Lcurve
         - ouput of temporal standard deviations of integrated/filtered fluxes to logfile
       * rename: `integrate_timemask' into `timemask_rhs_default'
                 `integrate_region'   into `regionset_rhs_default'

12.062 * new compiler version IBM/xlf12.1.0.5

12.061 * "priors.f90": correct bug for components with exttFilter="LT":
           there was wrong normalization due to wrong filter ('c' rather than 'b' erronously introduced
           for wgt_Box earlier [probably in 12.035])
           --> a-priori sigmas for LT components may have been too large by factor ~1.2 (possibly
               more for shorter inversion periods)

12.060 * "mask.f90": correct bug: time dimenasion of cos_ftime and sin_ftime only 1:ntimef
       * "diagnose.f90": additionally give values for components as-is (w/o scaling for
           the individual species) - important for components not directly affecting the
           surface-atmosphere fluxes but only through derived components

12.059 * add parameter `atm_constraint' to swtich off transport model run
       * read_prior: no allocatable arrays any more, to prevent memory leaks

12.058 * "Run_inv": can swtich between different "kinds_*.f" files

12.057 * model.f90: parallel do in TIS

12.056 * model.f90: some preparations for using TIS in derived components
         adjoint TIS

12.055

12.054 * changes necessary for porting the code to Power6 (blizzard.dkrz.de):
         - change of compiler flags, path names, etc.
           removal of any explicit path names other than in "run_inv.user"
         - "state.f90": replace NAG library calls by LAPACK
         - get_pfgh: remove some wrong and unnessecary lines

12.053 * iteration: possibility to calculate conjugacy separately for pixels

12.052 * "priors.f90" (extra constraints): set shape to zero for all inactive pixels

12.051 * "priors.f90": new option for shape in extra constraints:
           shapefile(iproc)=='%' for setting shape to root mean square apriflux
           (to obtain similar cost function contributions for each pixel)

12.050 * "mask.f90": change in end treatment of "DiffD2" filter

12.049 * "tm3.F": correct problem from 12.048: data ignored if mixo<=-9e9 (or smix<=0.)
                  because O2 data can be negative
       * "mask.f90": new filter "DiffD" for differentiation in time domain
                     (to avoid trouble from cyclic link between start and end when differentiating in Fourier domain)

12.048 * "tm3.F": ignore all data values with mixo<=0. or smix<=0.
         (meant to allow data points where not all species have a measured value)

12.047 * extra constraints: re-define `apriflux' and `shape':
            apriflux --> -apriflux
            shape    --> 1/shape
       * "integrate.f90": also calculate a-post values of extra constraints

12.046 * "tmodel_tm3.f90": No transport model run if zero flux to atmosphere
         (for minimization of extra constraints only)
       * "integrate.f90": replace `xor' by `neqv' (to be standard conformant)

12.045 * "Diff....???s" filters: unaccuracy in derivative of trend

12.044 * correct bug in `add_extra': negative for diff==.false.

12.043 * correct bug in `tsfilter': negative trend for "Diff....???s" filters

12.042 * changes in real type handling (intended to enable full double precision run),
         but not yet finished

12.041 * "aux.f90": pland: cut very small land or ocean fractions (below 0.0001)
                    to avoid numerical trouble (might slightly change results!)

12.040 * implementation of extra constraints (CT_extra components)

12.039 * prepared implementation of extra constraints
       * compiler flags only to be set in "Compile" and "CompileTM3" (not any more in "run_inv")

12.038 * "model.f90": For CT_drv components, change of units convention (no unit change in fluxmodel)
       * "mask.f90": Filter: added options for treatment of linear trend (4th letter)

12.037 * "priors.f90": `priorFile' or `shapeFile' can be '#' to leave `apriflux' or `shape' untouched - assuming
                       they are set in `get_shape_special' or `get_apriflux_special'

12.036 * `read_prior': add fake records within last year (from last year + trend) if missing in input file
         (only in multi-year inversions assuming that last year is spin-down only)
       * "tm3.F": corrected bug in calls to write out 3D fields
       * integrate: corrected new bug in integrating PRI
       * "tmodel_tm3.f90": totflux and ad_totflux are deleted after run (to save unnecessary disk usage)

12.035 * "tm3.F":
         - option to output surface mixing ratio, wind speed, pressure (if ninstsfc>0)
         - use "tm3io_mix_yearly_netCDF.f" (yearly NetCDF 3D mixing ratio output)
       * "tmodel_tm3.f90", "integrate.f90", "nr.frprmn.f90": add `ninstsfc'

12.034 * parameter files can now contain subroutines for parameter manipulations
       * "model.f90": prepared derived flux components and extra constraints
       * parameters for grid definitions now in separate files "grid_*.f90"

12.033 * "priors.f90": corrections for flux model for STILT application:
         - get_regions_Grid03: Generic code to generate regular regions for all non-TM3 grids
         - get_dist: Distance of grid cells calculated from `lat' and `lon'
                     (for TM3 grid, the old code has been kept for backward compatibility)

12.032 * "nr.frprmn.f90": add test option to replace conjucate h directions by vectors along the parameters
                          (setting `h_along_params' in "iteration.in")

12.031 * test time for RHS can now be chosen (`time_rhs')
       * "nr.frprmn.f90": do fwd transport run for each RHS (to get info about which data signals created flux feature)
       * "nr.frprmn.f90": additional convergence criterion: iter>m (prevent more iterations than degrees of freedom)
       * "nr.frprmn.f90": output k as column 10 of "*chi_it.d"
       * integrate: NetCDF output set as default (but ASCII "*.d2" output still possible)
       * integrate: option to output gridded time-filtered fluxes as NetCDF file
       * integrate: option to set mu='PRI' for integrating prior in NetCDF file
       * integrate: `timemask' can now contain both temporal filter and time mask
       * compilation: less optimization (vsafe rather than vopt)
                      to avoid occasional "Bus error" and numerical inaccuracy

12.030 * "aux.f90": Reading-in of flux files: implement filter '-LT' (subtract long-term mean)

12.029 * add capability for NetCDF output of filtered/aggregated flux time series

12.028 * "priors.f90": shape can be proportional to the difference between 2 files
         syntax for `shapefile(iproc)': "-  "

12.027 prepare coupling to regional models (STILT)
       * "aux.f90", "run_inv": generalize grid description

12.026 * "priors.f90": write diagnostic messages about filtered spectra of the components
                       (to be used to judge the relation of the a-priori sigmas between the component)
       * "io.f90": add attributes etc. to make NetCDF output CF-1.1 conformable

12.025 * init_rhs: regionset_rhs=='' or timemask_rhs =='' means that no r.h.s. are created
       * remove manipulations specific to TM3 grid (polar rows) - replaced by setting according to where dxyp==0
       * rename "Run_tdep.iter" --> "Run_inv" and "src/run_tdep.iter" --> "src/run_inv"
       * integrate: NetCDF output name: "*adjustflux*" --> "*apostflux*"

12.024 * options to manipulate flux model:
         - cut-out apriflux, shape, regions, and exts (for test of nesting scheme only)
         - additional multiplicative factors `shapeFact' of adjustable terms (per component)
       * "correl_mp.f90": Ferret commands:
         - no interpolation for correlation plot
         - fixed color scale for normalization plots

12.023 * "aux.f90": read_flux: if only one-year inversion, then no error message `climatolog. data'
       * new datamaode -D-: as -R- but not switching to `diff' - keep using priors
       * always read cutout files from CUTOUT dir
       * "integrate.f90": add possibility to output binary files convolved with time masks (e.g. 'JJA', not only filtere
d)

12.022 sgm/rgm: subtract long-term mean difference for sgm, and add the corresponding difference for rgm

12.021 data reading:
       - add possibility to subtract external global mean file
       - moved adjustment of minutes in .ts file into `read_line' - might affect a few values near itaui or itaue

12.020 Add capability to manipulate station list:
       `msite': site to be removed from station list
       `psite': site to be added instead (`msite' needs to be set then)
       `osite': all sites except for this one are set to zero (automatically sets difference=.true.)

12.019 "priors.f90" (get_extt): add possibility to specify Fourier series with mean (by setting
       3rd filter letter of `exttFilter' to "x" - a letter " " still means the previous default 'no mean'
       [as does letter "a"] for backward compatibility)

12.018 "mask.f90" (tsfilter): extend filter syntax (e.g. "Filt2.0gd-2001-2005"):
       can specify beginning and end years of an interval over which long-term mean and
       mean seasonal cycle is calculated --> to avoid period dependence when comparing inversion runs
       of different lengths

12.017 add capability for n-sigma criterion:
       * conc. time series from fwd runs now contain unweighted sigma (data densitt weighting undone;
         in "input/" sigma is still weighted)
       * reading-in of conc data: option to read selected data, add new parameter `nsigma'

12.016 add capability for nesting:
       * forward runs possible with cut-out (step 1)
       * reading-in of conc data: option to read residual (obs-model) from previous run

12.015 * integrate: add `name_stationlist' as parameter available for TM3 forward runs

12.014 * TM3 fwd runs:
         - 3D output fields now split into yearly files
         - can set `ninststn' on integration for regular time series output

12.013 * parameters: new parameter `priorMaskoutReg' for masking out priors read in from files

12.012 * move "run_tdep.iter" to "src/", move "parameters.*.F" to start directory,
         in order to separate fixed code from application-dependent code
       * integrate: optional output of fluxes as NetCDF file
         (with possibility to taper specified components)
       * "priors.f": add `ini1' time extension: one flux pulse at first time step (not during first half year)
       * parameters: add `enhance_sigma' (factor to increase data sigmas within first year,
                     meant to allow initial concentration to establish itself with less force
                     on fluxes

12.011 * read_prior: correct calculation of spectral power ( missing factor 1/sqrt(2) )
                        (should not affect inversion results due to scaling of global sigma in all cases)
                     skip `reimbursement' of the seasonal components in SD and power calculation
       * geomtry: TM3 specific polar cells for `smask_NH20' etc.
       * "parameters.*.FwdFile_quere7*.F": Read yrfi to yrfe only to get power calculation only for used period

12.010 * read_prior: allow deseasonalization for "Filt..."

12.009 * switch prepro path to "/scr/24/mj0143/TM3/prepro/"
       * ""tmodel_tm3.f90": `ninststn=21600' if `fwd_only'
       * "model.f90": suppress writing/reading of `shape' if `fwd_only' (to save disk space)

12.008 * further implement multi-species (successsfully tested with "co2+o2"):
         - c0
         - integrate: multi-species output

12.007 * partially implement multi-species capability
       * "tmodel_tm3"/"tm3": unique file names of "totflux" again (jobid-dependent, for simultaneous integration jobs)

12.006 * integrate: pass parameters `ninst' and `idatet' to TM3 for writing of 3D concentration fields
       * integrate: parameter `out_binary_tot' for writing totals
       * "tm3.F", "tmodel_tm3.f90": remove `fluxdir'

12.005 * new internal variable `fluxext'
       * write a-priori flux, shape, and inversion update as individual components
         (saving disk space, and for access to inversion update for later forward runs)

12.004 * implement `Tmol2unitf', `unitf' (needs loops over species)
       * parameters: add `spec3Scale', `spec4Scale'; internally use new variable `specScale'
       * new internal variable `dtau' (=itau(itime+1)-itau(itime))
       * read_prior: direct output (Filter=='') now possible for shorter time steps in input file than that
                     of inversion (flux is summed up within inversion interval then)

12.003 * init_rhs: selection of groups of components into individual RHS's now done according to `RHSgroup'
                   for co2: seasonal components not added to variability group any more (omitted instead)
       * read_prior: 3 do-loops parallelized

12.002 * integrate: filter set via `timemask' (remove `intFilter', script written by "nr.frprmn.f90" accordingly)
       * parameters: conc. sigmas now defined in separate file "parameters...conc.F"
       * parameters: remove `diu', `diudir'
       * read_prior: implement "-Filt*" filters, and "Filt*..a" (anomalies) for all filter types

12.001 CHANGES THAT YIELD RESULTS SLIGHTLY DIFFERENT FROM 11.213:
       * "tm3.F": fluxes read-in in one piece
         - solve problem with reading-in of fluxes by TM3: had been systematically 1 record too late
         - more efficient (only slight effect)
       * init_input: only read data within TM3 running period
         (this changed symmetry index back from ~1e-4 to ~1e-7)
       * init_input: handle dates correctly (e.g. minute<0 for hourly mean)
       * "tm3.F": linearly interpolate modelled conc. in time between model time steps
         (test: shift of time of data points by 3 hours in either fwd. or adj. increases symmetry index by factor 1000
          - this indicates that interpolation is identical in fwd. and adj.)

       CHANGES THAT REQUIRE MODIFICATIONS TO "parameter.*.*.F" file:
       * switch between sensitivity set-ups via CPP functionality:
         put #if clauses in standard file, include standard file from sensitivity files
       * parameters: remove `priordir2' (is same as `priordir')
       * prepare multi-species parameters (for later implementation)
         - species-specific parameters in extra file "parameters..f"
         - additional parameters `spec*Scale' linking components to species
         - add `nspec' (not yet used)
       * parameters, integrate: replace `subtr' by `OT' (more flexible, taper not yet implemented)
       * introduce parameters `RHSgroup' for later implementation of grouping in sigma calculation
       * specification of file reading parameters (prior, shape) by filter string
         translation:
            out_ave    --> 'LT'
            out_dummy  --> '/'
            out_MSC    --> 'Filt7.0Tm' etc. according to `priorFreql' and `priorWgt'
            out_IAV    --> 'Filt7.0T'                   - " -
            out_seas   --> 'SD6.0Tm' etc. according to `shapeFreql' and `shapeWgt'
         "aux.f90": `read_prior' has now string argument `Filter' determining kind of output as well as filter
         (internally just translated into old arguments - no change in actual code yet)
       * name change `apfact' --> `priorScale'
       * added capability to scale components according to global sigmas (set by `shapeScale')
         introduce `shapeScale_timemask' and `shapeScale_region' determining scales of normalization of component
            long-term comp.       --> 'sqrt_T'
            seasonal comp.        --> 'asis1', 'Filt2.0g', etc.
            non-seasonal comp.    --> 'triangular1', 'Filt2.0g', 'Filt2.0gd', etc.
            initialization comp.  --> 'firstyear'
         values of `shapeScale' found from "sigmas.*.out" files of previous run with code 11.xxx
       * remove `shapeScaleTr'
       * remove `apftst', `tscale'
       * priors: specification of temporal correlations (`extt') via string `exttFilter'
            extt_ave     --> 'LT'
            extt_seas    --> 'Filt12.0Tm' etc.
            extt_nonseas --> 'Filt12.0Td' etc.
            extt_fourier --> 'Filt12.0T' etc.
            extt_const   --> '1'
            extt_ini02   --> 'ini02'
       * priors: remove filtered normalization of extt (remove `normFreql/h', `normWgt')
         (not needed any more due to normalization of components by global contraints)
       * remove `monthly_conc' (had been unused)

       FURTHER CHANGES:
       * "run_tdep.iter" calls "run_tdep.user" containing all user-specific settings
       * remove `p_ih'
       * `tsfilter': only string argument for filter type (replacing Freql and code)
         - in `get_tmask', any filter is possible now for creating test integration pattern
         - in "integrate", filter is given as string `intFilter'="FiltXXXxx" (`intFreq' removed)
         - high-pass filter possible by "-FiltXXXxx"
       * reduces disk space needs:
         - avoid TOT*b
         - avoid SEAS*b, etc.
         - output of binary in "intergrate.f90" only if requested (`out_binary')
         - writing of "inversion.nc" moved to "correl_mp.f90" (--> only done on request)
           store `region'/`regionc' in "fluxmodel.b" (for correct writing into "inversion.nc" by "correl_mp")
           (still not fully tested!)
       * init_input: skip writing of "input.old/"

-------------------------------------------------------------------------

11.213 added NetCDF output of fluxes

11.212 added capability to do forward TM3 runs in `integrate' with alternative station sets
       (to be specified through `inputTag')
       [involves shift of `init_input' to module `tmodel']

11.211 added capability to do syntheic runs directly, but subtracting known truth

11.210 * undo change from 11.205 to 11.206
         (fixed terms not any more set to zero if do_subtract_gm,
         because this is not appropriate: subtracting the global mean from the data does not change
         implied spatial gradients, therefore it is still correct to have fixed terms that are
         constant in time [which is the case for co2 and apo standard set-ups])
       * correct bug introduced in 11.209: Save a-post state again because needed in `finish_rhs'

11.209 never save any states any more (in order to save disk space)
       therefore always recompute state in integrate.f90
       init_rhs: write output into separate logfile
       integrate.f90: Print parameter values for all one-parameter components

11.208 integrate.f90: slight change in order of reading-in: avoid reading of flux model if just integrating prior

11.207 prepare reading-in of data from several station lists (for forward runs),
       but not yet fully implemented.
       file "stations.coords.d" now has name "input.coords.d"

11.206 priors: set fixed terms to zero if do_subtract_gm
       [[ ATTENTION: will be undone in 11.210 ]]

11.205 init_c0: set zero c0 if do_subtract_gm
       mask.f90, integrate.f90: added timemasks for seasonal sums ('JJA' etc.)

11.204 integrate.f90: added options to integrate or flatten shape

11.203 tm3.F: Corrected bug: Negative height in data files now interpreted as altitude above ground

11.202 init_rhs: Skip entries if zero response
       "parameters.apo.Std07.F": integrate_region = '3Bands' (previously: 'AggregOcean04')

11.201 writing out shapes as binaries

11.200 "io.f90": Add NetCDF attributes
       units = degrees_north (degrees_east)
       point_spacing = even
       to lon and lat variables, for correct plotting in Ferret

11.199 mode_flux restartable (changes in main program)

11.198 init_input, tm3: I/O of concentration data using binary direct-access files
                        for CPU performance
       INFO: not bit-identical to 11.197
       "stations.coords.d": full site name (as in input file names)
                            warning coords -999. etc only if differences larger than threshold

11.197 integrate: change order of statements for influxfile = '....'

11.196 save_state_index

11.195 change in first iteration for each new RHS:
       go along b (made conjugate) - do not need b as initial guess any more

11.194 tm3 fine grid executable called tm3_fg,
       option _vfg

11.193 idatee = (/ yrfe  ,12,31, 0, 0, 0 /)
       (to avoid loading of next TM3 prepro year)

11.192a mnzt smaller than ntimef by parameter fmnzt
       read_prior: skip zero harmonics

11.192 define im_cg,jm_cg in script (to prepare _vfg)
       unit of "totflux*.b" changed into Tmol/grid/s
       (to allow 3-hourly time step - remove setting idate to monthly/daily/hourly in get_calendar)

11.191 variable end date (idatee) of TM3 run

11.154 correction of h right after it was calculated - now also corrected h
       in state files (before uncorrected - wrong for integrate
       and if reloaded)

11.153ll2  redefine A (and thus chi2): factor 2

11.150 Normalization of extt for extt_tri corrected