/[MITgcm]/MITgcm/pkg/autodiff/active_file.F
ViewVC logotype

Diff of /MITgcm/pkg/autodiff/active_file.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.5 by heimbach, Thu Mar 23 23:06:47 2006 UTC revision 1.8 by heimbach, Sat Nov 5 19:20:42 2011 UTC
# Line 1  Line 1 
1    C $Header$
2    C $Name$
3    
4  #include "AUTODIFF_OPTIONS.h"  #include "AUTODIFF_OPTIONS.h"
5    
# Line 19  c    o  active_write_xyz       - Write a Line 21  c    o  active_write_xyz       - Write a
21  c    o  active_write_xz        - Write an active 2D xz-slice to a file.  c    o  active_write_xz        - Write an active 2D xz-slice to a file.
22  c    o  active_write_yz        - Write an active 2D yz-slice to a file.  c    o  active_write_yz        - Write an active 2D yz-slice to a file.
23  c  c
 c    o  active_read_tile_xy    - Read  an active 2D variable from file.  
 c    o  active_read_tile_xyz   - Read  an active 3D variable from file.  
 c  
 c    o  active_write_tile_xy   - Write an active 2D variable to a file.  
 c    o  active_write_tile_xyz  - Write an active 3D variable to a file.  
 c  
 c    o  active_read_profile       - Read  an active 1D record.  
 c    o  active_write_profile      - Write an active 1D record.  
 c  
 c  
