/[MITgcm]/MITgcm/pkg/cost/cost_final_restore.F
ViewVC logotype

Diff of /MITgcm/pkg/cost/cost_final_restore.F

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

revision 1.1 by heimbach, Tue Mar 4 21:04:38 2003 UTC revision 1.2 by heimbach, Wed Mar 5 23:39:53 2003 UTC
# Line 0  Line 1 
1    C $Header$
2    
3    #include "COST_CPPOPTIONS.h"
4    
5    
6          subroutine cost_final_restore ( mythid, lastdiva )
7    
8    c     ==================================================================
9    c     SUBROUTINE cost_final_restore
10    c     ==================================================================
11    c
12    c     Restore cost function value
13    c     This is required in conjunction with DIVA
14    c     heimbach@mit.edu 5-Mar-2003
15    c
16    c     ==================================================================
17    c     SUBROUTINE cost_final_restore
18    c     ==================================================================
19    
20          implicit none
21    
22    c     == global variables ==
23    
24    #include "EEPARAMS.h"
25    #include "SIZE.h"
26    
27    #include "cost.h"
28    
29    c     == routine arguments ==
30    
31          integer mythid
32          logical lastdiva
33    
34    # ifdef ALLOW_DIVIDED_ADJOINT
35    
36    c     == local variables ==
37          logical exst
38    
39          integer idivbeg, idivend
40    c     == end of interface ==
41    
42    c--   Each process has calculated the global part for itself.
43          IF (myProcId .eq. 0) THEN
44             _BEGIN_MASTER( mythid )
45    c
46               inquire(file='divided.ctrl',exist=exst)
47               if (exst) then
48                  open(unit=76,file='divided.ctrl',form='formatted')
49                  read(unit=76,fmt=*) idivbeg,idivend
50                  close(unit=76)
51               else
52                  idivbeg = -2
53               endif
54    c
55               if ( idivbeg .EQ. 0 ) then
56                  lastdiva = .TRUE.
57                  open(unit=76,file='costfinal')
58                  read(76,*) fc        
59                  close(76)
60               endif
61    c
62             _END_MASTER( mythid )
63          ENDIF
64          _BARRIER
65    
66    #endif
67    
68          end

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

  ViewVC Help
Powered by ViewVC 1.1.22