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

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

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

revision 1.2 by heimbach, Fri Sep 28 04:19:27 2001 UTC revision 1.7 by jmc, Mon Oct 8 23:50:52 2007 UTC
# Line 1  Line 1 
1    C $Header$
2    C $Name$
3    
4  #include "CPP_OPTIONS.h"  #include "AUTODIFF_OPTIONS.h"
5    
6  c     ==================================================================  c     ==================================================================
7  c  c
# Line 14  c     o  adactive_read_xyz        - Adjo Line 16  c     o  adactive_read_xyz        - Adjo
16  c     o  adactive_write_xy        - Adjoint of active_write_xy  c     o  adactive_write_xy        - Adjoint of active_write_xy
17  c     o  adactive_write_xyz       - Adjoint of active_write_xyz  c     o  adactive_write_xyz       - Adjoint of active_write_xyz
18  c  c
19    c     o  adactive_read_xz         - Adjoint of active_read_xz
20    c     o  adactive_read_yz         - Adjoint of active_read_yz
21    c     o  adactive_write_xz        - Adjoint of active_write_xz
22    c     o  adactive_write_yz        - Adjoint of active_write_yz
23    c
24  c     o  adactive_read_tile_xy    - Adjoint of active_read_tile_xy  c     o  adactive_read_tile_xy    - Adjoint of active_read_tile_xy
25  c     o  adactive_read_tile_xyz   - Adjoint of active_read_tile_xyz  c     o  adactive_read_tile_xyz   - Adjoint of active_read_tile_xyz
26  c     o  adactive_write_tile_xy   - Adjoint of active_write_tile_xy  c     o  adactive_write_tile_xy   - Adjoint of active_write_tile_xy
27  c     o  adactive_write_tile_xyz  - Adjoint of active_write_tile_xyz  c     o  adactive_write_tile_xyz  - Adjoint of active_write_tile_xyz
28  c  c
 c  
