Back to home page

MITgcm

 
 

    


File indexing completed on 2024-10-29 05:11:02 UTC

view on githubraw file Latest commit c9bf1633 on 2024-10-29 03:40:17 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
                0015 c     changed: gforget@ocean.mit.edu 23-Mar-2006
                0016 C     ==================================================================
                0017 
                0018 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0019 CBOP
                0020 C     !ROUTINE: G_ACTIVE_READ_PROFILE
                0021 C     !INTERFACE:
                0022       SUBROUTINE G_ACTIVE_READ_PROFILE(
6e4c90fea3 Patr*0023      I                           active_num_file,
                0024      I                           nactive_var,
                0025      O                           active_var,
c9bf163375 Ivan*0026      I                           g_active_var,
6e4c90fea3 Patr*0027      I                           active_varnum,
                0028      I                           irec,
                0029      I                           lAdInit,
                0030      I                           myOptimIter,
71a5587721 Gael*0031      I                           bi,
                0032      I                           bj,
c9bf163375 Ivan*0033      I                           myThid,
                0034      I                           dummy
6e4c90fea3 Patr*0035      &                         )
                0036 
c9bf163375 Ivan*0037 C     !DESCRIPTION:
                0038 C
                0039 C     Read active 1D records from file for tangent linear simulation
6e4c90fea3 Patr*0040 
c9bf163375 Ivan*0041 C     !USES:
                0042       IMPLICIT NONE
6e4c90fea3 Patr*0043 
                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)
                0057 C     myThid:          thread number for this instance
                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
                0071 
                0072 #ifdef ALLOW_PROFILES
c9bf163375 Ivan*0073 CEOP
6e4c90fea3 Patr*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
                0094 C     !ROUTINE: G_ACTIVE_WRITE_PROFILE
                0095 C     !INTERFACE:
                0096       SUBROUTINE G_ACTIVE_WRITE_PROFILE(
6e4c90fea3 Patr*0097      I                           active_num_file,
                0098      I                           nactive_var,
                0099      I                           active_var,
c9bf163375 Ivan*0100      I                           g_active_var,
6e4c90fea3 Patr*0101      I                           active_varnum,
                0102      I                           irec,
                0103      I                           myOptimIter,
71a5587721 Gael*0104      I                           bi,
                0105      I                           bj,
c9bf163375 Ivan*0106      I                           myThid,
6e4c90fea3 Patr*0107      I                           dummy,
                0108      I                           g_dummy
                0109      &                                )
                0110 
c9bf163375 Ivan*0111 C     !DESCRIPTION: \bv
                0112 C
                0113 C     write active 1D records to file for tangent linear simulation
6e4c90fea3 Patr*0114 
c9bf163375 Ivan*0115 C     !USES:
                0116       IMPLICIT NONE
6e4c90fea3 Patr*0117 
                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)
                0131 C     myThid:          thread number for this instance
                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:
6e4c90fea3 Patr*0141 
                0142 #ifdef ALLOW_PROFILES
c9bf163375 Ivan*0143 CEOP
6e4c90fea3 Patr*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