Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:42:55 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
367ecbf006 Gael*0001 #include "PROFILES_OPTIONS.h"
6e4c90fea3 Patr*0002 
                0003 c     ==================================================================
                0004 c
                0005 c     active_files_ad.F: Routines to handle the I/O of the active file
                0006 c                        for the adjoint calculations. All files are
                0007 c                        direct access files.
                0008 c
                0009 c     Routines
                0010 c
                0011 c     o  adactive_read_profile      - Adjoint of active_read_profile
                0012 c     o  adactive_write_profile     - Adjoint of active_write_profile
                0013 c
                0014 c        changed: gforget@ocean.mit.edu 23-Mar-2006
                0015 c
                0016 c     ==================================================================
                0017 
                0018       subroutine adactive_read_profile(
                0019      I                              active_num_file,
                0020      I                              nadactive_var,
10434d1dc4 Patr*0021      I                              adactive_var,
71a5587721 Gael*0022      I                              active_varnum,
6e4c90fea3 Patr*0023      I                              irec,
                0024      I                              lAdInit,
                0025      I                              myiter,
71a5587721 Gael*0026      I                              bi,
                0027      I                              bj,
10434d1dc4 Patr*0028      I                              mythid
6e4c90fea3 Patr*0029      &                            )
                0030 
                0031 C     !DESCRIPTION: \bv
                0032 c     ==================================================================
                0033 c     SUBROUTINE adactive_read_profile
                0034 c     ==================================================================
                0035 c     o Adjoint of active_read_profile.
                0036 c     ==================================================================
                0037       implicit none
                0038 
                0039 c     == global variables ==
                0040 #include "EEPARAMS.h"
                0041 #include "SIZE.h"
                0042 #ifdef ALLOW_PROFILES
6328b73337 Gael*0043 # include "PROFILES_SIZE.h"
6e4c90fea3 Patr*0044 # include "profiles.h"
                0045 #endif
                0046 
                0047 c     == routine arguments ==
                0048 c     active_var_file: filename
                0049 c     nadactive_var:   integer size of adactive_var
                0050 c     adactive_var:    array
                0051 c     irec:            record number
                0052 c     myIter:          number of optimization iteration (default: 0)
                0053 c     mythid:          thread number for this instance
                0054 c     doglobalread:    flag for global or local read/write
                0055 c                      (default: .false.)
                0056 c     lAdInit:         initialisation of corresponding adjoint
                0057 c                      variable and write to active file
                0058       integer nadactive_var,active_num_file
                0059       _RL    adactive_var(nadactive_var)
                0060       integer irec,active_varnum
                0061       integer myiter
71a5587721 Gael*0062       integer  bi,bj,mythid
6e4c90fea3 Patr*0063       logical lAdInit
                0064 
                0065 #ifdef ALLOW_PROFILES
                0066 
71a5587721 Gael*0067       call active_read_profile_rl( fidadjoint(active_num_file,bi,bj) ,
6e4c90fea3 Patr*0068      &     active_num_file,
71a5587721 Gael*0069      &     nadactive_var, adactive_var, active_varnum, lAdInit,
                0070      &     irec, prof_ind_glob(active_num_file,irec,bi,bj),
                0071      &     REVERSE_SIMULATION, myiter,bi,bj, mythid)
6e4c90fea3 Patr*0072 
                0073 #endif
                0074 
                0075       end
                0076 
                0077 c     ==================================================================
                0078 c     ==================================================================
                0079 c     ==================================================================
                0080 
                0081 
                0082       subroutine adactive_write_profile(
                0083      I                              active_num_file,
                0084      I                              nadactive_var,
10434d1dc4 Patr*0085      I                              adactive_var,
71a5587721 Gael*0086      I                              active_varnum,
6e4c90fea3 Patr*0087      I                              irec,
                0088      I                              myiter,
71a5587721 Gael*0089      I                              bi,
                0090      I                              bj,
6e4c90fea3 Patr*0091      I                              mythid,
                0092      I                              dummy
                0093      &                            )
                0094 
                0095 C     !DESCRIPTION: \bv
                0096 c     ==================================================================
                0097 c     SUBROUTINE adactive_write_profile
                0098 c     ==================================================================
                0099 c     o Adjoint of active_write_profile.
                0100 c     ==================================================================
                0101 
                0102       implicit none
                0103 
                0104 c     == global variables ==
                0105 #include "EEPARAMS.h"
                0106 #include "SIZE.h"
                0107 #ifdef ALLOW_PROFILES
6328b73337 Gael*0108 # include "PROFILES_SIZE.h"
6e4c90fea3 Patr*0109 # include "profiles.h"
                0110 #endif
                0111 
                0112 c     == routine arguments ==
                0113 c     active_var_file: filename
                0114 c     nadactive_var:   integer size of adactive_var
                0115 c     adactive_var:    array
                0116 c     irec:            record number
                0117 c     myIter:          number of optimization iteration (default: 0)
                0118 c     mythid:          thread number for this instance
                0119 c     doglobalread:    flag for global or local read/write
                0120 c                      (default: .false.)
                0121 c     lAdInit:         initialisation of corresponding adjoint
                0122 c                      variable and write to active file
                0123       integer nadactive_var,active_num_file
                0124       _RL    adactive_var(nadactive_var)
                0125       integer irec,active_varnum
                0126       integer myiter
71a5587721 Gael*0127       integer  bi,bj,mythid
6e4c90fea3 Patr*0128       _RL     dummy
                0129 
                0130 
                0131 c     == end of interface ==
                0132 
                0133 #ifdef ALLOW_PROFILES
                0134 
71a5587721 Gael*0135       call active_write_profile_rl( fidadjoint(active_num_file,bi,bj) ,
6e4c90fea3 Patr*0136      &     active_num_file,
71a5587721 Gael*0137      &     nadactive_var, adactive_var, active_varnum,
                0138      &     irec, prof_ind_glob(active_num_file,irec,bi,bj),
                0139      &     REVERSE_SIMULATION, myiter,bi,bj, mythid)
6e4c90fea3 Patr*0140 
                0141 #endif
                0142 
                0143       end
                0144 
                0145 c     ==================================================================
                0146 
                0147