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

Diff of /MITgcm/model/src/ini_eos.F

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

revision 1.9 by jmc, Mon Feb 3 21:58:09 2003 UTC revision 1.11 by jmc, Tue Oct 19 02:39:58 2004 UTC
# Line 2  C $Header$ Line 2  C $Header$
2  C $Name$  C $Name$
3    
4  #include "CPP_OPTIONS.h"  #include "CPP_OPTIONS.h"
5    #define EXCLUDE_EOS_CHECK
6    
7  CBOP  CBOP
8  C     !ROUTINE: INI_EOS  C     !ROUTINE: INI_EOS
# Line 38  C     I,J,K Line 39  C     I,J,K
39        INTEGER  I,  J,  K        INTEGER  I,  J,  K
40        CHARACTER*(MAX_LEN_MBUF) msgBuf        CHARACTER*(MAX_LEN_MBUF) msgBuf
41                
42          IF ( .NOT.fluidIsWater ) RETURN
43    
44        equationOfState = eosType        equationOfState = eosType
45    
# Line 63  C     I,J,K Line 65  C     I,J,K
65           eosMDJWFden(k) = 0. _d 0           eosMDJWFden(k) = 0. _d 0
66        end do        end do
67    
 C     initialise pressure to zero (this is not really the right place to  
 C     do it, but let's do it anyway; pressure will be initialised to  
 C     sensible values in ini_pressure)  
       do bj = myByLo(myThid), myByHi(myThid)  
        do bi = myBxLo(myThid), myBxHi(myThid)  
         do K=1,Nr  
          do J=1-Oly,sNy+Oly  
           do I=1-Olx,sNx+Olx  
            pressure(i,j,k,bi,bj) = 0. _d 0  
           end do  
          end do  
         end do  
        end do  
       end do  
 C  
 C     initialise pressure to something sensible (will be overwritten)  
 C  
       if ( buoyancyRelation .eq. 'OCEANIC' ) then  
        do bj = myByLo(myThid), myByHi(myThid)  
         do bi = myBxLo(myThid), myBxHi(myThid)  
          do K=1,Nr  
           do J=1-Oly,sNy+Oly  
            do I=1-Olx,sNx+Olx  
             pressure(i,j,k,bi,bj) = rhoConst * (  
      &           - gravity*rC(k)  
      &           )  
            end do  
           end do  
          end do  
         end do  
        end do  
       elseif ( buoyancyRelation .eq. 'OCEANICP' ) then  
 C      
 C     in pressure coordinates the pressure is just the coordinate of  
 C     the tracer point, that is, its constant in time  
 C  
        do bj = myByLo(myThid), myByHi(myThid)  
         do bi = myBxLo(myThid), myBxHi(myThid)  
          do K=1,Nr  
           do J=1-Oly,sNy+Oly  
            do I=1-Olx,sNx+Olx  
             pressure(i,j,k,bi,bj) = rC(k)  
            end do  
           end do  
          end do  
         end do  
        end do  
       endif  
   
68        if ( equationOfState .eq. 'LINEAR' ) then        if ( equationOfState .eq. 'LINEAR' ) then
69           if ( tAlpha .eq. UNSET_RL ) tAlpha = 2.D-4           if ( tAlpha .eq. UNSET_RL ) tAlpha = 2.D-4
70           if ( sBeta  .eq. UNSET_RL ) sBeta  = 7.4D-4           if ( sBeta  .eq. UNSET_RL ) sBeta  = 7.4D-4
# Line 141  C     rho = R(salinity, potential temper Line 94  C     rho = R(salinity, potential temper
94  C     pressure needs to be available (from the previous  C     pressure needs to be available (from the previous
95  C     time step to linearize the problem)  C     time step to linearize the problem)
96  C  C
97           if ( equationOfState .eq. 'JMD95Z'           if ( equationOfState .eq. 'JMD95Z' .and. usingPCoords ) then
      &        .and. buoyancyRelation .eq. 'OCEANICP' ) then  
