1 |
czaja |
1.1 |
C $Header: /u/gcmpack/models/MITgcmUV/model/src/do_the_model_io.F,v 1.22 2001/09/26 18:09:14 cnh Exp $ |
2 |
|
|
C $Name: release1_beta1 $ |
3 |
|
|
|
4 |
|
|
#include "CPP_OPTIONS.h" |
5 |
|
|
|
6 |
|
|
CBOP |
7 |
|
|
C !ROUTINE: DO_THE_MODEL_IO |
8 |
|
|
C !INTERFACE: |
9 |
|
|
SUBROUTINE DO_THE_MODEL_IO(myCurrentTime, myIter, myThid) |
10 |
|
|
C !DESCRIPTION: \bv |
11 |
|
|
C *==========================================================* |
12 |
|
|
C | SUBROUTINE DO_THE_MODEL_IO |
13 |
|
|
C | o Controlling routine for IO in model main time-stepping |
14 |
|
|
C | loop. |
15 |
|
|
C *==========================================================* |
16 |
|
|
C | Many systems do not have thread safe IO so it is easier |
17 |
|
|
C | to lump everything together and do dumping of fields |
18 |
|
|
C | and updating of forcing terms in a single place. |
19 |
|
|
C | The approach to IO used here is that writes are only |
20 |
|
|
C | performed by thread 1 and that a process only writes out |
21 |
|
|
C | its data ( it does not know about anyone elses data!) |
22 |
|
|
C | Reading on the other hand is assumed to be from a file |
23 |
|
|
C | containing all the data for all the processes. Only the |
24 |
|
|
C | portion of data of interest to this process is actually |
25 |
|
|
C | loaded. To work well this assumes the existence of some |
26 |
|
|
C | reliable tool to join datasets together at the end of a |
27 |
|
|
C | run - see joinds.p |
28 |
|
|
C *==========================================================* |
29 |
|
|
C \ev |
30 |
|
|
|
31 |
|
|
C !USES: |
32 |
|
|
IMPLICIT NONE |
33 |
|
|
C == Global variables === |
34 |
|
|
#include "SIZE.h" |
35 |
|
|
#include "EEPARAMS.h" |
36 |
|
|
#include "PARAMS.h" |
37 |
|
|
#include "DYNVARS.h" |
38 |
|
|
LOGICAL DIFFERENT_MULTIPLE |
39 |
|
|
EXTERNAL DIFFERENT_MULTIPLE |
40 |
|
|
|
41 |
|
|
C !INPUT/OUTPUT PARAMETERS: |
42 |
|
|
C == Routine arguments == |
43 |
|
|
C myThid - Thread number for this instance of the routine. |
44 |
|
|
C myIter - Iteration number |
45 |
|
|
C myCurrentTime - Current time of simulation ( s ) |
46 |
|
|
INTEGER myThid |
47 |
|
|
INTEGER myIter |
48 |
|
|
_RL myCurrentTime |
49 |
|
|
|
50 |
|
|
CEOP |
51 |
|
|
|
52 |
|
|
C-- Generaly only thread 1 does IO here. It can not start until |
53 |
|
|
C-- all threads fields are ready. |
54 |
|
|
IF ( |
55 |
|
|
& DIFFERENT_MULTIPLE(dumpFreq,myCurrentTime, |
56 |
|
|
& myCurrentTime-deltaTClock) |
57 |
|
|
& ) THEN |
58 |
|
|
|
59 |
|
|
_BARRIER |
60 |
|
|
|
61 |
|
|
C-- Write "text-plots" of certain fields |
62 |
|
|
CC(acz) |
63 |
|
|
C CALL PLOT_FIELD_XYZRL( uVel , 'Current uVel ' , |
64 |
|
|
C & Nr, myIter, myThid ) |
65 |
|
|
C CALL PLOT_FIELD_XYZRL( vVel , 'Current vVel ' , |
66 |
|
|
C & Nr, myIter, myThid ) |
67 |
|
|
C CALL PLOT_FIELD_XYZRL( theta, 'Current theta ' , |
68 |
|
|
C & Nr, myIter, myThid ) |
69 |
|
|
C CALL PLOT_FIELD_XYRL( etaN , 'Current etaN ' , |
70 |
|
|
C & myIter, myThid ) |
71 |
|
|
|
72 |
|
|
ENDIF |
73 |
|
|
|
74 |
|
|
C-- Write model state to binary file |
75 |
|
|
CALL WRITE_STATE( myCurrentTime, myIter, myThid ) |
76 |
|
|
|
77 |
|
|
#ifdef ALLOW_TIMEAVE |
78 |
|
|
C-- Do time averages |
79 |
|
|
IF (taveFreq.GT.0.) THEN |
80 |
|
|
CALL TIMEAVE_STATV_WRITE( myCurrentTime, myIter, myThid ) |
81 |
|
|
#ifdef ALLOW_AIM |
82 |
|
|
IF (useAIM) |
83 |
|
|
& CALL AIM_WRITE_DIAGS( myCurrentTime, myIter, myThid ) |
84 |
|
|
#endif |
85 |
|
|
#ifdef ALLOW_MITPHYS |
86 |
|
|
IF (useMITPHYS) |
87 |
|
|
& CALL MITPHYS_WRITE_DIAGS( myCurrentTime, myIter, myThid ) |
88 |
|
|
#endif |
89 |
|
|
ENDIF |
90 |
|
|
#endif |
91 |
|
|
|
92 |
|
|
#ifdef ALLOW_GMREDI |
93 |
|
|
C-- Do KPP diagnostics. |
94 |
|
|
IF (useGMRedi) |
95 |
|
|
& CALL GMREDI_DIAGS( myCurrentTime, myIter, myThid ) |
96 |
|
|
#endif |
97 |
|
|
|
98 |
|
|
#ifdef ALLOW_KPP |
99 |
|
|
C-- Do KPP diagnostics. |
100 |
|
|
IF (useKPP) |
101 |
|
|
& CALL KPP_DO_DIAGS( myCurrentTime, myIter, myThid ) |
102 |
|
|
#endif |
103 |
|
|
|
104 |
|
|
RETURN |
105 |
|
|
END |
106 |
|
|
|