1 |
C $Header: /u/gcmpack/MITgcm/model/src/turnoff_model_io.F,v 1.2 2010/05/09 22:54:29 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "PACKAGES_CONFIG.h" |
5 |
#include "CPP_OPTIONS.h" |
6 |
|
7 |
CBOP |
8 |
C !ROUTINE: TURNOFF_MODEL_IO |
9 |
C !INTERFACE: |
10 |
SUBROUTINE TURNOFF_MODEL_IO( seqFlag, myThid ) |
11 |
|
12 |
C !DESCRIPTION: \bv |
13 |
C *==========================================================* |
14 |
C | SUBROUTINE TURNOFF_MODEL_IO |
15 |
C | o Turn off some of the model output flags |
16 |
C *==========================================================* |
17 |
C | Used in adjoint simulation (and called after the first |
18 |
C | forward sweep) to avoid writing output multiple times (if |
19 |
C | recomputations and/or grdchk) with the same iter number. |
20 |
C *==========================================================* |
21 |
C \ev |
22 |
|
23 |
C !USES: |
24 |
IMPLICIT NONE |
25 |
C === Global variables === |
26 |
#include "SIZE.h" |
27 |
#include "EEPARAMS.h" |
28 |
#include "PARAMS.h" |
29 |
c#ifdef ALLOW_MNC |
30 |
c# include "MNC_PARAMS.h" |
31 |
c#endif |
32 |
#ifdef ALLOW_EXF |
33 |
# include "EXF_PARAM.h" |
34 |
#endif |
35 |
|
36 |
C !INPUT/OUTPUT PARAMETERS: |
37 |
C seqFlag :: flag that indicates where this S/R is called from: |
38 |
C :: =0 called at the end of S/R COST_FINAL |
39 |
C :: =1 called at initialisation when using DIVA |
40 |
C myThid :: My Thread Id number |
41 |
INTEGER seqFlag |
42 |
INTEGER myThid |
43 |
|
44 |
C !LOCAL VARIABLES: |
45 |
c CHARACTER*(MAX_LEN_MBUF) msgBuf |
46 |
CEOP |
47 |
|
48 |
_BARRIER |
49 |
|
50 |
C-- only master-thread resets shared flags (in common block) |
51 |
_BEGIN_MASTER( myThid ) |
52 |
|
53 |
C-- Set output freq. to zero to avoid re-write of |
54 |
C averaged fields in reverse checkpointing loops |
55 |
monitorFreq = 0. |
56 |
dumpFreq = 0. |
57 |
taveFreq = 0. |
58 |
chkPtFreq = 0. |
59 |
pChkPtFreq = 0. |
60 |
dumpInitAndLast = .FALSE. |
61 |
writePickupAtEnd= .FALSE. |
62 |
|
63 |
#ifdef ALLOW_MNC |
64 |
C-- Not the best solution to fix some MNC output, since it is likely |
65 |
C that the same problem exists when we do not use MNC. A better fix |
66 |
C is to switch off the specific output freq; leave this commented out. |
67 |
c monitor_mnc = .FALSE. |
68 |
c snapshot_mnc = .FALSE. |
69 |
c timeave_mnc = .FALSE. |
70 |
#endif |
71 |
|
72 |
#ifdef ALLOW_EXF |
73 |
C- should call a S/R EXF_TURNOFF_IO (like SEAICE) to reset this flag |
74 |
IF ( useEXF ) exf_monFreq = 0. |
75 |
#endif |
76 |
|
77 |
C-- Disable SBO output |
78 |
useSBO = .FALSE. |
79 |
|
80 |
C-- For now, also disable diagnostics output (might need to change |
81 |
C this if we want to use diagnostics to output adjoint-variables) |
82 |
useDiagnostics = .FALSE. |
83 |
|
84 |
_END_MASTER( myThid ) |
85 |
|
86 |
C-- Package specific S/R to turn-off IO flags (all threads do call S/R) |
87 |
|
88 |
#ifdef ALLOW_SEAICE |
89 |
IF ( useSEAICE ) THEN |
90 |
CALL SEAICE_TURNOFF_IO( seqFlag, myThid ) |
91 |
ENDIF |
92 |
#endif |
93 |
|
94 |
#ifdef ALLOW_THSICE |
95 |
IF ( useThSIce ) THEN |
96 |
CALL THSICE_TURNOFF_IO( seqFlag, myThid ) |
97 |
ENDIF |
98 |
#endif |
99 |
|
100 |
#ifdef ALLOW_PTRACERS |
101 |
IF ( usePTRACERS ) THEN |
102 |
CALL PTRACERS_TURNOFF_IO( seqFlag, myThid ) |
103 |
ENDIF |
104 |
#endif |
105 |
|
106 |
C-- each thread waits for flags to be reset. |
107 |
_BARRIER |
108 |
|
109 |
RETURN |
110 |
END |