Back to home page

MITgcm

 
 

    


File indexing completed on 2026-03-19 05:08:29 UTC

view on githubraw file Latest commit 69361556 on 2026-03-18 21:20:20 UTC
2f1693fad8 Patr*0001 #include "PACKAGES_CONFIG.h"
2dcaa8b9a5 Patr*0002 
                0003 c     ==================================================================
                0004 c     HEADER COST
                0005 c     ==================================================================
                0006 c
                0007 c     o Header for model-data comparison.
                0008 c
                0009 c     The individual cost function contributions are multiplied by
                0010 c     factors mult_"var" which allow to switch off these contributions
                0011 c     without removing them in the adjoint code. This is useful for
                0012 c     doing tests with the adjoint and perhaps useful in assimilation
                0013 c     experiments where individual contributions are successively
                0014 c     switched on. For future applications it would be better to place
                0015 c     the initialisation of the multipliers somewhere else, for example
                0016 c     in a namelist, which is read in at the start of the model.
                0017 c
                0018 c     started: Christian Eckert eckert@mit.edu  24-Feb-1999
                0019 c     changed: Christian Eckert eckert@mit.edu
2f1693fad8 Patr*0020 c     heimbach@mit.edu 05-Nov-2003 Modularize cost package
2dcaa8b9a5 Patr*0021 c
                0022 c     ==================================================================
                0023 c     HEADER COST
                0024 c     ==================================================================
                0025 
                0026 c     The cost function, its contributions, and multipliers:
                0027 c     ======================================================
                0028 c
                0029 c     fc         - Final cost function.
8a270036d8 Gael*0030 c     glofc      - contributions from global mean constraints
2dcaa8b9a5 Patr*0031 c     mult_"var" - multipliers for the individual cost
                0032 c                  function contributions.
                0033 
69361556c2 Mart*0034 C     costWriteCostFunction :: internal parameter to ensure that cost function
                0035 C                              contribution is only written once per run
                0036       COMMON /COST_L/ costWriteCostFunction
                0037       LOGICAL costWriteCostFunction
                0038 
2dcaa8b9a5 Patr*0039       common /cost_r/
8a270036d8 Gael*0040      &                fc, glofc
2f1693fad8 Patr*0041       _RL  fc
8a270036d8 Gael*0042       _RL  glofc
2f1693fad8 Patr*0043 
29f6025d09 Jean*0044 C     tile_fc   :: Final cost function contribution from this tile
                0045       COMMON /COST_FINAL_R/ tile_fc
                0046       _RL  tile_fc (nSx,nSy)
                0047 
2f1693fad8 Patr*0048       common /cost_objf/
2dcaa8b9a5 Patr*0049      &                objf_atl,
bbf42b7711 Patr*0050      &                objf_test,
00c59bf6d0 Patr*0051      &                objf_tracer,
                0052      &                objf_entropy,
                0053      &                objf_t_misfit,
                0054      &                objf_eflux
11c3150c71 Mart*0055 #ifdef ALLOW_COST_HFLUXM
14021e1fda Davi*0056      &               ,objf_hflux_tut
                0057      &               ,objf_temp_tut
11c3150c71 Mart*0058 #endif
2dcaa8b9a5 Patr*0059 
cda1c18f72 Jean*0060       _RL  objf_atl  (nSx,nSy)
                0061       _RL  objf_test (nSx,nSy)
                0062       _RL  objf_tracer (nSx,nSy)
                0063       _RL  objf_entropy (nSx,nSy)
                0064       _RL  objf_t_misfit (nSx,nSy)
                0065       _RL  objf_eflux (nSx,nSy)
11c3150c71 Mart*0066 #ifdef ALLOW_COST_HFLUXM
cda1c18f72 Jean*0067       _RL  objf_hflux_tut (nSx,nSy)
                0068       _RL  objf_temp_tut (nSx,nSy)
