Back to home page

MITgcm

 
 

    


File indexing completed on 2025-12-15 06:14:26 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.F:
                0003 C--   Contents
                0004 C--   o active_read_obs_tile
                0005 C--   o active_write_obs_tile
                0006 C--   o active_read_obs_glob
                0007 C--   o active_write_obs_glob
                0008 
                0009 CBOP
                0010 C     !ROUTINE: ACTIVE_READ_OBS_TILE
                0011 
                0012 C     !INTERFACE:
                0013       SUBROUTINE ACTIVE_READ_OBS_TILE(
                0014      I                               active_num_file,
                0015      O                               active_var,
                0016      I                               irec,
                0017      I                               lAdInit,
                0018      I                               myOptimIter,
                0019      I                               bi,
                0020      I                               bj,
                0021      I                               myThid,
                0022      I                               dummy )
                0023 C     !DESCRIPTION:
                0024 C     ==================================================================
                0025 C     | Read an active record ("sample-equivalent") from an ObsFit
                0026 C     | .equi. tiled file (can be netcdf or binary)
                0027 C     ==================================================================
                0028 
                0029 C     !USES:
                0030       IMPLICIT NONE
                0031 C     == Global variables ===
                0032 #include "EEPARAMS.h"
                0033 #include "SIZE.h"
                0034 #ifdef ALLOW_OBSFIT
                0035 # include "OBSFIT_SIZE.h"
                0036 # include "OBSFIT.h"
                0037 #endif
                0038 
                0039 C     !INPUT PARAMETERS:
                0040 C     active_num_file: file number
                0041 C     active_var:      array
                0042 C     irec:            record number
                0043 C     myOptimIter:     number of optimization iteration (default: 0)
                0044 C     myThid:          my thread ID number
                0045 C     lAdInit:         initialisation of corresponding adjoint
                0046 C                      variable and write to active file
                0047       INTEGER  active_num_file
                0048       _RL      active_var
                0049       INTEGER  irec
                0050       INTEGER  myOptimIter
                0051       INTEGER  bi, bj, myThid
                0052       LOGICAL  lAdInit
                0053       _RL      dummy
                0054 CEOP
                0055 
                0056 #ifdef ALLOW_OBSFIT
                0057 
                0058       CALL ACTIVE_READ_OBS_TILE_RL(
                0059      I     fidfwd_obs(active_num_file,bi,bj), active_num_file,
                0060      O     active_var,
                0061      I     lAdInit, irec, sample_ind_glob(active_num_file,irec,bi,bj),
                0062      I     FORWARD_SIMULATION, myOptimIter, bi, bj, myThid )
                0063 
                0064 #endif
                0065 
                0066       RETURN
                0067       END
                0068 
                0069 C     ==================================================================
                0070 
                0071 CBOP
                0072 C     !ROUTINE: ACTIVE_WRITE_OBS_TILE
                0073 
                0074 C     !INTERFACE:
                0075       SUBROUTINE ACTIVE_WRITE_OBS_TILE(
                0076      I                           active_num_file,
                0077      I                           active_var,
                0078      I                           irec,
                0079      I                           myOptimIter,
                0080      I                           bi,
                0081      I                           bj,
                0082      I                           myThid,
                0083      I                           dummy )
                0084 
                0085 C     !DESCRIPTION:
                0086 C     ==================================================================
                0087 C     | Write to a file a sampled value during the model run
                0088 C     ==================================================================
                0089 
                0090 C     !USES:
                0091       IMPLICIT NONE
                0092 C     == Global variables ===
                0093 #include "EEPARAMS.h"
                0094 #include "SIZE.h"
                0095 #ifdef ALLOW_OBSFIT
                0096 # include "OBSFIT_SIZE.h"
                0097 # include "OBSFIT.h"
                0098 #endif
                0099 
                0100 C     !INPUT PARAMETERS:
                0101 C     active_num_file: file number
                0102 C     active_var:      array
                0103 C     irec:            record number
                0104 C     myOptimIter:     number of optimization iteration (default: 0)
                0105 C     myThid:          my thread ID number
                0106       INTEGER  active_num_file
                0107       _RL      active_var
                0108       INTEGER  irec
                0109       INTEGER  myOptimIter
                0110       INTEGER  bi, bj, myThid
                0111       _RL      dummy
                0112 CEOP
                0113 
                0114 #ifdef ALLOW_OBSFIT
                0115 
                0116       CALL ACTIVE_WRITE_OBS_TILE_RL(
                0117      I     fidfwd_obs(active_num_file,bi,bj),
                0118      I     active_num_file, active_var,
                0119      I     irec, sample_ind_glob(active_num_file,irec,bi,bj),
                0120      I     FORWARD_SIMULATION, myOptimIter, bi, bj, myThid )
                0121 
                0122 #endif
                0123 
                0124       RETURN
                0125       END
                0126 
                0127 C     ==================================================================
                0128 
                0129 CBOP
                0130 C     !ROUTINE: ACTIVE_READ_OBS_GLOB
                0131 
                0132 C     !INTERFACE:
                0133       SUBROUTINE ACTIVE_READ_OBS_GLOB(
                0134      I                               active_num_file,
                0135      O                               active_var,
                0136      O                               active_mask,
                0137      I                               irec,
                0138      I                               lAdInit,
                0139      I                               myOptimIter,
                0140      I                               myThid,
                0141      I                               dummy )
                0142 
                0143 C     !DESCRIPTION:
                0144 C     ==================================================================
                0145 C     | Read an active record ("observation-equivalent") from a
                0146 C     | global file
                0147 C     ==================================================================
                0148 
                0149 C     !USES:
                0150       IMPLICIT NONE
                0151 C     == Global variables ===
                0152 #include "EEPARAMS.h"
                0153 #include "SIZE.h"
                0154 #ifdef ALLOW_OBSFIT
                0155 # include "OBSFIT_SIZE.h"
                0156 # include "OBSFIT.h"
                0157 #endif
                0158 
                0159 C     !INPUT PARAMETERS:
                0160 C     active_num_file: file number
                0161 C     active_var:      array
                0162 C     active_mask:     array mask
                0163 C     irec:            record number
                0164 C     myOptimIter:     number of optimization iteration (default: 0)
                0165 C     myThid:          my thread ID number
                0166 C     lAdInit:         initialisation of corresponding adjoint
                0167 C                      variable and write to active file
                0168       INTEGER  active_num_file
                0169       _RL      active_var
                0170       _RL      active_mask
                0171       INTEGER  irec
                0172       INTEGER  myOptimIter
                0173       INTEGER  myThid
                0174       LOGICAL  lAdInit
                0175       _RL      dummy
                0176 CEOP
                0177 
                0178 #ifdef ALLOW_OBSFIT
                0179       CALL ACTIVE_READ_OBS_GLOB_RL(
                0180      I     fidglobal(active_num_file), active_num_file,
                0181      O     active_var, active_mask,
                0182      I     lAdInit, irec, obs_ind_glob(active_num_file,irec),
                0183      I     FORWARD_SIMULATION, myOptimIter, myThid )
                0184 
                0185 #endif
                0186 
                0187       RETURN
                0188       END
                0189 
                0190 C     ==================================================================
                0191 
                0192 CBOP
                0193 C     !ROUTINE: ACTIVE_WRITE_OBS_GLOB
                0194 
                0195 C     !INTERFACE:
                0196       SUBROUTINE ACTIVE_WRITE_OBS_GLOB(
                0197      I                           active_num_file,
                0198      I                           active_var,
                0199      I                           active_mask,
                0200      I                           irec,
                0201      I                           myOptimIter,
                0202      I                           myThid,
                0203      I                           dummy )
                0204 
                0205 C     !DESCRIPTION:
                0206 C     ==================================================================
                0207 C     | Write to a global file a model counterpart to an observation
                0208 C     ==================================================================
                0209 
                0210 C     !USES:
                0211       IMPLICIT NONE
                0212 C     == Global variables ===
                0213 #include "EEPARAMS.h"
                0214 #include "SIZE.h"
                0215 #ifdef ALLOW_OBSFIT
                0216 # include "OBSFIT_SIZE.h"
                0217 # include "OBSFIT.h"
                0218 #endif
                0219 
                0220 C     !INPUT PARAMETERS:
                0221 C     active_num_file: file number
                0222 C     active_var:      array
                0223 C     active_mask:     array mask
                0224 C     irec:            record number
                0225 C     myOptimIter:     number of optimization iteration (default: 0)
                0226 C     myThid:          my thread ID number
                0227       INTEGER  active_num_file
                0228       _RL      active_var
                0229       _RL      active_mask
                0230       INTEGER  irec
                0231       INTEGER  myOptimIter
                0232       INTEGER  myThid
                0233       _RL      dummy
                0234 CEOP
                0235 
                0236 #ifdef ALLOW_OBSFIT
                0237       CALL ACTIVE_WRITE_OBS_GLOB_RL(
                0238      I     fidglobal(active_num_file), active_num_file,
                0239      I     active_var, active_mask,
                0240      I     irec, obs_ind_glob(active_num_file,irec),
                0241      I     FORWARD_SIMULATION, myOptimIter, myThid )
                0242 
                0243 #endif
                0244 
                0245       RETURN
                0246       END
                0247 
                0248 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|