/[MITgcm]/MITgcm/verification/global_ocean_pressure/code/remove_mean_rl.F
ViewVC logotype

Contents of /MITgcm/verification/global_ocean_pressure/code/remove_mean_rl.F

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


Revision 1.1 - (show annotations) (download)
Mon Dec 16 21:41:52 2002 UTC (21 years, 5 months ago) by mlosch
Branch: MAIN
CVS Tags: checkpoint57t_post, checkpoint48f_post, checkpoint51k_post, checkpoint53f_post, checkpoint47j_post, checkpoint54a_pre, checkpoint55c_post, checkpoint53b_pre, checkpoint48d_pre, checkpoint51l_post, checkpoint51j_post, branch-exfmods-tag, checkpoint47e_post, checkpoint57m_post, checkpoint47i_post, checkpoint52l_pre, checkpoint48i_post, checkpoint52e_pre, checkpoint57v_post, checkpoint57g_pre, checkpoint52j_post, checkpoint47f_post, checkpoint48d_post, checkpoint51o_pre, checkpoint57f_post, checkpoint50e_post, checkpoint52e_post, checkpoint50c_post, checkpoint57s_post, checkpoint51n_pre, checkpoint47d_post, checkpoint57j_post, checkpoint57b_post, checkpoint53c_post, checkpoint53d_post, checkpoint57f_pre, checkpoint55d_pre, checkpoint51f_pre, checkpoint57g_post, checkpoint48e_post, checkpoint57a_post, checkpoint48h_post, checkpoint55j_post, checkpoint56b_post, checkpoint50c_pre, checkpoint57h_pre, checkpoint57y_post, branchpoint-genmake2, checkpoint57x_post, checkpoint52j_pre, checkpoint54a_post, branch-netcdf, checkpoint50d_pre, checkpoint55h_post, checkpoint51r_post, checkpoint52b_pre, checkpoint52n_post, checkpoint54b_post, checkpoint51i_post, checkpoint57e_post, checkpoint54d_post, checkpoint47h_post, checkpoint48c_post, checkpoint56c_post, checkpoint54e_post, checkpoint55b_post, checkpoint51e_post, checkpoint51b_post, checkpoint57h_post, checkpoint51l_pre, checkpoint52m_post, checkpoint51c_post, checkpoint57y_pre, checkpoint55, checkpoint53a_post, checkpoint55a_post, checkpoint57c_pre, checkpoint48, checkpoint49, checkpoint53b_post, checkpoint57o_post, checkpoint55g_post, checkpoint57r_post, checkpoint51o_post, checkpoint48g_post, checkpoint57k_post, checkpoint57d_post, checkpoint55f_post, checkpoint57i_post, checkpoint51q_post, checkpoint52l_post, checkpoint52k_post, checkpoint58, checkpoint57a_pre, checkpoint54, checkpoint57, checkpoint56, checkpoint51, checkpoint50, checkpoint53, checkpoint52, checkpoint50d_post, checkpoint52d_post, checkpoint51b_pre, checkpoint52a_post, checkpoint57h_done, checkpoint47g_post, checkpoint52b_post, checkpoint53g_post, checkpoint52f_post, checkpoint52c_post, checkpoint57w_post, checkpoint57p_post, checkpint57u_post, checkpoint51h_pre, checkpoint50g_post, checkpoint57q_post, checkpoint51g_post, ecco_c52_e35, checkpoint57z_post, checkpoint54f_post, checkpoint51f_post, checkpoint48b_post, checkpoint50b_post, eckpoint57e_pre, checkpoint48a_post, checkpoint57c_post, checkpoint50f_post, checkpoint50a_post, checkpoint50f_pre, checkpoint52a_pre, checkpoint51d_post, checkpoint48c_pre, checkpoint51m_post, checkpoint51t_post, checkpoint53d_pre, checkpoint55e_post, checkpoint54c_post, checkpoint50h_post, checkpoint52i_post, checkpoint51a_post, checkpoint50e_pre, checkpoint50i_post, checkpoint51p_post, checkpoint51n_post, checkpoint55i_post, checkpoint51i_pre, checkpoint57l_post, checkpoint52i_pre, checkpoint51u_post, checkpoint52h_pre, checkpoint52f_pre, checkpoint50b_pre, checkpoint56a_post, checkpoint51s_post, checkpoint55d_post
Branch point for: netcdf-sm0, branch-genmake2, branch-nonh, tg2-branch, checkpoint51n_branch, branch-exfmods-curt
o added new verification experiment global_ocean_pressure, this experiment is
  also described in the tutorial section of the manual

