Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:42:56 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_g.F: Routines to handle the I/O of the active file for
ef53b829d7 Jean*0006 c                      the tangent linear calculations. All files are
6e4c90fea3 Patr*0007 c                      direct access files.
                0008 c
                0009 c     Routines
                0010 c
                0011 c    o  g_active_read_profile      - Read  an active 1D variable from file.
                0012 c    o  g_active_write_profile     - Write an active 1D variable to a file.
                0013 c
                0014 c        changed: gforget@ocean.mit.edu 23-Mar-2006
                0015 c
                0016 c     ==================================================================
                0017 
                0018       subroutine g_active_read_profile(
                0019      I                           active_num_file,
                0020      I                           nactive_var,
                0021      O                           active_var,
                0022      I                           active_varnum,
                0023      I                           irec,
                0024      I                           lAdInit,
                0025      I                           myOptimIter,
71a5587721 Gael*0026      I                           bi,
                0027      I                           bj,
6e4c90fea3 Patr*0028      I                           mythid,
                0029      I                           dummy,
                0030      I                           g_active_var
                0031      &                         )
                0032 
                0033 C     !DESCRIPTION: \bv
                0034 c     ==================================================================
                0035 c     SUBROUTINE g_active_read_profile
                0036 c     ==================================================================
                0037 c     o Read an active 1D record from an profile data file.
                0038 c     ==================================================================
                0039 
                0040       implicit none
                0041 
                0042 c     == global variables ==
                0043 #include "EEPARAMS.h"
                0044 #include "SIZE.h"
                0045 #ifdef ALLOW_PROFILES
6328b73337 Gael*0046 # include "PROFILES_SIZE.h"
                0047 # include "profiles.h"
6e4c90fea3 Patr*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     irec:            record number
                0055 c     myOptimIter:     number of optimization iteration (default: 0)
                0056 c     mythid:          thread number for this instance
                0057 c     doglobalread:    flag for global or local read/write
                0058 c                      (default: .false.)
                0059 c     lAdInit:         initialisation of corresponding adjoint
                0060 c                      variable and write to active file
                0061       integer nactive_var
                0062       _RL  active_var(nactive_var)
                0063       _RL  g_active_var(nactive_var)
                0064       integer irec,active_varnum,active_num_file
                0065       integer myOptimIter
71a5587721 Gael*0066       integer  bi,bj,mythid
6e4c90fea3 Patr*0067       logical lAdInit
                0068       _RL     dummy
                0069 
                0070 #ifdef ALLOW_PROFILES
                0071 
71a5587721 Gael*0072       call active_read_profile_rl( fidforward(active_num_file,bi,bj),
6e4c90fea3 Patr*0073      &     active_num_file,
71a5587721 Gael*0074      &     nactive_var,  active_var, active_varnum, lAdInit,
                0075      &     irec, prof_ind_glob(active_num_file,irec,bi,bj),
                0076      &     TANGENT_SIMULATION, myOptimIter,bi,bj, mythid)
6e4c90fea3 Patr*0077 
71a5587721 Gael*0078       call active_read_profile_rl( fidtangent(active_num_file,bi,bj),
6e4c90fea3 Patr*0079      &     active_num_file,
71a5587721 Gael*0080      &     nactive_var, g_active_var,active_varnum, lAdInit,
                0081      &     irec, prof_ind_glob(active_num_file,irec,bi,bj),
                0082      &     TANGENT_SIMULATION, myOptimIter,bi,bj, mythid)
6e4c90fea3 Patr*0083 
                0084 #endif
                0085 
                0086       return
                0087       end
                0088 
                0089 
                0090 c     ==================================================================
                0091 c     ==================================================================
                0092 c     ==================================================================
                0093 
                0094       subroutine g_active_write_profile(
                0095      I                           active_num_file,
                0096      I                           nactive_var,
                0097      I                           active_var,
                0098      I                           active_varnum,
                0099      I                           irec,
                0100      I                           myOptimIter,
71a5587721 Gael*0101      I                           bi,
                0102      I                           bj,
6e4c90fea3 Patr*0103      I                           mythid,
                0104      I                           dummy,
                0105      I                           g_active_var,
                0106      I                           g_dummy
                0107      &                                )
                0108 
                0109 c     ==================================================================
                0110 c     SUBROUTINE g_active_write_profile
                0111 c     ==================================================================
                0112 c
                0113 c     o Write an active 1D variable to a file.
                0114 c     ==================================================================
                0115 
                0116       implicit none
                0117 
                0118 c     == global variables ==
                0119 #include "EEPARAMS.h"
                0120 #include "SIZE.h"
                0121 #ifdef ALLOW_PROFILES
6328b73337 Gael*0122 # include "PROFILES_SIZE.h"
                0123 # include "profiles.h"
6e4c90fea3 Patr*0124 #endif
                0125 
                0126 c     == routine arguments ==
                0127 c     active_var_file: filename
                0128 c     nactive_var:     integer size of active_var
                0129 c     active_var:      array
                0130 c     irec:            record number
                0131 c     myOptimIter:     number of optimization iteration (default: 0)
                0132 c     mythid:          thread number for this instance
                0133       integer nactive_var,active_num_file
                0134       _RL  active_var(nactive_var)
                0135       _RL  g_active_var(nactive_var)
                0136       integer irec,active_varnum
                0137       integer myOptimIter
71a5587721 Gael*0138       integer  bi,bj,mythid
6e4c90fea3 Patr*0139       _RL     dummy
                0140       _RL     g_dummy
                0141 
                0142 #ifdef ALLOW_PROFILES
                0143 
71a5587721 Gael*0144       call active_write_profile_rl( fidforward(active_num_file,bi,bj) ,
6e4c90fea3 Patr*0145      &     active_num_file,
71a5587721 Gael*0146      &     nactive_var, active_var, active_varnum,
                0147      &     irec, prof_ind_glob(active_num_file,irec,bi,bj),
                0148      &     TANGENT_SIMULATION, myOptimIter,bi,bj, mythid)
6e4c90fea3 Patr*0149 
71a5587721 Gael*0150       call active_write_profile_rl( fidtangent(active_num_file,bi,bj) ,
6e4c90fea3 Patr*0151      &     active_num_file,
71a5587721 Gael*0152      &     nactive_var, g_active_var, active_varnum,
                0153      &     irec, prof_ind_glob(active_num_file,irec,bi,bj),
                0154      &     TANGENT_SIMULATION, myOptimIter,bi,bj, mythid)
6e4c90fea3 Patr*0155 
                0156 #endif
                0157 
                0158       return
                0159       end
                0160 
                0161 c     ==================================================================
                0162 
                0163 
                0164