1 |
C $Header: /u/gcmpack/MITgcm/pkg/aim_v23/aim_initialise.F,v 1.6 2004/03/11 14:33:19 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "AIM_OPTIONS.h" |
5 |
|
6 |
SUBROUTINE AIM_INITIALISE( myThid ) |
7 |
C *==================================================================* |
8 |
C | S/R AIM_INITIALISE |
9 |
C *==================================================================* |
10 |
C | Initialisation of AIM atmospheric physics package : |
11 |
C | 1) call iniphys (=> set parameters to default value) |
12 |
C | 2) read AIM parameters |
13 |
C | 3) initialisation of AIM arrays (time-ave) |
14 |
C *==================================================================* |
15 |
IMPLICIT NONE |
16 |
|
17 |
C -------------- Global variables ------------------------------------ |
18 |
#include "SIZE.h" |
19 |
#include "EEPARAMS.h" |
20 |
#include "PARAMS.h" |
21 |
#include "GRID.h" |
22 |
#include "SURFACE.h" |
23 |
#include "DYNVARS.h" |
24 |
#include "AIM_PARAMS.h" |
25 |
#include "AIM_FFIELDS.h" |
26 |
c #include "AIM_GRID.h" |
27 |
#include "AIM_DIAGS.h" |
28 |
|
29 |
C == Routine arguments == |
30 |
C myThid - Number of this instance |
31 |
INTEGER myThid |
32 |
|
33 |
#ifdef ALLOW_AIM |
34 |
C == Local variables == |
35 |
C HSG - Cell face in vertical |
36 |
C pGround - Lower boundary pressure |
37 |
C i, j, k, bi,bj - Loop counters |
38 |
_RL HSG(0:Nr) |
39 |
_RL pGround, tmpPgrnd |
40 |
INTEGER i, j, K, bi, bj |
41 |
INTEGER Katm |
42 |
|
43 |
C-- Set default value for AIM interface code (AIM_PARAMS.h): |
44 |
aim_useFMsurfBC = .TRUE. |
45 |
aim_useMMsurfFc = .FALSE. |
46 |
aim_surfPotTemp = .FALSE. |
47 |
aim_energPrecip = .FALSE. |
48 |
aim_splitSIOsFx = .FALSE. |
49 |
aim_clrSkyDiag = .FALSE. |
50 |
aim_MMsufx = '.bin' |
51 |
aim_MMsufxLength = 4 |
52 |
aim_LandFile = ' ' |
53 |
aim_albFile = ' ' |
54 |
aim_vegFile = ' ' |
55 |
aim_sstFile = ' ' |
56 |
aim_lstFile = ' ' |
57 |
aim_oiceFile = ' ' |
58 |
aim_snowFile = ' ' |
59 |
aim_swcFile = ' ' |
60 |
aim_dragStrato = 0. |
61 |
aim_taveFreq = taveFreq |
62 |
aim_diagFreq = dumpFreq |
63 |
aim_tendFreq = 0. |
64 |
|
65 |
C-- Set default value for atmos. physics parameters: |
66 |
pGround = atm_Po |
67 |
DO k=1,Nr |
68 |
Katm = _KD2KA( k ) |
69 |
HSG(Katm) = rF(k)/pGround |
70 |
ENDDO |
71 |
k=Nr+1 |
72 |
Katm = _KD2KA( k ) |
73 |
HSG(Katm) = rF(k)/pGround |
74 |
|
75 |
c DO bj = myByLo(myThid), myByHi(myThid) |
76 |
c DO bi = myBxLo(myThid), myBxHi(myThid) |
77 |
|
78 |
C-- set default value for all atmos. physics parameter: |
79 |
CALL INPHYS( HSG, myThid ) |
80 |
|
81 |
c ENDDO |
82 |
c ENDDO |
83 |
|
84 |
C-- Read AIM parameters (from file data.aimphys): |
85 |
CALL AIM_READPARMS( myThid ) |
86 |
|
87 |
C-- set energy fractions in LW bands as a function of temperature: |
88 |
C initialize common block RADFIX (originally called from FORDATE in SPEEDY) |
89 |
_BEGIN_MASTER(myThid) |
90 |
CALL RADSET( myThid) |
91 |
_END_MASTER ( myThid) |
92 |
|
93 |
C-- Set truncSurfP : used to correct for truncation (because of hFacMin) |
94 |
C of surface reference pressure Ro_surf that affects Surf.Temp. |
95 |
CALL INI_P_GROUND(1, topoZ, truncSurfP, myThid ) |
96 |
DO bj = myByLo(myThid), myByHi(myThid) |
97 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
98 |
DO j=1,sNy |
99 |
DO i=1,sNx |
100 |
tmpPgrnd = MIN(truncSurfP(i,j,bi,bj),atm_Po) |
101 |
truncSurfP(i,j,bi,bj)= |
102 |
& ( Ro_surf(i,j,bi,bj)/tmpPgrnd )**atm_kappa |
103 |
ENDDO |
104 |
ENDDO |
105 |
IF (aim_useMMsurfFc .AND. aim_surfPotTemp) THEN |
106 |
DO j=1,sNy |
107 |
DO i=1,sNx |
108 |
truncSurfP(i,j,bi,bj) = |
109 |
& ( Ro_surf(i,j,bi,bj)/atm_Po )**atm_kappa |
110 |
ENDDO |
111 |
ENDDO |
112 |
ENDIF |
113 |
ENDDO |
114 |
ENDDO |
115 |
|
116 |
C-- Initialise surface forcing fields (in AIM_FFIELDS.h): |
117 |
c DO bj = myByLo(myThid), myByHi(myThid) |
118 |
c DO bi = myBxLo(myThid), myBxHi(myThid) |
119 |
c DO j=1-Oly,sNy+Oly |
120 |
c DO i=1-Olx,sNx+Olx |
121 |
c aim_surfTemp(i,j,bi,bj) = 300. |
122 |
c aim_soilWater(i,j,bi,bj) = 0. |
123 |
c aim_albedo (i,j,bi,bj) = 0. |
124 |
c aim_landFr (i,j,bi,bj) = 0. |
125 |
c ENDDO |
126 |
c ENDDO |
127 |
c ENDDO |
128 |
c ENDDO |
129 |
|
130 |
#ifdef ALLOW_AIM_TAVE |
131 |
C Initialise diagnostic counters (these are cleared on model start |
132 |
C i.e. not loaded from history file for now ). |
133 |
DO bj = myByLo(myThid), myByHi(myThid) |
134 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
135 |
CALL TIMEAVE_RESET(USTRtave, 1, bi, bj, myThid) |
136 |
CALL TIMEAVE_RESET(VSTRtave, 1, bi, bj, myThid) |
137 |
CALL TIMEAVE_RESET(TSRtave, 1, bi, bj, myThid) |
138 |
CALL TIMEAVE_RESET(OLRtave, 1, bi, bj, myThid) |
139 |
CALL TIMEAVE_RESET(SSRtave, 1, bi, bj, myThid) |
140 |
CALL TIMEAVE_RESET(SLRtave, 1, bi, bj, myThid) |
141 |
CALL TIMEAVE_RESET(SHFtave, 1, bi, bj, myThid) |
142 |
CALL TIMEAVE_RESET(EVAPtave, 1, bi, bj, myThid) |
143 |
CALL TIMEAVE_RESET(PRECNVtave,1, bi, bj, myThid) |
144 |
CALL TIMEAVE_RESET(PRECLStave,1, bi, bj, myThid) |
145 |
CALL TIMEAVE_RESET(CLOUDCtave,1, bi, bj, myThid) |
146 |
CALL TIMEAVE_RESET(CLTOPtave, 1, bi, bj, myThid) |
147 |
CALL TIMEAVE_RESET(CBMFtave, 1, bi, bj, myThid) |
148 |
CALL TIMEAVE_RESET(DRAGtave, 1, bi, bj, myThid) |
149 |
CALL TIMEAVE_RESET(aimV0tave, 1, bi, bj, myThid) |
150 |
CALL TIMEAVE_RESET(aimT0tave, 1, bi, bj, myThid) |
151 |
CALL TIMEAVE_RESET(aimQ0tave, 1, bi, bj, myThid) |
152 |
CALL TIMEAVE_RESET(EnFxPrtave,1, bi, bj, myThid) |
153 |
CALL TIMEAVE_RESET(albedotave,1, bi, bj, myThid) |
154 |
CALL TIMEAVE_RESET(dTsurftave,1, bi, bj, myThid) |
155 |
CALL TIMEAVE_RESET(aimRHtave,Nr, bi, bj, myThid) |
156 |
DO k=1,Nr |
157 |
aim_timeAve(k,bi,bj) = 0. |
158 |
ENDDO |
159 |
ENDDO |
160 |
ENDDO |
161 |
#endif /* ALLOW_AIM_TAVE */ |
162 |
|
163 |
#endif /* ALLOW_AIM */ |
164 |
|
165 |
RETURN |
166 |
END |