Back to home page

MITgcm

 
 

    


File indexing completed on 2025-08-05 05:09:14 UTC

view on githubraw file Latest commit 13ce79fe on 2025-08-04 21:05:34 UTC
367ecbf006 Gael*0001 #include "PROFILES_OPTIONS.h"
6e4c90fea3 Patr*0002 
c9bf163375 Ivan*0003 C     ==================================================================
                0004 C     active_file_profiles_g.F: Routines that handle the I/O of
                0005 C                               active variables for the tangently linear
                0006 C                               calculations, related to netcdf
                0007 C                               profiles data files
                0008 C
                0009 C     Routines
                0010 C     o  g_active_read_profile  - Read an active 1 record from file
                0011 C                                 fwd-mode only: including a mask
                0012 C     o  g_active_write_profile - Write nn active 1D record to file.
                0013 C                                 fwd-mode only: including a mask
                0014 C
13ce79fe94 Ivan*0015 C     changed: gforget@ocean.mit.edu 23-Mar-2006
c9bf163375 Ivan*0016 C     ==================================================================
                0017 
                0018 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0019 CBOP
13ce79fe94 Ivan*0020 C !ROUTINE: G_ACTIVE_READ_PROFILE
                0021 
                0022 C !INTERFACE:
c9bf163375 Ivan*0023       SUBROUTINE G_ACTIVE_READ_PROFILE(
6e4c90fea3 Patr*0024      I                           active_num_file,
                0025      I                           nactive_var,
                0026      O                           active_var,
13ce79fe94 Ivan*0027      O                           g_active_var,
6e4c90fea3 Patr*0028      I                           active_varnum,
                0029      I                           irec,
                0030      I                           lAdInit,
                0031      I                           myOptimIter,
71a5587721 Gael*0032      I                           bi,
                0033      I                           bj,
c9bf163375 Ivan*0034      I                           myThid,
13ce79fe94 Ivan*0035      O                           dummy
6e4c90fea3 Patr*0036      &                         )
                0037 
c9bf163375 Ivan*0038 C     !DESCRIPTION:
                0039 C     Read active 1D records from file for tangent linear simulation
6e4c90fea3 Patr*0040 
c9bf163375 Ivan*0041 C     !USES:
                0042       IMPLICIT NONE
13ce79fe94 Ivan*0043 C     == Global variables ===
6e4c90fea3 Patr*0044 #include "EEPARAMS.h"
                0045 #include "SIZE.h"
                0046 #ifdef ALLOW_PROFILES
6328b73337 Gael*0047 # include "PROFILES_SIZE.h"
                0048 # include "profiles.h"
6e4c90fea3 Patr*0049 #endif
                0050 
c9bf163375 Ivan*0051 C     !INPUT PARAMETERS:
                0052 C     active_var_file: filename
                0053 C     nactive_var:     integer size of active_var
                0054 C     active_var:      array
                0055 C     irec:            record number
                0056 C     myOptimIter:     number of optimization iteration (default: 0)
13ce79fe94 Ivan*0057 C     myThid:          my thread ID number
c9bf163375 Ivan*0058 C     lAdInit:         initialisation of corresponding adjoint
                0059 C                      variable and write to active file
                0060       INTEGER active_num_file
                0061       INTEGER nactive_var
                0062       INTEGER active_varnum
                0063       INTEGER irec
                0064       INTEGER myOptimIter
                0065       INTEGER bi, bj, myThid
                0066       LOGICAL lAdInit
                0067 C     !OUTPUT PARAMETERS:
                0068       _RL     active_var(nactive_var)
                0069       _RL     g_active_var(nactive_var)
6e4c90fea3 Patr*0070       _RL     dummy
13ce79fe94 Ivan*0071 CEOP
6e4c90fea3 Patr*0072 
                0073 #ifdef ALLOW_PROFILES
                0074 
c9bf163375 Ivan*0075       CALL ACTIVE_READ_PROFILE_RL( fidforward(active_num_file,bi,bj),
6e4c90fea3 Patr*0076      &     active_num_file,
71a5587721 Gael*0077      &     nactive_var,  active_var, active_varnum, lAdInit,
                0078      &     irec, prof_ind_glob(active_num_file,irec,bi,bj),
c9bf163375 Ivan*0079      &     FORWARD_SIMULATION, myOptimIter, bi, bj, myThid )
6e4c90fea3 Patr*0080 
c9bf163375 Ivan*0081       CALL ACTIVE_READ_PROFILE_RL( fidtangent(active_num_file,bi,bj),
6e4c90fea3 Patr*0082      &     active_num_file,
71a5587721 Gael*0083      &     nactive_var, g_active_var,active_varnum, lAdInit,
                0084      &     irec, prof_ind_glob(active_num_file,irec,bi,bj),
c9bf163375 Ivan*0085      &     TANGENT_SIMULATION, myOptimIter, bi, bj, myThid )
6e4c90fea3 Patr*0086 
                0087 #endif
                0088 