98              write(msgBuf,'(A)')              write(msgBuf,'(A)')
99       &      'ini_eos: equation of state ''JMD95Z'' should not'       &      'ini_eos: equation of state ''JMD95Z'' should not'
100              CALL PRINT_ERROR( msgBuf , 1)              CALL PRINT_ERROR( msgBuf , 1)
# Line 307  C--   Check EOS initialisation: Line 259  C--   Check EOS initialisation:
259    
260        call check_eos( myThid )        call check_eos( myThid )
261    
       IF ( buoyancyRelation .EQ. 'OCEANIC' .AND.  
      &     ( equationOfState .EQ. 'JMD95P'.OR.  
      &       equationOfState .EQ. 'MDJWF' .OR.  
      &       equationOfState .EQ. 'UNESCO'   ) ) THEN  
         WRITE(msgBuf,'(A)')  
      &   'S/R INI_EOS: WARNING >>> Wrong Restart !!!'  
         CALL PRINT_MESSAGE(msgBuf, errorMessageUnit,  
      &                     SQUEEZE_RIGHT,myThid)  
         WRITE(msgBuf,'(2A)') 'S/R INI_EOS: ',  
      &   'not correct using Z-coord with EOS function of P'  
         CALL PRINT_MESSAGE(msgBuf, errorMessageUnit,  
      &                     SQUEEZE_RIGHT,myThid)  
         WRITE(msgBuf,'(A)')  
      &   'S/R INI_EOS: WARNING <<< Wrong Restart !!!'  
         CALL PRINT_MESSAGE(msgBuf, errorMessageUnit,  
      &                     SQUEEZE_RIGHT,myThid)  
       ENDIF                                          
   
262        _END_MASTER( myThid )        _END_MASTER( myThid )
263    
264        return        RETURN
265        end        END
266    
267  CBOP  CBOP
268  C     !ROUTINE: CHECK_EOS  C     !ROUTINE: CHECK_EOS
# Line 354  C     == Routine arguments == Line 288  C     == Routine arguments ==
288  C     myThid -  Number of this instance of CHECK_EOS  C     myThid -  Number of this instance of CHECK_EOS
289        INTEGER myThid        INTEGER myThid
290    
291    #ifndef EXCLUDE_EOS_CHECK
292  C     !LOCAL VARIABLES:  C     !LOCAL VARIABLES:
293  C     == Local variables ==  C     == Local variables ==
294  C     bi,bj  - Loop counters  C     bi,bj  - Loop counters
# Line 465  C     check nonlinear EOS Line 400  C     check nonlinear EOS
400       &           '(a4,f4.1,a5,f4.1,a6,f5.0,a5,a3,f10.5,1x,f11.5)')       &           '(a4,f4.1,a5,f4.1,a6,f5.0,a5,a3,f10.5,1x,f11.5)')
401       &           'rho(', sFld(i,j,k,bi,bj), ' PSU,',       &           'rho(', sFld(i,j,k,bi,bj), ' PSU,',
402       &           tFld(i,j,k,bi,bj), ' degC,',       &           tFld(i,j,k,bi,bj), ' degC,',
403       &           pressure(i,j,k,bi,bj)*SItoBar, ' bar)',' = ',  c    &           pressure(i,j,k,bi,bj)*SItoBar, ' bar)',' = ',
404       &           rloc(kcheck), bloc(kcheck)       &           rloc(kcheck), bloc(kcheck)
405              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,              CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
406       &           SQUEEZE_RIGHT , 1)       &           SQUEEZE_RIGHT , 1)
# Line 486  C     check nonlinear EOS Line 421  C     check nonlinear EOS
421                            
422           enddo           enddo
423  C     end check nonlinear EOS  C     end check nonlinear EOS
424           pressure(i,j,k,bi,bj) = psave  c        pressure(i,j,k,bi,bj) = psave
425    
426           write(msgBuf,'(A)') 'end check the equation of state'           write(msgBuf,'(A)') 'end check the equation of state'
427           CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,           CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
428       &        SQUEEZE_RIGHT , 1)       &        SQUEEZE_RIGHT , 1)
429    
430        endif        endif
431    #endif /* EXCLUDE_EOS_CHECK */
432    
433        return        RETURN
434        end        END
435    

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.22