/[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.2 - (show annotations) (download)
Wed Mar 5 23:39:53 2003 UTC (21 years, 1 month ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint51k_post, checkpoint57m_post, checkpoint52l_pre, hrcube4, hrcube5, checkpoint57g_pre, checkpoint50c_post, checkpoint57b_post, checkpoint52d_pre, checkpoint57g_post, checkpoint56b_post, checkpoint50c_pre, checkpoint52j_pre, checkpoint51o_pre, checkpoint54d_post, checkpoint54e_post, checkpoint51l_post, checkpoint57d_post, checkpoint57i_post, checkpoint50d_pre, checkpoint52k_post, checkpoint55, checkpoint54, checkpoint57, checkpoint56, checkpoint51, checkpoint50, checkpoint53, checkpoint52, checkpoint50d_post, checkpoint52f_post, checkpoint57n_post, checkpoint50b_pre, checkpoint54f_post, checkpoint51f_post, checkpoint51d_post, checkpoint51t_post, checkpoint51n_post, checkpoint55i_post, checkpoint57l_post, checkpoint52i_pre, hrcube_1, hrcube_2, hrcube_3, checkpoint51s_post, checkpoint55c_post, checkpoint51j_post, checkpoint52e_pre, checkpoint57f_post, checkpoint52e_post, checkpoint51n_pre, checkpoint53d_post, checkpoint57a_post, checkpoint57h_pre, checkpoint52b_pre, checkpoint54b_post, checkpoint57h_post, checkpoint51l_pre, checkpoint52m_post, checkpoint55g_post, checkpoint51q_post, checkpoint51b_pre, checkpoint52b_post, checkpoint52c_post, checkpoint51h_pre, checkpoint57c_post, checkpoint50f_post, checkpoint50a_post, checkpoint50f_pre, checkpoint52f_pre, checkpoint55d_post, checkpoint54a_pre, checkpoint53c_post, checkpoint55d_pre, checkpoint57c_pre, checkpoint55j_post, branchpoint-genmake2, checkpoint54a_post, checkpoint55h_post, checkpoint51r_post, checkpoint51i_post, checkpoint57e_post, checkpoint55b_post, checkpoint51b_post, checkpoint51c_post, checkpoint53a_post, checkpoint55f_post, checkpoint52d_post, checkpoint53g_post, checkpoint57p_post, checkpoint50g_post, eckpoint57e_pre, checkpoint52a_pre, checkpoint50h_post, checkpoint52i_post, checkpoint50e_pre, checkpoint50i_post, checkpoint51i_pre, checkpoint52h_pre, checkpoint56a_post, checkpoint53f_post, checkpoint57h_done, checkpoint52j_post, checkpoint50e_post, checkpoint57j_post, checkpoint57f_pre, branch-netcdf, checkpoint52l_post, checkpoint52n_post, checkpoint53b_pre, checkpoint56c_post, checkpoint51e_post, checkpoint57a_pre, checkpoint55a_post, checkpoint49, checkpoint57o_post, checkpoint51o_post, checkpoint57k_post, checkpoint51f_pre, checkpoint53b_post, checkpoint52a_post, checkpoint51g_post, ecco_c52_e35, checkpoint50b_post, checkpoint51m_post, checkpoint53d_pre, checkpoint55e_post, checkpoint54c_post, checkpoint51a_post, checkpoint51p_post, checkpoint51u_post
Branch point for: branch-genmake2, branch-nonh, tg2-branch, netcdf-sm0, checkpoint51n_branch
Changes since 1.1: +68 -0 lines
Modif.s for correct DIVA handling:
  Modif.s in
  - ecco_the_main_loop.F
  - ecco_the_model_main.F
  and added cost_final_restore.F cost_final_store.F
  o With these changes, it is possible to fully separate
    the first forward run to compute the cost function (mdthe_main_loop)
    and adjoint runs over individual DIVA intervals (adthe_main_loop)
    into separate model executions.
    This enables better tuning of DIVA to given queue sizes.
  o Loss of cost function value in consecutive DIVA runs is
    fixed by storing to 'costfinal' file.
  o Appropriate call of ctrl_unpack/_pack,grdchk_main at
    beginning/end of adjoint integration is accounted for.
  The current changes apply to TAF-1.4.26.
  TAF has one remaining bug, requiring one manual change
  (see MITgcm manual).

1 C $Header: /u/gcmpack/MITgcm/pkg/cost/Attic/cost_final_restore.F,v 1.1.2.2 2003/03/04 21:58:49 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 endif
61 c
62 _END_MASTER( mythid )
63 ENDIF
64 _BARRIER
65
66 #endif
67
68 end

  ViewVC Help
Powered by ViewVC 1.1.22