C $Header: /home/ubuntu/mnt/e9_copy/MITgcm/model/src/ini_psurf.F,v 1.7 2003/10/30 12:00:41 edhill Exp $ C $Name: checkpoint51p_post $ #include "CPP_OPTIONS.h" CBOP C !ROUTINE: INI_PSURF C !INTERFACE: SUBROUTINE INI_PSURF( myThid ) C !DESCRIPTION: \bv C *==========================================================* C | SUBROUTINE INI_PSURF | C | o Set model initial free-surface height/pressure. | C *==========================================================* C | There are several options for setting the initial | C | surface displacement (r unit) field. | C | 1. Inline code | C | 2. Two-dimensional data from a file. | C *==========================================================* C \ev C !USES: IMPLICIT NONE C === Global variables === #include "SIZE.h" #include "EEPARAMS.h" #include "PARAMS.h" #include "GRID.h" #include "DYNVARS.h" #ifdef ALLOW_CD_CODE #include "CD_CODE_VARS.h" #endif C !INPUT/OUTPUT PARAMETERS: C == Routine arguments == C myThid - Number of this instance of INI_PSURF INTEGER myThid C !LOCAL VARIABLES: C == Local variables == C bi,bj - Loop counters C I,J INTEGER bi, bj INTEGER I, J CEOP C-- Initialise surface position anomaly to zero DO bj = myByLo(myThid), myByHi(myThid) DO bi = myBxLo(myThid), myBxHi(myThid) DO J=1-Oly,sNy+Oly DO I=1-Olx,sNx+Olx etaN(I,J,bi,bj) = 0. _d 0 ENDDO ENDDO ENDDO ENDDO C Read an initial state IF (pSurfInitFile .NE. ' ') THEN _BEGIN_MASTER( myThid ) CALL READ_FLD_XY_RL( pSurfInitFile, ' ', etaN, 0, myThid ) _END_MASTER(myThid) ENDIF C _EXCH_XY_R8(etaN, myThid) #ifdef ALLOW_CD_CODE C-- By default, initialize etaNm1 with etaN : DO bj=myByLo(myThid),myByHi(myThid) DO bi=myBxLo(myThid),myBxHi(myThid) DO J=1-Oly,sNy+Oly DO I=1-Olx,sNx+Olx etaNm1(I,J,bi,bj) = etaN(I,J,bi,bj) ENDDO ENDDO ENDDO ENDDO C _EXCH_XY_R8(etaNm1, myThid) #endif #ifdef NONLIN_FRSURF C-- By default, initialize etaH with etaN : DO bj=myByLo(myThid),myByHi(myThid) DO bi=myBxLo(myThid),myBxHi(myThid) DO J=1-Oly,sNy+Oly DO I=1-Olx,sNx+Olx etaH(I,J,bi,bj) = etaN(I,J,bi,bj) ENDDO ENDDO ENDDO ENDDO #endif RETURN END