/[MITgcm]/MITgcm/model/src/ini_nh_fields.F
ViewVC logotype

Contents of /MITgcm/model/src/ini_nh_fields.F

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


Revision 1.6 - (show annotations) (download)
Sun Aug 11 20:23:39 2013 UTC (10 years, 9 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64m, checkpoint64o, checkpoint64n, checkpoint65, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, HEAD
Changes since 1.5: +5 -2 lines
avoid unused variables

1 C $Header: /u/gcmpack/MITgcm/model/src/ini_nh_fields.F,v 1.5 2013/07/28 21:06:00 jmc Exp $
2 C $Name: $
3
4 #include "CPP_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: INI_NH_FIELDS
8 C !INTERFACE:
9 SUBROUTINE INI_NH_FIELDS( myThid )
10
11 C !DESCRIPTION: \bv
12 C *==========================================================*
13 C | SUBROUTINE INI_NH_FIELDS
14 C | o Set model initial non-hydrostatic fields.
15 C *==========================================================*
16 C | Note: If using NH form,
17 C | call this S/R whether starting or restarting simulation.
18 C | This is different from other "true" ini_fields type S/R
19 C | (e.g., INI_VEL) which are called only when starting.
20 C | Reason: no real physical field to initialise (since wVel
21 C | is diagnose from continuity) but needs to set few arrays
22 C *==========================================================*
23 C \ev
24
25 C !USES:
26 IMPLICIT NONE
27 C === Global variables ===
28 #include "SIZE.h"
29 #include "EEPARAMS.h"
30 #include "PARAMS.h"
31 #include "GRID.h"
32 #include "RESTART.h"
33 #include "NH_VARS.h"
34
35 C !INPUT/OUTPUT PARAMETERS:
36 C == Routine arguments ==
37 C myThid :: My Thread Id number
38 INTEGER myThid
39
40 #ifdef ALLOW_NONHYDROSTATIC
41 C !LOCAL VARIABLES:
42 C == Local variables ==
43 INTEGER bi,bj
44 INTEGER i,j
45 INTEGER ks
46 CHARACTER*(MAX_LEN_MBUF) msgBuf
47 #ifdef NONLIN_FRSURF
48 INTEGER k
49 #endif
50 CEOP
51
52 IF ( startTime .EQ. baseTime .AND. nIter0 .EQ. 0
53 & .AND. pickupSuff .EQ. ' ' ) THEN
54 C-- Case where starting from initial conditions
55
56 C-- Read an initial non-hydrostatic pressure field
57 c IF (phiNHinitFile .NE. ' ') THEN
58 c CALL READ_FLD_XYZ_RL( phiNHinitFile, ' ', phi_nh, 0, myThid )
59 c _EXCH_XYZ_RL(phi_nh, myThid)
60 c ENDIF
61
62 ELSE
63 C-- Case where restarting from a pickup
64
65 _BEGIN_MASTER(myThid)
66 WRITE(msgBuf,'(A,I4)')
67 & 'INI_NH_FIELDS: dPhiNHstatus=', dPhiNHstatus
68 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
69 & SQUEEZE_RIGHT, myThid )
70 _END_MASTER(myThid)
71 IF ( exactConserv .AND. dPhiNHstatus.EQ.0 ) THEN
72 c IF ( exactConserv ) THEN
73 C-- Separate the Hydrostatic Surface Pressure adjusment (=> put it in dPhiNH)
74 C from the Non-hydrostatic pressure (since cg3d_x contains both contribution)
75 DO bj=myByLo(myThid),myByHi(myThid)
76 DO bi=myBxLo(myThid),myBxHi(myThid)
77 IF ( select_rStar.EQ.0 .AND. uniformFreeSurfLev ) THEN
78 C- Z coordinate: assume surface @ level k=1
79 DO j=1-OLy,sNy+OLy
80 DO i=1-OLx,sNx+OLx
81 dPhiNH(i,j,bi,bj) = phi_nh(i,j,1,bi,bj)
82 c dPhiNH(i,j,bi,bj) = 0.
83 ENDDO
84 ENDDO
85 ELSEIF ( select_rStar.EQ.0 ) THEN
86 C- Other than Z coordinate: no assumption on surface level index
87 DO j=1-OLy,sNy+OLy
88 DO i=1-OLx,sNx+OLx
89 ks = kSurfC(i,j,bi,bj)
90 IF ( ks.LE.Nr ) THEN
91 dPhiNH(i,j,bi,bj) = phi_nh(i,j,ks,bi,bj)
92 ELSE
93 dPhiNH(i,j,bi,bj) = 0.
94 ENDIF
95 ENDDO
96 ENDDO
97 #ifdef NONLIN_FRSURF
98 ELSE
99 C rStar : take vertical average of P_NH as Hyd.Surf.Press adjustment
100 DO j=1-OLy,sNy+OLy
101 DO i=1-OLx,sNx+OLx
102 dPhiNH(i,j,bi,bj) = 0.
103 ENDDO
104 ENDDO
105 DO k=1,Nr
106 DO j=1-OLy,sNy+OLy
107 DO i=1-OLx,sNx+OLx
108 dPhiNH(i,j,bi,bj) = dPhiNH(i,j,bi,bj)
109 & + phi_nh(i,j,k,bi,bj)*drF(k)*hFacC(i,j,k,bi,bj)
110 ENDDO
111 ENDDO
112 ENDDO
113 DO j=1-OLy,sNy+OLy
114 DO i=1-OLx,sNx+OLx
115 dPhiNH(i,j,bi,bj) = dPhiNH(i,j,bi,bj)
116 & *recip_Rcol(i,j,bi,bj)
117 ENDDO
118 ENDDO
119 #endif /* NONLIN_FRSURF */
120 ENDIF
121 ENDDO
122 ENDDO
123 C- end of if-block: dPhiNH_status
124 ENDIF
125
126 ENDIF
127
128 #endif /* ALLOW_NONHYDROSTATIC */
129 RETURN
130 END

  ViewVC Help
Powered by ViewVC 1.1.22