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

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

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


Revision 1.3 - (show annotations) (download)
Fri Aug 5 18:40:24 2005 UTC (18 years, 10 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint57s_post, checkpoint58b_post, checkpoint57y_post, checkpoint57r_post, checkpoint59, checkpoint58, checkpoint58f_post, checkpoint58d_post, checkpoint58a_post, checkpoint57z_post, checkpoint58y_post, checkpoint58t_post, checkpoint58m_post, checkpoint57t_post, checkpoint57v_post, checkpoint58w_post, checkpoint57y_pre, checkpoint58o_post, checkpoint58p_post, checkpoint58q_post, checkpoint58e_post, checkpoint58r_post, checkpoint58n_post, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59h, checkpint57u_post, checkpoint57q_post, checkpoint58k_post, checkpoint58v_post, checkpoint58l_post, checkpoint58g_post, checkpoint58x_post, checkpoint58h_post, checkpoint58j_post, checkpoint57w_post, checkpoint58i_post, checkpoint57x_post, checkpoint58c_post, checkpoint58u_post, checkpoint58s_post
Changes since 1.2: +3 -1 lines
Set lastdiva to .FALSE. in intermediate adjoint steps to
prevent unnecessary ctrl_pack.

1 C $Header: /u/gcmpack/MITgcm/pkg/cost/cost_final_restore.F,v 1.2 2003/03/05 23:39:53 heimbach Exp $
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 else
61 lastdiva = .FALSE.
62 endif
63 c
64 _END_MASTER( mythid )
65 ENDIF
66 _BARRIER
67
68 #endif
69
70 end

  ViewVC Help
Powered by ViewVC 1.1.22