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

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

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


Revision 1.24 - (show annotations) (download)
Thu Nov 21 19:11:42 2002 UTC (21 years, 7 months ago) by cheisey
Branch: MAIN
Changes since 1.23: +7 -7 lines
Two packages:  bulk_force (Bulk forcing)
and therm_seaice (thermodynamic_seaice) - adopted from LANL CICE.v2.0.2
Earlier integration from Stephaine Dutkiewicz
and Patrick Heimbach.

Two ifdef statements for compile time,
ALLOW_THERM_SEAICE and ALLOW_BULK_FORCE

Two switches in data.pkg to turn on at run-time:

cat data.pkg
# Packages
 &PACKAGES
 useBulkForce=.TRUE.,
 useThermSeaIce=.TRUE.,
 &

WARNING:  useSEAICE and useThermSEAICE are mutually exclusive.

The bulk package requires an additional parameter file
with two namelists, data.ice and data.blk.

c ADAPTED FROM:
c LANL CICE.v2.0.2
c-----------------------------------------------------------------------
c.. thermodynamics (vertical physics) based on M. Winton 3-layer model
c.. See Bitz, C. M. and W. H. Lipscomb, 1999:  "An energy-conserving
c..       thermodynamic sea ice model for climate study."  J. Geophys.
c..       Res., 104, 15669 - 15677.
c..     Winton, M., 1999:  "A reformulated three-layer sea ice model."
c..       Submitted to J. Atmos. Ocean. Technol.

c.. authors Elizabeth C. Hunke and William Lipscomb
c..         Fluid Dynamics Group, Los Alamos National Laboratory
c-----------------------------------------------------------------------

1 C $Header: /u/u0/gcmpack/MITgcm/model/src/do_the_model_io.F,v 1.23 2002/11/15 19:58:21 cheisey Exp $
2 C $Name: $
3
4 #include "CPP_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: DO_THE_MODEL_IO
8 C !INTERFACE:
9 SUBROUTINE DO_THE_MODEL_IO(myCurrentTime, myIter, myThid)
10 C !DESCRIPTION: \bv
11 C *==========================================================*
12 C | SUBROUTINE DO_THE_MODEL_IO
13 C | o Controlling routine for IO in model main time-stepping
14 C | loop.
15 C *==========================================================*
16 C | Many systems do not have thread safe IO so it is easier
17 C | to lump everything together and do dumping of fields
18 C | and updating of forcing terms in a single place.
19 C | The approach to IO used here is that writes are only
20 C | performed by thread 1 and that a process only writes out
21 C | its data ( it does not know about anyone elses data!)
22 C | Reading on the other hand is assumed to be from a file
23 C | containing all the data for all the processes. Only the
24 C | portion of data of interest to this process is actually
25 C | loaded. To work well this assumes the existence of some
26 C | reliable tool to join datasets together at the end of a
27 C | run - see joinds.p
28 C *==========================================================*
29 C \ev
30
31 C !USES:
32 IMPLICIT NONE
33 C == Global variables ===
34 #include "SIZE.h"
35 #include "EEPARAMS.h"
36 #include "PARAMS.h"
37 #include "DYNVARS.h"
38 cswdblk --- add ---
39 #ifdef ALLOW_BULK_FORCE
40 #include "BULKF.h"
41 #include "FFIELDS.h"
42 #endif
43 cswdblk -- end add ---
44 cswdice -- add ---
45 #ifdef ALLOW_THERM_SEAICE
46 #include "ICE.h"
47 #include "ICE_DIAGS.h"
48 #endif
49 cswdice -- end add ---
50
51
52
53 LOGICAL DIFFERENT_MULTIPLE
54 EXTERNAL DIFFERENT_MULTIPLE
55
56 C !INPUT/OUTPUT PARAMETERS:
57 C == Routine arguments ==
58 C myThid - Thread number for this instance of the routine.
59 C myIter - Iteration number
60 C myCurrentTime - Current time of simulation ( s )
61 INTEGER myThid
62 INTEGER myIter
63 _RL myCurrentTime
64
65 CEOP
66
67 C-- Generaly only thread 1 does IO here. It can not start until
68 C-- all threads fields are ready.
69 IF (
70 & DIFFERENT_MULTIPLE(dumpFreq,myCurrentTime,
71 & myCurrentTime-deltaTClock)
72 & ) THEN
73
74 _BARRIER
75
76 C-- Write "text-plots" of certain fields
77 CALL PLOT_FIELD_XYZRL( uVel , 'Current uVel ' ,
78 & Nr, myIter, myThid )
79 CALL PLOT_FIELD_XYZRL( vVel , 'Current vVel ' ,
80 & Nr, myIter, myThid )
81 CALL PLOT_FIELD_XYZRL( theta, 'Current theta ' ,
82 & Nr, myIter, myThid )
83 CALL PLOT_FIELD_XYRL( etaN , 'Current etaN ' ,
84 & myIter, myThid )
85
86 ENDIF
87
88 C-- Write model state to binary file
89 CALL WRITE_STATE( myCurrentTime, myIter, myThid )
90
91 #ifdef ALLOW_TIMEAVE
92 C-- Do time averages
93 IF (taveFreq.GT.0.) THEN
94 CALL TIMEAVE_STATV_WRITE( myCurrentTime, myIter, myThid )
95 #ifdef ALLOW_AIM
96 IF (useAIM)
97 & CALL AIM_WRITE_DIAGS( myCurrentTime, myIter, myThid )
98 #endif
99 ENDIF
100 #endif
101
102 #ifdef ALLOW_GMREDI
103 C-- Do KPP diagnostics.
104 IF (useGMRedi)
105 & CALL GMREDI_DIAGS( myCurrentTime, myIter, myThid )
106 #endif
107
108 #ifdef ALLOW_KPP
109 C-- Do KPP diagnostics.
110 IF (useKPP)
111 & CALL KPP_DO_DIAGS( myCurrentTime, myIter, myThid )
112 #endif
113
114 cswdblk --- add ---
115 #ifdef ALLOW_BULK_FORCE
116 C-- Do bulkf diagnostics.
117 IF (useBulkforce)
118 & CALL BULKF_DIAGS( myCurrentTime, myIter, myThid )
119 #endif
120 cswdblk -- end add ---
121
122 cswdice --- add ---
123 #ifdef ALLOW_THERM_SEAICE
124 C-- Do seaice diagnostics.
125 IF (useThermSeaice)
126 & CALL ICE_DIAGS( myCurrentTime, myIter, myThid )
127 #endif
128 cswdice -- end add ---
129
130
131
132 RETURN
133 END
134

  ViewVC Help
Powered by ViewVC 1.1.22