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

Diff of /MITgcm/model/src/write_state.F

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

revision 1.14 by heimbach, Tue Aug 14 00:20:49 2001 UTC revision 1.15 by cnh, Wed Sep 26 18:09:16 2001 UTC
# Line 2  C $Header$ Line 2  C $Header$
2  C $Name$  C $Name$
3  #include "CPP_OPTIONS.h"  #include "CPP_OPTIONS.h"
4    
 C--  File read_write.F: Routines to handle mid-level I/O interface.  
 C--   o WRITE_STATE - Write out model state.  
   
 C The following CPP flag (MULTIPLE_RECORD_STATE_FILES) is  
 C #define/#undefed here since it is specific to this routine and  
 C very user-preference specific.  
 C  
 C If #undefed (default) the state files are written as in all versions  
 C prior to checkpoint32, where a file is created per variable, per time  
 C and per tile. This *has* to be the default because most users use this  
 C mode and all utilities and scripts (diagnostic) assume this form.  
 C It is also robust, as explained below.  
 C  
 C If #defined, subsequent snap-shots are written as records in the  
 C same file (no iteration number in filenames).  
 C Advantages: - fewer files  
 C             - for small problems, is easy to copy the output around  
 C Disadvantages:  
 C             - breaks a lot of diagnostic scripts  
 C             - for large or long problems this creates huge files  
 C             - is an unexpected, unsolicited change in behaviour which came  
 C               as a surprise (in c32) and inconvenience to several users  
 C             - can not accomodate changing the frequency of output  
 C               after a pickup (this is trivial in previous method  
 C               but needs new code and parameters in this new method)  
 C Known Bugs:  
 C             - if the length of integration is not exactly an integer  
 C               times the output frequency then the last record written  
 C               (at end of integration) overwrites a previously written  
 C               record corresponding to an earier time. *BE WARNED*  
   
5  #undef  MULTIPLE_RECORD_STATE_FILES  #undef  MULTIPLE_RECORD_STATE_FILES
     
   
6    
7  CStartofinterface  CBOP
8    C     !ROUTINE: WRITE_STATE
9    C     !INTERFACE:
10        SUBROUTINE WRITE_STATE ( myCurrentTime, myIter, myThid )        SUBROUTINE WRITE_STATE ( myCurrentTime, myIter, myThid )
11  C     /==========================================================\  C     !DESCRIPTION: \bv
12  C     | SUBROUTINE WRITE_STATE                                   |  C     *==========================================================*
13  C     | o Controlling routine for IO to dump model state.        |  C     | SUBROUTINE WRITE_STATE                                    
14  C     |==========================================================|  C     | o Controlling routine for IO to dump model state.        
15  C     | Write model state files for post-processing. This file   |  C     *==========================================================*
16  C     | includes code for diagnosing W and RHO for output.       |  C     | Write model state files for post-processing. This file  
17  C     \==========================================================/  C     | includes code for diagnosing W and RHO for output.      
18        IMPLICIT NONE  C     | File write_state.F: Routines to handle mid-level I/O
19    C     | interface.
20    C     | o WRITE_STATE - Write out model state.
21    C     | The following CPP flag (MULTIPLE_RECORD_STATE_FILES) is
22    C     | #define/#undefed here since it is specific to this routine
23    C     | and very user-preference specific.
24    C     |
25    C     | If #undefed (default) the state files are written as in all versions
26    C     | prior to checkpoint32, where a file is created per variable, per time
27    C     | and per tile. This *has* to be the default because most users use this
28    C     | mode and all utilities and scripts (diagnostic) assume this form.
29    C     | It is also robust, as explained below.
30    C     |
31    C     | If #defined, subsequent snap-shots are written as records in the
32    C     | same file (no iteration number in filenames).
33    C     | Advantages: - fewer files
34    C     |       - for small problems, is easy to copy the output around
35    C     | Disadvantages:
36    C     |       - breaks a lot of diagnostic scripts
37    C     |       - for large or long problems this creates huge files
38    C     |       - is an unexpected, unsolicited change in behaviour which came
39    C     |         as a surprise (in c32) and inconvenience to several users
40    C     |       - can not accomodate changing the frequency of output
41    C     |         after a pickup (this is trivial in previous method
42    C     |         but needs new code and parameters in this new method)
43    C     | Known Bugs:
44    C     |       - if the length of integration is not exactly an integer
45    C     |         times the output frequency then the last record written
46    C     |         (at end of integration) overwrites a previously written
47    C     |         record corresponding to an earier time. *BE WARNED*
48    C     *==========================================================*
49    C     \ev
50    
51    C     !USES:
52          IMPLICIT NONE
53  C     == Global variables ===  C     == Global variables ===
54  #include "SIZE.h"  #include "SIZE.h"
55  #include "EEPARAMS.h"  #include "EEPARAMS.h"
# Line 56  C     == Global variables === Line 58  C     == Global variables ===
58  #ifdef ALLOW_PASSIVE_TRACER  #ifdef ALLOW_PASSIVE_TRACER
59  #include "TR1.h"  #include "TR1.h"
60  #endif  #endif
   
61        LOGICAL  DIFFERENT_MULTIPLE        LOGICAL  DIFFERENT_MULTIPLE
62        EXTERNAL DIFFERENT_MULTIPLE        EXTERNAL DIFFERENT_MULTIPLE
63        INTEGER  IO_ERRCOUNT        INTEGER  IO_ERRCOUNT
64        EXTERNAL IO_ERRCOUNT        EXTERNAL IO_ERRCOUNT
65    
66    C     !INPUT/OUTPUT PARAMETERS:
67  C     == Routine arguments ==  C     == Routine arguments ==
68  C     myThid - Thread number for this instance of the routine.  C     myThid - Thread number for this instance of the routine.
69  C     myIter - Iteration number  C     myIter - Iteration number
# Line 69  C     myCurrentTime - Current time of si Line 71  C     myCurrentTime - Current time of si
71        _RL     myCurrentTime        _RL     myCurrentTime
72        INTEGER myThid        INTEGER myThid
73        INTEGER myIter        INTEGER myIter
 CEndofinterface  
74    
75    C     !LOCAL VARIABLES:
76  C     == Local variables ==  C     == Local variables ==
77        CHARACTER*(MAX_LEN_MBUF) suff        CHARACTER*(MAX_LEN_MBUF) suff
78        INTEGER iRec        INTEGER iRec
79    CEOP
80    
81        IF (        IF (
82       &     DIFFERENT_MULTIPLE(dumpFreq,myCurrentTime,       &     DIFFERENT_MULTIPLE(dumpFreq,myCurrentTime,

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

  ViewVC Help
Powered by ViewVC 1.1.22