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

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

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


Revision 1.5 - (hide annotations) (download)
Mon Apr 26 20:28:37 2010 UTC (14 years ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62g, checkpoint62f, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62w, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint63g, checkpoint63, checkpoint63p, checkpoint63q, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63a, checkpoint63b, checkpoint63c
Changes since 1.4: +3 -3 lines
Prepare fix of global_sum_ad.F
This one only affects DIVA (not tested by testreport,
I tested it for natl_box_adjoint).

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

  ViewVC Help
Powered by ViewVC 1.1.22