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_file.F: Routines to handle the I/O of the active file for
                0006 c                    the adjoint calculations. All files are direct
                0007 c                    access files.
                0008 c
                0009 c     Routines
                0010 c
                0011 c    o  active_read_profile       - Read  an active 1D record.
                0012 c    o  active_write_profile      - Write an active 1D record.
                0013 c
                0014 c
                0015 c        changed: gforget@ocean.mit.edu 23-Mar-2006
                0016 c
                0017 c     ==================================================================
                0018 
                0019 C     !ROUTINE: active_read_profile
                0020 C     !INTERFACE:
                0021       subroutine active_read_profile(
                0022      I                           active_num_file,
                0023      I                           nactive_var,
                0024      O                           active_var,
                0025      I                           active_varnum,
                0026      I                           irec,
                0027      I                           lAdInit,
                0028      I                           myOptimIter,
71a5587721 Gael*0029      I                           bi,
                0030      I                           bj,
6e4c90fea3 Patr*0031      I                           mythid,
                0032      I                           dummy
                0033      &                         )
                0034 
                0035 c     ==================================================================
                0036 c     SUBROUTINE active_read_profile
                0037 c     ==================================================================
                0038 c     o Read an active 1D record from an profile data file.
                0039 c     ==================================================================
                0040 
                0041       implicit none
                0042 c     == global variables ==
                0043 #include "EEPARAMS.h"
                0044 #include "SIZE.h"
                0045 #ifdef ALLOW_PROFILES
6328b73337 Gael*0046 # include "PROFILES_SIZE.h"
6e4c90fea3 Patr*0047 # include "profiles.h"
                0048 #endif
                0049 
                0050 c     == routine arguments ==
                0051 c     active_var_file: filename
                0052 c     nactive_var:     integer size of active_var
                0053 c     active_var:      array
                0054 c     active_varname:      name fo the quantity to save
                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  nactive_var,active_num_file
                0061       _RL   active_var(nactive_var)
                0062       integer  irec,active_varnum
                0063       integer  myOptimIter
71a5587721 Gael*0064       integer  bi,bj,mythid
6e4c90fea3 Patr*0065       logical  lAdInit
                0066       _RL      dummy
                0067 
                0068 #ifdef ALLOW_PROFILES
                0069 
71a5587721 Gael*0070       call active_read_profile_rl( fidforward(active_num_file,bi,bj),
6e4c90fea3 Patr*0071      &     active_num_file,
                0072      &     nactive_var, active_var, active_varnum, lAdInit,
71a5587721 Gael*0073      &     irec, prof_ind_glob(active_num_file,irec,bi,bj),
                0074      &     FORWARD_SIMULATION, myOptimIter,bi,bj, mythid)
6e4c90fea3 Patr*0075 
                0076 #endif
                0077 
                0078       return
                0079       end
                0080 
                0081 c     ==================================================================
                0082 c     ==================================================================
                0083 c     ==================================================================
                0084 
                0085 C     !ROUTINE: active_write_profile
                0086 C     !INTERFACE:
                0087       subroutine active_write_profile(
                0088      I                           active_num_file,
                0089      I                           nactive_var,
                0090      I                           active_var,
                0091      I                           active_varnum,
                0092      I                           irec,
                0093      I                           myOptimIter,
71a5587721 Gael*0094      I                           bi,
                0095      I                           bj,
6e4c90fea3 Patr*0096      I                           mythid,
                0097      I                           dummy
                0098      &                         )
                0099 
                0100 C     !DESCRIPTION: \bv
                0101 c     ==================================================================
                0102 c     SUBROUTINE active_write_profile
                0103 c     ==================================================================
                0104 c     o Write an active 1D record from file.
                0105 c     ==================================================================
                0106 
                0107 C     !USES:
                0108       implicit none
                0109 
                0110 c     == global variables ==
                0111 #include "EEPARAMS.h"
                0112 #include "SIZE.h"
                0113 #ifdef ALLOW_PROFILES
6328b73337 Gael*0114 # include "PROFILES_SIZE.h"
6e4c90fea3 Patr*0115 # include "profiles.h"
                0116 #endif
                0117 
                0118 c     == routine arguments ==
                0119 c     active_var_file: filename
                0120 c     nactive_var:     integer size of active_var
                0121 c     active_var:      array
                0122 c     active_varname:      name fo the quantity to save
                0123 c     irec:            record number
                0124 c     myOptimIter:     number of optimization iteration (default: 0)
                0125 c     mythid:          thread number for this instance
                0126       integer  nactive_var,active_num_file, active_varnum
                0127       _RL   active_var(nactive_var)
                0128       integer  irec
                0129       integer  myOptimIter
71a5587721 Gael*0130       integer  bi,bj,mythid
6e4c90fea3 Patr*0131       _RL      dummy
                0132 
                0133 #ifdef ALLOW_PROFILES
                0134 
71a5587721 Gael*0135       call active_write_profile_rl( fidforward(active_num_file,bi,bj),
6e4c90fea3 Patr*0136      &     active_num_file,
71a5587721 Gael*0137      &     nactive_var, active_var, active_varnum,
                0138      &     irec, prof_ind_glob(active_num_file,irec,bi,bj),
                0139      &     FORWARD_SIMULATION, myOptimIter,bi,bj, mythid)
6e4c90fea3 Patr*0140 
                0141 #endif
                0142 
                0143       return
                0144       end
                0145 
                0146 c     ==================================================================
                0147 
                0148