Back to home page

MITgcm

 
 

    


File indexing completed on 2025-12-15 06:14:27 UTC

view on githubraw file Latest commit ad59256d on 2025-12-15 00:05:36 UTC
ad59256d7d aver*0001 #include "OBSFIT_OPTIONS.h"
                0002 C--  File obsfit_active_file_g.F:
                0003 C--   Contents
                0004 C--   o g_active_read_obs_tile
                0005 C--   o g_active_write_obs_tile
                0006 C--   o g_active_read_obs_glob
                0007 C--   o g_active_write_obs_glob
                0008 
                0009 CBOP
                0010 C     !ROUTINE: G_ACTIVE_READ_OBS_TILE
                0011 
                0012 C     !INTERFACE:
                0013       SUBROUTINE G_ACTIVE_READ_OBS_TILE(
                0014      I                                   active_num_file,
                0015      O                                   active_var,
                0016      I                                   g_active_var,
                0017      I                                   irec,
                0018      I                                   lAdInit,
                0019      I                                   myOptimIter,
                0020      I                                   bi,
                0021      I                                   bj,
                0022      I                                   myThid,
                0023      I                                   dummy )
                0024 
                0025 C     !DESCRIPTION:
                0026 C     ==================================================================
                0027 C     | Read an active record from an ObsFit .equi. tiled file
                0028 C     | for tangent linear calculations
                0029 C     ==================================================================
                0030 
                0031 C     !USES:
                0032       IMPLICIT NONE
                0033 C     == Global variables ===
                0034 #include "EEPARAMS.h"
                0035 #include "SIZE.h"
                0036 #ifdef ALLOW_OBSFIT
                0037 # include "OBSFIT_SIZE.h"
                0038 # include "OBSFIT.h"
                0039 #endif
                0040 
                0041 C     !INPUT PARAMETERS:
                0042 C     active_num_file: file number
                0043 C     active_var:      array
                0044 C     irec:            record number
                0045 C     myOptimIter:     number of optimization iteration (default: 0)
                0046 C     myThid:          my thread ID number
                0047 C     lAdInit:         initialisation of corresponding adjoint
                0048 C                      variable and write to active file
                0049       _RL     active_var
                0050       _RL     g_active_var
                0051       INTEGER irec, active_num_file
                0052       INTEGER myOptimIter
                0053       INTEGER bi, bj, myThid
                0054       LOGICAL lAdInit
                0055       _RL     dummy
                0056 CEOP
                0057 
                0058 #ifdef ALLOW_OBSFIT
                0059       CALL ACTIVE_READ_OBS_TILE_RL(
                0060      I     fidfwd_obs(active_num_file,bi,bj), active_num_file,
                0061      O     active_var,
                0062      I     lAdInit, irec, sample_ind_glob(active_num_file,irec,bi,bj),
                0063      I     FORWARD_SIMULATION, myOptimIter, bi, bj, myThid )
                0064 
                0065       CALL ACTIVE_READ_OBS_TILE_RL(
                0066      I     fidtan_obs(active_num_file,bi,bj), active_num_file,
                0067      O     g_active_var,
                0068      I     lAdInit, irec, sample_ind_glob(active_num_file,irec,bi,bj),
                0069      I     TANGENT_SIMULATION, myOptimIter, bi, bj, myThid )
                0070 
                0071 #endif
                0072 
                0073       RETURN
                0074       END
                0075 
                0076 C     ==================================================================
                0077 
                0078 CBOP
                0079 C     !ROUTINE: G_ACTIVE_WRITE_OBS_TILE
                0080 
                0081 C     !INTERFACE:
                0082       SUBROUTINE G_ACTIVE_WRITE_OBS_TILE(
                0083      I                                    active_num_file,
                0084      I                                    active_var,
                0085      I                                    g_active_var,
                0086      I                                    irec,
                0087      I                                    myOptimIter,
                0088      I                                    bi,
                0089      I                                    bj,
                0090      I                                    myThid,
                0091      I                                    dummy,
                0092      I                                    g_dummy )
                0093 
                0094 C     !DESCRIPTION:
                0095 C     ==================================================================
                0096 C     | Write an active record to an ObsFit .equi. tiled file
                0097 C     | for tangent linear calculations
                0098 C     ==================================================================
                0099 
                0100 C     !USES:
                0101       IMPLICIT NONE
                0102 C     == Global variables ===
                0103 #include "EEPARAMS.h"
                0104 #include "SIZE.h"
                0105 #ifdef ALLOW_OBSFIT
                0106 # include "OBSFIT_SIZE.h"
                0107 # include "OBSFIT.h"
                0108 #endif
                0109 
                0110 C     !INPUT PARAMETERS:
                0111 C     active_num_file: file number
                0112 C     active_var:      array
                0113 C     irec:            record number
                0114 C     myOptimIter:     number of optimization iteration (default: 0)
                0115 C     myThid:          my thread ID number
                0116       INTEGER active_num_file
                0117       _RL     active_var
                0118       _RL     g_active_var
                0119       INTEGER irec
                0120       INTEGER myOptimIter
                0121       INTEGER bi, bj, myThid
                0122       _RL     dummy
                0123       _RL     g_dummy
                0124 CEOP
                0125 
                0126 #ifdef ALLOW_OBSFIT
                0127       CALL ACTIVE_WRITE_OBS_TILE_RL(
                0128      I     fidfwd_obs(active_num_file,bi,bj),
                0129      I     active_num_file, active_var,
                0130      I     irec, sample_ind_glob(active_num_file,irec,bi,bj),
                0131      I     FORWARD_SIMULATION, myOptimIter, bi, bj, myThid )
                0132 
                0133       CALL ACTIVE_WRITE_OBS_TILE_RL(
                0134      I     fidtan_obs(active_num_file,bi,bj),
                0135      I     active_num_file, g_active_var,
                0136      I     irec, sample_ind_glob(active_num_file,irec,bi,bj),
                0137      I     TANGENT_SIMULATION, myOptimIter, bi, bj, myThid )
                0138 
                0139 #endif
                0140 
                0141       RETURN
                0142       END
                0143 
                0144 C     ==================================================================
                0145 
                0146 CBOP
                0147 C     !ROUTINE: G_ACTIVE_READ_OBS_GLOB
                0148 
                0149 C     !INTERFACE:
                0150       SUBROUTINE G_ACTIVE_READ_OBS_GLOB(
                0151      I                                   active_num_file,
                0152      O                                   active_var,
                0153      I                                   g_active_var,
                0154      O                                   active_mask,
                0155      I                                   g_active_mask,
                0156      I                                   irec,
                0157      I                                   lAdInit,
                0158      I                                   myOptimIter,
                0159      I                                   myThid,
                0160      I                                   dummy )
                0161 
                0162 C     !DESCRIPTION:
                0163 C     ==================================================================
                0164 C     | Read an active record from an ObsFit .equi. global file
                0165 C     | for tangent linear calculations
                0166 C     ==================================================================
                0167 
                0168 C     !USES:
                0169       IMPLICIT NONE
                0170 C     == Global variables ===
                0171 #include "EEPARAMS.h"
                0172 #include "SIZE.h"
                0173 #ifdef ALLOW_OBSFIT
                0174 # include "OBSFIT_SIZE.h"
                0175 # include "OBSFIT.h"
                0176 #endif
                0177 
                0178 C     !INPUT PARAMETERS:
                0179 C     active_num_file: file number
                0180 C     active_var:      array
                0181 C     active_mask:     array mask
                0182 C     irec:            record number
                0183 C     myOptimIter:     number of optimization iteration (default: 0)
                0184 C     myThid:          my thread ID number
                0185 C     lAdInit:         initialisation of corresponding adjoint
                0186 C                      variable and write to active file
                0187       _RL     active_var
                0188       _RL     g_active_var
                0189       _RL     active_mask
                0190       _RL     g_active_mask
                0191       INTEGER irec, active_num_file
                0192       INTEGER myOptimIter
                0193       INTEGER myThid
                0194       LOGICAL lAdInit
                0195       _RL     dummy
                0196 CEOP
                0197 
                0198 #ifdef ALLOW_OBSFIT
                0199 
                0200       CALL ACTIVE_READ_OBS_GLOB_RL(
                0201      I     fidglobal(active_num_file), active_num_file,
                0202      O     active_var, active_mask,
                0203      I     lAdInit, irec, obs_ind_glob(active_num_file,irec),
                0204      I     FORWARD_SIMULATION, myOptimIter, myThid )
                0205 
                0206       CALL ACTIVE_READ_OBS_GLOB_RL(
                0207      I     fidtanglobal(active_num_file), active_num_file,
                0208      O     g_active_var, active_mask,
                0209      I     lAdInit, irec, obs_ind_glob(active_num_file,irec),
                0210      I     TANGENT_SIMULATION, myOptimIter, myThid )
                0211 
                0212 #endif
                0213 
                0214       RETURN
                0215       END
                0216 
                0217 C     ==================================================================
                0218 
                0219 CBOP
                0220 C     !ROUTINE: G_ACTIVE_WRITE_OBS_GLOB
                0221 
                0222 C     !INTERFACE:
                0223       SUBROUTINE G_ACTIVE_WRITE_OBS_GLOB(
                0224      I                                    active_num_file,
                0225      I                                    active_var,
                0226      I                                    g_active_var,
                0227      I                                    active_mask,
                0228      I                                    g_active_mask,
                0229      I                                    irec,
                0230      I                                    myOptimIter,
                0231      I                                    myThid,
                0232      I                                    dummy,
                0233      I                                    g_dummy )
                0234 
                0235 C     !DESCRIPTION:
                0236 C     ==================================================================
                0237 C     | Write an active record to an ObsFit .equi. global file
                0238 C     | for tangent linear calculations
                0239 C     ==================================================================
                0240 
                0241 C     !USES:
                0242       IMPLICIT NONE
                0243 C     == Global variables ===
                0244 #include "EEPARAMS.h"
                0245 #include "SIZE.h"
                0246 #ifdef ALLOW_OBSFIT
                0247 # include "OBSFIT_SIZE.h"
                0248 # include "OBSFIT.h"
                0249 #endif
                0250 
                0251 C !INPUT PARAMETERS:
                0252 C     active_num_file: file number
                0253 C     active_var:      array
                0254 C     active_mask:     array mask
                0255 C     irec:            record number
                0256 C     myOptimIter:     number of optimization iteration (default: 0)
                0257 C     myThid:          my thread ID number
                0258       INTEGER active_num_file
                0259       _RL     active_var
                0260       _RL     g_active_var
                0261       _RL     active_mask
                0262       _RL     g_active_mask
                0263       INTEGER irec
                0264       INTEGER myOptimIter
                0265       INTEGER myThid
                0266       _RL     dummy
                0267       _RL     g_dummy
                0268 CEOP
                0269 
                0270 #ifdef ALLOW_OBSFIT
                0271       CALL ACTIVE_WRITE_OBS_GLOB_RL(
                0272      I     fidglobal(active_num_file), active_num_file,
                0273      I     active_var, active_mask,
                0274      I     irec, obs_ind_glob(active_num_file,irec),
                0275      I     FORWARD_SIMULATION, myOptimIter, myThid )
                0276 
                0277       CALL ACTIVE_WRITE_OBS_GLOB_RL(
                0278      I     fidtanglobal(active_num_file), active_num_file,
                0279      I     g_active_var, g_active_mask,
                0280      I     irec, obs_ind_glob(active_num_file,irec),
                0281      I     TANGENT_SIMULATION, myOptimIter, myThid )
                0282 
                0283 #endif
                0284 
                0285       RETURN
                0286       END
                0287 
                0288 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|