/[MITgcm]/MITgcm/model/src/do_the_model_io.F
ViewVC logotype

Contents of /MITgcm/model/src/do_the_model_io.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.18 - (show annotations) (download)
Sun Feb 4 14:38:46 2001 UTC (23 years, 4 months ago) by cnh
Branch: MAIN
CVS Tags: checkpoint36, checkpoint35
Changes since 1.17: +2 -1 lines
Made sure each .F and .h file had
the CVS keywords Header and Name at its start.
Most had header but very few currently have Name, so
lots of changes!

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

  ViewVC Help
Powered by ViewVC 1.1.22