/[MITgcm]/MITgcm/pkg/thsice/thsice_check_conserv.F
ViewVC logotype

Annotation of /MITgcm/pkg/thsice/thsice_check_conserv.F

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


Revision 1.4 - (hide annotations) (download)
Thu May 25 18:03:24 2006 UTC (17 years, 11 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint58l_post, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, mitgcm_mapl_00, checkpoint58u_post, checkpoint58w_post, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint64, checkpoint60, checkpoint61, checkpoint62, checkpoint63, checkpoint58r_post, checkpoint58n_post, checkpoint58x_post, checkpoint58t_post, checkpoint58h_post, checkpoint58q_post, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint58j_post, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint59j, checkpoint59, checkpoint58f_post, checkpoint58i_post, checkpoint58g_post, checkpoint58o_post, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint58y_post, checkpoint58k_post, checkpoint58v_post, checkpoint58s_post, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint58p_post, checkpoint61a, checkpoint61n, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint61z, checkpoint61x, checkpoint61y, checkpoint58m_post
Changes since 1.3: +21 -11 lines
- put i,j loops inside S/R: THSICE_ALBEDO, THSICE_SOLVE4TEMP, THSICE_EXTEND
   and THSICE_CALC_THICKN
- split thsice_step_fwd.F in 2 S/R: thsice_step_temp.F & thsice_step_fwd.F

1 jmc 1.4 C $Header: /u/gcmpack/MITgcm/pkg/thsice/thsice_check_conserv.F,v 1.3 2006/03/13 03:53:40 jmc Exp $
2 jmc 1.1 C $Name: $
3    
4     #include "THSICE_OPTIONS.h"
5 jmc 1.3
6 jmc 1.1 C !ROUTINE: THSICE_CHECK_CONSERV
7     C !INTERFACE:
8     SUBROUTINE THSICE_CHECK_CONSERV(
9 jmc 1.4 I dBugFlag, i, j, bi, bj, iceStart,
10 jmc 1.1 I iceFrac, compact, hIce, hSnow, qicen,
11 jmc 1.4 I qleft, ffresh, fsalt,
12 jmc 1.1 I myTime, myIter, myThid )
13     C *==========================================================*
14 jmc 1.3 C | S/R THSICE_CHECK_CONSERV
15 jmc 1.1 C | o Check Conservation of Energy, water and salt
16     C *==========================================================*
17    
18     C !USES:
19     IMPLICIT NONE
20     C === Global variables ===
21     #include "SIZE.h"
22     #include "EEPARAMS.h"
23     c #include "PARAMS.h"
24     #include "THSICE_SIZE.h"
25     #include "THSICE_PARAMS.h"
26 jmc 1.2 #include "THSICE_VARS.h"
27     #include "THSICE_TAVE.h"
28 jmc 1.3
29 jmc 1.1 C !INPUT/OUTPUT PARAMETERS:
30     C === Routine arguments ===
31     C myIter :: iteration counter for this thread
32     C myTime :: time counter for this thread
33     C myThid :: thread number for this instance of the routine.
34 jmc 1.4 LOGICAL dBugFlag
35 jmc 1.1 INTEGER i,j, bi,bj
36     INTEGER iceStart
37     _RL iceFrac
38     _RL compact, hIce, hSnow, qicen(nlyr)
39     _RL qleft, fsalt, ffresh
40     _RL myTime
41     INTEGER myIter
42     INTEGER myThid
43    
44     #ifdef ALLOW_THSICE
45     C !LOCAL VARIABLES:
46     C === Local variables ===
47     _RL dEnerg, dWater, dSalt
48     _RL flxFrac
49 jmc 1.4 _RL flxAtm, frwAtm
50     LOGICAL dBugLoc
51    
52     C- define grid-point location where to print debugging values
53     #include "THSICE_DEBUG.h"
54 jmc 1.1
55 jmc 1.3 1010 FORMAT(A,1P4E14.6)
56 jmc 1.1
57 jmc 1.4 dBugLoc = .FALSE.
58     #ifdef ALLOW_DBUG_THSICE
59     dBugLoc = dBug(i,j,bi,bj)
60     #endif
61 jmc 1.1 flxFrac = iceFrac
62 jmc 1.4 flxAtm = icFlxAtm(i,j,bi,bj)
63     frwAtm = icFrwAtm(i,j,bi,bj)
64 jmc 1.1 IF (iceStart.EQ.1) flxFrac = 1.
65    
66     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
67 jmc 1.3 dEnerg= -rhos*snowHeight(i,j,bi,bj)*qsnow
68 jmc 1.1 & -rhoi*iceHeight(i,j,bi,bj)
69     & *(Qice1(i,j,bi,bj)+Qice2(i,j,bi,bj))*0.5
70     dWater = rhos*snowheight(i,j,bi,bj)+rhoi*iceHeight(i,j,bi,bj)
71     dSalt = rhoi*iceHeight(i,j,bi,bj)*saltice
72 jmc 1.4 IF (dBugLoc) WRITE(6,1010) 'ThSI_CHK: Ener0,Water0,Salt0 =',
73 jmc 1.1 & dEnerg, dWater, dSalt
74     C--
75     dEnerg = dEnerg*iceFrac
76 jmc 1.3 & + compact*( rhos*hSnow*qsnow
77 jmc 1.1 & + rhoi*hIce*(qicen(1)+qicen(2))*0.5
78     & )
79     dWater = dWater*iceFrac
80     & - compact*( rhos*hSnow + rhoi*hIce )
81     dSalt = dSalt*iceFrac
82     & - compact* rhoi*hIce*saltice
83    
84 jmc 1.4 IF (dBugLoc) WRITE(6,1010) 'ThSI_CHK: dEner,dH20,dSal /dt=',
85 jmc 1.1 & dEnerg/thSIce_deltaT,dWater/thSIce_deltaT,dSalt/thSIce_deltaT
86 jmc 1.4 IF (dBugLoc) WRITE(6,1010) 'ThSI_CHK: fxH,fxW,fxS=',
87     & flxAtm-qleft, -ffresh-frwAtm,-fsalt
88 jmc 1.1 dEnerg = dEnerg + thSIce_deltaT*flxFrac*(flxAtm-qleft)
89 jmc 1.2 dWater = dWater - thSIce_deltaT*flxFrac*(ffresh+frwAtm)
90 jmc 1.1 dSalt = dSalt - thSIce_deltaT*flxFrac*fsalt
91    
92     #ifdef ALLOW_TIMEAVE
93 jmc 1.2 ice_flx2oc_Ave(i,j,bi,bj) = ice_flx2oc_Ave(i,j,bi,bj)
94 jmc 1.1 & + dEnerg
95 jmc 1.2 ice_frw2oc_Ave(i,j,bi,bj) = ice_frw2oc_Ave(i,j,bi,bj)
96 jmc 1.1 & + dWater
97 jmc 1.2 ice_salFx_Ave(i,j,bi,bj) = ice_salFx_Ave(i,j,bi,bj)
98 jmc 1.1 & + dSalt
99     #endif /*ALLOW_TIMEAVE*/
100     C--
101 jmc 1.4 IF (dBugLoc) WRITE(6,1010) 'ThSI_CHK: resid.H,W,S=',
102 jmc 1.1 & dEnerg/thSIce_deltaT,dWater/thSIce_deltaT,dSalt/thSIce_deltaT
103 jmc 1.4 IF (dBugLoc) WRITE(6,1010) 'ThSI_CHK: hIc,hSn,snow*dt=',
104 jmc 1.2 & hIce, hSnow, snowPrc(i,j,bi,bj)*thSIce_deltaT/rhos
105 jmc 1.1
106     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
107    
108     #endif /*ALLOW_THSICE*/
109    
110     RETURN
111     END

  ViewVC Help
Powered by ViewVC 1.1.22