1 |
C $Header: /u/gcmpack/MITgcm/model/src/turnoff_model_io.F,v 1.3 2010/11/23 20:13:31 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 |
printDomain = .FALSE. |
63 |
|
64 |
#ifdef ALLOW_MNC |
65 |
C-- Not the best solution to fix some MNC output, since it is likely |
66 |
C that the same problem exists when we do not use MNC. A better fix |
67 |
C is to switch off the specific output freq; leave this commented out. |
68 |
c monitor_mnc = .FALSE. |
69 |
c snapshot_mnc = .FALSE. |
70 |
c timeave_mnc = .FALSE. |
71 |
#endif |
72 |
|
73 |
#ifdef ALLOW_EXF |
74 |
C- should call a S/R EXF_TURNOFF_IO (like SEAICE) to reset this flag |
75 |
IF ( useEXF ) exf_monFreq = 0. |
76 |
#endif |
77 |
|
78 |
C-- Disable SBO output |
79 |
useSBO = .FALSE. |
80 |
|
81 |
C-- For now, also disable diagnostics output (might need to change |
82 |
C this if we want to use diagnostics to output adjoint-variables) |
83 |
useDiagnostics = .FALSE. |
84 |
|
85 |
_END_MASTER( myThid ) |
86 |
|
87 |
C-- Package specific S/R to turn-off IO flags (all threads do call S/R) |
88 |
|
89 |
#ifdef ALLOW_SEAICE |
90 |
IF ( useSEAICE ) THEN |
91 |
CALL SEAICE_TURNOFF_IO( seqFlag, myThid ) |
92 |
ENDIF |
93 |
#endif |
94 |
|
95 |
#ifdef ALLOW_THSICE |
96 |
IF ( useThSIce ) THEN |
97 |
CALL THSICE_TURNOFF_IO( seqFlag, myThid ) |
98 |
ENDIF |
99 |
#endif |
100 |
|
101 |
#ifdef ALLOW_PTRACERS |
102 |
IF ( usePTRACERS ) THEN |
103 |
CALL PTRACERS_TURNOFF_IO( seqFlag, myThid ) |
104 |
ENDIF |
105 |
#endif |
106 |
|
107 |
C-- each thread waits for flags to be reset. |
108 |
_BARRIER |
109 |
|
110 |
RETURN |
111 |
END |