1 |
C $Header$ |
C $Header$ |
2 |
|
|
3 |
#include "CPP_EEOPTIONS.h" |
#include "CPP_OPTIONS.h" |
4 |
|
|
5 |
SUBROUTINE DO_THE_MODEL_IO(myCurrentTime, myIter, myThid) |
SUBROUTINE DO_THE_MODEL_IO( |
6 |
|
I forceOutput, myCurrentTime, myIter, myThid) |
7 |
C /==========================================================\ |
C /==========================================================\ |
8 |
C | SUBROUTINE DO_THE_MODEL_IO | |
C | SUBROUTINE DO_THE_MODEL_IO | |
9 |
C | o Controlling routine for IO in model main time-stepping | |
C | o Controlling routine for IO in model main time-stepping | |
14 |
C | and updating of forcing terms in a single place. | |
C | and updating of forcing terms in a single place. | |
15 |
C | The approach to IO used here is that writes are only | |
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 | |
C | performed by thread 1 and that a process only writes out | |
17 |
C | its data ( since it doen't know about anyone elses data!)| |
C | its data ( it does not know about anyone elses data!) | |
18 |
C | Reading on the other hand is assumed to be from a file | |
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 | |
C | containing all the data for all the processes. Only the | |
20 |
C | portion of data of interest to this process is actually | |
C | portion of data of interest to this process is actually | |
21 |
C | loaded. To work well this assumes the existence of some | |
C | loaded. To work well this assumes the existence of some | |
22 |
C | reliable tool to join datasets together at the end of a | |
C | reliable tool to join datasets together at the end of a | |
23 |
C | run. | |
C | run - see joinds.p | |
|
C | Notes | |
|
|
C | ===== | |
|
|
C | We allow thread 2-nThreads to continue whilst thread 1 | |
|
|
C | does IO. The assumption is that the other threads won't | |
|
|
C | do anything to update their interior regions before | |
|
|
C | thread 1 has finished writing them out. | |
|
24 |
C \==========================================================/ |
C \==========================================================/ |
25 |
|
IMPLICIT NONE |
26 |
|
|
27 |
C == Global variables === |
C == Global variables === |
28 |
#include "SIZE.h" |
#include "SIZE.h" |
30 |
#include "PARAMS.h" |
#include "PARAMS.h" |
31 |
#include "DYNVARS.h" |
#include "DYNVARS.h" |
32 |
#include "CG2D.h" |
#include "CG2D.h" |
33 |
|
#ifdef ALLOW_KPP |
34 |
|
#include "KPPMIX.h" |
35 |
|
#endif |
36 |
|
|
37 |
LOGICAL DIFFERENT_MULTIPLE |
LOGICAL DIFFERENT_MULTIPLE |
38 |
EXTERNAL DIFFERENT_MULTIPLE |
EXTERNAL DIFFERENT_MULTIPLE |
39 |
|
|
40 |
C == Routine arguments == |
C == Routine arguments == |
41 |
|
C forceOutput - If .TRUE. then force I/O, indepenent of other tests |
42 |
C myThid - Thread number for this instance of the routine. |
C myThid - Thread number for this instance of the routine. |
43 |
C myIter - Iteration number |
C myIter - Iteration number |
44 |
C myCurrentTime - Current time of simulation ( s ) |
C myCurrentTime - Current time of simulation ( s ) |
45 |
|
LOGICAL forceOutput |
46 |
INTEGER myThid |
INTEGER myThid |
47 |
INTEGER myIter |
INTEGER myIter |
48 |
REAL myCurrentTime |
_RL myCurrentTime |
49 |
|
|
50 |
C == Local variables == |
C == Local variables == |
|
C suff - Hold suffix part of a filename |
|
|
CHARACTER*(MAX_LEN_FNAM) suff |
|
|
|
|
51 |
|
|
52 |
C-- Generaly only thread 1 does IO here. It can't start until everyone's |
C-- Generaly only thread 1 does IO here. It can not start until |
53 |
C-- fields are ready. |
C-- all threads fields are ready. |
54 |
IF ( |
IF ( |
55 |
& DIFFERENT_MULTIPLE(dumpFreq,myCurrentTime,myCurrentTime-deltaTClock) |
& DIFFERENT_MULTIPLE(dumpFreq,myCurrentTime, |
56 |
|
& myCurrentTime-deltaTClock) |
57 |
& ) THEN |
& ) THEN |
58 |
|
|
59 |
_BARRIER |
_BARRIER |
60 |
|
|
61 |
C-- Write "text-plots" of certain fields |
C-- Write "text-plots" of certain fields |
62 |
CALL PLOT_FIELD_XYZRL( uVel , 'Current uVel ' , Nz, myIter, myThid ) |
CALL PLOT_FIELD_XYZRL( uVel , 'Current uVel ' , |
63 |
CALL PLOT_FIELD_XYZRL( vVel , 'Current vVel ' , Nz, myIter, myThid ) |
& Nr, myIter, myThid ) |
64 |
CALL PLOT_FIELD_XYZRL( theta, 'Current theta ' , Nz, myIter, myThid ) |
CALL PLOT_FIELD_XYZRL( vVel , 'Current vVel ' , |
65 |
CALL PLOT_FIELD_XYRL( cg2d_x, 'Current cg2d_x ' , myIter, myThid ) |
& Nr, myIter, myThid ) |
66 |
|
CALL PLOT_FIELD_XYZRL( theta, 'Current theta ' , |
67 |
|
& Nr, myIter, myThid ) |
68 |
|
CALL PLOT_FIELD_XYRL( cg2d_x, 'Current cg2d_x ' , |
69 |
|
& myIter, myThid ) |
70 |
|
|
71 |
|
#ifdef ALLOW_KPP |
72 |
|
IF (KPPmixingMaps) THEN |
73 |
|
CALL PLOT_FIELD_XYRL ( KPPhbl , 'KPPhbl' , |
74 |
|
& myIter, myThid ) |
75 |
|
CALL PLOT_FIELD_XYZRL ( KPPviscAz , 'KPPviscAz' , |
76 |
|
& Nr, myIter, myThid ) |
77 |
|
CALL PLOT_FIELD_XYZRL ( KPPdiffKzT, 'KPPdiffKzT', |
78 |
|
& Nr, myIter, myThid ) |
79 |
|
CALL PLOT_FIELD_XYZRL ( KPPghat , 'KPPghat' , |
80 |
|
& Nr, myIter, myThid ) |
81 |
|
ENDIF |
82 |
|
#endif |
83 |
|
|
84 |
ENDIF |
ENDIF |
85 |
|
|
86 |
C-- Write model state to binary file |
C-- Write model state to binary file |
87 |
CALL WRITE_STATE( .FALSE., myCurrentTime, myIter, myThid ) |
CALL WRITE_STATE( forceOutput, myCurrentTime, myIter, myThid ) |
88 |
|
|
89 |
C |
C |
90 |
RETURN |
RETURN |