Back to home page

MITgcm

 
 

    


File indexing completed on 2023-05-28 05:10:31 UTC

view on githubraw file Latest commit b4daa243 on 2023-05-28 03:53:22 UTC
b4daa24319 Shre*0001 #include "PROFILES_OPTIONS.h"
                0002 
                0003 c     ==================================================================
                0004 c
                0005 c     active_files_tap_adj.F: Routines to handle the I/O of the active file
                0006 c                        for the adjoint calculations with Tapenade.
                0007 c                        All files are direct access files.
                0008 c
                0009 c     Routines
                0010 c     o  active_read_profile_b      - Adjoint of active_read_profile
                0011 c     o  active_write_profile_b     - Adjoint of active_write_profile
                0012 c
                0013 c        changed: shreyasg911@gmail.com 26-Mar-2023
                0014 c
                0015 c     ==================================================================
                0016 
                0017       subroutine active_read_profile_b(
                0018      I                              active_num_file,
                0019      I                              nadactive_var,
                0020      I                              active_var,
                0021      I                              adactive_var,
                0022      I                              active_varnum,
                0023      I                              irec,
                0024      I                              lAdInit,
                0025      I                              myiter,
                0026      I                              bi,
                0027      I                              bj,
                0028      I                              mythid,
                0029      I                              dummy,
                0030      I                              dummyb
                0031      &                            )
                0032 
                0033 C     !DESCRIPTION: \bv
                0034 c     ==================================================================
                0035 c     SUBROUTINE active_read_profile_b
                0036 c     ==================================================================
                0037 c     o Adjoint of active_read_profile.
                0038 c     ==================================================================
                0039       implicit none
                0040 
                0041 c     == global variables ==
                0042 #include "EEPARAMS.h"
                0043 #include "SIZE.h"
                0044 #ifdef ALLOW_PROFILES
                0045 # include "PROFILES_SIZE.h"
                0046 # include "profiles.h"
                0047 #endif
                0048 
                0049 c     == routine arguments ==
                0050 c     active_var_file: filename
                0051 c     nadactive_var:   integer size of adactive_var
                0052 c     adactive_var:    array
                0053 c     irec:            record number
                0054 c     lAdInit:         initialisation of corresponding adjoint
                0055 c                      variable and write to active file
                0056 c     myIter:          number of optimization iteration (default: 0)
                0057 c     mythid:          thread number for this instance
                0058       integer active_num_file, nadactive_var
                0059       _RL    active_var(nadactive_var), adactive_var(nadactive_var)
                0060       integer active_varnum
                0061       integer irec
                0062       logical lAdInit
                0063       integer myiter
                0064       integer  bi, bj, mythid
                0065       _RL      dummy
                0066       _RL      dummyb
                0067 c     == end of interface ==
                0068 
                0069 #ifdef ALLOW_PROFILES
                0070 
                0071       call active_read_profile_rl( fidadjoint(active_num_file,bi,bj) ,
                0072      &     active_num_file,
                0073      &     nadactive_var, adactive_var, active_varnum, lAdInit,
                0074      &     irec, prof_ind_glob(active_num_file,irec,bi,bj),
                0075      &     REVERSE_SIMULATION, myiter,bi,bj, mythid)
                0076 
                0077 #endif
                0078 
                0079       end
                0080 
                0081 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0082 
                0083       subroutine active_write_profile_b(
                0084      I                              active_num_file,
                0085      I                              nadactive_var,
                0086      I                              active_var,
                0087      I                              adactive_var,
                0088      I                              active_varnum,
                0089      I                              irec,
                0090      I                              myiter,
                0091      I                              bi,
                0092      I                              bj,
                0093      I                              mythid,
                0094      I                              dummy,
                0095      I                              dummyb
                0096      &                            )
                0097 
                0098 C     !DESCRIPTION: \bv
                0099 c     ==================================================================
                0100 c     SUBROUTINE active_write_profile_b
                0101 c     ==================================================================
                0102 c     o Adjoint of active_write_profile.
                0103 c     ==================================================================
                0104 
                0105       implicit none
                0106 
                0107 c     == global variables ==
                0108 #include "EEPARAMS.h"
                0109 #include "SIZE.h"
                0110 #ifdef ALLOW_PROFILES
                0111 # include "PROFILES_SIZE.h"
                0112 # include "profiles.h"
                0113 #endif
                0114 
                0115 c     == routine arguments ==
                0116 c     active_var_file: filename
                0117 c     nadactive_var:   integer size of adactive_var
                0118 c     adactive_var:    array
                0119 c     irec:            record number
                0120 c     myIter:          number of optimization iteration (default: 0)
                0121 c     mythid:          thread number for this instance
                0122       integer active_num_file, nadactive_var
                0123       _RL    active_var(nadactive_var), adactive_var(nadactive_var)
                0124       integer active_varnum
                0125       integer irec
                0126       integer myiter
                0127       integer  bi, bj, mythid
                0128       _RL     dummy
                0129       _RL     dummyb
                0130 c     == end of interface ==
                0131 
                0132 #ifdef ALLOW_PROFILES
                0133 
                0134       call active_write_profile_rl( fidadjoint(active_num_file,bi,bj) ,
                0135      &     active_num_file,
                0136      &     nadactive_var, adactive_var, active_varnum,
                0137      &     irec, prof_ind_glob(active_num_file,irec,bi,bj),
                0138      &     REVERSE_SIMULATION, myiter,bi,bj, mythid)
                0139 
                0140 #endif
                0141 
                0142       end