1 |
C $Header: /u/gcmpack/MITgcm/pkg/aim_v23/aim_initialise.F,v 1.13 2006/10/18 20:08:15 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "AIM_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: AIM_INITIALISE |
8 |
C !INTERFACE: |
9 |
SUBROUTINE AIM_INITIALISE( myThid ) |
10 |
|
11 |
C !DESCRIPTION: \bv |
12 |
C *==================================================================* |
13 |
C | S/R AIM_INITIALISE |
14 |
C *==================================================================* |
15 |
C | Initialisation of AIM atmospheric physics package : |
16 |
C | 1) call iniphys (=> set parameters to default value) |
17 |
C | 2) read AIM parameters |
18 |
C *==================================================================* |
19 |
C \ev |
20 |
C !USES: |
21 |
IMPLICIT NONE |
22 |
|
23 |
C === Global variables === |
24 |
#include "SIZE.h" |
25 |
#include "EEPARAMS.h" |
26 |
#include "PARAMS.h" |
27 |
#include "GRID.h" |
28 |
#include "SURFACE.h" |
29 |
#include "AIM_PARAMS.h" |
30 |
#include "AIM_FFIELDS.h" |
31 |
c #include "AIM_GRID.h" |
32 |
c #include "AIM_DIAGS.h" |
33 |
|
34 |
C !INPUT/OUTPUT PARAMETERS: |
35 |
C == Routine arguments == |
36 |
C myThid :: my Thread Id. number |
37 |
INTEGER myThid |
38 |
|
39 |
#ifdef ALLOW_AIM |
40 |
C !LOCAL VARIABLES: |
41 |
C == Local variables == |
42 |
C HSG :: Cell face in vertical |
43 |
C pGround :: Lower boundary pressure |
44 |
C bi,bj :: Tile indices |
45 |
C i, j, k :: Loop counters |
46 |
_RL HSG(0:Nr) |
47 |
_RL pGround, tmpPgrnd |
48 |
INTEGER bi, bj |
49 |
INTEGER i, j, k |
50 |
INTEGER Katm |
51 |
CEOP |
52 |
|
53 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
54 |
|
55 |
_BEGIN_MASTER(myThid ) |
56 |
|
57 |
C-- Set default value for atmos. physics parameters: |
58 |
pGround = atm_Po |
59 |
DO k=1,Nr |
60 |
Katm = _KD2KA( k ) |
61 |
HSG(Katm) = rF(k)/pGround |
62 |
ENDDO |
63 |
k=Nr+1 |
64 |
Katm = _KD2KA( k ) |
65 |
HSG(Katm) = rF(k)/pGround |
66 |
|
67 |
_END_MASTER ( myThid ) |
68 |
|
69 |
C-- set default value for all atmos. physics parameter: |
70 |
CALL INPHYS( HSG, myThid ) |
71 |
|
72 |
C-- Read AIM parameters (from file data.aimphys): |
73 |
CALL AIM_READPARMS( myThid ) |
74 |
|
75 |
C-- set energy fractions in LW bands as a function of temperature: |
76 |
C initialize common block RADFIX (originally called from FORDATE in SPEEDY) |
77 |
_BEGIN_MASTER(myThid ) |
78 |
CALL RADSET( myThid ) |
79 |
_END_MASTER ( myThid ) |
80 |
|
81 |
C-- Set truncSurfP : used to correct for truncation (because of hFacMin) |
82 |
C of surface reference pressure Ro_surf that affects Surf.Temp. |
83 |
CALL INI_P_GROUND(1, topoZ, truncSurfP, myThid ) |
84 |
DO bj = myByLo(myThid), myByHi(myThid) |
85 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
86 |
DO j=1,sNy |
87 |
DO i=1,sNx |
88 |
tmpPgrnd = MIN(truncSurfP(i,j,bi,bj),atm_Po) |
89 |
truncSurfP(i,j,bi,bj)= |
90 |
& ( Ro_surf(i,j,bi,bj)/tmpPgrnd )**atm_kappa |
91 |
ENDDO |
92 |
ENDDO |
93 |
IF (aim_useMMsurfFc .AND. aim_surfPotTemp) THEN |
94 |
DO j=1,sNy |
95 |
DO i=1,sNx |
96 |
truncSurfP(i,j,bi,bj) = |
97 |
& ( Ro_surf(i,j,bi,bj)/atm_Po )**atm_kappa |
98 |
ENDDO |
99 |
ENDDO |
100 |
ENDIF |
101 |
ENDDO |
102 |
ENDDO |
103 |
|
104 |
C-- Initialise Land Fraction (in AIM_FFIELDS.h): |
105 |
DO bj = myByLo(myThid), myByHi(myThid) |
106 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
107 |
DO j=1-Oly,sNy+Oly |
108 |
DO i=1-Olx,sNx+Olx |
109 |
aim_landFr (i,j,bi,bj) = 0. |
110 |
ENDDO |
111 |
ENDDO |
112 |
ENDDO |
113 |
ENDDO |
114 |
|
115 |
IF ( aim_LandFile .NE. ' ' ) THEN |
116 |
_BARRIER |
117 |
CALL READ_REC_XY_RS(aim_LandFile,aim_landFr,1,nIter0,myThid) |
118 |
C- better to fill land fraction overlap (likely to be needed for sea-ice) |
119 |
CALL EXCH_XY_RS( aim_landFr, myThid ) |
120 |
ENDIF |
121 |
|
122 |
#ifdef ALLOW_MNC |
123 |
IF (useMNC) THEN |
124 |
CALL AIM_MNC_INIT( myThid ) |
125 |
ENDIF |
126 |
#endif /* ALLOW_MNC */ |
127 |
|
128 |
#ifdef ALLOW_DIAGNOSTICS |
129 |
IF ( useDiagnostics ) THEN |
130 |
CALL AIM_DIAGNOSTICS_INIT( myThid ) |
131 |
ENDIF |
132 |
#endif |
133 |
|
134 |
C-- Everyone else must wait for the parameters to be set |
135 |
_BARRIER |
136 |
|
137 |
#endif /* ALLOW_AIM */ |
138 |
|
139 |
RETURN |
140 |
END |