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

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

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

revision 1.12 by mlosch, Sun Apr 18 20:36:56 2004 UTC revision 1.13 by jmc, Thu May 3 21:39:59 2007 UTC
# Line 8  CBOP Line 8  CBOP
8  C     !ROUTINE: SWFRAC  C     !ROUTINE: SWFRAC
9  C     !INTERFACE:  C     !INTERFACE:
10        SUBROUTINE SWFRAC(        SUBROUTINE SWFRAC(
11       I     imax, fact,       I                  imax, fact,
12       I     mytime, mythid,       U                  swdk,
13       U     swdk )       I                  myTime, myIter, myThid )
14  C     !DESCRIPTION: \bv  C     !DESCRIPTION: \bv
15  C     *==========================================================*  C     *==========================================================*
16  C     | SUBROUTINE SWFRAC                                          C     | SUBROUTINE SWFRAC
17  C     | o Compute solar short-wave flux penetration.  C     | o Compute solar short-wave flux penetration.
18  C     *==========================================================*  C     *==========================================================*
19  C     | Compute fraction of solar short-wave flux penetrating to    C     | Compute fraction of solar short-wave flux penetrating to
20  C     | specified depth, swdk, due to exponential decay in          C     | specified depth, swdk, due to exponential decay in
21  C     | Jerlov water type jwtype.                                  C     | Jerlov water type jwtype.
22  C     | Reference : Two band solar absorption model of Paulson      C     | Reference : Two band solar absorption model of Paulson
23  C     |             and Simpson (1977, JPO, 7, 952-956)            C     |             and Simpson (1977, JPO, 7, 952-956)
24  C     | Notes                                                      C     | Notes
25  C     | =====                                                      C     | =====
26  C     | Parameter jwtype is hardcoded to 3 for time being.          C     | Parameter jwtype is hardcoded to 3 for time being.
27  C     | Below 200m the solar penetration gets set to zero,          C     | Below 200m the solar penetration gets set to zero,
28  C     | otherwise the limit for the exponent (+/- 5678) needs to    C     | otherwise the limit for the exponent (+/- 5678) needs to
29  C     | be taken care of.                                          C     | be taken care of.
30  C     | Written by   : Jan Morzel                                  C     | Written by   : Jan Morzel
31  C     | Date         : July 12, 1995                                C     | Date         : July 12, 1995
32  C     *==========================================================*  C     *==========================================================*
33  C     \ev  C     \ev
34    
# Line 40  C     === Routine arguments === Line 40  C     === Routine arguments ===
40  C     input arguments  C     input arguments
41  C     imax    :: number of vertical grid points  C     imax    :: number of vertical grid points
42  C     fact    :: scale  factor to apply to depth array  C     fact    :: scale  factor to apply to depth array
43  C     myTime  :: current time in simulation  C     myTime  :: Current time in simulation
44  C     myThid  :: thread number for this instance of the routine.  C     myIter  :: Current iteration number in simulation
45    C     myThid  :: My Thread Id. number
46        INTEGER imax        INTEGER imax
47        _RL     fact        _RL     fact
48        _RL     mytime        _RL     myTime
49        integer mythid        INTEGER myIter
50          INTEGER myThid
51  C     input/output arguments  C     input/output arguments
52  C     swdk    :: on input: vertical depth for desired sw fraction  C     swdk    :: on input: vertical depth for desired sw fraction
53  C               (fact*swdk) is negative distance (m) from surface  C               (fact*swdk) is negative distance (m) from surface
# Line 54  C     swdk    :: on output: short wave ( Line 56  C     swdk    :: on output: short wave (
56    
57  C     !LOCAL VARIABLES:  C     !LOCAL VARIABLES:
58  C     === Local variables ===  C     === Local variables ===
59  C     max number of different water types  C     max number of different water types
60        integer   nwtype  , jwtype        INTEGER   nwtype  , jwtype
61        PARAMETER(nwtype=5)        PARAMETER(nwtype=5)
62        _RL facz        _RL facz
63        _RL rfac(nwtype),a1(nwtype),a2(nwtype)        _RL rfac(nwtype),a1(nwtype),a2(nwtype)
64        INTEGER i        INTEGER i
65  #ifdef ALLOW_CAL  #ifdef ALLOW_CAL
66        _RL     fac        _RL     fac
67        logical first, changed        LOGICAL first, changed
68        integer count0, count1        INTEGER count0, count1
69        integer myiter        INTEGER jerl(12)
70        integer jerl(12)        DATA jerl / 2 , 2 , 2 , 3 , 3 , 3 , 4 , 4 , 4 , 4 , 3 , 2 /
       data jerl / 2 , 2 , 2 , 3 , 3 , 3 , 4 , 4 , 4 , 4 , 3 , 2 /  
71  #endif /* ALLOW_CAL */  #endif /* ALLOW_CAL */
72  C  C
73  C     Jerlov water type :  I       IA      IB      II      III  C     Jerlov water type :  I       IA      IB      II      III
# Line 80  CEOP Line 81  CEOP
81  #ifdef ALLOW_CAL  #ifdef ALLOW_CAL
82  ceh3 this should have an IF ( useCALENDAR ) THEN  ceh3 this should have an IF ( useCALENDAR ) THEN
83  CML(  CML(
84  C     myIter = 0 makes cal_getMonthsRec always return count0=12  C     myIter = 0 makes cal_getMonthsRec always return  count0=12
85  C     so that jerl(count0) = 2.  C     so that jerl(count0) = 2.
86  C     The following lines are meant to be an example of how to  C     The following lines are meant to be an example of how to
87  C     include time dependent water types. However, it would probably  C     include time dependent water types. However, it would probably
88  C     make more sense to first think about a regionally varying  C     make more sense to first think about a regionally varying
89  C     water type before implementing a time dependence.  C     water type before implementing a time dependence.
90  CML      myiter=0  CML      CALL  cal_GetMonthsRec(
 CML      call  cal_GetMonthsRec(  
91  CML     O     fac, first, changed, count0, count1,  CML     O     fac, first, changed, count0, count1,
92  CML     I     mytime, myiter, mythid )  CML     I     myTime, myIter, myThid )
93  CML      jwtype=jerl(count0)  CML      jwtype=jerl(count0)
94  CML)  CML)
95        jwtype=2        jwtype=2

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.22