1 |
C $Header: /u/gcmpack/MITgcm/pkg/fizhi/fizhi_write_state.F,v 1.6 2004/08/18 15:41:18 molod Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "FIZHI_OPTIONS.h" |
5 |
CBOP |
6 |
C !ROUTINE: FIZHI_WRITE_STATE |
7 |
C !INTERFACE: |
8 |
SUBROUTINE FIZHI_WRITE_STATE( myTime, myIter, myThid ) |
9 |
|
10 |
C !DESCRIPTION: \bv |
11 |
C *==========================================================* |
12 |
C | S/R FIZHI_WRITE_STATE |
13 |
C | o Writes current state of fizhi package to an output file |
14 |
C | o Called from do_the_model_io |
15 |
C *==========================================================* |
16 |
C \ev |
17 |
|
18 |
C !USES: |
19 |
CEOP |
20 |
IMPLICIT NONE |
21 |
|
22 |
C == Global variables === |
23 |
#include "SIZE.h" |
24 |
#include "fizhi_SIZE.h" |
25 |
#include "fizhi_land_SIZE.h" |
26 |
#include "fizhi_coms.h" |
27 |
#include "fizhi_land_coms.h" |
28 |
#include "EEPARAMS.h" |
29 |
#include "PARAMS.h" |
30 |
|
31 |
C !INPUT/OUTPUT PARAMETERS: |
32 |
C == Routine Arguments == |
33 |
C suff :: suffix for pickup file |
34 |
C myTime :: current time |
35 |
C myIter :: time-step number |
36 |
C myThid :: Number of this instance |
37 |
_RL myTime |
38 |
INTEGER myIter |
39 |
INTEGER myThid |
40 |
|
41 |
C !LOCAL VARIABLES: |
42 |
C fn :: character buffer for creating filename |
43 |
CHARACTER*(MAX_LEN_FNAM) pref |
44 |
CHARACTER*(MAX_LEN_MBUF) suff |
45 |
CHARACTER*(80) fn |
46 |
logical glf |
47 |
LOGICAL DIFF_BASE_MULTIPLE |
48 |
EXTERNAL DIFF_BASE_MULTIPLE |
49 |
|
50 |
IF ( |
51 |
& DIFF_BASE_MULTIPLE(baseTime,dumpFreq,myTime,deltaTClock).OR. |
52 |
& myTime.EQ.endTime .OR. |
53 |
& myTime.EQ.startTime |
54 |
& ) THEN |
55 |
|
56 |
|
57 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
58 |
|
59 |
C-- Write fields as consecutive records |
60 |
glf = .FALSE. |
61 |
WRITE(suff,'(I10.10)') myIter |
62 |
pref = 'fizhi_U.' |
63 |
WRITE( fn, '(A,A)' ) pref(1:8),suff(1:10) |
64 |
call mdswritefield(fn,64,glf,'RL',Nrphys,uphy,1,myIter,myThid) |
65 |
pref = 'fizhi_V.' |
66 |
WRITE( fn, '(A,A)' ) pref(1:8),suff(1:10) |
67 |
call mdswritefield(fn,64,glf,'RL',Nrphys,vphy,1,myIter,myThid) |
68 |
pref = 'fizhi_T.' |
69 |
WRITE( fn, '(A,A)' ) pref(1:8),suff(1:10) |
70 |
call mdswritefield(fn,64,glf,'RL',Nrphys,thphy,1,myIter,myThid) |
71 |
pref = 'fizhi_S.' |
72 |
WRITE( fn, '(A,A)' ) pref(1:8),suff(1:10) |
73 |
call mdswritefield(fn,64,glf,'RL',Nrphys,sphy,1,myIter,myThid) |
74 |
|
75 |
ENDIF |
76 |
|
77 |
RETURN |
78 |
END |