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

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

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


Revision 1.13 - (hide 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 jmc 1.13 C $Header: /u/gcmpack/MITgcm/pkg/aim_v23/aim_initialise.F,v 1.12 2006/08/08 03:14:33 jmc Exp $
2 jmc 1.1 C $Name: $
3    
4     #include "AIM_OPTIONS.h"
5    
6 jmc 1.12 CBOP
7     C !ROUTINE: AIM_INITIALISE
8     C !INTERFACE:
9 jmc 1.1 SUBROUTINE AIM_INITIALISE( myThid )
10 jmc 1.12 C !DESCRIPTION: \bv
11 jmc 1.1 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 jmc 1.12 C | 2) read AIM parameters
17 jmc 1.1 C *==================================================================*
18 jmc 1.12 C \ev
19    
20     C !USES:
21 jmc 1.1 IMPLICIT NONE
22    
23 jmc 1.12 C === Global variables ===
24     #include "SIZE.h"
25 jmc 1.1 #include "EEPARAMS.h"
26     #include "PARAMS.h"
27 jmc 1.2 #include "GRID.h"
28     #include "SURFACE.h"
29     #include "AIM_PARAMS.h"
30     #include "AIM_FFIELDS.h"
31     c #include "AIM_GRID.h"
32 jmc 1.12 c #include "AIM_DIAGS.h"
33 jmc 1.1
34 jmc 1.12 C !INPUT/OUTPUT PARAMETERS:
35 jmc 1.1 C == Routine arguments ==
36 jmc 1.12 C myThid :: my Thread Id number
37 jmc 1.1 INTEGER myThid
38    
39     #ifdef ALLOW_AIM
40 jmc 1.12 C !LOCAL VARIABLES:
41 jmc 1.1 C == Local variables ==
42 jmc 1.12 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 jmc 1.1 _RL HSG(0:Nr)
47 jmc 1.2 _RL pGround, tmpPgrnd
48 jmc 1.12 INTEGER bi, bj
49     INTEGER i, j, k
50 jmc 1.1 INTEGER Katm
51 jmc 1.12 CEOP
52    
53     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
54    
55     _BEGIN_MASTER(myThid )
56 jmc 1.1
57 jmc 1.2 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 jmc 1.1 ENDDO
63 jmc 1.2 k=Nr+1
64     Katm = _KD2KA( k )
65     HSG(Katm) = rF(k)/pGround
66 jmc 1.1
67 jmc 1.12 _END_MASTER ( myThid )
68 jmc 1.1
69     C-- set default value for all atmos. physics parameter:
70 jmc 1.12 CALL INPHYS( HSG, myThid )
71 jmc 1.1
72 jmc 1.2 C-- Read AIM parameters (from file data.aimphys):
73     CALL AIM_READPARMS( myThid )
74    
75 jmc 1.1 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 jmc 1.12 _BEGIN_MASTER(myThid )
78     CALL RADSET( myThid )
79     _END_MASTER ( myThid )
80 jmc 1.1
81 jmc 1.2 C-- Set truncSurfP : used to correct for truncation (because of hFacMin)
82     C of surface reference pressure Ro_surf that affects Surf.Temp.
83 jmc 1.4 CALL INI_P_GROUND(1, topoZ, truncSurfP, myThid )
84 jmc 1.2 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 jmc 1.12 truncSurfP(i,j,bi,bj)=
90 jmc 1.2 & ( 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 jmc 1.12
104 jmc 1.8 C-- Initialise Land Fraction (in AIM_FFIELDS.h):
105 jmc 1.1 DO bj = myByLo(myThid), myByHi(myThid)
106     DO bi = myBxLo(myThid), myBxHi(myThid)
107 jmc 1.8 DO j=1-Oly,sNy+Oly
108 jmc 1.12 DO i=1-Olx,sNx+Olx
109 jmc 1.8 aim_landFr (i,j,bi,bj) = 0.
110     ENDDO
111 jmc 1.3 ENDDO
112 jmc 1.1 ENDDO
113     ENDDO
114 jmc 1.8
115     IF ( aim_LandFile .NE. ' ' ) THEN
116 jmc 1.12 _BARRIER
117 jmc 1.8 CALL READ_REC_XY_RS(aim_LandFile,aim_landFr,1,nIter0,myThid)
118     ENDIF
119 jmc 1.1
120 edhill 1.9 #ifdef ALLOW_MNC
121     IF (useMNC) THEN
122     CALL AIM_MNC_INIT( myThid )
123     ENDIF
124     #endif /* ALLOW_MNC */
125    
126 molod 1.10 #ifdef ALLOW_DIAGNOSTICS
127 jmc 1.12 IF ( useDiagnostics ) THEN
128     CALL AIM_DIAGNOSTICS_INIT( myThid )
129     ENDIF
130 molod 1.10 #endif
131    
132 jmc 1.12 C-- Everyone else must wait for the parameters to be set
133     _BARRIER
134    
135 jmc 1.1 #endif /* ALLOW_AIM */
136    
137     RETURN
138     END

  ViewVC Help
Powered by ViewVC 1.1.22