1 C $Header:
2 C $Name:
3
4 #include "CPP_OPTIONS.h"
5
6 SUBROUTINE REMOVE_MEAN_RL(
7 I myNr, arr, arrMask, arrhFac, arrArea, arrDr,
8 I arrName,
9 I myThid )
10 C /==========================================================\
11 C | SUBROUTINE REMOVE_MEAN_RL |
12 C | o Calculate mean of global array "_RL arr" and substract |
13 C | it from the array |
14 C |==========================================================|
15 C \==========================================================/
16 IMPLICIT NONE
17
18 C === Global data ===
19 #include "SIZE.h"
20 #include "EEPARAMS.h"
21
22 C === Routine arguments ===
23 INTEGER myNr
24 _RL arr(1-OLx:sNx+OLx,1-OLy:sNy+OLy,myNr,nSx,nSy)
25 _RS arrMask(1-OLx:sNx+OLx,1-OLy:sNy+OLy,myNr,nSx,nSy)
26 _RS arrhFac(1-OLx:sNx+OLx,1-OLy:sNy+OLy,myNr,nSx,nSy)
27 _RS arrArea(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
28 _RS arrDr(myNr)
29 CHARACTER*(*) arrName
30 INTEGER myThid
31
32 C === Local variables ====
33 INTEGER bi,bj,I,J,K
34 _RL tmpVal
35 _RL theMean
36 _RL theVol
37 _RL tmpVol
38 CHARACTER*(max_len_mbuf) msgbuf
39
40 theMean=0.
41 theVol=0.
42
43 DO bj=myByLo(myThid),myByHi(myThid)
44 DO bi=myBxLo(myThid),myBxHi(myThid)
45 DO K=1,myNr
46 DO J=1,sNy
47 DO I=1,sNx
48 tmpVal=arr(I,J,K,bi,bj)
49 IF (arrMask(I,J,K,bi,bj).NE.0.) THEN
50 tmpVol = arrArea(I,J,bi,bj)*arrhFac(I,J,K,bi,bj)*arrDr(K)
51 theVol = theVol + tmpVol
52 theMean = theMean + tmpVol*tmpVal
53 ENDIF
54 ENDDO
55 ENDDO
56 ENDDO
57 ENDDO
58 ENDDO
59
60 _GLOBAL_SUM_R8(theVol,myThid)
61 _GLOBAL_SUM_R8(theMean,myThid)
62
63 IF (theVol.GT.0.) THEN
64 theMean=theMean/theVol
65
66 DO bj=myByLo(myThid),myByHi(myThid)
67 DO bi=myBxLo(myThid),myBxHi(myThid)
68 DO K=1,myNr
69 DO J=1,sNy
70 DO I=1,sNx
71 IF (arrMask(I,J,K,bi,bj).NE.0.) THEN
72 arr(I,J,K,bi,bj) = arr(I,J,K,bi,bj) - theMean
73 ENDIF
74 ENDDO
75 ENDDO
76 ENDDO
77 ENDDO
78 ENDDO
79
80 ENDIF
81
82 C Print the global mean to standard output, this is a measure for
83 C the drift of the array arr
84 WRITE(msgbuf,'(a,a,a,e24.17)')
85 & '%GM: Global mean of ', arrName, ' = ', theMean
86 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
87 & SQUEEZE_RIGHT , 1)
88
89
90 RETURN
91 END

  ViewVC Help
Powered by ViewVC 1.1.22