/[MITgcm]/MITgcm/pkg/aim_v23/aim_initialise.F
ViewVC logotype

Contents of /MITgcm/pkg/aim_v23/aim_initialise.F

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


Revision 1.13 - (show annotations) (download)
Wed Oct 18 20:08:15 2006 UTC (17 years, 8 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint58t_post, checkpoint58w_post, checkpoint58q_post, checkpoint58r_post, checkpoint58v_post, checkpoint58x_post, checkpoint58u_post, checkpoint58s_post
Changes since 1.12: +1 -37 lines
- remove EQUIVALENCE instructions (in AIM_FFIELDS.h)
- clean-up multi-threaded problems (reported by debugger tcheck on ACES)
  by moving time-interpolation weight (aim_sWght0,1) out of common block

1 C $Header: /u/gcmpack/MITgcm/pkg/aim_v23/aim_initialise.F,v 1.12 2006/08/08 03:14:33 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 C !DESCRIPTION: \bv
11 C *==================================================================*
12 C | S/R AIM_INITIALISE
13 C *==================================================================*
14 C | Initialisation of AIM atmospheric physics package :
15 C | 1) call iniphys (=> set parameters to default value)
16 C | 2) read AIM parameters
17 C *==================================================================*
18 C \ev
19
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 ENDIF
119
120 #ifdef ALLOW_MNC
121 IF (useMNC) THEN
122 CALL AIM_MNC_INIT( myThid )
123 ENDIF
124 #endif /* ALLOW_MNC */
125
126 #ifdef ALLOW_DIAGNOSTICS
127 IF ( useDiagnostics ) THEN
128 CALL AIM_DIAGNOSTICS_INIT( myThid )
129 ENDIF
130 #endif
131
132 C-- Everyone else must wait for the parameters to be set
133 _BARRIER
134
135 #endif /* ALLOW_AIM */
136
137 RETURN
138 END

  ViewVC Help
Powered by ViewVC 1.1.22