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

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

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

revision 1.9 by jmc, Thu Feb 5 19:23:05 2015 UTC revision 1.10 by mlosch, Sun Feb 15 16:47:32 2015 UTC
# Line 110  C     PR     :: reference pressure Line 110  C     PR     :: reference pressure
110  CEOP  CEOP
111    
112  C     !FUNCTIONS:  C     !FUNCTIONS:
113        _RL sw_adtg        _RL sw_ptmp
114        EXTERNAL sw_adtg        EXTERNAL sw_ptmp
115    
116  C     !LOCAL VARIABLES:        SW_temp = SW_PTMP (S,T,PR,P)
       _RL del_P ,del_th, th, q  
       _RL onehalf, two, three  
       PARAMETER ( onehalf = 0.5 _d 0, two = 2. _d 0, three = 3. _d 0 )  
   
 C theta1  
 C--   here we swap P and PR in order to get in-situ temperature  
 C     del_P  = PR - P ! to get potential from in-situ temperature  
       del_P  = P - PR ! to get in-situ from potential temperature  
       del_th = del_P*sw_adtg(S,T,PR)  
       th     = T + onehalf*del_th  
       q      = del_th  
 C theta2  
       del_th = del_P*sw_adtg(S,th,PR+onehalf*del_P)  
   
       th     = th + (1 - 1/sqrt(two))*(del_th - q)  
       q      = (two-sqrt(two))*del_th + (-two+three/sqrt(two))*q  
   
 C theta3  
       del_th = del_P*sw_adtg(S,th,PR+onehalf*del_P)  
       th     = th + (1 + 1/sqrt(two))*(del_th - q)  
       q      = (two + sqrt(two))*del_th + (-two-three/sqrt(two))*q  
   
 C theta4  
       del_th = del_P*sw_adtg(S,th,PR+del_P)  
       SW_temp= th + (del_th - two*q)/(two*three)  
117    
118        RETURN        RETURN
119        END        END

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

  ViewVC Help
Powered by ViewVC 1.1.22