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

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

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


Revision 1.20 - (hide annotations) (download)
Tue Apr 10 22:35:25 2001 UTC (23 years, 1 month ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint38, checkpoint39
Changes since 1.19: +4 -7 lines
See doc/tag-index and doc/notes_c37_adj.txt
Preparation for stand-alone autodifferentiability.

1 heimbach 1.20 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 cnh 1.1
4 cnh 1.11 #include "CPP_OPTIONS.h"
5 cnh 1.1
6 heimbach 1.20 SUBROUTINE DO_THE_MODEL_IO(myCurrentTime, myIter, myThid)
7 cnh 1.1 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 cnh 1.10 C | its data ( it does not know about anyone elses data!) |
18 cnh 1.1 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 cnh 1.10 C | run - see joinds.p |
24 cnh 1.1 C \==========================================================/
25 adcroft 1.12 IMPLICIT NONE
26 cnh 1.1
27     C == Global variables ===
28     #include "SIZE.h"
29     #include "EEPARAMS.h"
30     #include "PARAMS.h"
31     #include "DYNVARS.h"
32    
33 cnh 1.3 LOGICAL DIFFERENT_MULTIPLE
34     EXTERNAL DIFFERENT_MULTIPLE
35    
36 cnh 1.1 C == Routine arguments ==
37     C myThid - Thread number for this instance of the routine.
38     C myIter - Iteration number
39 cnh 1.3 C myCurrentTime - Current time of simulation ( s )
40 cnh 1.1 INTEGER myThid
41     INTEGER myIter
42 adcroft 1.13 _RL myCurrentTime
43 cnh 1.1
44     C == Local variables ==
45    
46 cnh 1.10 C-- Generaly only thread 1 does IO here. It can not start until
47     C-- all threads fields are ready.
48 cnh 1.6 IF (
49 cnh 1.10 & DIFFERENT_MULTIPLE(dumpFreq,myCurrentTime,
50     & myCurrentTime-deltaTClock)
51 cnh 1.6 & ) THEN
52    
53 cnh 1.3 _BARRIER
54 cnh 1.1
55 cnh 1.3 C-- Write "text-plots" of certain fields
56 cnh 1.10 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 jmc 1.19 CALL PLOT_FIELD_XYRL( etaN , 'Current etaN ' ,
63 cnh 1.10 & myIter, myThid )
64 adcroft 1.13
65 cnh 1.3 ENDIF
66    
67     C-- Write model state to binary file
68 heimbach 1.20 CALL WRITE_STATE( myCurrentTime, myIter, myThid )
69 cnh 1.5
70 jmc 1.19 #ifdef ALLOW_TIMEAVE
71 adcroft 1.16 C-- Do time averages
72     IF (taveFreq.GT.0.) THEN
73 jmc 1.19 CALL TIMEAVE_STATV_WRITE( myCurrentTime, myIter, myThid )
74 adcroft 1.16 ENDIF
75     #endif
76    
77     #ifdef ALLOW_GMREDI
78     C-- Do KPP diagnostics.
79 heimbach 1.17 IF (useGMRedi)
80 adcroft 1.16 & CALL GMREDI_DIAGS( myCurrentTime, myIter, myThid )
81     #endif
82    
83     #ifdef ALLOW_KPP
84     C-- Do KPP diagnostics.
85 heimbach 1.17 IF (useKPP)
86 adcroft 1.16 & CALL KPP_DO_DIAGS( myCurrentTime, myIter, myThid )
87     #endif
88    
89 cnh 1.1 RETURN
90     END
91    

  ViewVC Help
Powered by ViewVC 1.1.22