/[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.4 - (hide annotations) (download)
Tue May 26 21:29:45 1998 UTC (26 years ago) by cnh
Branch: MAIN
Changes since 1.3: +1 -2 lines
Changes to support "low" memory mode of operation
 - Small change to allow _RS -> REAL*4 to work
 - Added some macros for case where grid variations are a
   a subset of the general case. e.g. dx constnat or flat bottom

1 cnh 1.4 C $Header: /u/gcmpack/models/MITgcmUV/model/src/do_the_model_io.F,v 1.3 1998/05/21 18:25:49 cnh Exp $
2 cnh 1.1
3     #include "CPP_EEOPTIONS.h"
4    
5 cnh 1.3 SUBROUTINE DO_THE_MODEL_IO(myCurrentTime, myIter, myThid)
6 cnh 1.1 C /==========================================================\
7     C | SUBROUTINE DO_THE_MODEL_IO |
8     C | o Controlling routine for IO in model main time-stepping |
9     C | loop. |
10     C |==========================================================|
11     C | Many systems do not have thread safe IO so it is easier |
12     C | to lump everything together and do dumping of fields |
13     C | and updating of forcing terms in a single place. |
14     C | The approach to IO used here is that writes are only |
15     C | performed by thread 1 and that a process only writes out |
16     C | its data ( since it doen't know about anyone elses data!)|
17     C | Reading on the other hand is assumed to be from a file |
18     C | containing all the data for all the processes. Only the |
19     C | portion of data of interest to this process is actually |
20     C | loaded. To work well this assumes the existence of some |
21     C | reliable tool to join datasets together at the end of a |
22     C | run. |
23     C | Notes |
24     C | ===== |
25     C | We allow thread 2-nThreads to continue whilst thread 1 |
26     C | does IO. The assumption is that the other threads won't |
27     C | do anything to update their interior regions before |
28     C | thread 1 has finished writing them out. |
29     C \==========================================================/
30    
31     C == Global variables ===
32     #include "SIZE.h"
33     #include "EEPARAMS.h"
34     #include "PARAMS.h"
35     #include "DYNVARS.h"
36     #include "CG2D.h"
37    
38 cnh 1.3 LOGICAL DIFFERENT_MULTIPLE
39     EXTERNAL DIFFERENT_MULTIPLE
40    
41 cnh 1.1 C == Routine arguments ==
42     C myThid - Thread number for this instance of the routine.
43     C myIter - Iteration number
44 cnh 1.3 C myCurrentTime - Current time of simulation ( s )
45 cnh 1.1 INTEGER myThid
46     INTEGER myIter
47 cnh 1.3 REAL myCurrentTime
48 cnh 1.1
49     C == Local variables ==
50 cnh 1.3 C suff - Hold suffix part of a filename
51     CHARACTER*(MAX_LEN_FNAM) suff
52    
53 cnh 1.1
54     C-- Generaly only thread 1 does IO here. It can't start until everyone's
55     C-- fields are ready.
56 cnh 1.3 IF ( MOD(myIter,1000) .EQ. 0 ) THEN
57     _BARRIER
58 cnh 1.1
59 cnh 1.3 C-- Write "text-plots" of certain fields
60     CALL PLOT_FIELD_XYZR8( uVel , 'uVel ' , Nz, myIter, myThid )
61     CALL PLOT_FIELD_XYZR8( vVel , 'vVel ' , Nz, myIter, myThid )
62     CALL PLOT_FIELD_XYZR8( theta, 'Theta ' , Nz, myIter, myThid )
63     CALL PLOT_FIELD_XYR8( cg2d_x, 'cg2d_x ' , myIter, myThid )
64    
65     ENDIF
66    
67     C-- Write model state to binary file
68     CALL WRITE_STATE( myCurrentTime, myIter, myThid )
69     C WRITE(suff,'(I10.10)') myIter
70     C CALL DFILE_SET_RW
71     C CALL DFILE_SET_CONT_ON_ERROR
72     C CALL WRITE_FLD_XYZ( 'U.',suff, uVel)
73     C CALL WRITE_FLD_XYZ( 'V.',suff, vVel)
74     C CALL WRITE_FLD_XYZ( 'T.',suff, theta)
75     C CALL WRITE_FLD_XYZ( 'S.',suff, salt)
76     C CALL WRITE_FLD_XYZ( 'W.',suff, IO_tmp3d)
77     C CALL WRITE_FLD_XYZ('RHO.',suff, IO_tmp3d)
78     C CALL WRITE_FLD_XYZ( 'PH.',suff, IO_tmp3d)
79     C CALL WRITE_FLD_XY ( 'PS.',suff, IO_tmp2d)
80    
81     C-- Write model checkpoint files
82     C nCheck = 1,2,...nCheckLev, 1,2,...nCheckLev, etc...
83     C CALL WRITE_CHECKPOINT( myIter, myThid )
84     C nCheck = MOD(nCheck,nCheckLev)+1
85     C suff = checkPtSuff(nCheck)
86     C CALL DFILE_SET_RW
87     C CALL DFILE_SET_CONT_ON_ERROR
88     C CALL WRITE_FLD_XYZ( 'uVel.',suff,uVel )
89     C CALL WRITE_FLD_XYZ( 'vVel.',suff,vVel )
90     C CALL WRITE_FLD_XYZ( 'theta.',suff,theta )
91     C CALL WRITE_FLD_XYZ( 'salt.',suff,salt )
92     C CALL WRITE_FLD_XY ('cg2d_x.',suff,cg2d_x)
93     C CALL WRITE_FLD_XYZ( 'gu.',suff,gu )
94     C CALL WRITE_FLD_XYZ( 'gv.',suff,gv )
95     C CALL WRITE_FLD_XYZ( 'gunm1.',suff,gunm1 )
96     C CALL WRITE_FLD_XYZ( 'gvnm1.',suff,gvnm1 )
97    
98 cnh 1.1 _BARRIER
99     C
100     RETURN
101     END
102    

  ViewVC Help
Powered by ViewVC 1.1.22