/[MITgcm]/MITgcm/pkg/dic/insol.F
ViewVC logotype

Contents of /MITgcm/pkg/dic/insol.F

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


Revision 1.14 - (show annotations) (download)
Fri Jul 30 12:06:44 2010 UTC (13 years, 9 months ago) by mlosch
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint64, checkpoint65, checkpoint63, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint62k, checkpoint62j, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, HEAD
Changes since 1.13: +2 -2 lines
small bug fix for the unlikely case of a cartesian grid

1 C $Header: /u/gcmpack/MITgcm/pkg/dic/insol.F,v 1.13 2010/03/24 21:06:35 jmc Exp $
2 C $Name: $
3
4 #include "DIC_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: INSOL
8
9 C !INTERFACE: ==========================================================
10 SUBROUTINE insol(Time,sfac,bi,bj,myThid)
11
12 C !DESCRIPTION:
13 C find light as function of date and latitude
14 C based on paltridge and parson
15
16
17 C !USES: ===============================================================
18 IMPLICIT NONE
19 C === Global variables ===
20 #include "SIZE.h"
21 #include "EEPARAMS.h"
22 #include "PARAMS.h"
23 #include "FFIELDS.h"
24 #include "GRID.h"
25 #include "DYNVARS.h"
26 #include "DIC_VARS.h"
27
28 C !INPUT PARAMETERS: ===================================================
29 C Time :: current time
30 _RL Time
31 INTEGER bi,bj
32 INTEGER myThid
33
34 C !OUPUT PARAMETERS: ===================================================
35 _RL sfac(1-OLy:sNy+OLy)
36
37 #ifdef DIC_BIOTIC
38
39 C !LOCAL VARIABLES: ====================================================
40 _RL solar, albedo
41 _RL dayfrac, yday, delta
42 _RL lat, sun1, dayhrs
43 _RL cosz, frac, fluxi
44 integer j
45 CEOP
46
47 solar = 1360. _d 0 !solar constant
48 albedo= 0.6 _d 0 !planetary albedo
49
50 C Case where a 2-d output array is needed: for now, stop here.
51 IF ( usingCurvilinearGrid .OR. rotateGrid ) THEN
52 STOP 'ABNORMAL END: S/R INSOL: 2-D output not implemented'
53 ENDIF
54
55 C find day (****NOTE for year starting in winter*****)
56 dayfrac=mod(Time,360. _d 0*86400. _d 0)
57 & /(360. _d 0*86400. _d 0) !fraction of year
58 yday = 2. _d 0*PI*dayfrac !convert to radians
59 delta = (0.006918 _d 0
60 & -(0.399912 _d 0*cos(yday)) !cosine zenith angle
61 & +(0.070257 _d 0*sin(yday)) !(paltridge+platt)
62 & -(0.006758 _d 0*cos(2. _d 0*yday))
63 & +(0.000907 _d 0*sin(2. _d 0*yday))
64 & -(0.002697 _d 0*cos(3. _d 0*yday))
65 & +(0.001480 _d 0*sin(3. _d 0*yday)) )
66 DO j=1-OLy,sNy+OLy
67 C latitude in radians
68 lat=YC(1,j,1,bj)*deg2rad
69 C latitute in radians, backed out from coriolis parameter
70 C (makes latitude independent of grid)
71 IF ( usingCartesianGrid .OR. usingCylindricalGrid )
72 & lat = asin( fCori(1,j,1,bj)/(2. _d 0*omega) )
73 sun1 = -sin(delta)/cos(delta) * sin(lat)/cos(lat)
74 IF (sun1.LE.-0.999 _d 0) sun1=-0.999 _d 0
75 IF (sun1.GE. 0.999 _d 0) sun1= 0.999 _d 0
76 dayhrs = abs(acos(sun1))
77 cosz = ( sin(delta)*sin(lat)+ !average zenith angle
78 & (cos(delta)*cos(lat)*sin(dayhrs)/dayhrs) )
79 IF (cosz.LE.5. _d -3) cosz= 5. _d -3
80 frac = dayhrs/PI !fraction of daylight in day
81 C daily average photosynthetically active solar radiation just below surface
82 fluxi = solar*(1. _d 0-albedo)*cosz*frac*parfrac
83
84 C convert to sfac
85 sfac(j) = MAX(1. _d -5,fluxi)
86 ENDDO !j
87
88 #endif /* DIC_BIOTIC */
89
90 RETURN
91 END

  ViewVC Help
Powered by ViewVC 1.1.22