/[MITgcm]/MITgcm_contrib/bling/pkg/bling_insol.F
ViewVC logotype

Contents of /MITgcm_contrib/bling/pkg/bling_insol.F

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


Revision 1.2 - (show annotations) (download)
Thu Jun 5 21:15:17 2014 UTC (11 years, 1 month ago) by mmazloff
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Not needed

1 C $Header: /u/gcmpack/MITgcm_contrib/bling/pkg/bling_insol.F,v 1.1 2014/05/23 17:33:43 mmazloff Exp $
2 C $Name: $
3
4 #include "BLING_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: INSOL
8
9 C !INTERFACE: ==========================================================
10 SUBROUTINE BLING_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 "BLING_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
38 C !LOCAL VARIABLES: ====================================================
39 _RL solar, albedo
40 _RL dayfrac, yday, delta
41 _RL lat, sun1, dayhrs
42 _RL cosz, frac, fluxi
43 integer j
44 CEOP
45
46 solar = 1360. _d 0 !solar constant
47 albedo= 0.6 _d 0 !planetary albedo
48
49 C Case where a 2-d output array is needed: for now, stop here.
50 IF ( usingCurvilinearGrid .OR. rotateGrid ) THEN
51 STOP 'ABNORMAL END: S/R INSOL: 2-D output not implemented'
52 ENDIF
53
54 C find day (****NOTE for year starting in winter*****)
55 dayfrac=mod(Time,360. _d 0*86400. _d 0)
56 & /(360. _d 0*86400. _d 0) !fraction of year
57 yday = 2. _d 0*PI*dayfrac !convert to radians
58 delta = (0.006918 _d 0
59 & -(0.399912 _d 0*cos(yday)) !cosine zenith angle
60 & +(0.070257 _d 0*sin(yday)) !(paltridge+platt)
61 & -(0.006758 _d 0*cos(2. _d 0*yday))
62 & +(0.000907 _d 0*sin(2. _d 0*yday))
63 & -(0.002697 _d 0*cos(3. _d 0*yday))
64 & +(0.001480 _d 0*sin(3. _d 0*yday)) )
65 DO j=1-OLy,sNy+OLy
66 C latitude in radians
67 lat=YC(1,j,1,bj)*deg2rad
68 C latitute in radians, backed out from coriolis parameter
69 C (makes latitude independent of grid)
70 IF ( usingCartesianGrid .OR. usingCylindricalGrid )
71 & lat = asin( fCori(1,j,1,bj)/(2. _d 0*omega) )
72 sun1 = -sin(delta)/cos(delta) * sin(lat)/cos(lat)
73 IF (sun1.LE.-0.999 _d 0) sun1=-0.999 _d 0
74 IF (sun1.GE. 0.999 _d 0) sun1= 0.999 _d 0
75 dayhrs = abs(acos(sun1))
76 cosz = ( sin(delta)*sin(lat)+ !average zenith angle
77 & (cos(delta)*cos(lat)*sin(dayhrs)/dayhrs) )
78 IF (cosz.LE.5. _d -3) cosz= 5. _d -3
79 frac = dayhrs/PI !fraction of daylight in day
80 C daily average photosynthetically active solar radiation just below surface
81 fluxi = solar*(1. _d 0-albedo)*cosz*frac*parfrac
82
83 C convert to sfac
84 sfac(j) = MAX(1. _d -5,fluxi)
85 ENDDO !j
86
87
88 RETURN
89 END

  ViewVC Help
Powered by ViewVC 1.1.22