c9bf163375 Ivan*0089       RETURN
                0090       END
6e4c90fea3 Patr*0091 
c9bf163375 Ivan*0092 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0093 CBOP
13ce79fe94 Ivan*0094 C !ROUTINE: G_ACTIVE_WRITE_PROFILE
                0095 
                0096 C !INTERFACE:
c9bf163375 Ivan*0097       SUBROUTINE G_ACTIVE_WRITE_PROFILE(
6e4c90fea3 Patr*0098      I                           active_num_file,
                0099      I                           nactive_var,
                0100      I                           active_var,
c9bf163375 Ivan*0101      I                           g_active_var,
6e4c90fea3 Patr*0102      I                           active_varnum,
                0103      I                           irec,
                0104      I                           myOptimIter,
71a5587721 Gael*0105      I                           bi,
                0106      I                           bj,
c9bf163375 Ivan*0107      I                           myThid,
6e4c90fea3 Patr*0108      I                           dummy,
                0109      I                           g_dummy
                0110      &                                )
                0111 
13ce79fe94 Ivan*0112 C     !DESCRIPTION:
                0113 C     Write active 1D records to file for tangent linear simulation
6e4c90fea3 Patr*0114 
c9bf163375 Ivan*0115 C     !USES:
                0116       IMPLICIT NONE
13ce79fe94 Ivan*0117 C     == Global variables ===
6e4c90fea3 Patr*0118 #include "EEPARAMS.h"
                0119 #include "SIZE.h"
                0120 #ifdef ALLOW_PROFILES
6328b73337 Gael*0121 # include "PROFILES_SIZE.h"
                0122 # include "profiles.h"
6e4c90fea3 Patr*0123 #endif
                0124 
c9bf163375 Ivan*0125 C     !INPUT PARAMETERS:
                0126 C     active_var_file: filename
                0127 C     nactive_var:     integer size of active_var
                0128 C     active_var:      array
                0129 C     irec:            record number
                0130 C     myOptimIter:     number of optimization iteration (default: 0)
13ce79fe94 Ivan*0131 C     myThid:          my thread ID number
c9bf163375 Ivan*0132       INTEGER nactive_var,active_num_file
                0133       _RL     active_var(nactive_var)
                0134       _RL     g_active_var(nactive_var)
                0135       INTEGER irec,active_varnum
                0136       INTEGER myOptimIter
                0137       INTEGER bi,bj,myThid
6e4c90fea3 Patr*0138       _RL     dummy
                0139       _RL     g_dummy
c9bf163375 Ivan*0140 C     !OUTPUT PARAMETERS:
13ce79fe94 Ivan*0141 CEOP
6e4c90fea3 Patr*0142 
                0143 #ifdef ALLOW_PROFILES
                0144 
c9bf163375 Ivan*0145       CALL ACTIVE_WRITE_PROFILE_RL( fidforward(active_num_file,bi,bj),
6e4c90fea3 Patr*0146      &     active_num_file,
71a5587721 Gael*0147      &     nactive_var, active_var, active_varnum,
                0148      &     irec, prof_ind_glob(active_num_file,irec,bi,bj),
c9bf163375 Ivan*0149      &     FORWARD_SIMULATION, myOptimIter, bi, bj, myThid )
6e4c90fea3 Patr*0150 
c9bf163375 Ivan*0151       CALL ACTIVE_WRITE_PROFILE_RL( fidtangent(active_num_file,bi,bj),
6e4c90fea3 Patr*0152      &     active_num_file,
71a5587721 Gael*0153      &     nactive_var, g_active_var, active_varnum,
                0154      &     irec, prof_ind_glob(active_num_file,irec,bi,bj),
c9bf163375 Ivan*0155      &     TANGENT_SIMULATION, myOptimIter, bi, bj, myThid )
6e4c90fea3 Patr*0156 
                0157 #endif
                0158 
c9bf163375 Ivan*0159       RETURN
                0160       END