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