29  c        changed: Christian Eckert eckert@mit.edu 24-Apr-2000  c        changed: Christian Eckert eckert@mit.edu 24-Apr-2000
30  c                 - Added routines that do active writes on tiles  c                 - Added routines that do active writes on tiles
31  c                   instead of a whole thread.  c                   instead of a whole thread.
32  c        changed: Patrick Heimbach heimbach@mit.edu 27-May-2000  c        changed: Patrick Heimbach heimbach@mit.edu 27-May-2000
33  c                 - changed suboutine argument list:  c                 - changed suboutine argument list:
34  c                   dropped mycurrentiter, mycurrenttime  c                   dropped mycurrentiter, mycurrenttime
35    c        changed: heimbach@mit.edu 25-Mar-2002
36    c                 - added active file handling of xz-/yz-arrays
37  c  c
38  c     ==================================================================  c     ==================================================================
39    
# Line 185  CEOP Line 193  CEOP
193        end        end
194    
195  CBOP  CBOP
196    C     !ROUTINE: adactive_read_xz
197    C     !INTERFACE:
198          subroutine adactive_read_xz(
199         I                              active_var_file,
200         I                              irec,
201         I                              doglobalread,
202         I                              lAdInit,
203         I                              myiter,
204         I                              mythid,
205         I                              adactive_var
206         &                            )
207    
208    C     !DESCRIPTION: \bv
209    c     ==================================================================
210    c     SUBROUTINE adactive_read_xz
211    c     ==================================================================
212    c     o Adjoint of active_read_xz.
213    c     started: heimbach@mit.edu 05-Mar-2001
214    c     ==================================================================
215    c     SUBROUTINE adactive_read_xz
216    c     ==================================================================
217    C     \ev
218    
219    C     !USES:
220          implicit none
221    
222    c     == global variables ==
223    #include "EEPARAMS.h"
224    #include "SIZE.h"
225    
226    c     == routine arguments ==
227    c     active_var_file: filename
228    c     adactive_var:    array
229    c     irec:            record number
230    c     myIter:          number of optimization iteration (default: 0)
231    c     mythid:          thread number for this instance
232    c     doglobalread:    flag for global or local read/write
233    c                      (default: .false.)
234    c     lAdInit:         initialisation of corresponding adjoint
235    c                      variable and write to active file
236          character*(*) active_var_file
237          _RL     adactive_var(1-olx:snx+olx,nr,nsx,nsy)
238          integer irec
239          integer myiter,mythid
240          logical doglobalread
241          logical lAdInit
242    
243    C     !LOCAL VARIABLES:
244    c     == local variables ==
245          integer mynr
246          integer il
247          integer ilnblnk
248          character*(2) adpref
249          character*(80) fname
250    
251    c     == functions ==
252          external ilnblnk
253    
254    c     == end of interface ==
255    CEOP
256    
257          mynr   = nr
258          adpref = 'ad'
259          write(fname(1:80),'(a)') ' '
260    
261          il     = ilnblnk(active_var_file)
262    
263          write(fname(1:2),'(a)') adpref
264          write(fname(3:2+il),'(a)') active_var_file(1:il)
265    
266          call active_read_xz_rl( fname, adactive_var,
267         &                     doglobalread, lAdInit, irec, mynr,
268         &                     REVERSE_SIMULATION, myiter, mythid )
269    
270          end
271    
272    CBOP
273    C     !ROUTINE: adactive_read_yz
274    C     !INTERFACE:
275          subroutine adactive_read_yz(
276         I                              active_var_file,
277         I                              irec,
278         I                              doglobalread,
279         I                              lAdInit,
280         I                              myiter,
281         I                              mythid,
282         I                              adactive_var
283         &                            )
284    
285    C     !DESCRIPTION: \bv
286    c     ==================================================================
287    c     SUBROUTINE adactive_read_yz
288    c     ==================================================================
289    c     o Adjoint of active_read_yz.
290    c     started: heimbach@mit.edu 05-Mar-2001
291    c     ==================================================================
292    c     SUBROUTINE adactive_read_yz
293    c     ==================================================================
294    C     \ev
295    
296    C     !USES:
297          implicit none
298    
299    c     == global variables ==
300    #include "EEPARAMS.h"
301    #include "SIZE.h"
302    
303    c     == routine arguments ==
304    c     active_var_file: filename
305    c     adactive_var:    array
306    c     irec:            record number
307    c     myIter:          number of optimization iteration (default: 0)
308    c     mythid:          thread number for this instance
309    c     doglobalread:    flag for global or local read/write
310    c                      (default: .false.)
311    c     lAdInit:         initialisation of corresponding adjoint
312    c                      variable and write to active file
313          character*(*) active_var_file
314          _RL     adactive_var(1-oly:sny+oly,nr,nsx,nsy)
315          integer irec
316          integer myiter,mythid
317          logical doglobalread
318          logical lAdInit
319    
320    C     !LOCAL VARIABLES:
321    c     == local variables ==
322          integer mynr
323          integer il
324          integer ilnblnk
325          character*(2) adpref
326          character*(80) fname
327    
328    c     == functions ==
329          external ilnblnk
330    
331    c     == end of interface ==
332    CEOP
333    
334          mynr   = nr
335          adpref = 'ad'
336          write(fname(1:80),'(a)') ' '
337    
338          il     = ilnblnk(active_var_file)
339    
340          write(fname(1:2),'(a)') adpref
341          write(fname(3:2+il),'(a)') active_var_file(1:il)
342    
343          call active_read_yz_rl( fname, adactive_var,
344         &                     doglobalread, lAdInit, irec, mynr,
345         &                     REVERSE_SIMULATION, myiter, mythid )
346    
347          end
348    
349    CBOP
350  C     !ROUTINE: adactive_read_xy  C     !ROUTINE: adactive_read_xy
351  C     !INTERFACE:  C     !INTERFACE:
352        subroutine adactive_write_xy(        subroutine adactive_write_xy(
# Line 259  CEOP Line 421  CEOP
421    
422        end        end
423    
   
424  CBOP  CBOP
425  C     !ROUTINE: adactive_read_xyz  C     !ROUTINE: adactive_read_xyz
426  C     !INTERFACE:  C     !INTERFACE:
# Line 335  CEOP Line 496  CEOP
496    
497        end        end
498    
499    CBOP
500    C     !ROUTINE: adactive_read_xz
501    C     !INTERFACE:
502          subroutine adactive_write_xz(
503         I                               active_var_file,
504         I                               irec,
505         I                               myiter,
506         I                               mythid,
507         U                               adactive_var,
508         I                               dummy
509         &                             )
510    
511    
512    C     !DESCRIPTION: \bv
513    c     ==================================================================
514    c     SUBROUTINE adactive_write_xz
515    c     ==================================================================
516    c     o Adjoint of active_write_xz.
517    c     started: heimbach@mit.edu 05-Mar-2001
518    c     ==================================================================
519    c     SUBROUTINE adactive_write_xz
520    c     ==================================================================
521    C     \ev
522    
523    C     !USES:
524          implicit none
525    
526    c     == global variables ==
527    #include "EEPARAMS.h"
528    #include "SIZE.h"
529    
530    c     == routine arguments ==
531    c     active_var_file: filename
532    c     adactive_var:    array
533    c     irec:            record number
534    c     myIter:          number of optimization iteration (default: 0)
535    c     mythid:          thread number for this instance
536          character*(*) active_var_file
537          _RL     adactive_var(1-olx:snx+olx,nr,nsx,nsy)
538          integer irec
539          integer myiter,mythid
540          _RL dummy
541    
542    C     !LOCAL VARIABLES:
543    c     == local variables ==
544          integer mynr
545          integer il
546          integer ilnblnk
547          character*(2) adpref
548          character*(80) fname
549          logical globalfile
550    
551    c     == functions ==
552          external ilnblnk
553    
554    c     == end of interface ==
555    CEOP
556    
557          mynr   = nr
558          adpref = 'ad'
559          write(fname(1:80),'(a)') ' '
560    
561          il     = ilnblnk(active_var_file)
562    
563          write(fname(1:2),'(a)') adpref
564          write(fname(3:2+il),'(a)') active_var_file(1:il)
565    
566          globalfile = .false.
567    
568          call active_write_xz_rl( fname, adactive_var,
569         &                      globalfile, irec, mynr,
570         &                      REVERSE_SIMULATION, myiter, mythid )
571    
572          end
573    
574    CBOP
575    C     !ROUTINE: adactive_read_yz
576    C     !INTERFACE:
577          subroutine adactive_write_yz(
578         I                               active_var_file,
579         I                               irec,
580         I                               myiter,
581         I                               mythid,
582         U                               adactive_var,
583         I                               dummy
584         &                             )
585    
586    
587    C     !DESCRIPTION: \bv
588    c     ==================================================================
589    c     SUBROUTINE adactive_write_yz
590    c     ==================================================================
591    c     o Adjoint of active_write_yz.
592    c     started: heimbach@mit.edu 05-Mar-2001
593    c     ==================================================================
594    c     SUBROUTINE adactive_write_yz
595    c     ==================================================================
596    C     \ev
597    
598    C     !USES:
599          implicit none
600    
601    c     == global variables ==
602    #include "EEPARAMS.h"
603    #include "SIZE.h"
604    
605    c     == routine arguments ==
606    c     active_var_file: filename
607    c     adactive_var:    array
608    c     irec:            record number
609    c     myIter:          number of optimization iteration (default: 0)
610    c     mythid:          thread number for this instance
611          character*(*) active_var_file
612          _RL     adactive_var(1-oly:sny+oly,nr,nsx,nsy)
613          integer irec
614          integer myiter,mythid
615          _RL dummy
616    
617    C     !LOCAL VARIABLES:
618    c     == local variables ==
619          integer mynr
620          integer il
621          integer ilnblnk
622          character*(2) adpref
623          character*(80) fname
624          logical globalfile
625    
626    c     == functions ==
627          external ilnblnk
628    
629    c     == end of interface ==
630    CEOP
631    
632          mynr   = nr
633          adpref = 'ad'
634          write(fname(1:80),'(a)') ' '
635    
636          il     = ilnblnk(active_var_file)
637    
638          write(fname(1:2),'(a)') adpref
639          write(fname(3:2+il),'(a)') active_var_file(1:il)
640    
641          globalfile = .false.
642    
643          call active_write_yz_rl( fname, adactive_var,
644         &                      globalfile, irec, mynr,
645         &                      REVERSE_SIMULATION, myiter, mythid )
646    
647          end
648    
649    
650    
651        subroutine adactive_read_tile_xy(        subroutine adactive_read_tile_xy(
# Line 369  c                instead of a whole thre Line 680  c                instead of a whole thre
680  c  c
681  c     changed: Patrick Heimbach heimbach@mit.edu 27-May-2000  c     changed: Patrick Heimbach heimbach@mit.edu 27-May-2000
682  c  c
683  c              - changed suboutine argument list:  c              - changed suboutine argument list:
684  c                dropped mycurrentiter, mycurrenttime  c                dropped mycurrentiter, mycurrenttime
685  c  c
686  c     ==================================================================  c     ==================================================================
# Line 467  c                instead of a whole thre Line 778  c                instead of a whole thre
778  c  c
779  c     changed: Patrick Heimbach heimbach@mit.edu 27-May-2000  c     changed: Patrick Heimbach heimbach@mit.edu 27-May-2000
780  c  c
781  c              - changed suboutine argument list:  c              - changed suboutine argument list:
782  c                dropped mycurrentiter, mycurrenttime  c                dropped mycurrentiter, mycurrenttime
783  c  c
784  c     ==================================================================  c     ==================================================================
# Line 564  c                instead of a whole thre Line 875  c                instead of a whole thre
875  c  c
876  c     changed: Patrick Heimbach heimbach@mit.edu 27-May-2000  c     changed: Patrick Heimbach heimbach@mit.edu 27-May-2000
877  c  c
878  c              - changed suboutine argument list:  c              - changed suboutine argument list:
879  c                dropped mycurrentiter, mycurrenttime  c                dropped mycurrentiter, mycurrenttime
880  c  c
881  c     ==================================================================  c     ==================================================================
# Line 661  c                instead of a whole thre Line 972  c                instead of a whole thre
972  c  c
973  c     changed: Patrick Heimbach heimbach@mit.edu 27-May-2000  c     changed: Patrick Heimbach heimbach@mit.edu 27-May-2000
974  c  c
975  c              - changed suboutine argument list:  c              - changed suboutine argument list:
976  c                dropped mycurrentiter, mycurrenttime  c                dropped mycurrentiter, mycurrenttime
977  c  c
978  c     ==================================================================  c     ==================================================================

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.22