24  c        changed: Christian Eckert eckert@mit.edu 24-Apr-2000  c        changed: Christian Eckert eckert@mit.edu 24-Apr-2000
25  c                 - Added routines that do active writes on tiles  c                 - Added routines that do active writes on tiles
26  c                   instead of a whole thread.  c                   instead of a whole thread.
# Line 564  CEOP Line 556  CEOP
556    
557        return        return
558        end        end
   
 c     ==================================================================  
   
       subroutine active_read_tile_xy(  
      I                                active_var_file,  
      O                                active_var,  
      I                                irec,  
      I                                doglobalread,  
      I                                bi,  
      I                                bj,  
      I                                lAdInit,  
      I                                myOptimIter,  
      I                                mythid  
      &                              )  
   
 c     ==================================================================  
 c     SUBROUTINE active_read_tile_xy  
 c     ==================================================================  
 c  
 c     o Read an active 2D variable from file.  
 c  
 c     started: Christian Eckert eckert@mit.edu 30-Jun-1999  
 c  
 c     changed: Christian Eckert eckert@mit.edu 11-Feb-2000  
 c  
 c              - Restructured the code in order to create a package  
 c                for the MITgcmUV.c  
 c  
 c     changed: Christian Eckert eckert@mit.edu 24-Apr-2000  
 c  
 c              - Added routines that do active writes on tiles  
 c                instead of a whole thread.  
 c  
 c     ==================================================================  
 c     SUBROUTINE active_read_tile_xy  
 c     ==================================================================  
   
       implicit none  
   
 c     == global variables ==  
   
 #include "EEPARAMS.h"  
 #include "SIZE.h"  
   
 c     == routine arguments ==  
   
       character*(*) active_var_file  
       _RL     active_var(1-olx:snx+olx,1-oly:sny+oly)  
       integer irec  
       integer myOptimIter  
       integer mythid  
       integer bi  
       integer bj  
       logical doglobalread  
       logical lAdInit  
   
 c     == local variables ==  
   
       integer mynr  
   
 c     == end of interface ==  
   
       mynr = 1  
       call active_read_tile_rl(  
      I                          active_var_file,  
      I                          active_var,  
      I                          doglobalread,  
      I                          lAdInit,  
      I                          irec,  
      I                          mynr,  
      I                          bi,  
      I                          bj,  
      I                          FORWARD_SIMULATION,  
      I                          myOptimIter,  
      I                          mythid  
      &                        )  
   
       return  
       end  
   
   
       subroutine active_read_tile_xyz(  
      I                                 active_var_file,  
      O                                 active_var,  
      I                                 irec,  
      I                                 doglobalread,  
      I                                 bi,  
      I                                 bj,  
      I                                 lAdInit,  
      I                                 myOptimIter,  
      I                                 mythid  
      &                               )  
   
 c     ==================================================================  
 c     SUBROUTINE active_read_tile_xyz  
 c     ==================================================================  
 c  
 c     o Read an active 3D variable from file.  
 c  
 c     started: Christian Eckert eckert@mit.edu 30-Jun-1999  
 c  
 c     changed: Christian Eckert eckert@mit.edu 11-Feb-2000  
 c  
 c              - Restructured the code in order to create a package  
 c                for the MITgcmUV.c  
 c  
 c     changed: Christian Eckert eckert@mit.edu 24-Apr-2000  
 c  
 c              - Added routines that do active writes on tiles  
 c                instead of a whole thread.  
 c  
 c     ==================================================================  
 c     SUBROUTINE active_read_tile_xyz  
 c     ==================================================================  
   
       implicit none  
   
 c     == global variables ==  
   
 #include "EEPARAMS.h"  
 #include "SIZE.h"  
   
 c     == routine arguments ==  
   
       character*(*) active_var_file  
       _RL active_var(1-olx:snx+olx,1-oly:sny+oly,nr)  
       integer irec  
       integer myOptimIter  
       integer mythid  
       logical doglobalread  
       integer bi  
       integer bj  
       logical lAdInit  
   
 c     == local variables ==  
   
       integer mynr  
   
 c     == end of interface ==  
   
       mynr = nr  
   
       call active_read_tile_rl(  
      I                          active_var_file,  
      I                          active_var,  
      I                          doglobalread,  
      I                          lAdInit,  
      I                          irec,  
      I                          mynr,  
      I                          bi,  
      I                          bj,  
      I                          FORWARD_SIMULATION,  
      I                          myOptimIter,  
      I                          mythid  
      &                        )  
   
       return  
       end  
   
   
       subroutine active_write_tile_xy(  
      I                                 active_var_file,  
      I                                 active_var,  
      I                                 irec,  
      I                                 bi,  
      I                                 bj,  
      I                                 myOptimIter,  
      I                                 mythid  
      &                               )  
   
 c     ==================================================================  
 c     SUBROUTINE active_write_tile_xy  
 c     ==================================================================  
 c  
 c     o Write an active 2D variable to a file.  
 c  
 c     started: Christian Eckert eckert@mit.edu 30-Jun-1999  
 c  
 c     changed: Christian Eckert eckert@mit.edu 11-Feb-2000  
 c  
 c              - Restructured the code in order to create a package  
 c                for the MITgcmUV.c  
 c  
 c     changed: Christian Eckert eckert@mit.edu 24-Apr-2000  
 c  
 c              - Added routines that do active writes on tiles  
 c                instead of a whole thread.  
 c  
 c     ==================================================================  
 c     SUBROUTINE active_write_tile_xy  
 c     ==================================================================  
   
       implicit none  
   
 c     == global variables ==  
   
 #include "EEPARAMS.h"  
 #include "SIZE.h"  
   
 c     == routine arguments ==  
   
       character*(*) active_var_file  
       _RL     active_var(1-olx:snx+olx,1-oly:sny+oly)  
       integer irec  
       integer bi  
       integer bj  
       integer myOptimIter  
       integer mythid  
   
 c     == local variables ==  
   
       integer mynr  
       logical globalfile  
   
 c     == end of interface ==  
   
       mynr = 1  
       globalfile = .false.  
   
       call active_write_tile_rl(  
      I                           active_var_file,  
      I                           active_var,  
      I                           globalfile,  
      I                           irec,  
      I                           mynr,  
      I                           bi,  
      I                           bj,  
      I                           FORWARD_SIMULATION,  
      I                           myOptimIter,  
      I                           mythid  
      &                         )  
   
       return  
       end  
   
   
       subroutine active_write_tile_xyz(  
      I                                  active_var_file,  
      I                                  active_var,  
      I                                  irec,  
      I                                  bi,  
      I                                  bj,  
      I                                  myOptimIter,  
      I                                  mythid  
      &                                )  
   
 c     ==================================================================  
 c     SUBROUTINE active_write_tile_xyz  
 c     ==================================================================  
 c  
 c     o Write an active 3D variable to a file.  
 c  
 c     started: Christian Eckert eckert@mit.edu 30-Jun-1999  
 c  
 c     changed: Christian Eckert eckert@mit.edu 11-Feb-2000  
 c  
 c              - Restructured the code in order to create a package  
 c                for the MITgcmUV.c  
 c  
 c     changed: Christian Eckert eckert@mit.edu 24-Apr-2000  
 c  
 c              - Added routines that do active writes on tiles  
 c                instead of a whole thread.  
 c  
 c     ==================================================================  
 c     SUBROUTINE active_write_tile_xyz  
 c     ==================================================================  
   
       implicit none  
   
 c     == global variables ==  
   
 #include "EEPARAMS.h"  
 #include "SIZE.h"  
   
 c     == routine arguments ==  
   
       character*(*) active_var_file  
       _RL active_var(1-olx:snx+olx,1-oly:sny+oly,nr)  
       integer irec  
       integer bi  
       integer bj  
       integer myOptimIter  
       integer mythid  
   
 c     == local variables ==  
   
       integer mynr  
       logical globalfile  
   
 c     == end of interface ==  
   
       mynr = nr  
       globalfile = .false.  
       call active_write_tile_rl(  
      I                           active_var_file,  
      I                           active_var,  
      I                           globalfile,  
      I                           irec,  
      I                           mynr,  
      I                           bi,  
      I                           bj,  
      I                           FORWARD_SIMULATION,  
      I                           myOptimIter,  
      I                           mythid  
      &                         )  
   
       return  
       end  
   
 C     !ROUTINE: active_read_profile  
 C     !INTERFACE:  
       subroutine active_read_profile(  
      I                           active_num_file,  
      I                           nactive_var,  
      O                           active_var,  
      I                           active_varnum,  
      I                           irec,  
      I                           lAdInit,  
      I                           myOptimIter,  
      I                           mythid,  
      I                           dummy  
      &                         )  
   
 c     ==================================================================  
 c     SUBROUTINE active_read_profile  
 c     ==================================================================  
 c     o Read an active 1D record from an profile data file.  
 c     ==================================================================  
   
       implicit none  
 c     == global variables ==  
 #include "EEPARAMS.h"  
 #include "SIZE.h"  
 #include "profiles.h"  
   
 c     == routine arguments ==  
 c     active_var_file: filename  
 c     nactive_var:     integer size of active_var  
 c     active_var:      array  
 c     active_varname:      name fo the quantity to save  
 c     irec:            record number  
 c     myOptimIter:     number of optimization iteration (default: 0)  
 c     mythid:          thread number for this instance  
 c     lAdInit:         initialisation of corresponding adjoint  
 c                      variable and write to active file  
       integer  nactive_var,active_num_file  
       _RL   active_var(nactive_var)  
       integer  irec,active_varnum  
       integer  myOptimIter  
       integer  mythid  
       logical  lAdInit  
       _RL      dummy  
   
   
       call active_read_profile_rl( fidforward(active_num_file),  
      &     active_num_file,  
      &     nactive_var, active_var, active_varnum, lAdInit,  
      &     irec, prof_ind_glob(active_num_file,irec),  
      &     FORWARD_SIMULATION, myOptimIter, mythid)  
   
       return  
       end  
   
 c     ==================================================================  
 c     ==================================================================  
 c     ==================================================================  
   
 C     !ROUTINE: active_write_profile  
 C     !INTERFACE:  
       subroutine active_write_profile(  
      I                           active_num_file,  
      I                           nactive_var,  
      I                           active_var,  
      I                           active_varnum,  
      I                           irec,  
      I                           myOptimIter,  
      I                           mythid,  
      I                           dummy  
      &                         )  
   
 C     !DESCRIPTION: \bv  
 c     ==================================================================  
 c     SUBROUTINE active_write_profile  
 c     ==================================================================  
 c     o Write an active 1D record from file.  
 c     ==================================================================  
   
 C     !USES:  
       implicit none  
   
 c     == global variables ==  
 #include "EEPARAMS.h"  
 #include "SIZE.h"  
 #include "profiles.h"  
   
 c     == routine arguments ==  
 c     active_var_file: filename  
 c     nactive_var:     integer size of active_var  
 c     active_var:      array  
 c     active_varname:      name fo the quantity to save  
 c     irec:            record number  
 c     myOptimIter:     number of optimization iteration (default: 0)  
 c     mythid:          thread number for this instance  
       integer  nactive_var,active_num_file, active_varnum  
       _RL   active_var(nactive_var)  
       integer  irec  
       integer  myOptimIter  
       integer  mythid  
       _RL      dummy  
   
       call active_write_profile_rl( fidforward(active_num_file),  
      &     active_num_file,  
      &  nactive_var, active_var, active_varnum,  
      &     irec, prof_ind_glob(active_num_file,irec),  
      &  FORWARD_SIMULATION, myOptimIter, mythid)  
   
       return  
       end  
   
 c     ==================================================================  
   
   

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.22