-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* move call to DIAGSTATS_INI_IO from diagnostics_init_fixed.F to diagnostics_init_varia.F * move call to TURNOFF_MODEL_IO (for DIVA) - move call to TURNOFF_MODEL_IO from ctrl_init_fixed.F (for DIVA run) to the_model_main.F - minor improvement in the_model_main.F (test for file "costfinal" only once, improve indentation, ...) * switch "diag_pkgStatus" on/off - switch diag_pkgStatus to ready2fillDiags also in first backward sweep call - switch it off in last DIAGNOSTICS_WRITE call (as it used to be) - try to do the same in diagnostics_write_adj.F (for now, commented out) * update "gdiag" description * cleaning - remove 500+ lines of MITgcm general description that don't get updated when main version (in model/src) is; add a relevant comment/description ; - avoid changing back and forth "writeBinaryPrec" by using WRITE_REC_3D_RL ; - remove Divided-Adjoint pieces of code ; remove some un-used var ; - import some improvements from model/src version. * switch arg order (myThid last) for small S/R (and used only for DIVA) cost_final_[re]store.F * Adjust report to STDOUT write few more (useful) info. * New small S/R for diagnostics with DIVA Just to know when DIAGNOSTICS_SWITCH_ONOFF is called for the first time * switch on diagnostics (including some ADJ diags) * report more output * Adjust comments/descriptions * adjust comments * document fixing ADJ-diags in DIVA runs
- Loading branch information
Showing
23 changed files
with
568 additions
and
959 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,68 +3,60 @@ | |
# include "AUTODIFF_OPTIONS.h" | ||
#endif | ||
|
||
subroutine cost_final_restore ( mythid, lastdiva ) | ||
CBOP | ||
C !ROUTINE: COST_FINAL_RESTORE | ||
|
||
c ================================================================== | ||
c SUBROUTINE cost_final_restore | ||
c ================================================================== | ||
c | ||
c Restore cost function value | ||
c This is required in conjunction with DIVA | ||
c [email protected] 5-Mar-2003 | ||
c | ||
c ================================================================== | ||
c SUBROUTINE cost_final_restore | ||
c ================================================================== | ||
C !INTERFACE: | ||
SUBROUTINE COST_FINAL_RESTORE( lastDiva, myThid ) | ||
|
||
implicit none | ||
|
||
c == global variables == | ||
C !DESCRIPTION: | ||
C Restore cost function value | ||
C This is required in conjunction with DIVA | ||
C [email protected] 5-Mar-2003 | ||
|
||
C !USES: | ||
IMPLICIT NONE | ||
C == Global variables === | ||
#include "EEPARAMS.h" | ||
#include "SIZE.h" | ||
|
||
#include "cost.h" | ||
|
||
c == routine arguments == | ||
|
||
integer mythid | ||
logical lastdiva | ||
|
||
# ifdef ALLOW_DIVIDED_ADJOINT | ||
|
||
c == local variables == | ||
logical exst | ||
|
||
integer idivbeg, idivend | ||
c == end of interface == | ||
|
||
c-- Each process has calculated the global part for itself. | ||
cph IF (myProcId .eq. 0) THEN | ||
_BEGIN_MASTER( mythid ) | ||
c | ||
inquire(file='divided.ctrl',exist=exst) | ||
if (exst) then | ||
open(unit=76,file='divided.ctrl',form='formatted') | ||
read(unit=76,fmt=*) idivbeg,idivend | ||
close(unit=76) | ||
else | ||
idivbeg = -2 | ||
endif | ||
c | ||
if ( idivbeg .EQ. 0 ) then | ||
lastdiva = .TRUE. | ||
open(unit=76,file='costfinal') | ||
read(76,*) fc | ||
close(76) | ||
else | ||
lastdiva = .FALSE. | ||
endif | ||
c | ||
_END_MASTER( mythid ) | ||
cph ENDIF | ||
C !INPUT/OUTPUT PARAMETERS: | ||
C lastDiva :: True if last AD run from DIVA sequence, False otherwise | ||
C myThid :: my Thread Id number | ||
LOGICAL lastDiva | ||
INTEGER myThid | ||
|
||
#ifdef ALLOW_DIVIDED_ADJOINT | ||
C !LOCAL VARIABLES: | ||
LOGICAL exst | ||
INTEGER idivbeg, idivend | ||
CEOP | ||
|
||
_BEGIN_MASTER( myThid ) | ||
|
||
INQUIRE(FILE='divided.ctrl',EXIST=exst) | ||
IF (exst) THEN | ||
OPEN(UNIT=76,FILE='divided.ctrl',FORM='formatted') | ||
READ(UNIT=76,FMT=*) idivbeg,idivend | ||
CLOSE(UNIT=76) | ||
ELSE | ||
idivbeg = -2 | ||
ENDIF | ||
|
||
IF ( idivbeg .EQ. 0 ) THEN | ||
lastDiva = .TRUE. | ||
OPEN(UNIT=76,FILE='costfinal') | ||
READ(76,*) fc | ||
CLOSE(76) | ||
ELSE | ||
lastDiva = .FALSE. | ||
ENDIF | ||
|
||
_END_MASTER( myThid ) | ||
_BARRIER | ||
|
||
#endif | ||
#endif /* ALLOW_DIVIDED_ADJOINT */ | ||
|
||
end | ||
RETURN | ||
END |
Oops, something went wrong.