Home Contact Us Site Map  
 
       
    next up previous contents
Next: 3.18.3 Code Configuration Up: 3.18 Global Ocean State Previous: 3.18.1 Overview   Contents

Subsections

3.18.2 Implemention of the control variable and the cost function

All subroutines that require modifications are found in verifications/Optim/code_ad

3.18.2.1 The control variable

The correction $ Q_\mathrm{netm}$ is activated by setting ALLOW_HFLUXM_CONTROL to "define" in ECCO_OPTIONS.h.

It is first implemented as a forcing variable. It is defined in FFIELDS.h, initialized to zero in ini_forcing.F, and then used in external_forcing_surf.F.

$ Q_\mathrm{netm}$ is made a control variable in the ctrl package by modifying the following subroutines:

  • ctrl_init.F where $ Q_\mathrm{netm}$ is defined as the control variable number 24,

  • ctrl_pack.F which writes, at the end of iteration, the sensitivity of the cost function $ \partial J/\partial Q_\mathrm{netm}$ into a file to be used by the lins-search algorithm,

  • ctrl_unpack.F which reads, at the start of each iteration, the updated perturbations as provided by the line-search algorithm,

  • ctrl_map_forcing.F where the updated perturbation is added to the first guess $ Q_\mathrm{netm}$.

Note also some minor changes in ctrl.h, ctrl_readparams.F, and ctrl_dummy.h (xx_hfluxm_file, fname_hfluxm, xx_hfluxm_dummy).

3.18.2.2 Cost functions

The cost functions are implemented using the cost package.

  • The temperature cost function $ J_1$ which measures the drift of the mean model temperature from the Levitus climatology is implemented cost_temp.F. It is activated by ALLOW_COST_TEMP in ECCO_OPTIONS.h. It requires the mean temperature of the model which is obtained by accumulating the temperature in cost_tile.F (called at each time step). The value of the cost function is stored in objf_temp and its weight $ \lambda_1$ in mult_temp.

  • The heat flux cost function penalizing the departure of the surface heat flux from observations is implemented in cost_hflux.F, and activated by activated ALLOW_COST_HFLUXM in ECCO_OPTIONS.h. The value of the cost function is stored in objf_hfluxm and its weight $ \lambda_2$ in mult_hfluxm,

  • The subroutine cost_final.F calls the cost_functions subroutines and make the (weighted) sum of the different contributions.

  • The weights used in the cost functions are read is cost_weights.F. The weigth of the cost functions are read in cost_readparams.F from the input file data.cost.


next up previous contents
Next: 3.18.3 Code Configuration Up: 3.18 Global Ocean State Previous: 3.18.1 Overview   Contents
mitgcm-support@mitgcm.org
Copyright © 2006 Massachusetts Institute of Technology