1 |
C $Header: do_the_model_io.F,v 1.1.1.1 1998/04/22 19:15:30 cnh Exp $ |
2 |
|
3 |
#include "CPP_EEOPTIONS.h" |
4 |
|
5 |
SUBROUTINE DO_THE_MODEL_IO(myIter, myThid) |
6 |
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 |
C == Routine arguments == |
39 |
C myThid - Thread number for this instance of the routine. |
40 |
C myIter - Iteration number |
41 |
INTEGER myThid |
42 |
INTEGER myIter |
43 |
|
44 |
C == Local variables == |
45 |
|
46 |
C-- Generaly only thread 1 does IO here. It can't start until everyone's |
47 |
C-- fields are ready. |
48 |
IF ( MOD(myIter,10) .NE. 0 ) RETURN |
49 |
_BARRIER |
50 |
|
51 |
C-- Write "text-plots" of certain fields |
52 |
CALL PLOT_FIELD_XYZR8( uVel , 'uVel ' , Nz, myIter, myThid ) |
53 |
CALL PLOT_FIELD_XYZR8( vVel , 'vVel ' , Nz, myIter, myThid ) |
54 |
CALL PLOT_FIELD_XYZR8( theta, 'Theta ' , Nz, myIter, myThid ) |
55 |
CALL PLOT_FIELD_XYZR8( rho, 'rho ' , Nz, myIter, myThid ) |
56 |
CALL PLOT_FIELD_XYR8( cg2d_x, 'cg2d_x ' , myIter, myThid ) |
57 |
_BARRIER |
58 |
C |
59 |
RETURN |
60 |
END |
61 |
|