11c3150c71 Mart*0069 #endif
00c59bf6d0 Patr*0070 
449f3c105b Patr*0071       common /cost_param_r/
                0072      &                lastinterval
                0073       _RL lastinterval
                0074 
9eb96e5404 Patr*0075 #ifdef ALLOW_COST_STATE_FINAL
                0076       common /cost_state_final_r/
                0077      &                objf_state_final
a8da18f773 Patr*0078 cph      _RL  objf_state_final (snx,sny,nsx,nsy)
cda1c18f72 Jean*0079       _RL  objf_state_final (sNx,sNy,nSx,nSy,4*Nr+1)
00c59bf6d0 Patr*0080 #endif
2dcaa8b9a5 Patr*0081 
720be40b89 Patr*0082 #ifdef ALLOW_COST_VECTOR
9eb96e5404 Patr*0083       common /cost_vector_r/
720be40b89 Patr*0084      &                objf_vector
cda1c18f72 Jean*0085       _RL  objf_vector (sNx,nSx,nSy)
720be40b89 Patr*0086 #endif
                0087 
af61e5eb16 Mart*0088       common /cost_fname_c/
                0089      &     cost_mask_file
                0090       CHARACTER*(MAX_LEN_FNAM) cost_mask_file
                0091 
2dcaa8b9a5 Patr*0092       common /cost_aux_r/
                0093      &                    mult_atl,
bbf42b7711 Patr*0094      &                    mult_test,
00c59bf6d0 Patr*0095      &                    mult_tracer,
                0096      &                    mult_entropy,
                0097      &                    mult_t_misfit,
586ad2dc56 Patr*0098      &                    mult_eflux,
                0099      &                    multTheta,
                0100      &                    multSalt,
                0101      &                    multUvel,
                0102      &                    multVvel,
                0103      &                    multEtan
11c3150c71 Mart*0104 #ifdef ALLOW_COST_HFLUXM
14021e1fda Davi*0105      &                   ,mult_hflux_tut
                0106      &                   ,mult_temp_tut
11c3150c71 Mart*0107 #endif
2dcaa8b9a5 Patr*0108 
                0109       _RL  mult_atl
                0110       _RL  mult_test
bbf42b7711 Patr*0111       _RL  mult_tracer
00c59bf6d0 Patr*0112       _RL  mult_entropy
                0113       _RL  mult_t_misfit
                0114       _RL  mult_eflux
586ad2dc56 Patr*0115       _RL  multTheta
                0116       _RL  multSalt
                0117       _RL  multUvel
                0118       _RL  multVvel
                0119       _RL  multEtan
11c3150c71 Mart*0120 #ifdef ALLOW_COST_HFLUXM
14021e1fda Davi*0121       _RL  mult_hflux_tut
                0122       _RL  mult_temp_tut
11c3150c71 Mart*0123 #endif
2dcaa8b9a5 Patr*0124 
                0125 #ifdef ALLOW_COST_TEST
                0126       common /cost_test_i/
                0127      &                           iLocOut
                0128      &                         , jLocOut
                0129      &                         , kLocOut
                0130       integer iLocOut
                0131       integer jLocOut
                0132       integer kLocOut
                0133 #endif
                0134 
4a2a8da507 Davi*0135 #ifdef ALLOW_COST
449f3c105b Patr*0136       COMMON /COST_MEAN_R/
781d8676b2 Patr*0137      &                     cMeanTheta, cMeanUVel, cMeanVVel,
                0138      &                     cMeanThetaUVel, cMeanThetaVVel
449f3c105b Patr*0139       _RL cMeanTheta(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
                0140       _RL cMeanUVel(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
                0141       _RL cMeanVVel(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
781d8676b2 Patr*0142       _RL cMeanThetaUVel(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
                0143       _RL cMeanThetaVVel(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
449f3c105b Patr*0144 #endif
                0145 
2dcaa8b9a5 Patr*0146 c     ==================================================================
                0147 c     END OF HEADER COST
                0148 c     ==================================================================