1 |
C $Header: /u/gcmpack/MITgcm/pkg/land/land_read_pickup.F,v 1.4 2006/06/23 00:49:27 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "LAND_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: LAND_READ_PICKUP |
8 |
C !INTERFACE: |
9 |
SUBROUTINE LAND_READ_PICKUP( myIter, myThid ) |
10 |
|
11 |
C !DESCRIPTION: \bv |
12 |
C *==========================================================* |
13 |
C | S/R LAND_READ_PICKUP |
14 |
C | o Reads current state of land model from a pickup file |
15 |
C *==========================================================* |
16 |
C \ev |
17 |
|
18 |
C !USES: |
19 |
IMPLICIT NONE |
20 |
|
21 |
C == Global variables === |
22 |
#include "LAND_SIZE.h" |
23 |
#include "EEPARAMS.h" |
24 |
#include "PARAMS.h" |
25 |
#include "LAND_PARAMS.h" |
26 |
#include "LAND_VARS.h" |
27 |
|
28 |
C == Routine Arguments == |
29 |
C myIter :: time-step number |
30 |
C myThid :: Number of this instance |
31 |
INTEGER myIter |
32 |
INTEGER myThid |
33 |
|
34 |
#ifdef ALLOW_LAND |
35 |
|
36 |
C !LOCAL VARIABLES: |
37 |
C fn :: character buffer for creating filename |
38 |
C prec :: precision of pickup files |
39 |
C k :: loop index |
40 |
INTEGER prec, k |
41 |
CHARACTER*(MAX_LEN_FNAM) fn |
42 |
CEOP |
43 |
|
44 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
45 |
|
46 |
C Going to really do some IO. Make everyone except master thread wait. |
47 |
_BARRIER |
48 |
|
49 |
IF ( .NOT.land_pickup_read_mnc ) THEN |
50 |
|
51 |
WRITE(fn,'(A,I10.10)') 'pickup_land.',myIter |
52 |
prec = precFloat64 |
53 |
|
54 |
#ifdef ALLOW_MDSIO |
55 |
IF ( land_oldPickup ) THEN |
56 |
C- Read fields as consecutive records |
57 |
CALL MDSREADFIELD(fn,prec,'RL',land_nLev,land_groundT,1,myThid) |
58 |
CALL MDSREADFIELD(fn,prec,'RL',land_nLev,land_groundW,2,myThid) |
59 |
|
60 |
ELSE |
61 |
|
62 |
C- Read fields as consecutive records |
63 |
CALL MDSREADFIELD(fn,prec,'RL',land_nLev,land_enthalp,1,myThid) |
64 |
CALL MDSREADFIELD(fn,prec,'RL',land_nLev,land_groundW,2,myThid) |
65 |
k=2*land_nLev |
66 |
CALL MDSREADFIELD(fn,prec,'RL', 1, land_skinT, k+1, myThid) |
67 |
CALL MDSREADFIELD(fn,prec,'RL', 1, land_hSnow, k+2, myThid) |
68 |
CALL MDSREADFIELD(fn,prec,'RL', 1, land_snowAge,k+3, myThid) |
69 |
|
70 |
ENDIF |
71 |
#else /* ALLOW_MDSIO */ |
72 |
STOP 'ABNORMAL END: S/R LAND_READ_PICKUP: NEEDS MSDIO PKG' |
73 |
#endif /* ALLOW_MDSIO */ |
74 |
|
75 |
ENDIF |
76 |
|
77 |
#ifdef ALLOW_MNC |
78 |
IF ( land_pickup_read_mnc ) THEN |
79 |
|
80 |
DO k = 1,MAX_LEN_FNAM |
81 |
fn(k:k) = ' ' |
82 |
ENDDO |
83 |
WRITE(fn,'(A)') 'pickup_land' |
84 |
CALL MNC_FILE_CLOSE_ALL_MATCHING(fn, myThid) |
85 |
CALL MNC_CW_SET_UDIM(fn, 1, myThid) |
86 |
CALL MNC_CW_SET_CITER(fn, 3, 3, myIter, -1, myThid) |
87 |
|
88 |
CALL MNC_CW_RL_R('D',fn,0,0, |
89 |
& 'land_enthalp', land_enthalp, myThid) |
90 |
CALL MNC_CW_RL_R('D',fn,0,0, |
91 |
& 'land_groundW', land_groundW, myThid) |
92 |
|
93 |
CALL MNC_CW_RL_R('D',fn,0,0, |
94 |
& 'land_skinT', land_skinT, myThid) |
95 |
CALL MNC_CW_RL_R('D',fn,0,0, |
96 |
& 'land_hSnow', land_hSnow, myThid) |
97 |
CALL MNC_CW_RL_R('D',fn,0,0, |
98 |
& 'land_snAge', land_snowAge, myThid) |
99 |
|
100 |
ENDIF |
101 |
#endif |
102 |
|
103 |
C- jmc: exchange is not really necessary for land model |
104 |
C- and presently exchange S/R cannot work for 3d array where 3rd dim <> Nr |
105 |
|
106 |
C-- Every one else must wait until writing is done. |
107 |
_BARRIER |
108 |
|
109 |
#endif /* ALLOW_LAND */ |
110 |
|
111 |
RETURN |
112 |
END |