1 |
C $Header: /u/gcmpack/MITgcm_contrib/ESMF/global_ocean.128x64x15/code/driver_run.F,v 1.2 2004/02/22 02:56:19 cnh Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "CPP_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: DRIVER_RUN |
8 |
C !INTERFACE: |
9 |
SUBROUTINE DRIVER_RUN( |
10 |
I atm_HeatFlux, atm_TauX, atm_TauY, |
11 |
I atm_Qlatent, atm_Qsensible, atm_Qlongwave, |
12 |
I atm_Qshortwave, |
13 |
I atm_uVelGround, atm_vVelGround, |
14 |
I atm_FWFlux, |
15 |
I atm_Hatm, |
16 |
O ocn_SSTocn, ocn_Hocn, |
17 |
U myCurrentTime, myCurrentIter, |
18 |
U iLoop, |
19 |
I nTimeS, myThid) |
20 |
|
21 |
C !DESCRIPTION: \bv |
22 |
C *================================================================== |
23 |
C | SUBROUTINE driver_run |
24 |
C | o External driver control routine for MITgcm forward step |
25 |
C | execution phase. |
26 |
C *================================================================== |
27 |
C | |
28 |
C | DRIVER routines are used to control the MITgcm code from an external |
29 |
C | driver. This routine invokes the forward phase of code execution. |
30 |
C | The driver here is written for an ocean configuration and is designed |
31 |
C | for use with either an argument based call/return interface or with a |
32 |
C | messaging based "event loop" interface. |
33 |
C | |
34 |
C *================================================================== |
35 |
C \ev |
36 |
|
37 |
C !USES: |
38 |
IMPLICIT NONE |
39 |
C == Global variables == |
40 |
#include "SIZE.h" |
41 |
#include "EEPARAMS.h" |
42 |
#include "EESUPPORT.h" |
43 |
#include "PARAMS.h" |
44 |
#include "GRID.h" |
45 |
#include "OCNCPL.h" |
46 |
|
47 |
C == Routine arguments == |
48 |
_RL atm_HeatFlux( 1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
49 |
_RL atm_TauX( 1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
50 |
_RL atm_TauY( 1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
51 |
_RL atm_Qlatent( 1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
52 |
_RL atm_Qsensible( 1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
53 |
_RL atm_Qlongwave( 1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
54 |
_RL atm_Qshortwave( 1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
55 |
_RL atm_uVelGround( 1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
56 |
_RL atm_vVelGround( 1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
57 |
_RL atm_FWFlux( 1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
58 |
_RL atm_Hatm( 1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
59 |
_RL ocn_SSTocn( 1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
60 |
_RL ocn_Hocn( 1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
61 |
C myThid :: Thread number for this instance of the routine |
62 |
INTEGER myThid |
63 |
INTEGER myCurrentIter |
64 |
_RL myCurrentTime |
65 |
INTEGER nTimeS |
66 |
INTEGER iLoop |
67 |
C == Local variables == |
68 |
INTEGER i,j,bi,bj |
69 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
70 |
CHARACTER*13 fNam |
71 |
INTEGER iStep |
72 |
CEOP |
73 |
|
74 |
CALL COMP_OCN_PUSH_CONTEXT(1) |
75 |
|
76 |
myThid = 1 |
77 |
!cnhdbg CLOSE(errorMessageUnit) |
78 |
!cnhdbg CLOSE(standardMessageUnit) |
79 |
! myProcessStr = '0000' |
80 |
!cnhdbg WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:4) |
81 |
!cnhdbg OPEN(standardMessageUnit,FILE=fNam,STATUS='old',POSITION='append') |
82 |
!cnhdbg WRITE(fNam,'(A,A)') 'STDERR.', myProcessStr(1:4) |
83 |
!cnhdbg OPEN(errorMessageUnit,FILE=fNam,STATUS='old',POSITION='append') |
84 |
!cnhdbg WRITE(msgBuf,*) 'Entering OCN driver_run' |
85 |
!cnhdbg CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
86 |
!cnhdbg & SQUEEZE_RIGHT , 1) |
87 |
|
88 |
C Extract the import fields |
89 |
DO bj=myByLo(myThid),myByHi(myThid) |
90 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
91 |
DO j=1-OLy,sNy+OLy |
92 |
DO i=1-OLx,sNx+OLx |
93 |
HeatFlux( i,j,bi,bj)=atm_HeatFlux( i,j,bi,bj) |
94 |
TauX( i,j,bi,bj)=atm_tauX( i,j,bi,bj) |
95 |
TauY( i,j,bi,bj)=atm_tauY( i,j,bi,bj) |
96 |
Qlatent( i,j,bi,bj)=atm_qLatent( i,j,bi,bj) |
97 |
Qsensible( i,j,bi,bj)=atm_qSensible( i,j,bi,bj) |
98 |
Qlongwave( i,j,bi,bj)=atm_qLongwave( i,j,bi,bj) |
99 |
Qshortwave( i,j,bi,bj)=atm_qShortwave(i,j,bi,bj) |
100 |
uVelGround( i,j,bi,bj)=atm_uVelGround(i,j,bi,bj) |
101 |
vVelGround( i,j,bi,bj)=atm_vVelGround(i,j,bi,bj) |
102 |
FWFlux( i,j,bi,bj)=atm_FWFlux( i,j,bi,bj) |
103 |
Hatm( i,j,bi,bj)=atm_Hatm( i,j,bi,bj) |
104 |
ENDDO |
105 |
ENDDO |
106 |
ENDDO |
107 |
ENDDO |
108 |
|
109 |
|
110 |
C myThid = 1 |
111 |
myCurrentTime = startTime |
112 |
myCurrentIter = nIter0 |
113 |
C myThid = 1 |
114 |
C nTimesteps = 1 |
115 |
|
116 |
CALL MONITOR( myCurrentIter, myCurrentTime, myThid ) |
117 |
|
118 |
DO iStep = 1, nTimeS |
119 |
CALL FORWARD_STEP_EXECUTE( iLoop, myCurrentTime, |
120 |
& myCurrentIter, myThid ) |
121 |
iLoop = iLoop+1 |
122 |
CALL FORWARD_STEP_SETUP( iLoop, myCurrentTime, |
123 |
& myCurrentIter, myThid ) |
124 |
ENDDO |
125 |
|
126 |
CALL FORWARD_STEP_EXECUTE( iLoop, myCurrentTime, |
127 |
& myCurrentIter, myThid ) |
128 |
iLoop = iLoop+1 |
129 |
CALL FORWARD_STEP_SETUP( iLoop, myCurrentTime, |
130 |
& myCurrentIter, myThid ) |
131 |
|
132 |
C Fill the export fields |
133 |
DO bj=myByLo(myThid),myByHi(myThid) |
134 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
135 |
DO j=1-OLy,sNy+OLy |
136 |
DO i=1-OLx,sNx+OLx |
137 |
ocn_SSTocn(i,j,bi,bj) = SSTocn2cpl(i,j,bi,bj) |
138 |
ocn_Hocn( i,j,bi,bj) = R_low( i,j,bi,bj) |
139 |
ENDDO |
140 |
ENDDO |
141 |
ENDDO |
142 |
ENDDO |
143 |
|
144 |
!cnhdbg CLOSE(errorMessageUnit) |
145 |
!cnhdbg CLOSE(standardMessageUnit) |
146 |
CALL COMP_OCN_POP_CONTEXT(1) |
147 |
|
148 |
RETURN |
149 |
END |