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 |